/*
Theme Name: Sajad Tapis
Theme URI: https://sajad.ctrlyagency.com
Author: Ctrl Y Agency
Author URI: https://ctrlyagency.com
Description: Custom hand-coded theme for Sajad Tapis — rugs, carpets and Quick-Step flooring in Lebanon.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: sajad
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f3ec;
  --bg-alt: #efe8dc;
  --ink: #1b2423;
  --ink-soft: #5f6664;
  --line: rgba(27, 36, 35, .13);
  --teal: #0F787C;
  --teal-deep: #0a4e51;
  --red: #b9433a;
  --peach: #f2b89a;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
html[data-theme="dark"] {
  --bg: #0e1717;
  --bg-alt: #142221;
  --ink: #f1ece2;
  --ink-soft: #a5aca9;
  --line: rgba(241, 236, 226, .14);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; transition: background .4s var(--ease), color .4s var(--ease); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.04; margin: 0; letter-spacing: -.01em; }
h4 { font-family: var(--sans); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); font-weight: 500; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.lead { font-size: 18px; color: var(--ink-soft); max-width: 520px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--teal); font-weight: 500; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.btn { display: inline-flex; align-items: center; gap: 14px; padding: 16px 28px; border: 1px solid currentColor; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s; margin-top: 10px; }
.btn:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn--light { color: #fff; }
.btn--light:hover { background: #fff; color: var(--teal-deep); border-color: #fff; }
.btn .arrow { width: 18px; height: 1px; background: currentColor; position: relative; }
.btn .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: baseline; gap: .28em; line-height: 1; }
.wordmark__script { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.25em; letter-spacing: .01em; }
.wordmark__serif { font-family: var(--serif); font-size: .72em; letter-spacing: .3em; text-transform: uppercase; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 24px var(--pad); color: #fff; transition: background .35s var(--ease), color .35s var(--ease), padding .35s var(--ease); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header.is-solid, body:not(.home) .site-header { background: var(--bg); color: var(--ink); padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.site-header.is-solid .brand, body:not(.home) .site-header .brand { color: var(--teal); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; flex-wrap: wrap; }
.site-nav a { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .9; transition: opacity .2s, color .2s; }
.site-nav a:hover { opacity: 1; color: var(--peach); }
.site-header.is-solid .site-nav a:hover { color: var(--teal); }
.brand { font-size: clamp(24px, 2.4vw, 34px); transition: color .3s; }
.brand img { max-height: 54px; width: auto; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 24px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.header-tools button { background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 0; }
.burger { width: 26px; height: 14px; position: relative; display: none; }
.burger span, .burger::before, .burger::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor; transition: transform .3s var(--ease), opacity .3s; }
.burger::before { top: 0; } .burger span { top: 6.5px; } .burger::after { bottom: 0; }
.nav-open .burger::before { transform: translateY(6.5px) rotate(45deg); }
.nav-open .burger span { opacity: 0; }
.nav-open .burger::after { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; color: #fff; overflow: hidden; display: flex; align-items: flex-end; background: var(--teal-deep); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); animation: heroZoom 14s var(--ease) forwards; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,40,42,.55) 0%, rgba(6,40,42,.12) 38%, rgba(6,40,42,.78) 100%); }
@keyframes heroZoom { to { transform: scale(1); } }
.hero__inner { position: relative; width: 100%; padding-bottom: clamp(56px, 10vh, 120px); display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: end; }
.hero h1 { font-size: clamp(46px, 6.6vw, 108px); margin-top: 18px; max-width: 13ch; }
.hero .eyebrow { color: rgba(255,255,255,.88); }
.hero__side { max-width: 380px; justify-self: end; font-size: 17px; color: rgba(255,255,255,.9); }
.scroll-cue { position: absolute; left: 50%; bottom: 26px; width: 1px; height: 54px; background: rgba(255,255,255,.35); overflow: hidden; }
.scroll-cue::after { content: ""; position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: #fff; animation: cue 2s infinite var(--ease); }
@keyframes cue { to { top: 100%; } }

/* ---------- Strip ---------- */
.strip { background: var(--teal); color: #fff; }
.strip__inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 26px; padding-top: 20px; padding-bottom: 20px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.strip .dot { width: 6px; height: 6px; background: var(--peach); transform: rotate(45deg); }

/* ---------- Intro ---------- */
.statement { padding: clamp(90px, 12vw, 170px) 0; }
.statement__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.statement h2 { font-size: clamp(38px, 4.8vw, 74px); margin: 20px 0 26px; }
.statement p { color: var(--ink-soft); font-size: 18px; max-width: 520px; }
.statement__media { position: relative; }
.statement__media img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.statement__tile { position: absolute; left: -40px; bottom: -40px; width: 38%; aspect-ratio: 1; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.statement__tile svg { width: 100%; height: 100%; display: block; }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 150px) 0; }
.section--alt { background: var(--bg-alt); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2, .qs__head h2, .rugs h2, .acc h2 { font-size: clamp(38px, 4.8vw, 74px); margin-top: 16px; }
.section-head p, .qs__head p { color: var(--ink-soft); max-width: 460px; justify-self: end; font-size: 17px; }

/* ---------- Collections ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.card { display: block; }
.card__media { aspect-ratio: 3 / 4; overflow: hidden; background: var(--teal-deep); margin-bottom: 20px; }
.card__media img, .card__media svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.1s var(--ease); }
.card:hover .card__media img, .card:hover .card__media svg { transform: scale(1.06); }
.card__num { font-size: 12px; letter-spacing: .16em; color: var(--teal); }
.card h3 { font-size: 30px; margin: 6px 0 10px; }
.card p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ---------- Rugs ---------- */
.rugs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.rugs__art { position: relative; aspect-ratio: 1 / 1.05; }
.rugs__a, .rugs__b { position: absolute; box-shadow: 0 30px 60px rgba(0,0,0,.18); }
.rugs__a { left: 0; top: 0; width: 66%; aspect-ratio: 5 / 6; }
.rugs__b { right: 0; bottom: 0; width: 50%; aspect-ratio: 5 / 6; }
.rugs__a svg, .rugs__b svg { width: 100%; height: 100%; display: block; }
.rugs .lead { margin: 22px 0 36px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; border-top: 1px solid var(--line); padding-top: 30px; }
.spec ul { list-style: none; margin: 14px 0 0; padding: 0; }
.spec li { font-size: 17px; line-height: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips li { line-height: 1; padding: 10px 16px; border: 1px solid var(--line); border-radius: 40px; font-size: 14px; }

/* ---------- Quick-Step ---------- */
.qs { background: var(--teal-deep); color: #f4efe6; }
.qs .eyebrow { color: var(--peach); }
.qs__head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.qs__head p { color: rgba(244,239,230,.75); }
.qs__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(30px, 5vw, 80px); align-items: stretch; }
.qs__media img { width: 100%; height: 100%; object-fit: cover; min-height: 420px; }
.features { list-style: none; margin: 0; padding: 0; }
.features li { display: grid; grid-template-columns: 46px 1fr; gap: 18px; padding: 26px 0; border-top: 1px solid rgba(244,239,230,.16); }
.features li:last-child { border-bottom: 1px solid rgba(244,239,230,.16); }
.features svg { width: 38px; height: 38px; color: var(--peach); }
.features h3 { font-size: 27px; margin-bottom: 6px; }
.features p { margin: 0; color: rgba(244,239,230,.72); font-size: 15px; }

/* ---------- Shades ---------- */
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.swatch { margin: 0; }
.swatch img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; transition: transform .6s var(--ease); }
.swatch:hover img { transform: translateY(-6px); }
.swatch figcaption { margin-top: 12px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 210px; gap: 18px; }
.gallery__item { position: relative; margin: 0; overflow: hidden; }
.gallery__item:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.gallery__item:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.gallery__item:nth-child(3), .gallery__item:nth-child(4), .gallery__item:nth-child(5) { grid-column: span 2; grid-row: span 2; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.gallery__item:hover img { transform: scale(1.05); }
.gallery__item figcaption { position: absolute; left: 16px; bottom: 14px; color: #fff; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 10px rgba(0,0,0,.5); }

/* ---------- Accessories ---------- */
.acc { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.acc .lead { margin-top: 20px; }
.acc__list { list-style: none; margin: 0; padding: 0; }
.acc__list li { display: flex; align-items: baseline; gap: 24px; padding: 20px 0; border-top: 1px solid var(--line); font-family: var(--serif); font-size: clamp(30px, 3.4vw, 50px); line-height: 1; }
.acc__list li:last-child { border-bottom: 1px solid var(--line); }
.acc__list span { font-family: var(--sans); font-size: 12px; letter-spacing: .16em; color: var(--teal); }

/* ---------- CTA ---------- */
.cta { position: relative; background: var(--teal); color: #fff; overflow: hidden; }
.cta__pattern { position: absolute; right: -60px; top: -60px; width: 420px; height: 420px; opacity: .22; transform: rotate(12deg); }
.cta__pattern svg { width: 100%; height: 100%; }
.cta .wrap { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: end; }
.cta h2 { font-size: clamp(42px, 5.6vw, 90px); margin-top: 18px; }
.cta .eyebrow { color: rgba(255,255,255,.85); }
.contact-list { list-style: none; margin: 0 0 24px; padding: 0; }
.contact-list li { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.25); display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.contact-list li span:first-child { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* ---------- WhatsApp ---------- */
.wa-float { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .3s var(--ease); }
.wa-float:hover { transform: scale(1.08); }

/* ---------- Footer ---------- */
.site-footer { padding: 70px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid ul { list-style: none; margin: 14px 0 0; padding: 0; display: block; }
.footer-grid li { line-height: 2.1; font-size: 15px; }
.footer-grid a:hover { color: var(--teal); }
.footer-brand { font-size: 34px; color: var(--teal); }
.footer-note { color: var(--ink-soft); max-width: 300px; margin-top: 16px; }
.footer-bottom { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: 13px; color: var(--ink-soft); }

/* ---------- Inner pages ---------- */
.page-hero { padding: 180px 0 60px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(44px, 6vw, 96px); margin-top: 16px; }
.entry { padding: 70px 0 110px; }
.entry-content { max-width: 760px; font-size: 18px; }
.entry-content h2 { font-size: 40px; margin: 1.4em 0 .5em; }
.entry-content h3 { font-size: 28px; margin: 1.2em 0 .4em; }
.entry-content a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.feature__frame { aspect-ratio: 21 / 9; overflow: hidden; }
.feature__frame img { width: 100%; height: 100%; object-fit: cover; }
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; padding: 70px 0 110px; }
.project__media { aspect-ratio: 3 / 2; overflow: hidden; margin-bottom: 18px; background: var(--bg-alt); }
.project__media img, .project__media svg { width: 100%; height: 100%; object-fit: cover; }
.post-card h2 { font-size: 28px; margin: 8px 0 10px; }
.post-card time { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.post-card p { color: var(--ink-soft); font-size: 15px; }
.pagination { padding-bottom: 100px; display: flex; gap: 14px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); }
.pagination .current { background: var(--teal); color: #fff; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__media img, .scroll-cue::after { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .post-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .site-header { grid-template-columns: 1fr auto; padding-top: 16px; padding-bottom: 16px; }
  .brand { order: -1; }
  .burger { display: block; }
  .site-nav { position: fixed; inset: 0; z-index: -1; background: var(--teal-deep); color: #fff; display: flex; align-items: center; padding: var(--pad); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility .35s; }
  .nav-open .site-nav { opacity: 1; visibility: visible; }
  .site-nav ul { display: block; }
  .site-nav a { font-family: var(--serif); font-size: 36px; letter-spacing: 0; text-transform: none; line-height: 1.5; opacity: 1; }
  .nav-open .site-header { color: #fff; background: transparent; border-color: transparent; }
  .nav-open .site-header .brand { color: #fff; }
  .mode-label { display: none; }
  .hero__inner, .section-head, .qs__head, .statement__grid, .rugs__grid, .qs__grid, .acc, .cta .wrap { grid-template-columns: 1fr; }
  .hero__side, .section-head p, .qs__head p { justify-self: start; }
  .statement__tile { left: auto; right: -10px; bottom: -30px; width: 34%; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .gallery__item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
  .gallery__item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .qs__media img { min-height: 280px; }
}
@media (max-width: 560px) {
  .cards, .footer-grid, .post-list, .spec { grid-template-columns: 1fr; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .strip__inner { flex-direction: column; gap: 10px; }
  .strip .dot { display: none; }
  .footer-bottom { flex-direction: column; }
  .contact-list li { flex-direction: column; gap: 4px; }
}
