@import './tokens.css';

:root {
  --container: 1180px;
  --header-height: 72px;
  --mobile-bar-height: calc(68px + env(safe-area-inset-bottom, 0px));
  --texte-doux: var(--text-muted);
  --accent: var(--sauge);
  --accent-strong: #6fa892;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ivoire);
}

body.has-mobile-bar {
  padding-bottom: var(--mobile-bar-height);
}

@media (min-width: 761px) {
  body.has-mobile-bar { padding-bottom: 0; }
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--vert);
}

.brand-hijama {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.65em;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.section { padding: 56px 0; }

.section--white { background: var(--white); }

.section--dark {
  background: var(--vert);
  color: var(--ivoire);
}

.section--dark h2 { color: var(--ivoire); }

.section--trust { padding: 20px 0; }

.section-head { max-width: 680px; margin-bottom: 32px; }

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-lead {
  color: var(--texte-doux);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 42rem;
}

.section-head--center .section-lead {
  margin-inline: auto;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.eyebrow--light { color: var(--sable); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.btn--accent {
  background: var(--sauge);
  color: var(--vert);
}

.btn--accent:hover { background: #7cad9a; }

.btn--outline-light {
  border-color: rgba(247, 245, 239, 0.55);
  color: var(--ivoire);
}

.btn--outline-light:hover {
  background: rgba(247, 245, 239, 0.12);
  border-color: var(--ivoire);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Header — modèle CCM */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--vert);
  border-bottom: 1px solid rgba(247, 245, 239, 0.1);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-height);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: var(--ivoire);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.header-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.header__cta { display: none; }

nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
}

nav a {
  color: var(--ivoire);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

nav a:hover { color: var(--sable); }

.menu-toggle {
  display: none;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--ivoire);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.menu-toggle .icon-close { display: none; }

.menu-toggle[aria-expanded='true'] .icon-open { display: none; }

.menu-toggle[aria-expanded='true'] .icon-close { display: block; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--vert);
    border-top: 1px solid rgba(247, 245, 239, 0.1);
  }
  nav.is-open { display: block; }
  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 16px;
  }
  nav a {
    display: block;
    padding: 12px 0;
    font-size: 1.05rem;
  }
}

@media (min-width: 901px) {
  .header__cta { display: inline-flex; }
}

@media (max-width: 760px) {
  :root { --header-height: 60px; }
}

/* Hero — modèle CCM Couverture */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--vert);
  color: var(--ivoire);
}

.hero--photo {
  min-height: calc(100svh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__media picture { display: contents; }

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-position, center 32%);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(36, 71, 62, 0) 0%,
    rgba(36, 71, 62, 0.15) 35%,
    rgba(36, 71, 62, 0.72) 70%,
    rgba(36, 71, 62, 0.85) 100%
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100svh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom));
}

.hero__copy { max-width: 34rem; }

.zones-strip {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(36, 71, 62, 0.55);
  backdrop-filter: blur(6px);
  color: var(--sable);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero h1 {
  margin: 0 0 12px;
  color: var(--ivoire);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.12;
  text-wrap: balance;
}

.hero__lead {
  margin: 0 0 24px;
  color: rgba(247, 245, 239, 0.92);
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.5;
  max-width: 32rem;
}

.hero__lead--mobile { display: none; }

@media (max-width: 760px) {
  .hero__overlay {
    background: linear-gradient(
      180deg,
      rgba(36, 71, 62, 0.05) 0%,
      rgba(36, 71, 62, 0.45) 45%,
      rgba(36, 71, 62, 0.78) 100%
    );
  }

  .hero__inner {
    justify-content: center;
    padding: 24px 0 32px;
  }

  .hero__lead--desktop { display: none; }

  .hero__lead--mobile { display: block; margin-bottom: 0; }

  .hero__actions { display: none; }
}

@media (min-width: 900px) {
  .hero__overlay {
    background: linear-gradient(
      90deg,
      rgba(36, 71, 62, 0.88) 0%,
      rgba(36, 71, 62, 0.65) 42%,
      rgba(36, 71, 62, 0.2) 65%,
      transparent 85%
    );
  }

  .hero__inner {
    justify-content: center;
    align-items: flex-start;
    padding: 56px 0 72px;
  }
}

/* Trust strip — défilement mobile CCM */
.trust-track { display: contents; }

.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  list-style: none;
}

.trust--clone { display: none; }

.trust li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--vert);
}

.trust svg { flex-shrink: 0; color: var(--accent-strong); }

@media (max-width: 960px) {
  .trust { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .section--trust { padding: 16px 0; }

  .trust-wrap {
    overflow: hidden;
    margin-inline: -20px;
    mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  }

  .trust-track {
    display: flex;
    width: max-content;
    animation: trust-scroll 26s linear infinite;
  }

  .trust, .trust--clone {
    display: flex;
    flex-wrap: nowrap;
    gap: 32px;
    padding-right: 32px;
  }

  .trust--clone { display: flex; }

  .trust li { white-space: nowrap; font-size: 0.9rem; }

  .trust svg { width: 24px; height: 24px; }
}

@keyframes trust-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .trust-track { animation: none; }
  .trust-wrap { overflow-x: auto; mask-image: none; }
  .trust--clone { display: none; }
}

/* Steps */
.home-steps__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
}

