/*
 * Société de pêche de Grimisuat — feuille de style unique, sans outil de build.
 * Couleurs : rouge du logo, encre bleu nuit, papier clair (thème sombre auto).
 */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-normal.eb2486760f75.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --ink: #14232b;
  --muted: #56666e;
  --line: #e1dcd1;
  --accent: #b3232c;
  --accent-hover: #941b23;
  --accent-soft: #f7e3e2;
  --on-accent: #ffffff;
  --water: #1d5c63;
  --footer-bg: #10202a;
  --footer-ink: #d7e0e4;
  --shadow: 0 1px 2px rgb(20 35 43 / 6%), 0 8px 24px rgb(20 35 43 / 8%);
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --container: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e191f;
    --surface: #15242c;
    --surface-2: #1b2d36;
    --ink: #e7ecee;
    --muted: #9db0b8;
    --line: #263943;
    --accent: #e0575e;
    --accent-hover: #ec7a80;
    --accent-soft: #3a2024;
    --on-accent: #1a0d0e;
    --water: #78bcc2;
    --footer-bg: #0a1318;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

/* --- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

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

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

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

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: inline-block;
  font: 600 0.78rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.muted { color: var(--muted); }

/* --- Boutons et formulaires ---------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 600 0.98rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 0.55rem 1rem; font-size: 0.9rem; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgb(255 255 255 / 14%); color: inherit; }

label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--water); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 3rem; }

.field { margin-bottom: 1.1rem; }
.helptext, .field .helptext { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.helptext ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.errorlist { list-style: none; margin: 0.3rem 0 0; padding: 0; color: var(--accent); font-size: 0.9rem; }

.flash-list { margin-top: 1rem; }
.flash { padding: 0.8rem 1rem; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--water); box-shadow: var(--shadow); }
.flash-error { border-left-color: var(--accent); }

/* --- En-tête -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4.25rem; }

.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand img { width: 44px; height: auto; }
.brand-text { font: 600 1.25rem/1 var(--font-display); }
.brand-small { display: block; font: 500 0.7rem/1.4 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.nav-toggle {
  display: none;
  padding: 0.5rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); cursor: pointer;
}

.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.1rem; }
.main-nav a, .dropdown summary {
  display: block;
  padding: 0.5rem 0.75rem; border-radius: 8px;
  color: var(--ink); text-decoration: none;
  font-size: 0.95rem; font-weight: 500;
  cursor: pointer;
}
.main-nav a:hover, .dropdown summary:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.main-nav .btn { margin-left: 0.5rem; color: var(--on-accent); }
.main-nav .btn:hover { background: var(--accent-hover); color: var(--on-accent); }

.dropdown { position: relative; }
.dropdown summary { list-style: none; display: flex; align-items: center; gap: 0.4rem; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after {
  content: ""; width: 0.45em; height: 0.45em;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px); opacity: 0.6;
}
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 0.4rem);
  min-width: 13rem; padding: 0.4rem;
  display: flex; flex-direction: column; gap: 0.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.main-nav .dropdown-panel { display: flex; flex-direction: column; }
.dropdown-panel a, .dropdown-panel button {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 0.75rem; border: 0; border-radius: 8px;
  background: none; color: var(--ink); font: inherit; font-size: 0.95rem; cursor: pointer;
}
.dropdown-panel a:hover, .dropdown-panel button:hover { background: var(--surface-2); }
.dropdown-panel form { margin: 0; }

.account-menu { margin-left: 0.5rem; }
.avatar {
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--water); color: var(--surface);
  font-weight: 700; font-size: 0.85rem;
}
.account-name { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1060px) {
  .js .nav-toggle { display: inline-flex; }
  .header-inner { flex-wrap: wrap; }
  .main-nav {
    flex-basis: 100%; flex-direction: column; align-items: stretch;
    gap: 0.25rem; padding-bottom: 1rem;
  }
  .js .main-nav:not(.is-open) { display: none; }
  .main-nav ul { flex-direction: column; }
  .dropdown-panel { position: static; box-shadow: none; border: 0; padding: 0 0 0 0.75rem; background: none; }
  .account-menu { margin-left: 0; }
  .main-nav .btn { margin: 0.5rem 0 0; justify-content: center; }
}

/* --- Accueil -------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(82vh, 760px);
  display: grid; align-items: end;
  color: #fff;
  background: var(--footer-bg);
  overflow: hidden;
  isolation: isolate;
}
.hero-image { position: absolute; inset: 0; z-index: -2; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(8 20 26 / 10%) 0%, rgb(8 20 26 / 25%) 45%, rgb(8 20 26 / 80%) 100%),
    linear-gradient(90deg, rgb(8 20 26 / 45%) 0%, transparent 60%);
}
.hero-content { padding-block: 7rem 4.5rem; max-width: 46rem; }
.hero .eyebrow { color: #ffd6d6; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.8rem); font-weight: 600; margin-bottom: 0.35em; }
.hero-lead { font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.55; color: rgb(255 255 255 / 90%); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero .btn-ghost { color: #fff; }

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section-head { max-width: 42rem; margin-bottom: 2.5rem; }
.section-alt { background: var(--surface-2); }

.feature-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

.feature {
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.feature-image { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.feature-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.feature:hover .feature-image img { transform: scale(1.04); }
.feature-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.feature-body h3 { margin-bottom: 0.35rem; }
.feature-sub { color: var(--water); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.6rem; }
.feature-body p:last-child { margin-bottom: 0; }
.feature-link { margin-top: auto; padding-top: 0.75rem; font-weight: 600; }

.quick-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.quick-link {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.3rem 1.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.quick-link:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.quick-link svg { flex: none; width: 1.75rem; height: 1.75rem; color: var(--accent); margin-top: 0.15rem; }
.quick-link strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.quick-link span { color: var(--muted); font-size: 0.93rem; line-height: 1.45; }

.member-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  border-radius: calc(var(--radius) + 4px);
  background: var(--footer-bg); color: var(--footer-ink);
}
.member-band h2 { color: #fff; margin-bottom: 0.25rem; font-size: 1.6rem; }
.member-band p { margin: 0; }
.member-band .last-message { margin-top: 0.75rem; font-size: 0.95rem; opacity: 0.85; max-width: 40rem; }
.member-band .btn-ghost { color: #fff; }

/* --- Pages de contenu ----------------------------------------------------- */

