/* ============================================================
   The Model Town of Bdadoun — بدادون نموذجية
   Visual system: Mount Lebanon terraces, limestone, olive, brass.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --forest-deep: #12271C;
  --forest:      #1B3A2A;
  --forest-soft: #2C5540;
  --olive:       #7D8F55;
  --olive-dim:   #5F6E42;
  --stone:       #E7E1D4;
  --stone-warm:  #DED6C5;
  --paper:       #F8F5EE;
  --brass:       #C09A3E;
  --brass-lift:  #D9B65A;
  --tile:        #A9503A;
  --ink:         #22271F;
  --ink-soft:    #5A6150;
  --line:        rgba(34, 39, 31, .14);
  --line-soft:   rgba(34, 39, 31, .08);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Karla', system-ui, -apple-system, sans-serif;
  --font-ar-display: 'Amiri', 'Times New Roman', serif;
  --font-ar-body:    'IBM Plex Sans Arabic', system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
  --header-h: 84px;

  --shadow-soft: 0 2px 10px rgba(18, 39, 28, .06);
  --shadow-lift: 0 18px 44px -18px rgba(18, 39, 28, .34);

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Arabic pages swap the type stack wholesale */
[dir="rtl"] {
  --font-display: 'Amiri', Georgia, serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.075rem);
  line-height: 1.72;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }

a { color: var(--forest); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--olive-dim); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  color: var(--forest-deep);
  margin: 0 0 .6em;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
  letter-spacing: -.012em;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  font-variation-settings: normal;
  letter-spacing: 0;
  line-height: 1.4;
  font-weight: 700;
}

h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.1rem); }
h2 { font-size: clamp(1.85rem, 1.3rem + 2.1vw, 3rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .5vw, 1.5rem); }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

/* Eyebrow label */
.section-label {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--olive-dim);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-label::before {
  content: "";
  inline-size: 26px;
  block-size: 2px;
  background: var(--brass);
  flex: none;
}
[dir="rtl"] .section-label { letter-spacing: 0; }

.author {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--olive-dim);
  margin-top: 1.4rem;
}
[dir="rtl"] .author { font-style: normal; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.9rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .84rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), background-color .3s, color .3s, border-color .3s;
}
[dir="rtl"] .btn { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--brass);
  color: var(--forest-deep);
  border-color: var(--brass);
}
.btn-primary:hover { background: var(--brass-lift); border-color: var(--brass-lift); color: var(--forest-deep); }

.btn-outline {
  background: transparent;
  color: var(--forest);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--forest); background: var(--forest); color: var(--paper); }

/* ---------- 5. Terrace rule (signature motif) ---------- */
/* A stepped hairline echoing the village's agricultural terraces. */
.terrace {
  block-size: 22px;
  inline-size: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 21H30V14H60V7H90V0H120' fill='none' stroke='%237D8F55' stroke-width='1.25' stroke-opacity='.5'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: .85;
}
.terrace.on-dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 21H30V14H60V7H90V0H120' fill='none' stroke='%23C09A3E' stroke-width='1.25' stroke-opacity='.45'/%3E%3C/svg%3E");
}

/* ---------- 6. Header ---------- */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  transition: background-color .4s var(--ease), box-shadow .4s, border-color .4s;
  border-block-end: 1px solid transparent;
}
.site-header.is-scrolled {
  background: transparent;
  border-block-end-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}
.site-header.is-scrolled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(248, 245, 238, .93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  block-size: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  flex: none;
}
.brand img {
  inline-size: 46px;
  block-size: 46px;
  object-fit: contain;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-ar {
  font-family: var(--font-ar-display);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--paper);
  transition: color .4s;
}
.brand-en {
  font-family: var(--font-body);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(248, 245, 238, .72);
  transition: color .4s;
}
.site-header.is-scrolled .brand-ar { color: var(--forest-deep); }
.site-header.is-scrolled .brand-en { color: var(--olive-dim); }