.home-steps__list li {
  text-align: center;
  padding: 0 8px;
}

.home-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--vert);
  color: var(--ivoire);
  font-weight: 700;
}

.home-steps__list h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  margin-bottom: 6px;
}

.home-steps__list p {
  font-size: 0.9375rem;
  color: var(--texte-doux);
}

@media (max-width: 820px) {
  .home-steps__list {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .home-steps__list li {
    display: grid;
    grid-template-columns: 36px 1fr;
    column-gap: 14px;
    text-align: left;
    align-items: start;
  }

  .home-steps__num {
    grid-row: span 2;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
    margin: 0;
  }

  .home-steps__list h3,
  .home-steps__list p { grid-column: 2; }
}

/* Service cards */
.prestations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .prestations-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
}

.service-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.service-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-card__body { padding: 1.1rem 1.15rem 1.25rem; }

.service-card__body h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  margin-bottom: 0.35rem;
}

.service-card__body p {
  font-size: 0.9375rem;
  color: var(--texte-doux);
  margin-bottom: 0.75rem;
}

.service-card__link {
  font-weight: 700;
  color: var(--vert);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sunnah-split {
  display: grid;
  gap: 28px;
  align-items: start;
}

.sunnah-split > div p {
  color: var(--texte-doux);
  margin-bottom: 1em;
}

.sunnah-split > div p:last-of-type { margin-bottom: 0; }

.sunnah-points {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.sunnah-points li {
  padding: 0.85rem 1rem;
  background: var(--ivoire);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--texte-doux);
  font-size: 0.9375rem;
}

.sunnah-points strong {
  display: block;
  color: var(--vert);
  font-family: var(--font-body);
  margin-bottom: 0.2rem;
}

.quote {
  margin: 0;
  padding: 1.5rem 1.35rem;
  border-left: 3px solid var(--sable);
  background: var(--ivoire);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--vert);
}

.quote cite {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 400;
  color: var(--texte-doux);
  line-height: 1.5;
}

@media (min-width: 900px) {
  .sunnah-split { grid-template-columns: 1.15fr 0.85fr; gap: 40px; }
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gallery-grid figure { margin: 0; }

.gallery-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-grid figcaption {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--texte-doux);
}

@media (max-width: 760px) {
  .gallery-grid {
    grid-auto-flow: column;
    grid-auto-columns: min(72vw, 260px);
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
  }

  .gallery-grid figure { scroll-snap-align: start; }
}

/* Reasons */
.reasons__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  list-style: none;
}

.reasons__grid li {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.reasons__item--highlight {
  border-color: color-mix(in srgb, var(--sauge) 50%, var(--border));
  background: color-mix(in srgb, var(--sauge-soft) 60%, var(--white));
}

.reasons__grid h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.reasons__grid p {
  font-size: 0.9375rem;
  color: var(--texte-doux);
}

@media (min-width: 900px) {
  .reasons__grid { grid-template-columns: repeat(3, 1fr); }
}

/* FAQ — style CCM */
.faq-block { max-width: 820px; }

.faq-block details {
  border-bottom: 1px solid var(--border);
}

.faq-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--vert);
  min-height: 44px;
}

.faq-block summary::-webkit-details-marker { display: none; }

.faq-block summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent-strong);
}

.faq-block details[open] summary::after { content: '−'; }

.faq-block details p {
  padding: 0 4px 18px;
  font-size: 0.9375rem;
  color: var(--texte-doux);
}

/* Zones dark */
.zones__inner {
  display: grid;
  gap: 24px;
}

.zones p {
  color: rgba(247, 245, 239, 0.85);
  font-size: 0.9375rem;
  max-width: 36rem;
}

.zones__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.zones__chips li {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(247, 245, 239, 0.2);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .zones__inner { grid-template-columns: 1.2fr 1fr; align-items: center; }
}

/* CTA band */
.cta-band {
  position: relative;
  isolation: isolate;
  padding: 72px 0;
  color: var(--ivoire);
  overflow: hidden;
}

.cta-band__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.cta-band__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.cta-band__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(36, 71, 62, 0.9) 0%, rgba(36, 71, 62, 0.55) 100%);
}

.cta-band h2 {
  color: var(--ivoire);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.5rem;
}

.cta-band p {
  max-width: 28rem;
  margin-bottom: 1.25rem;
  color: rgba(247, 245, 239, 0.9);
  font-size: 0.9375rem;
}

/* Footer */
.site-footer {
  padding: 2.25rem 0 calc(1.5rem + var(--safe-bottom));
  font-size: 0.875rem;
  color: var(--texte-doux);
  border-top: 1px solid var(--border);
}

.site-footer p + p { margin-top: 0.4rem; }

.site-footer a { text-decoration: underline; }

.site-footer__legal { font-size: 0.8125rem; margin-top: 0.75rem !important; }

.site-footer__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

/* Mobile bar — CCM */
.mobile-bar {
  display: none;
}

@media (max-width: 760px) {
  .mobile-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: flex;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--vert);
    border-top: 1px solid rgba(247, 245, 239, 0.1);
  }

  .mobile-bar a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-bar__primary {
    background: var(--sauge);
    color: var(--vert);
  }

  .mobile-bar__secondary {
    border: 2px solid var(--ivoire);
    color: var(--ivoire);
  }
}
