/*
Theme Name: Watersport Nijmegen
Theme URI: https://watersportnijmegen.nl
Author: Watersport in Nijmegen
Description: Editorial home base for watersports on the Spiegelwaal and around Nijmegen - clubs, safety, events, and getting out on the water.
Version: 1.0
Text Domain: watersportnijmegen
*/

/* ============================================
   DESIGN TOKENS - dark "rivernacht" palette
   ============================================ */
:root {
  --color-bg: #FDFBF7;          /* main background - near-white, like the original site */
  --color-surface: #F2EFE7;     /* widget/card surface on light bg */
  --color-surface-2: #E8E3D8;
  --color-header-bg: #16232B;   /* dark band reserved for header/footer/hero only */
  --color-text: #1C262D;        /* primary text - dark slate, on light bg */
  --color-text-soft: rgba(28, 38, 45, 0.68);
  --color-river: #2B4C5C;       /* link/accent - slate river-blue, darkened for light-bg contrast */
  --color-clay: #C1572E;        /* CTA/kicker accent - terracotta */
  --color-clay-deep: #A8471F;   /* AA-safe fill behind small white text (5.86:1) */
  --color-reed: #6B7A4F;
  --color-white: #FFFCF6;
  --color-border: rgba(28, 38, 45, 0.12);
  --color-border-on-dark: rgba(255, 252, 246, 0.14);

  --font-heading: 'Lora', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 6px;
  --max-width: 1180px;
  --max-width-wide: 1680px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
.entry-content h2 { scroll-margin-top: 5.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-river); text-decoration: none; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: var(--space-4); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 var(--space-2); }
ul, ol { padding-left: 1.3rem; }

/* rule-extend link treatment: hairline underline grows/thickens on hover/focus */
.entry-content a,
.site-footer a.text-link {
  position: relative;
  text-decoration: none;
  border-bottom: 1px solid rgba(134, 176, 196, 0.4);
  transition: border-color 0.2s ease, border-bottom-width 0.2s ease;
}
.entry-content a:hover,
.entry-content a:focus,
.site-footer a.text-link:hover {
  border-bottom: 2px solid var(--color-clay);
}

/* ============================================
   LAYOUT SHELL
   ============================================ */
.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }
.wrap-wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 clamp(var(--space-2), 2.5vw, 2rem); }
.wide-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--space-3);
  align-items: start;
}
@media (max-width: 1000px) {
  .wide-with-sidebar { grid-template-columns: minmax(0, 1fr); }
}
.home-sidebar { position: sticky; top: calc(var(--space-2) + 60px); display: flex; flex-direction: column; gap: var(--space-3); }

.site-header {
  background: var(--color-header-bg);
  color: var(--color-white);
  padding: var(--space-2) 0;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border-on-dark);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.site-branding { display: flex; align-items: center; gap: var(--space-1); }
.site-branding a { color: var(--color-white); display: flex; align-items: center; gap: 0.6rem; }
.site-branding .site-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-white);
}
.site-logo-mark { width: 42px; height: 42px; flex-shrink: 0; }

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-navigation a {
  color: rgba(255,252,246,0.75);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.main-navigation a:hover,
.main-navigation a:focus {
  border-bottom-color: var(--color-clay);
  color: var(--color-white);
}
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a { border-bottom-color: var(--color-clay); color: var(--color-white); }

/* Sits on the dark header band, so it must use the on-dark tokens. It previously
   used --color-text (the dark on-light token) against #16232B: a 1.04:1 contrast
   ratio, i.e. an effectively invisible primary nav control on mobile. Leftover from
   the palette flip to a light body theme. */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border-on-dark);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
}
.menu-toggle:hover,
.menu-toggle:focus-visible {
  border-color: var(--color-clay);
  color: var(--color-clay);
}

@media (max-width: 780px) {
  .menu-toggle { display: inline-block; }
  .main-navigation { width: 100%; display: none; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 0.6rem; padding-top: var(--space-2); }
}