/* Nav */
.main-nav { display: flex; align-items: center; gap: 2rem; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list > li { position: relative; }
.nav-list a {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(248, 245, 238, .88);
  white-space: nowrap;
  padding-block: .4rem;
  position: relative;
  transition: color .3s;
}
[dir="rtl"] .nav-list a { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.nav-list a::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  inline-size: 0;
  block-size: 1.5px;
  background: var(--brass);
  transition: inline-size .35s var(--ease);
}
.nav-list a:hover::after,
.nav-list a[aria-current="page"]::after { inline-size: 100%; }
.nav-list a:hover { color: #fff; }

.site-header.is-scrolled .nav-list a { color: var(--forest); }
.site-header.is-scrolled .nav-list a:hover { color: var(--forest-deep); }

/* Dropdown */
.dropdown {
  position: absolute;
  inset-block-start: calc(100% + 14px);
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(8px);
  min-inline-size: 200px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  list-style: none;
  margin: 0;
  padding: .5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
}
[dir="rtl"] .dropdown { transform: translateX(50%) translateY(8px); }

.dropdown::before {
  content: "";
  position: absolute;
  inset-block-end: 100%;
  inset-inline: 0;
  block-size: 16px;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
[dir="rtl"] .has-dropdown:hover .dropdown,
[dir="rtl"] .has-dropdown:focus-within .dropdown { transform: translateX(50%) translateY(0); }

.dropdown a {
  display: block;
  padding: .6rem .9rem;
  color: var(--forest) !important;
  border-radius: 2px;
  letter-spacing: .08em;
  transition: background-color .25s, color .25s;
}
.dropdown a::after { display: none; }
.dropdown a:hover,
.dropdown a[aria-current="page"] {
  background: var(--stone);
  color: var(--forest-deep) !important;
}

/* Language switch */
.lang-switch {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding-inline-start: 1.4rem;
  border-inline-start: 1px solid rgba(248, 245, 238, .25);
  transition: border-color .4s;
}
.site-header.is-scrolled .lang-switch { border-inline-start-color: var(--line); }

.lang-switch a {
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  color: rgba(248, 245, 238, .68);
  transition: color .3s;
}
.lang-switch span { color: rgba(248, 245, 238, .3); font-size: .7rem; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.is-active { color: var(--brass-lift); }

.site-header.is-scrolled .lang-switch a { color: var(--ink-soft); }
.site-header.is-scrolled .lang-switch span { color: var(--line); }
.site-header.is-scrolled .lang-switch a:hover { color: var(--forest-deep); }
.site-header.is-scrolled .lang-switch a.is-active { color: var(--tile); }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 110;
}
.menu-toggle span {
  display: block;
  inline-size: 24px;
  block-size: 2px;
  margin-inline: auto;
  background: var(--paper);
  border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s, background-color .4s;
}
.site-header.is-scrolled .menu-toggle span { background: var(--forest-deep); }

.menu-toggle[aria-expanded="true"] span { background: var(--paper); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  min-block-size: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../img/hero-yt.jpg');
  background-image: -webkit-image-set(
    url('../img/hero-yt.jpg') 1x,
    url('../img/hero-2x.jpg') 2x
  );
  background-image: image-set(
    url('../img/hero-yt.jpg') 1x,
    url('../img/hero-2x.jpg') 2x
  );
  background-size: cover;
  background-position: center 38%;
  background-repeat: no-repeat;
  transform: scale(1.06);
  animation: kenburns 26s var(--ease) forwards;
}
@keyframes kenburns {
  from { transform: scale(1.14); }
  to   { transform: scale(1.0); }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(18, 39, 28, .35) 0%,
      rgba(18, 39, 28, .12) 40%,
      rgba(18, 39, 28, .25) 70%,
      rgba(18, 39, 28, .72) 100%),
    linear-gradient(to right,
      rgba(18, 39, 28, .55) 0%,
      rgba(18, 39, 28, .18) 50%,
      rgba(18, 39, 28, 0) 85%);
}
[dir="rtl"] .hero::before {
  background:
    linear-gradient(to bottom,
      rgba(18, 39, 28, .35) 0%,
      rgba(18, 39, 28, .12) 40%,
      rgba(18, 39, 28, .25) 70%,
      rgba(18, 39, 28, .72) 100%),
    linear-gradient(to left,
      rgba(18, 39, 28, .55) 0%,
      rgba(18, 39, 28, .18) 50%,
      rgba(18, 39, 28, 0) 85%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: calc(var(--header-h) + 3rem) 5rem;
  color: var(--paper);
  max-inline-size: 100%;
}
.hero-content > * { max-inline-size: 60ch; }

.hero-brand {
  display: block;
  margin-block-end: 2.2rem;
}
.hero-brand img { display: none; }
.hero-brand-ar {
  font-family: var(--font-ar-display);
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 22px rgba(18, 39, 28, .5);
}
.hero-brand-en {
  font-family: var(--font-body);
  font-size: clamp(.66rem, .6rem + .2vw, .78rem);
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--brass-lift);
  margin: .3rem 0 0;
}

.hero h1 {
  color: #fff;
  margin: 0 0 1.5rem;
  font-weight: 500;
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  text-shadow: 0 4px 40px rgba(18, 39, 28, .45);
  max-inline-size: 16ch;
}
[dir="rtl"] .hero h1 { max-inline-size: 20ch; font-weight: 700; }

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1rem + .55vw, 1.5rem);
  font-style: italic;
  line-height: 1.5;
  color: rgba(248, 245, 238, .95);
  max-inline-size: 44ch;
  margin-block-end: 1.4rem;
}
[dir="rtl"] .hero-tagline { font-style: normal; }

