/* ==========================================================================
   Broekerhaven – minimal professional styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --color-bg: #f7f5f2; /* off-white */
  --color-bg-alt: #f7f5f2;
  --color-surface: #f7f5f2;
  --color-text: #000000;
  --color-text-muted: #333333;
  --color-border: #e0e0e0;
  --color-accent: #000000;
  --color-accent-hover: #333333;
  --color-header-bg: #ffffff;
  --color-footer-bg: #1a1a1a;
  --color-footer-text: #cccccc;
  --color-topbar-bg: #1a1a1a;
  --color-topbar-text: #ffffff;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Gloock", Georgia, "Times New Roman", serif;
  --font-size-base: 1.0625rem;
  --line-height: 1.65;
  --line-height-tight: 1.25;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;

  --container-max: 1100px;
  --container-narrow: 720px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --topbar-height: 2.5rem;
  --header-height: 4rem;
  --logo-height: 10.97rem; /* previous 8.125rem × 1.35 */
  --transition: 0.2s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--line-height-tight);
  font-weight: 400; /* Gloock is a display face; 400 is its normal weight */
  margin-top: 0;
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--space-md); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); margin-bottom: var(--space-sm); }
h3 { font-size: 1.15rem; margin-bottom: var(--space-xs); }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

ul {
  margin-top: 0;
  margin-bottom: var(--space-md);
  padding-left: 1.25rem;
}

li {
  margin-bottom: var(--space-xs);
}

code {
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

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

.section {
  padding-block: var(--space-xl);
}

/* First content block when no page-header is used */
.section-page-start {
  padding-top: calc(var(--space-lg) + 50px);
}

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

.section-title {
  text-align: center;
  margin-bottom: var(--space-lg);
}

/* --------------------------------------------------------------------------
   4. Site chrome (top bar + wood header stick together)
   -------------------------------------------------------------------------- */
.site-chrome {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* --------------------------------------------------------------------------
   4b. Top bar (social + contact)
   -------------------------------------------------------------------------- */
.top-bar {
  background: var(--color-topbar-bg);
  color: var(--color-topbar-text);
  min-height: var(--topbar-height);
  font-size: 0.875rem;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--topbar-height);
  padding-block: 0.35rem;
}

.top-bar-social {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
  z-index: 25; /* stay clickable if logo edge overlaps */
}

.top-bar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-topbar-text);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.top-bar-icon:hover {
  opacity: 1;
  color: var(--color-topbar-text);
}

.top-bar-icon svg {
  display: block;
}

.top-bar-contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1.25rem;
}

.top-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-topbar-text);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.95;
  transition: opacity var(--transition);
}

.top-bar-link:hover {
  color: var(--color-topbar-text);
  opacity: 1;
  text-decoration: underline;
}

.top-bar-link svg {
  flex-shrink: 0;
  display: block;
  color: var(--color-topbar-text);
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   5. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 2;
  /* Full-width wood from far left edge of the viewport */
  background-color: #4a2f1a;
  background-image: url("images/wood.jpg");
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  height: var(--header-height);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-md);
  position: relative;
  overflow: visible;
  background: transparent;
}

/* Logo spans top-bar (#1A1A1A) + wood header-inner, hangs below */
.logo {
  display: inline-flex;
  align-items: flex-start;
  text-decoration: none;
  flex-shrink: 0;
  /* Pull up into the dark top-bar; offset: +50px right, net −15px up (was −20px + 5px lower) */
  margin-top: calc(-1 * var(--topbar-height) + 0.2rem - 15px);
  margin-left: 50px;
  margin-bottom: 0;
  position: relative;
  z-index: 20;
  height: var(--logo-height);
}

.logo img {
  height: var(--logo-height);
  width: auto;
  max-width: none;
  object-fit: contain;
  margin: 0;
  display: block;
}

.site-nav {
  align-self: center;
}

.site-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: #000000;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.309rem; /* previous − 5% */
  font-weight: 400;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  /* Grey outline around black menu text */
  text-shadow:
    -1px -1px 0 #9a9a9a,
     1px -1px 0 #9a9a9a,
    -1px  1px 0 #9a9a9a,
     1px  1px 0 #9a9a9a,
    -1px  0   0 #9a9a9a,
     1px  0   0 #9a9a9a,
     0   -1px 0 #9a9a9a,
     0    1px 0 #9a9a9a;
  transition: color var(--transition), background var(--transition), text-shadow var(--transition);
}

.site-nav a:hover {
  color: #ffffff;
  background: transparent;
  /* Black outline when text is white on hover */
  text-shadow:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000,
    -1px  0   0 #000000,
     1px  0   0 #000000,
     0   -1px 0 #000000,
     0    1px 0 #000000;
}

.site-nav a.active {
  color: #ffffff;
  background: transparent;
  font-weight: 400;
  /* Readable white text on wood */
  text-shadow:
    -1px -1px 0 #000000,
     1px -1px 0 #000000,
    -1px  1px 0 #000000,
     1px  1px 0 #000000,
    -1px  0   0 #000000,
     1px  0   0 #000000,
     0   -1px 0 #000000,
     0    1px 0 #000000;
}

.site-nav a.active::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 0.2rem;
  background: #ffffff;
  border-radius: 1px;
  box-shadow: 0 0 0 1px #000000;
}

.site-nav a.active:hover {
  color: #ffffff;
}