.page-banner {
  position: relative; isolation: isolate;
  padding-block: clamp(3rem, 8vw, 5rem) 2.5rem;
  color: #fff; background: var(--footer-bg); overflow: hidden;
}
.page-banner img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.page-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(8 20 26 / 82%), rgb(8 20 26 / 40%)); }
.page-banner h1 { margin: 0; }
.page-banner .eyebrow { color: #ffd6d6; }

.page-layout { display: grid; gap: 2.5rem; grid-template-columns: 15rem minmax(0, 1fr); padding-block: 3rem 5rem; }
.page-layout > * { min-width: 0; }
@media (max-width: 860px) { .page-layout { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; } }

.side-nav ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 5.5rem; }
.side-nav a {
  display: block; padding: 0.55rem 0.9rem; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-weight: 500;
  border-left: 3px solid transparent;
}
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"] { border-left-color: var(--accent); background: var(--surface); color: var(--accent); }
.side-nav .side-nav-label { padding: 1rem 0.9rem 0.3rem; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 860px) {
  .side-nav ul { position: static; display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: thin; }
  .side-nav a { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; }
  .side-nav a[aria-current="page"] { border-color: var(--accent); }
  .side-nav .side-nav-label { display: none; }
}

.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.75rem);
}

.prose { max-width: 70ch; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.6em; }
.prose h1 { font-size: 1.75rem; }
.prose h3 { font-size: 1.45rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.3em; }
.prose blockquote { margin: 1.5em 0; padding: 0.5em 1.25em; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.embed { margin-top: 2rem; }
.embed:first-child { margin-top: 0; }
.embed h2 { font-size: 1.3rem; }
.embed-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (min-width: 700px) { .embed-frame { aspect-ratio: 16 / 10; } }

/* --- Connexion ------------------------------------------------------------ */

.auth-wrap { display: grid; place-items: center; padding: 4rem 1rem 6rem; }
.auth-card { width: min(100%, 26rem); text-align: left; }
.auth-card .auth-logo { width: 96px; margin: 0 auto 1rem; }
.auth-card h1 { font-size: 1.9rem; text-align: center; }
.auth-card .intro { text-align: center; color: var(--muted); margin-bottom: 1.75rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }
.auth-note { margin: 1.25rem 0 0; font-size: 0.9rem; text-align: center; color: var(--muted); }

/* --- Galerie -------------------------------------------------------------- */

.year-group + .year-group { margin-top: 3rem; }
.year-title { display: flex; align-items: center; gap: 1rem; font-size: 1.8rem; }
.year-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.album-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.album-card { color: var(--ink); text-decoration: none; }
.album-card:hover { color: var(--ink); }
.album-cover { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.album-card:hover .album-cover img { transform: scale(1.05); }
.album-card h3 { font-size: 1.1rem; margin: 0.75rem 0 0.1rem; }
.album-card span { color: var(--muted); font-size: 0.9rem; }

.photo-grid { columns: 3 260px; column-gap: 1rem; }
.photo-grid figure { margin: 0 0 1rem; break-inside: avoid; }
.photo-grid a { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); text-decoration: none; }
.photo-grid img { width: 100%; transition: opacity 0.2s; }
.photo-grid a:hover img { opacity: 0.88; }
.photo-grid figcaption { padding: 0.5rem 0.75rem; font-size: 0.9rem; color: var(--muted); background: var(--surface); }

.lightbox { padding: 0; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgb(5 12 16 / 94%); color: #fff; }
.lightbox::backdrop { background: rgb(5 12 16 / 80%); }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 3.5rem 1rem 1rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { padding-top: 0.75rem; color: rgb(255 255 255 / 80%); min-height: 2.5rem; text-align: center; }
.lightbox button {
  position: absolute; display: grid; place-items: center;
  width: 3rem; height: 3rem; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 12%); color: #fff; font-size: 1.5rem; cursor: pointer;
}
.lightbox button:hover { background: rgb(255 255 255 / 24%); }
.lightbox .lb-close { top: 0.75rem; right: 0.75rem; }
.lightbox .lb-prev { left: 0.75rem; top: 50%; translate: 0 -50%; }
.lightbox .lb-next { right: 0.75rem; top: 50%; translate: 0 -50%; }
.lightbox .lb-counter { position: absolute; top: 1.4rem; left: 1.25rem; font-size: 0.9rem; opacity: 0.75; }

/* --- Chat ----------------------------------------------------------------- */

.chat { display: flex; flex-direction: column; gap: 1rem; }
.chat-log {
  height: min(60vh, 34rem); overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.9rem;
  padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper);
}
.chat-message { max-width: min(42rem, 88%); }
.chat-message.is-mine { align-self: flex-end; }
.chat-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.2rem; }
.chat-meta strong { color: var(--ink); font-weight: 600; }
.chat-message.is-mine .chat-meta { text-align: right; }
.chat-bubble {
  padding: 0.7rem 1rem; border-radius: 4px 16px 16px 16px;
  background: var(--surface); box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.chat-message.is-mine .chat-bubble { border-radius: 16px 4px 16px 16px; background: var(--accent-soft); }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-empty { margin: auto; color: var(--muted); }
.chat-form { display: flex; gap: 0.75rem; align-items: flex-end; }
.chat-form .field { flex: 1; margin: 0; }
.chat-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* --- Pied de page --------------------------------------------------------- */

.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: 3rem 2rem; margin-top: auto; font-size: 0.95rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: auto 1fr; align-items: start; }
.footer-brand { display: flex; gap: 1rem; align-items: center; }
.footer-brand img { width: 64px; }
.footer-brand p { margin: 0; line-height: 1.5; }
.footer-brand strong { color: #fff; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1.5rem; }
.site-footer a { color: var(--footer-ink); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-meta { grid-column: 1 / -1; margin: 0; padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / 10%); color: rgb(215 224 228 / 65%); font-size: 0.85rem; }
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
  .site-footer nav ul { justify-content: flex-start; }
}

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