/* ============================================
   HERO / RIVER-BAND ARCHETYPE
   ============================================ */
.river-band {
  color: var(--color-white);
  padding: var(--space-5) 0 var(--space-3);
  position: relative;
}
.river-band h1 { color: var(--color-white); max-width: 40rem; }
.river-band p.lede { max-width: 38rem; font-size: 1.15rem; color: rgba(255,252,246,0.82); }
.river-wave-divider { display: none; }
.home-intro { max-width: 54rem; color: var(--color-text-soft); margin: 0 0 var(--space-3); line-height: 1.6; }

/* ============================================
   CONTENT GRID: hub + silo cards (inner pages only)
   ============================================ */
.silo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.silo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-river);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.silo-card.silo-safety { border-left-color: var(--color-clay); }
.silo-card.silo-events { border-left-color: var(--color-reed); }
.silo-card h3 { margin-top: 0; }
.silo-card .silo-kicker {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-clay);
}
.silo-card ul { list-style: none; padding: 0; margin: var(--space-1) 0 0; }
.silo-card li { margin-bottom: 0.4rem; }
.silo-card { transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.silo-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.3); }

/* ============================================
   ARTICLE / PAGE CONTENT
   ============================================ */
.content-area { padding: var(--space-4) 0 var(--space-5); }
.entry-content { max-width: 42rem; }
.entry-content figure.body-image {
  margin: var(--space-3) 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-content figure.body-image img { width: 100%; }
.entry-content p, .entry-content li { color: var(--color-text-soft); }
.entry-header { max-width: 42rem; margin-bottom: var(--space-3); }
.entry-meta {
  font-size: 0.85rem;
  color: var(--color-river);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.share-buttons {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  max-width: 42rem;
}
.share-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  margin-right: 0.2rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-river);
  border: 1px solid var(--color-border);
  transition: background 0.2s ease, color 0.2s ease;
}
.share-btn:hover {
  background: var(--color-clay);
  color: var(--color-white);
  border-color: var(--color-clay);
}
.callout-safety {
  background: var(--color-surface);
  border-left: 4px solid var(--color-clay);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
}
.callout-safety strong { color: var(--color-clay); }

/* ============================================
   BETTING BANNER - preserved equity, restyled as a CTA card
   ============================================ */
