/* ============================================================
   Tennis de la Cavalerie — feuille de styles
   ============================================================ */

/* --- Reset & base ----------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; }

/* --- Design tokens ---------------------------------------- */

:root {
  --color-bg:        #FAF6EF;
  --color-bg-alt:    #F1E8D8;
  --color-surface:   #FFFFFF;
  --color-text:      #1F1812;
  --color-text-soft: #6B5D52;
  --color-line:      #E5DDD0;
  --color-primary:   #8B4A2B;   /* terre cuite profonde */
  --color-primary-2: #C26B4A;   /* terre cuite chaude */
  --color-accent:    #B8956A;   /* or chaud */
  --color-overlay:   rgba(20, 14, 9, .42);

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(31, 24, 18, .04), 0 2px 6px rgba(31, 24, 18, .04);
  --shadow:    0 6px 22px rgba(31, 24, 18, .08);
  --shadow-lg: 0 18px 48px rgba(31, 24, 18, .14);

  --container: 1200px;
  --container-narrow: 760px;

  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 7rem;

  --header-h: 78px;

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

/* --- Typography ------------------------------------------- */

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--color-text);
}

h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 300; letter-spacing: -.02em; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 400; }
h3 { font-size: 1.25rem; font-weight: 500; font-variation-settings: "opsz" 24; }

p { color: var(--color-text); }

a { text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--color-primary); }

::selection { background: var(--color-primary-2); color: #fff; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.eyebrow.centered { text-align: center; display: block; }

.centered { text-align: center; }

.lede {
  font-size: 1.1rem;
  color: var(--color-text-soft);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-text);
  color: #fff;
  padding: .75rem 1rem;
  z-index: 1000;
}
.skip-link:focus { top: 0; }

/* --- Layout ----------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.container.narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: clamp(4rem, 10vw, var(--space-7));
}

.section + .section { border-top: 1px solid var(--color-line); }

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background .35s var(--ease), backdrop-filter .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header[data-scrolled="true"] {
  background: rgba(250, 246, 239, .88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
          backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--color-text);
}

.site-header:not([data-scrolled="true"]) .brand,
.site-header:not([data-scrolled="true"]) .nav a,
.site-header:not([data-scrolled="true"]) .lang-switch,
.site-header:not([data-scrolled="true"]) .nav-toggle span {
  color: #fff;
}
.site-header:not([data-scrolled="true"]) .nav-toggle span { background: #fff; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .005em;
}

.nav ul {
  display: flex;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
}

.nav a {
  position: relative;
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding: .5rem 0;
}

.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-switch {
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  padding: .55rem .75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: .85;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.lang-switch:hover { opacity: 1; background: rgba(0,0,0,.05); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg);
  z-index: 60; /* AU-DESSUS du header (50) — le menu couvre tout, X cliquable */
  padding: calc(env(safe-area-inset-top, 0px) + 5.5rem) var(--space-4) var(--space-4);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  right: 1rem;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(31, 24, 18, .15);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.mobile-nav-close:hover,
.mobile-nav-close:focus,
.mobile-nav-close:active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
  outline: none;
}
.mobile-nav-close svg { display: block; pointer-events: none; }
.mobile-nav[hidden] { display: none; }
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.mobile-nav a {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  display: block;
  padding: .75rem 0;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-text);
}

@media (max-width: 820px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
}

/* --- Hero ------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20,14,9,.55) 0%, rgba(20,14,9,.15) 30%, rgba(20,14,9,.15) 55%, rgba(20,14,9,.78) 100%);
}

.hero-content {
  padding-block: var(--space-7) var(--space-6);
  max-width: 980px;
}

.hero-content .eyebrow {
  color: #E9D9C1;
  margin-bottom: var(--space-3);
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--space-3);
  font-weight: 300;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  font-style: italic;
  font-weight: 300;
  color: #f4ead9;
  max-width: 56ch;
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #f4ead9;
  opacity: .9;
}
.hero-scroll svg { animation: bob 1.8s var(--ease) infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* --- Section: about -------------------------------------- */

.section-about {
  background: var(--color-bg);
}

.section-about h2 {
  margin-block: var(--space-2) var(--space-4);
}

.about-text p {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--color-text-soft);
  margin-bottom: var(--space-3);
}