.hero-text {
  color: rgba(248, 245, 238, .8);
  max-inline-size: 46ch;
  margin-block-end: .5rem;
}
.hero-author {
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brass-lift);
  margin-block-end: 2.4rem;
}
[dir="rtl"] .hero-author { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.hero-terrace {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 3;
}

/* ---------- 8. Sections ---------- */
.section {
  padding-block: clamp(4rem, 2.5rem + 5vw, 7.5rem);
  position: relative;
}
.section-alt { background: var(--stone); }
.section-forest { background: var(--forest-deep); color: rgba(248, 245, 238, .82); }
.section-forest h2, .section-forest h3 { color: #fff; }
.section-forest .section-label { color: var(--brass-lift); }

.section-intro {
  max-inline-size: 62ch;
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  line-height: 1.8;
  color: var(--ink-soft);
}

/* Split: text + image */
.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
.split img {
  inline-size: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.split h3 { margin-top: 1.8rem; }

/* Conclusion */
.conclusion {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 1rem + 3vw, 3.5rem);
  background: var(--stone);
  border-radius: var(--radius);
  border-inline-start: 3px solid var(--brass);
}
.conclusion img {
  inline-size: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}
.conclusion h3 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
}

/* ---------- 9. Pillars (terraced list, not cards) ---------- */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(2rem, 1rem + 4vw, 5rem);
  margin-top: 3rem;
  border-block-start: 1px solid var(--line);
}
.pillar {
  padding-block: 2rem;
  border-block-end: 1px solid var(--line);
  position: relative;
}
.pillar h3 {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  margin-bottom: .7rem;
  color: var(--forest-deep);
}
/* Olive-sprig mark — the village's own crop, not a generic bullet */
.pillar h3::before {
  content: "";
  inline-size: 9px;
  block-size: 9px;
  flex: none;
  border-radius: 0 60% 0 60%;
  background: var(--olive);
  transform: rotate(-12deg);
  transition: background-color .3s, transform .4s var(--ease);
}
.pillar:hover h3::before { background: var(--brass); transform: rotate(-12deg) scale(1.35); }
.pillar p {
  color: var(--ink-soft);
  font-size: .98rem;
  margin-bottom: .7rem;
}