.site-nav a.active:hover::after {
  background: #ffffff;
  box-shadow: 0 0 0 1px #000000;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  align-self: center;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: #ffffff;
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. Hero & page headers
   -------------------------------------------------------------------------- */
.hero {
  padding-block: var(--space-xl) var(--space-sm);
  text-align: center;
  background: var(--color-bg);
  border-bottom: none;
}

/* Tighter gap between welcome heading and the next section (e.g. “Ons koor”) */
.hero + .section {
  padding-top: var(--space-md);
}

.hero-photo {
  margin: 0 0 var(--space-lg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.hero-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: min(52vh, 520px);
  object-position: center;
}

.hero-title {
  font-size: 24px;
  line-height: 1.35;
  max-width: 28em;
  margin-inline: auto;
  margin-bottom: 0;
}

/* Larger screens: force “het Broekerhaven Smartlappenkoor” onto its own line */
@media (min-width: 701px) {
  .hero-title-line {
    display: block;
  }
}

.page-header {
  padding-block: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 36em;
  margin-inline: auto;
  margin-bottom: 0;
}

.page-header .lead {
  margin-inline: 0;
}

/* --------------------------------------------------------------------------
   7. Content
   -------------------------------------------------------------------------- */
.content h2 {
  margin-top: var(--space-lg);
}

.content h2:first-child {
  margin-top: 0;
}

/* Data tables (oefenavonden, optredens, bestuur) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  margin-bottom: var(--space-md);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.table-wrap .data-table {
  margin-bottom: 0;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  background: #ebe8e3;
  color: var(--color-text);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.7);
}

.data-table tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.02);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td:first-child {
  white-space: nowrap;
  width: 40%;
}

@media (max-width: 500px) {
  .data-table td:first-child {
    white-space: normal;
    width: auto;
  }

  .data-table th,
  .data-table td {
    padding: 0.55rem 0.65rem;
    font-size: 0.92rem;
  }
}

/* --------------------------------------------------------------------------
   8. Cards (home)
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cccccc;
}

.card p {
  flex: 1;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.card-link {
  font-weight: 500;
  text-decoration: none;
  margin-top: var(--space-sm);
}

.card-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. Gallery
   -------------------------------------------------------------------------- */

/* Main Galerij index: album cards */
.gallery-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.gallery-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.gallery-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.gallery-card-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ebe8e3;
}

.gallery-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-thumb img {
  transform: scale(1.04);
}

.gallery-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  margin: var(--space-md) var(--space-md) var(--space-xs);
  line-height: 1.3;
}

.gallery-card-meta {
  margin: 0 var(--space-md) var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Single album page */
.gallery-back {
  margin: 0 0 var(--space-md);
  font-size: 0.95rem;
}

.gallery-back a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.gallery-back a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

.gallery-album-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  margin-bottom: var(--space-xs);
}

.gallery-header {
  margin-bottom: var(--space-lg);
}

.gallery-header p {
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.gallery-grid--wide {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f5f5;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.04);
}

/* Broken image / missing file placeholder look */
.gallery-item img {
  background:
    linear-gradient(135deg, #f0f0f0 25%, #e5e5e5 25%, #e5e5e5 50%, #f0f0f0 50%, #f0f0f0 75%, #e5e5e5 75%);
  background-size: 16px 16px;
}

/* --------------------------------------------------------------------------
   10. Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: min(100%, 1100px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  padding: 0.5rem;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1.25rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 0.75rem;
}

.lightbox-next {
  right: 0.75rem;
}

/* --------------------------------------------------------------------------
   11. Videos
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl) var(--space-lg);
}

.video-card {
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}

.video-desc {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f5f5f5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Google Maps embed (Over page) */
.address-line {
  margin-bottom: var(--space-md);
}

.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  background: #ebe8e3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-md);
}

.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding-block: var(--space-lg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.footer-brand {
  margin: 0;
  font-weight: 600;
  color: #ffffff;
}

.footer-copy {
  margin: 0;
  font-size: 0.9rem;
}

/* Sticky footer layout */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* Menu 30% smaller below 800px */
@media (max-width: 799px) {
  .site-nav a {
    font-size: 0.916rem; /* 1.309rem × 0.7 */
  }
}

@media (max-width: 700px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding-block: 0.5rem;
  }

  .top-bar-social {
    justify-content: center;
  }

  .top-bar-contact {
    justify-content: center;
    gap: 0.25rem 1rem;
    font-size: 0.8125rem;
  }

  /* Hide logo on viewports narrower than 700px */
  .logo {
    display: none;
  }

  .header-inner {
    align-items: center;
    justify-content: flex-end;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Continue wood look on mobile dropdown */
    background-color: #4a2f1a;
    background-image: url("images/wood.jpg");
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: none;
    z-index: 120;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav a {
    padding: 0.75rem 0.5rem;
  }

  .site-nav a.active::after {
    display: none;
  }

  .site-nav a.active {
    background: transparent;
    color: #ffffff;
  }

  .site-nav a:hover {
    color: #ffffff;
    background: transparent;
  }

  .hero {
    padding-block: var(--space-xl);
  }

  .section {
    padding-block: var(--space-lg);
  }

  .gallery-grid,
  .gallery-grid--wide {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 1.5rem;
  }
}

@media (max-width: 400px) {
  .gallery-grid,
  .gallery-grid--wide {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   14. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