.about-text p:first-child::first-letter {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 3.6rem;
  float: left;
  line-height: .9;
  padding: .25rem .75rem 0 0;
  color: var(--color-primary);
}

/* --- Section: features ----------------------------------- */

.section-features {
  background: var(--color-bg-alt);
}

.section-features h2 {
  margin-block: var(--space-2) var(--space-5);
}

.features-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-line);
  border: 1px solid var(--color-line);
}

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

.features-grid li {
  background: var(--color-bg);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: background .25s var(--ease);
}
.features-grid li:hover { background: var(--color-surface); }

.features-grid svg {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.features-grid h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.features-grid p {
  color: var(--color-text-soft);
  font-size: .96rem;
  line-height: 1.6;
}

/* --- Section: gallery ------------------------------------ */

.section-gallery h2 {
  margin-block: var(--space-2) var(--space-5);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 14px;
}

.gallery-grid--2col {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: clamp(280px, 38vw, 460px);
  gap: 18px;
}

.gallery-item {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), filter .35s var(--ease);
}
.gallery-item:hover img { transform: scale(1.04); filter: brightness(.95); }

.gallery-item--tall { grid-row: span 2; }
.gallery-item--wide { grid-column: span 2; }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .gallery-item--wide { grid-column: span 2; }
  .gallery-item--tall { grid-row: span 1; }
}

/* --- Section: privatisation ------------------------------ */

.section-private {
  background: var(--color-text);
  color: #E9D9C1;
  text-align: center;
}

.section-private .eyebrow { color: var(--color-accent); }
.section-private h2 { color: #fff; margin-block: var(--space-2) var(--space-3); }
.section-private .lede {
  color: #d4c5a8;
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

.cta-wrap { text-align: center; margin-top: var(--space-3); }

.btn-outline {
  display: inline-block;
  padding: .95rem 1.7rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn-outline:hover {
  background: #E9D9C1;
  color: var(--color-text);
  border-color: #E9D9C1;
}

/* --- Section: contact ------------------------------------ */

.section-contact {
  background: var(--color-bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-5);
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

.contact-intro h2 { margin-block: var(--space-2) var(--space-3); }

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

@media (max-width: 540px) {
  .contact-cards { grid-template-columns: 1fr; }
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.contact-card:not(.contact-card--static):hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.contact-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.contact-value {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
}

.contact-meta {
  font-size: .9rem;
  color: var(--color-text-soft);
}
.contact-meta.link { color: var(--color-primary); }

.socials {
  display: inline-flex;
  gap: .75rem;
  margin-top: .35rem;
}
.socials a {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-text);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.socials a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  background: var(--color-bg-alt);
}
.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(.85) contrast(.95);
}

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

.site-footer {
  background: var(--color-text);
  color: #E9D9C1;
  padding-block: var(--space-5);
}

/* Footer sombre : un fond clair derrière le logo pour qu'il garde
   tous ses détails (raquettes, balle) tout en restant visible */
.site-footer .brand-mark {
  background: var(--color-bg);
  padding: 4px;
  border-radius: 6px;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

@media (max-width: 820px) {
  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: var(--space-3); }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: .9rem;
  opacity: .8;
}
.footer-nav a:hover { opacity: 1; color: #fff; }

.footer-copy {
  font-size: .82rem;
  opacity: .65;
  letter-spacing: .04em;
}

/* --- Lightbox -------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 11, 8, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fade .25s var(--ease);
}
.lightbox[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox figure {
  max-width: min(1200px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox figcaption {
  text-align: center;
  color: #E9D9C1;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background .2s var(--ease);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.12); }

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

/* --- Reveal on scroll ------------------------------------ */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --- Legal / static pages -------------------------------- */

.page-legal {
  padding-top: calc(var(--header-h) + var(--space-5));
  padding-bottom: var(--space-6);
}
.page-legal h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--space-4); }
.page-legal h2 { font-size: 1.25rem; margin-block: var(--space-3) var(--space-1); }
.page-legal p, .page-legal li { color: var(--color-text-soft); margin-bottom: .5rem; }
.page-legal a { color: var(--color-primary); }
.page-legal .back { display: inline-block; margin-top: var(--space-4); font-size: .9rem; }
