/* ============================================================
   DAR KOUTOUBIA — Système de design
   « Chaque clé ouvre une histoire »
   ============================================================ */

:root {
  /* Palette */
  --bordeaux: #3A0E1A;
  --bordeaux-deep: #2C0A13;
  --noir: #1A0B0E;
  --noir-deep: #120709;
  --noir-ink: #1A0B0E; /* toujours fonce, independant des feuilles theme-clair/theme-cobalt qui redefinissent --noir/--noir-deep pour leur propre fond */
  --cuivre: #C68B59;
  --cuivre-hl: #E4B58E;
  --ivoire: #F4EBE0;
  --ivoire-dim: rgba(244, 235, 224, 0.62);
  --ivoire-faint: rgba(244, 235, 224, 0.38);
  --terracotta: #C76B3F;
  --majorelle: #2D6CB0;
  --line: rgba(198, 139, 89, 0.28);
  --line-soft: rgba(198, 139, 89, 0.14);

  /* Typographie */
  --font-display: 'Playfair Display', 'Cormorant Garamond', serif;
  --font-body: 'Jost', 'Montserrat', sans-serif;
  --font-script: 'Pinyon Script', cursive;
  --font-mono: 'Courier New', monospace;

  /* Rythme */
  --section-pad: clamp(72px, 9vw, 140px);
  --gutter: clamp(24px, 5vw, 72px);
  --maxw: 1320px;

  /* Hero fond (tweakable) */
  --hero-tone: var(--bordeaux);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--noir);
  color: var(--ivoire);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--cuivre); color: var(--noir-ink); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Typographie ---------- */

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cuivre);
  display: flex;
  align-items: center;
  gap: 14px;
}
.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--cuivre);
  flex: none;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--cuivre);
  flex: none;
}

.script { font-family: var(--font-script); font-weight: 400; color: var(--cuivre-hl); }

p { text-wrap: pretty; }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--ivoire-dim); max-width: 56ch; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 32px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--cuivre);
  background: transparent;
  color: var(--cuivre-hl);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.btn:hover { background: var(--cuivre); color: var(--noir-ink); }

.btn--solid { background: var(--cuivre); color: var(--noir-ink); }
.btn--solid:hover { background: var(--cuivre-hl); border-color: var(--cuivre-hl); }

.btn--ghost { border-color: var(--line); color: var(--ivoire); }
.btn--ghost:hover { border-color: var(--cuivre); background: transparent; color: var(--cuivre-hl); }

.btn--ink { border-color: var(--bordeaux); color: var(--bordeaux); }
.btn--ink:hover { background: var(--bordeaux); color: var(--ivoire); }

.link-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cuivre);
  transition: color 0.3s ease, gap 0.3s ease;
}
.link-line::after { content: "\2192"; font-size: 16px; transition: transform 0.3s ease; }
.link-line:hover { color: var(--cuivre-hl); gap: 16px; }

/* ---------- Placeholders photo ---------- */

.ph {
  position: relative;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(198, 139, 89, 0.07) 0px,
      rgba(198, 139, 89, 0.07) 1px,
      transparent 1px,
      transparent 9px
    ),
    linear-gradient(160deg, #2A0D15 0%, #1C0B10 100%);
}
.ph::after {
  content: attr(data-ph);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(228, 181, 142, 0.5);
}
.ph--light {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(58, 14, 26, 0.06) 0px,
      rgba(58, 14, 26, 0.06) 1px,
      transparent 1px,
      transparent 9px
    ),
    linear-gradient(160deg, #EADFD0 0%, #E2D4C2 100%);
}
.ph--light::after { color: rgba(58, 14, 26, 0.45); }

/* Arche en fer à cheval pour encadrer les visuels */
.arch {
  border-radius: 50% 50% 0 0 / 38% 38% 0 0;
  border: 1px solid var(--line);
  padding: 10px;
}
.arch > .ph, .arch > img {
  border-radius: inherit;
  height: 100%;
  width: 100%;
}

/* Étoile zellige (8 branches : 2 carrés) */
.star8 { width: 14px; height: 14px; flex: none; }
.star8 rect { fill: none; stroke: var(--cuivre); stroke-width: 1.4; }
.star8--fill rect { fill: var(--cuivre); stroke: none; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  transition: background 0.4s ease, padding 0.4s ease, box-shadow 0.4s ease;
}
.site-header.is-scrolled {
  background: rgba(18, 7, 9, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: 12px;
  padding-bottom: 12px;
  box-shadow: 0 1px 0 var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 52px; height: 52px;
  border: 1px solid var(--cuivre);
  border-radius: 50%;
  background: url("img/logo-dk-header.png") center/cover no-repeat, #1a0d10;
  color: transparent;
  font-size: 0;
  overflow: hidden;
  flex: none;
  box-shadow: 0 2px 10px rgba(26, 13, 16, 0.35);
}
.brand-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  line-height: 1.3;
}
.brand-name small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.38em;
  color: var(--cuivre);
}

.main-nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.main-nav a {
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivoire-dim);
  padding: 6px 0;
  position: relative;
  transition: color 0.3s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--cuivre);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ivoire); }
.main-nav a:hover::after, .main-nav a[aria-current]::after { transform: scaleX(1); }

.header-utils { display: flex; align-items: center; gap: 18px; }
.util-select {
  background: transparent;
  border: none;
  color: var(--ivoire-dim);
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.util-select option { color: var(--noir-ink); }
.util-divider { width: 1px; height: 18px; background: var(--line); }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--ivoire-dim);
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  transition: color 0.3s ease;
}
.icon-btn:hover { color: var(--cuivre-hl); }
.icon-btn svg { width: 19px; height: 19px; }

.header-cta { padding: 11px 22px; font-size: 11.5px; }

.burger {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  place-items: center;
  color: var(--ivoire);
}
.burger svg { width: 20px; height: 20px; }

/* Menu mobile */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--noir-deep);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu nav a {
  font-family: var(--font-display);
  font-size: 28px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ivoire);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu nav a span { font-family: var(--font-body); font-size: 11px; letter-spacing: 0.2em; color: var(--cuivre); }
.mobile-menu-foot { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Sections génériques ---------- */

.section {
  padding: var(--section-pad) var(--gutter);
}
.section-inner { max-width: var(--maxw); margin: 0 auto; }

.section--bordeaux { background: var(--bordeaux); }
.section--bordeaux-deep { background: var(--bordeaux-deep); }
.section--ivory { background: var(--ivoire); color: var(--bordeaux); }
.section--ivory .eyebrow { color: var(--terracotta); }
.section--ivory .eyebrow::before, .section--ivory .eyebrow::after { background: var(--terracotta); }
.section--ivory .lead { color: rgba(58, 14, 26, 0.68); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head h2 { font-size: clamp(30px, 3.6vw, 48px); max-width: 22ch; }
.section-head--split {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.section-head--split > div { display: flex; flex-direction: column; gap: 18px; }

/* Révélation au scroll */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Property card ---------- */

.prop-card {
  background: var(--bordeaux-deep);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.35s ease, transform 0.35s ease;
}
.prop-card:hover { border-color: var(--line); transform: translateY(-4px); }

.prop-media { position: relative; aspect-ratio: 4 / 3; }
.prop-media .ph { position: absolute; inset: 0; }

.prop-badges { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; z-index: 2; }
.badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: rgba(18, 7, 9, 0.85);
  color: var(--cuivre-hl);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.badge--verified { color: var(--ivoire); }
.badge--verified .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cuivre); }
.badge--excl { background: var(--cuivre); color: var(--noir-ink); border-color: var(--cuivre); }

.fav-btn {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(18, 7, 9, 0.7);
  color: var(--ivoire-dim);
  display: grid;
  place-items: center;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.fav-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.fav-btn:hover { color: var(--cuivre-hl); border-color: var(--cuivre); }
.fav-btn.is-active { color: var(--terracotta); border-color: var(--terracotta); }
.fav-btn.is-active svg { fill: var(--terracotta); stroke: var(--terracotta); }

.prop-body { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.prop-price { display: flex; align-items: baseline; gap: 12px; }
.prop-price strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--cuivre-hl);
  letter-spacing: 0.01em;
}
.prop-price span { font-size: 12.5px; color: var(--ivoire-faint); letter-spacing: 0.04em; }

.prop-title { font-size: 18px; font-weight: 600; color: var(--ivoire); }
.prop-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cuivre);
}

.prop-specs {
  display: flex;
  gap: 18px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ivoire-dim);
  flex-wrap: wrap;
}
.prop-specs span { display: inline-flex; align-items: center; gap: 7px; }
.prop-specs svg { width: 15px; height: 15px; stroke: var(--cuivre); fill: none; stroke-width: 1.4; opacity: 0.9; }

.prop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(18, 7, 9, 0.35);
}
.prop-ref { font-family: var(--font-mono); font-size: 11px; color: var(--ivoire-faint); letter-spacing: 0.06em; }
.prop-actions { display: flex; gap: 8px; }
.prop-actions a {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--cuivre);
  transition: background 0.3s ease, color 0.3s ease;
}
.prop-actions a:hover { background: var(--cuivre); color: var(--noir-ink); }
.prop-actions svg { width: 15px; height: 15px; }

/* ---------- Carrousel ---------- */

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(280px, 26vw, 380px);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; }

.carousel-nav { display: flex; gap: 10px; }
.carousel-nav button {
  width: 48px; height: 48px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cuivre);
  display: grid;
  place-items: center;
  transition: background 0.3s ease, color 0.3s ease;
}
.carousel-nav button:hover { background: var(--cuivre); color: var(--noir-ink); }
.carousel-nav svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--noir-deep);
  border-top: 1px solid var(--line-soft);
  padding: clamp(56px, 7vw, 96px) var(--gutter) 32px;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-soft);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cuivre);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col li { font-size: 14px; color: var(--ivoire-dim); transition: color 0.3s ease; }
.footer-col a:hover { color: var(--cuivre-hl); }

.footer-brand p { font-size: 14px; color: var(--ivoire-dim); max-width: 30ch; margin-top: 18px; }
.footer-tagline { font-family: var(--font-script); font-size: 26px; color: var(--cuivre-hl); margin-top: 18px; }

.footer-nap { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: var(--ivoire-dim); }
.footer-nap strong { color: var(--ivoire); font-weight: 500; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ivoire-faint);
}
.footer-bottom nav { display: flex; gap: 22px; }
.footer-bottom a:hover { color: var(--cuivre-hl); }
.footer-langs { display: flex; gap: 14px; }
.footer-langs a { letter-spacing: 0.16em; text-transform: uppercase; }
.footer-langs a[aria-current] { color: var(--cuivre); }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .header-cta { display: none; }
  .burger { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-utils .util-select, .header-utils .util-divider { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .carousel { grid-auto-columns: 86%; }
  .section-head--split { flex-direction: column; align-items: flex-start; }
}


/* ---------- Image slots (drag & drop) ---------- */
image-slot.ph { display: block; width: 100%; height: 100%; }
image-slot.ph::after { content: none; }


/* Badge compteur favoris (header) */
.fav-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--cuivre, #A4623A);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}