/* ---------- 10. Gallery marquee ---------- */
.gallery-section {
  padding-block: clamp(3rem, 2rem + 3vw, 5rem);
  overflow: hidden;
  background: var(--forest-deep);
}
.gallery-track {
  display: flex;
  gap: 1.1rem;
  inline-size: max-content;
  animation: marquee 90s linear infinite;
}
.gallery-section:hover .gallery-track { animation-play-state: paused; }
.gallery-track img {
  inline-size: clamp(210px, 24vw, 320px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  flex: none;
  filter: saturate(.92);
  transition: transform .5s var(--ease), filter .5s;
}
.gallery-track img:hover { transform: translateY(-6px); filter: saturate(1.08); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
[dir="rtl"] .gallery-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

/* ---------- 11. Interior page hero ---------- */
.page-hero {
  position: relative;
  padding-block: calc(var(--header-h) + clamp(3.5rem, 2rem + 5vw, 6.5rem)) clamp(3.5rem, 2rem + 5vw, 6rem);
  background-image:
    linear-gradient(rgba(18, 39, 28, .8), rgba(18, 39, 28, .88)),
    var(--page-hero-bg, url('../assets/img/service-bg.jpg'));
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.page-hero h1 {
  color: #fff;
  margin: 0;
  font-size: clamp(2.2rem, 1.5rem + 3vw, 4rem);
  font-weight: 500;
}
.page-hero .terrace {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
}

/* ---------- 12. Content blocks ---------- */
.content-block { max-inline-size: 78ch; }
.content-block h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
  margin-top: 2.4rem;
}
.content-block h2:first-child { margin-top: 0; }
.content-block ul {
  padding-inline-start: 0;
  list-style: none;
  margin: 0 0 1.4rem;
}
.content-block li {
  position: relative;
  padding-inline-start: 1.6rem;
  margin-bottom: .85rem;
  color: var(--ink-soft);
}
.content-block li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: .62em;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 0 60% 0 60%;
  background: var(--olive);
  transform: rotate(-12deg);
}
.content-block li strong { color: var(--ink); }

/* Directory (Annuaire) */
.directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-inline-size: 60ch;
  border-block-start: 1px solid var(--line);
}
.directory-item {
  padding-block: 1.8rem;
  border-block-end: 1px solid var(--line);
}
.directory-item h3 {
  font-size: .74rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--olive-dim);
  margin-bottom: .7rem;
}
[dir="rtl"] .directory-item h3 { letter-spacing: 0; text-transform: none; font-size: 1rem; }
.directory-item p {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--forest-deep);
  margin-bottom: .25rem;
}

/* Churches — alternating rows */
.church-block {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);
  border-block-end: 1px solid var(--line);
}
.church-block:last-child { border-block-end: 0; padding-block-end: 0; }
.church-block:nth-child(even) > img { order: 2; }
.church-block img {
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.church-block h2 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.9rem); }
.church-meta { color: var(--ink-soft); font-size: .96rem; margin-bottom: .5rem; }
.church-meta strong, .church-block p strong { color: var(--forest); }

/* Silk museum grid */
.silk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-top: 2.5rem;
}
.silk-grid img {
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .5s var(--ease);
}
.silk-grid img:hover { transform: scale(1.02); }

/* Projects — terraced left edge */
.project-section {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 0 clamp(1.5rem, 1rem + 2vw, 2.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding-inline-start: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  padding-inline-end: 0;
  border-inline-start: 2px solid var(--line);
  position: relative;
  transition: border-color .4s;
}
.project-section:hover { border-inline-start-color: var(--brass); }
.project-section h2 {
  margin-top: 0;
  font-size: clamp(1.35rem, 1.15rem + .9vw, 1.9rem);
}
.project-section p strong { color: var(--forest); }

/* Empty state */
.empty-state {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.9rem);
  font-style: italic;
  color: var(--olive-dim);
  text-align: center;
  padding-block: clamp(3rem, 2rem + 4vw, 5rem);
  border-block: 1px solid var(--line);
}
[dir="rtl"] .empty-state { font-style: normal; }

/* ---------- 13. Footer ---------- */
.site-footer {
  background: var(--forest-deep);
  color: rgba(248, 245, 238, .68);
  padding-block: clamp(3.5rem, 2rem + 4vw, 5.5rem) 2rem;
  position: relative;
}
.site-footer .terrace {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
  padding-block-end: 2.5rem;
}
.site-footer h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}
.site-footer p { font-size: .95rem; margin-bottom: .5rem; }
.site-footer a { color: rgba(248, 245, 238, .78); text-decoration: none; transition: color .3s; }
.site-footer a:hover { color: var(--brass-lift); }

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
[dir="rtl"] .footer-links a { letter-spacing: 0; text-transform: none; font-size: .95rem; }

.footer-bottom {
  border-block-start: 1px solid rgba(248, 245, 238, .12);
  padding-block-start: 1.75rem;
  text-align: center;
}
.footer-bottom p {
  font-size: .78rem;
  letter-spacing: .06em;
  color: rgba(248, 245, 238, .5);
  margin: 0;
}

.lang-switch { display: none !important; }