.sidebar-cta-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-3) 0;
  transition: box-shadow 0.2s ease;
}
.sidebar-cta-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.sidebar-cta-card img { width: 100%; }
.sidebar-cta-card .cta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  padding: 0.4rem var(--space-2) 0;
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .content-with-sidebar { grid-template-columns: minmax(0, 1fr); }
}
.widget-area h2.widget-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-river);
}
.widget-area .widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.widget-toc .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.92rem;
}
.widget-toc .toc-list a {
  display: block;
  padding-left: 0.7rem;
  border-left: 2px solid var(--color-border);
  color: var(--color-text-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.widget-toc .toc-list a:hover,
.widget-toc .toc-list a:focus {
  border-left-color: var(--color-clay);
  color: var(--color-text);
}

/* ============================================
   RELATED GUIDES - bottom-of-article strip, reuses the book-card style
   at a smaller scale
   ============================================ */
.related-guides {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  max-width: none;
}
.related-guides-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 var(--space-2);
}
.card-wall-related {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 190px;
}
.card-wall-related .book-title { font-size: 1rem; }

/* ============================================
   BOOK-CARD WALL - one dense, tight mosaic of guide cards.
   No section headings inside the grid - kicker + title live on the
   card itself. "guide you open" signature interaction stays on click.
   ============================================ */
.card-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 260px;
  grid-auto-flow: dense;
  gap: 4px;
  container-type: inline-size;
  container-name: cardwall;
}
.book-card.span-2-col { grid-column: span 2; }
.book-card.span-2-row { grid-row: span 2; }
@media (max-width: 640px) {
  .card-wall { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .book-card.span-2-col { grid-column: span 2; }
  .book-card.span-2-row { grid-row: span 1; }
}
/* Surgical patch for one specific case: at exactly 3 auto-fill columns (container
   ~788-1052px, which real viewports land on around 830-1000px and 1090-1350px,
   because the sidebar breakpoint at 1000px changes available width) the 14-card
   span mix occupies 20 cells - not divisible by 3, so dense packing always leaves
   one cell empty (the reported bottom-right gap). Nowhere else is touched: 2, 4
   and 5-column widths already tiled with zero gaps and are unchanged. Giving one
   additional plain card a 2-column span ONLY in this container-width band brings
   the total to 21 (divisible by 3, 7 rows exact). */
@container cardwall (min-width: 788px) and (max-width: 1051px) {
  .card-wall .book-card:nth-child(4) { grid-column: span 2; }
}

.book-card {
  position: relative;
  display: block;
  overflow: hidden;
  transition: transform 0.3s ease;
  will-change: transform;
}
.book-card picture { display: block; width: 100%; height: 100%; }
.book-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.book-card:hover img,
.book-card:focus-visible img { transform: scale(1.05); }
.book-card .book-scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(180deg, rgba(15,23,28,0) 0%, rgba(10,15,18,0.92) 90%);
}
.book-card .book-kicker {
  position: absolute;
  top: 0.7rem;
  left: 0.9rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  background: var(--color-clay-deep);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  z-index: 2;
}
.book-card .book-title {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.75rem;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.2;
  text-wrap: balance;
  overflow-wrap: normal;
  hyphens: auto;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
}
.book-card:hover,
.book-card:focus-visible {
  transform: scale(1.015);
  z-index: 3;
}

/* page-open transition overlay - progressive enhancement only, see main.js */
.page-open-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-header-bg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
.page-open-overlay.is-active { opacity: 1; }
.book-card.is-opening {
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(.2,.7,.3,1);
  transform: scale(1.08);
}
@media (prefers-reduced-motion: reduce) {
  .book-card, .book-card.is-opening, .book-card img { transition: none; transform: none; }
  .page-open-overlay { transition: none; }
}

/* FAQ */
.entry-faq { margin-top: var(--space-4); max-width: 42rem; }
.entry-faq h2 { margin-top: 0; }
.faq-list { display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-heading);
  color: var(--color-text);
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { display: inline; margin: 0; font: inherit; color: inherit; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 0;
  font-size: 1.2rem;
  color: var(--color-clay);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0.7rem 0 0; color: var(--color-text-soft); }

/* Article hero image */
.entry-hero {
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
}
.entry-hero picture { display: block; width: 100%; height: 100%; }
.entry-hero img { width: 100%; height: 100%; object-fit: cover; }

/* 404 page */
.error-404-content { text-align: center; padding: var(--space-5) 0; }
.error-404-mark { margin-bottom: var(--space-2); display: flex; justify-content: center; }
.error-404-lede { color: var(--color-text-soft); max-width: 32rem; margin: 0 auto var(--space-4); }
.error-404-content .card-wall { margin: 0 auto; text-align: left; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  margin-bottom: var(--space-2);
}
.breadcrumbs a { border-bottom: 1px solid rgba(134,176,196,0.35); }
.breadcrumbs .sep { margin: 0 0.4rem; opacity: 0.6; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-header-bg);
  color: var(--color-white);
  padding: var(--space-4) 0 var(--space-3);
  margin-top: var(--space-5);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-border-on-dark);
}
.site-footer a { color: rgba(255,252,246,0.75); }
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.site-footer .footer-bottom {
  border-top: 1px solid var(--color-border-on-dark);
  padding-top: var(--space-2);
  opacity: 0.6;
  font-size: 0.8rem;
}

/* accessibility */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-clay);
  color: #fff; padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }
