/* =========================================================
   Le Bousquet – site stylesheet
   Mobile-first: base styles are for phones; wider screens
   are added with min-width media queries further down.
   ========================================================= */


/* ---------- 1. Settings: change the look here ---------- */

:root {
  /* Colours */
  --stone-900: #2b2a29;   /* header and footer */
  --stone-800: #3a3939;   /* page background (your original grey) */
  --stone-600: #5c5a57;   /* borders, hover backgrounds */
  --limewash:  #fcfaf7;   /* main text */
  --muted:     #cfc9c0;   /* secondary text */
  --armagnac:  #e0a93e;   /* accent: underlines, active page, focus */
  --almond:    #faebd7;   /* dropdown background (your antiquewhite) */

  /* Type */
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  /* Fluid sizes: smallest value, preferred, largest value */
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-hero: clamp(1.75rem, 1.2rem + 4vw, 4.5rem);

  /* Spacing and layout */
  --space-s: 0.5rem;
  --space-m: 1rem;
  --space-l: clamp(1.5rem, 1rem + 2vw, 3rem);
  --content-width: 72rem;
  --radius: 4px;
}


/* ---------- 2. Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--stone-800);
  color: var(--limewash);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}

main {
  flex: 1;
}

[hidden] {
  display: none !important;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-m);
}

p {
  margin: 0 0 var(--space-m);
}

a {
  color: var(--armagnac);
}

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

/* Hidden until a keyboard user tabs to it */
.skip-link {
  position: absolute;
  left: var(--space-m);
  top: -4rem;
  z-index: 100;
  padding: var(--space-s) var(--space-m);
  background: var(--almond);
  color: var(--stone-900);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-m);
}


/* ---------- 3. Header and navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--stone-900);
  border-bottom: 1px solid var(--stone-600);
}

.site-nav {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-m);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.375rem;
  color: var(--limewash);
  text-decoration: none;
  padding: 0.75rem 0;
}

/* Menu button (small screens only) */
.nav-toggle {
  display: none;               /* shown only when JavaScript is running */
  align-items: center;
  gap: var(--space-s);
  min-height: 44px;            /* comfortable touch target */
  padding: 0 var(--space-m);
  font: inherit;
  color: var(--limewash);
  background: transparent;
  border: 1px solid var(--stone-600);
  border-radius: var(--radius);
  cursor: pointer;
}

.js .nav-toggle {
  display: inline-flex;
}

/* Three-bar icon drawn in CSS, becomes a cross when open */
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s, background-color 0.2s;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* The list of links: a full-width column on small screens */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-m);
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: calc(100svh - 4rem);   /* long menu scrolls on short phones */
  overflow-y: auto;
}

.js .nav-toggle[aria-expanded="false"] + .nav-menu {
  display: none;
}

.nav-menu a,
.nav-menu summary {
  display: block;
  padding: 0.75rem var(--space-s);
  color: var(--limewash);
  text-decoration: none;
  border-bottom: 1px solid var(--stone-600);
  cursor: pointer;
}

.nav-menu a:hover,
.nav-menu summary:hover {
  background: var(--stone-600);
}

.nav-menu a[aria-current="page"] {
  color: var(--armagnac);
  font-weight: 600;
}

/* Administration submenu (uses <details>, so it opens on tap) */
.nav-sub summary {
  list-style: none;
}

.nav-sub summary::-webkit-details-marker {
  display: none;
}

.nav-sub summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.5em;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg);
  transition: transform 0.2s;
}

.nav-sub details[open] summary::after {
  transform: translateY(0) rotate(-135deg);
}

.nav-sub ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-m);
}

.nav-sub ul a {
  color: var(--muted);
}


/* ---------- 4. Home page hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--stone-900);
}

.hero-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

/* Dark gradient at the bottom keeps the caption readable on any photo */
.hero::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(to bottom, transparent, rgb(20 19 18 / 0.75));
  pointer-events: none;
}

.hero-caption {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-m) var(--space-l);
  font-size: var(--text-hero);
  font-weight: 500;
  color: var(--limewash);
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.5);
  animation: welcome 1.6s ease-out 0.4s both;
}

@keyframes welcome {
  from { opacity: 0; transform: translateY(0.5em); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ---------- 5. Home page introduction ---------- */

.intro {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-l) var(--space-m);
  display: grid;
  gap: 0 var(--space-l);
}

.intro p {
  max-width: 38em;          /* keeps lines a comfortable reading length */
}

.intro p:first-child {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.65;
}

.intro p + p {
  color: var(--muted);
}


/* ---------- 6. Shared components for the other pages ---------- */

/* Buttons: use <button class="btn"> or <a class="btn"> */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--stone-900);
  background: var(--armagnac);
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--almond);
}

.btn:active {
  transform: translateY(1px);
}

/* General page wrapper for content pages */
.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-l) var(--space-m);
}

/* Image + text block (for the gallery sections on MainView) */
.story {
  display: grid;
  gap: var(--space-m) var(--space-l);
  align-items: center;
  padding: var(--space-l) 0;
  border-bottom: 1px solid var(--stone-600);
}

.story:last-child {
  border-bottom: 0;
}

.story img {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.story-image {
  justify-self: center;
  display: block;
  width: 100%;
  max-width: 14rem;
  border-radius: 50%;
}

.story-image img {
  transition: opacity 0.2s;
}

.story-image:hover img {
  opacity: 0.85;
}

.story h2 {
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  color: var(--almond);
}

.story p {
  max-width: 38em;
}

.story .btn {
  margin-top: var(--space-s);
}

/* Gallery viewer on MainView */
.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  margin-bottom: var(--space-m);
}

.viewer-bar h1 {
  margin: 0;
}

/* Photo gallery grid (gallery.php) */
.gallery-hint {
  color: var(--muted);
}

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(7rem, 30%), 1fr));
  gap: 0.5rem;
}

.gallery a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--stone-900);
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.25s, opacity 0.25s;
}

.gallery a:hover img {
  transform: scale(1.04);
  opacity: 0.9;
}

/* Video page */
.feature-video {
  width: 100%;
  max-height: 75vh;
  max-height: 75svh;
  margin-bottom: var(--space-m);
  background: #000;
  border-radius: var(--radius);
}

/* Full-screen photo viewer */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #121110;
  color: var(--limewash);
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 0.6);
}

body:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.2s;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.is-loading .lightbox-img {
  opacity: 0.3;
}

.lightbox-count {
  position: absolute;
  left: var(--space-m);
  top: var(--space-m);
  margin: 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
  background: rgb(0 0 0 / 0.5);
  border-radius: var(--radius);
}

.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: var(--limewash);
  background: rgb(0 0 0 / 0.5);
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-btn:hover {
  background: rgb(0 0 0 / 0.8);
  border-color: var(--armagnac);
}

.lightbox-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-close { top: var(--space-m); right: var(--space-m); }
.lightbox-full  { top: var(--space-m); right: calc(var(--space-m) + 56px); }
.lightbox-prev  { left: var(--space-m);  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: var(--space-m); top: 50%; transform: translateY(-50%); }

/* Embedded frames (galleries, video) fill the width, never a fixed height */
.frame {
  width: 100%;
  height: 80vh;
  height: 80svh;
  border: 0;
}


/* ---------- 7. Tablet and up (768px+) ---------- */

@media (min-width: 48rem) {

  .hero-img {
    aspect-ratio: 16 / 9;
  }

  .intro {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .story {
    grid-template-columns: minmax(10rem, 18rem) 1fr;
  }

  .story-image {
    max-width: none;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  }
}


/* ---------- 8. Desktop navigation (896px+) ---------- */

@media (min-width: 56rem) {

  .js .nav-toggle {
    display: none;
  }

  .nav-menu,
  .js .nav-toggle[aria-expanded="false"] + .nav-menu {
    display: flex;
    flex-direction: row;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    gap: 0.25rem;
  }

  .nav-menu a,
  .nav-menu summary {
    padding: 1.1rem 0.75rem 0.9rem;
    border-bottom: 3px solid transparent;
  }

  .nav-menu a:hover,
  .nav-menu summary:hover {
    background: transparent;
    border-bottom-color: var(--stone-600);
  }

  .nav-menu a[aria-current="page"] {
    border-bottom-color: var(--armagnac);
  }

  .nav-sub {
    position: relative;
  }

  .nav-sub ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 15rem;
    padding: var(--space-s) 0;
    background: var(--almond);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 10px 24px rgb(0 0 0 / 0.35);
  }

  .nav-sub ul a {
    color: var(--stone-900);
    padding: 0.6rem var(--space-m);
    border: 0;
  }

  .nav-sub ul a:hover {
    background: rgb(0 0 0 / 0.08);
  }
}


/* ---------- 9. Large screens (1200px+) ---------- */

@media (min-width: 75rem) {

  .hero-img {
    aspect-ratio: auto;
    height: min(75svh, 46rem);
  }
}


/* ---------- 10. Respect "reduce motion" settings ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