/* ---------- 14b. Floating language widget ---------- */
.lang-float {
  position: fixed;
  left: 24px;
  right: auto;
  bottom: 24px;
  z-index: 91;
  display: inline-flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 4px;
  background: rgba(248, 245, 238, 0.96);
  border: 1px solid rgba(18, 39, 28, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 28px -10px rgba(18, 39, 28, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lang-float::before { display: none; }
.lang-float-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-inline-size: 44px;
  inline-size: auto;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--forest-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  transition: background 0.25s var(--ease), color 0.25s, transform 0.25s var(--ease);
}
.lang-float-btn::before { display: none; }
.lang-float-btn + .lang-float-btn::after {
  content: "";
  position: absolute;
  inset-block: 22%;
  inset-inline-start: 0;
  inline-size: 1px;
  background: rgba(18, 39, 28, 0.12);
  pointer-events: none;
}
.lang-float-btn:hover {
  color: var(--forest-deep);
  background: rgba(18, 39, 28, 0.06);
  transform: none;
}
.lang-float-btn.is-active {
  background: var(--forest-deep);
  color: var(--paper);
  box-shadow: none;
  pointer-events: none;
}
.lang-float-btn.is-active + .lang-float-btn::after,
.lang-float-btn.is-active::after {
  opacity: 0;
}
[dir="rtl"] .lang-float-btn[lang="en"],
[dir="rtl"] .lang-float-btn[lang="fr"] {
  font-family: var(--font-body);
  letter-spacing: 0.14em;
}
.lang-float-btn[lang="ar"] {
  font-family: var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding-inline: 0.85rem;
}

/* ---------- 14. WhatsApp float ---------- */
.whatsapp-float {
  position: fixed;
  right: 24px;
  left: auto;
  bottom: 24px;
  z-index: 90;
  inline-size: 56px;
  block-size: 56px;
  display: grid;
  place-items: center;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 8px 26px -6px rgba(37, 211, 102, .6);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.whatsapp-float svg {
  inline-size: 28px;
  block-size: 28px;
  fill: #fff;
}
.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 34px -6px rgba(37, 211, 102, .7);
}
[dir="rtl"] .whatsapp-float {
  right: 24px;
  left: auto;
}

/* ---------- 15. Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Hero load stagger */
.hero-content > * { animation: rise .95s var(--ease) both; }
.hero-brand    { animation-delay: .15s; }
.hero h1       { animation-delay: .3s; }
.hero-tagline  { animation-delay: .45s; }
.hero-text     { animation-delay: .58s; }
.hero-author   { animation-delay: .68s; }
.hero .btn     { animation-delay: .78s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 16. Responsive ---------- */
@media (max-width: 1024px) {
  .nav-list { gap: 1.1rem; }
  .nav-list a { font-size: .72rem; letter-spacing: .06em; }
}

@media (max-width: 900px) {
  :root { --header-h: 72px; }

  /* Solid header bar on mobile (same look as scrolled desktop) */
  .site-header {
    border-block-end-color: var(--line-soft);
    box-shadow: var(--shadow-soft);
  }
  .site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(248, 245, 238, .97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .site-header .brand-ar { color: var(--forest-deep); }
  .site-header .brand-en { color: var(--olive-dim); }
  .site-header .menu-toggle span { background: var(--forest-deep); }

  .menu-toggle { display: flex; }

  .main-nav {
    position: fixed;
    inset: 0;
    z-index: 120;
    inline-size: 100%;
    block-size: 100%;
    min-block-size: 100dvh;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    background: var(--forest-deep);
    padding: 5rem var(--gutter) 3rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform .45s var(--ease);
  }
  [dir="rtl"] .main-nav { transform: translateX(-100%); }
  .main-nav.is-open { transform: translateX(0); }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
  }
  .nav-list a,
  .site-header.is-scrolled .nav-list a {
    color: var(--paper);
    font-size: 1rem;
    letter-spacing: .12em;
  }
  [dir="rtl"] .nav-list a { font-size: 1.15rem; }

  /* Dropdown becomes a static sublist in the drawer */
  .dropdown {
    position: static;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: .9rem 0 0;
    margin-top: .5rem;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: .35rem 1.5rem;
    justify-content: center;
    border-block-start: 1px solid rgba(248, 245, 238, .16);
  }
  .dropdown a,
  .dropdown a:hover,
  .dropdown a[aria-current="page"] {
    color: rgba(248, 245, 238, .72) !important;
    background: transparent;
    font-size: .82rem;
    padding: .25rem 0;
    text-align: center;
  }
  .dropdown a:hover { color: var(--brass-lift) !important; }
  .has-dropdown > .nav-link { pointer-events: none; }

  .lang-switch {
    padding-inline-start: 0;
    border-inline-start: 0;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid rgba(248, 245, 238, .16);
    inline-size: 100%;
    justify-content: center;
  }
  .site-header.is-scrolled .lang-switch { border-inline-start: 0; }
  .site-header.is-scrolled .lang-switch a { color: rgba(248, 245, 238, .68); }
  .site-header.is-scrolled .lang-switch span { color: rgba(248, 245, 238, .3); }
  .site-header.is-scrolled .lang-switch a.is-active,
  .lang-switch a.is-active { color: var(--brass-lift); }

  /* Layout collapse */
  .split,
  .conclusion,
  .church-block,
  .footer-grid { grid-template-columns: 1fr; }

  .split img { aspect-ratio: 16 / 10; }
  .church-block:nth-child(even) > img { order: 0; }
  .conclusion img { aspect-ratio: 16 / 10; }

  .pillars-grid { grid-template-columns: 1fr; }

  /* Mobile hero — clean, bottom-anchored, minimal */
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    block-size: 500px;
    min-block-size: 500px;
    max-block-size: 500px;
    overflow: hidden;
  }
  .hero-bg {
    transform: none;
    animation: none;
    background-image: url('../img/hero-2x.jpg');
    background-position: 55% 32%;
    background-size: cover;
    filter: none;
    opacity: 1;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .hero::before,
  [dir="rtl"] .hero::before {
    /* Keep photo colors pure — only a soft bottom fade for text */
    background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 58%,
      rgba(0, 0, 0, 0.18) 82%,
      rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
  }
  .hero h1,
  .hero-tagline {
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65), 0 1px 3px rgba(0, 0, 0, 0.45);
  }
  .hero-brand { display: none; }
  .hero-text,
  .hero-author { display: none; }
  .hero-terrace { display: none; }
  .hero-content {
    padding-inline: 1.35rem;
    padding-block: 0 1.75rem;
    margin-block-start: auto;
  }
  .hero-content > * { max-inline-size: 100%; }
  .hero h1 {
    font-size: clamp(1.55rem, 5.8vw, 2.1rem);
    line-height: 1.3;
    margin-block-end: 0.85rem;
    max-inline-size: none;
  }
  [dir="rtl"] .hero h1 {
    max-inline-size: none;
    font-size: clamp(1.65rem, 6vw, 2.2rem);
    line-height: 1.45;
  }
  .hero-tagline {
    font-size: 0.98rem;
    line-height: 1.5;
    margin-block-end: 1.15rem;
    max-inline-size: none;
    opacity: 0.92;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .hero .btn {
    padding: 0.9rem 1.75rem;
    font-size: 0.85rem;
    margin-block-start: 0.15rem;
  }
  [dir="rtl"] .hero-content { text-align: right; }
  html:not([dir="rtl"]) .hero-content { text-align: left; }
}

@media (max-width: 560px) {
  .hero-content {
    padding-inline: 1.15rem;
    padding-block-end: 1.5rem;
  }
  .hero h1 { font-size: 1.45rem; }
  [dir="rtl"] .hero h1 { font-size: 1.55rem; }
  .hero-tagline { font-size: 0.95rem; }
  .brand img { inline-size: 38px; block-size: 38px; }
  .brand-ar { font-size: 1.05rem; }
  .brand-en { font-size: .52rem; letter-spacing: .1em; }

  .silk-grid { grid-template-columns: 1fr; }
  .gallery-track img { inline-size: 200px; }

  .lang-float {
    left: 18px;
    bottom: 18px;
  }
  .whatsapp-float {
    inline-size: 52px;
    block-size: 52px;
    right: 18px;
    left: auto;
    bottom: 18px;
  }
  .btn { padding: .85rem 1.5rem; font-size: .78rem; }
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-bg { transform: none; }
  .reveal { opacity: 1; transform: none; }
  .gallery-track { animation: none; }
}

/* ---------- 18. Print ---------- */
@media print {
  .site-header, .whatsapp-float, .lang-float, .gallery-section { display: none; }
  body { background: #fff; color: #000; }
}
