/* ==========================================================
   RAAK KALKEN — MAIN STYLESHEET
   ========================================================== */

/* ----------------------------------------------------------
   1. CUSTOM PROPERTIES
   ---------------------------------------------------------- */
:root {
  /* Colour palette */
  --color-primary:       #1b4332;
  --color-primary-mid:   #2d6a4f;
  --color-accent:        #40916c;
  --color-accent-light:  #74c69d;
  --color-bg:            #ffffff;
  --color-bg-soft:       #f4f9f6;
  --color-border:        #d1e8db;
  --color-text:          #1a1a1a;
  --color-text-muted:    #6b7280;
  --color-white:         #ffffff;

  /* Typography */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Lato', sans-serif;

  /* Layout */
  --container-max:  1140px;
  --container-pad:  1.5rem;
  --header-h:       80px;
  --nav-h:          54px;
  --radius:         6px;
  --radius-lg:      12px;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(27, 67, 50, 0.10);
  --shadow:    0 2px 8px rgba(27, 67, 50, 0.12);
  --shadow-lg: 0 8px 24px rgba(27, 67, 50, 0.16);

  /* Motion */
  --ease: 0.22s ease;
}

/* ----------------------------------------------------------
   2. RESET
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

ul { list-style: none; }

/* ----------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

/* ----------------------------------------------------------
   4. LAYOUT
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

main {
  padding: 0 0 4rem;
  min-height: 50vh;
}

/* ----------------------------------------------------------
   5. SITE HEADER (CAROUSEL)
   ---------------------------------------------------------- */
.carousel-header {
  position: relative;
  height: 320px;
  background: var(--color-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2s ease-in-out; /* 2-second fade */
}

.carousel-image.active {
  opacity: 1;
}

.header-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Optional: A dark gradient makes the white text readable regardless of the image behind it */
  background: rgba(0, 0, 0, 0.35); 
}

.header-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  text-align: center;
  text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.6);
}

/* ----------------------------------------------------------
   6. NAVIGATION
   ---------------------------------------------------------- */
.site-nav {
  background: var(--color-primary-mid);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.site-nav .container {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  position: relative;
}

/* Nav link list */
.nav-links {
  display: flex;
  align-items: stretch;
  justify-content: center; /* Centers the list items horizontally */
  flex: 1;                 /* Allows the list to span the full container width */
  height: var(--nav-h);
}

.nav-links li {
  display: flex;
  align-items: stretch;
}

.nav-links a {
  display: flex;
  align-items: center;
  justify-content: center; /* Centers the text horizontally inside the button */
  text-align: center;      /* Backup centering for the text */
  padding: 0 1.5rem;       /* Slightly increased padding for better breathing room */
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.80);
  border-bottom: 3px solid transparent;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
}

.nav-links a.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-bottom-color: var(--color-accent-light);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}

/* Animated X state */
.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);
}

/* ----------------------------------------------------------
   7. FOOTER
   ---------------------------------------------------------- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 1.2rem 0 1rem 0;
  margin-top: 2rem;
}

.footer-bottom {
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.45);
}
.footer-bottom a:hover {
  color: var(--color-white);
}

/* ----------------------------------------------------------
   8. PAGE HEADER (title bar at top of each page)
   ---------------------------------------------------------- */
.page-header {
  background: var(--color-bg-soft);
  border-bottom: 2px solid var(--color-border);
  padding: 1.8rem 0;
  margin-bottom: 2.5rem;
}

.page-header h1 {
  margin: 0;
}

.page-header .page-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* ----------------------------------------------------------
   9. CARDS (news, activities, people, etc.)
   ---------------------------------------------------------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
  display: flex;
  flex-direction: column;
  height: 100%; 
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.card-body {
  padding: 1.4rem;
  flex-grow: 1; /* This pushes the footer down! */
}

.card-meta {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.card-body h3 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.card-body p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.card-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* ----------------------------------------------------------
   10. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--ease), color var(--ease),
              border-color var(--ease), transform var(--ease);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
  color: var(--color-white);
}

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-outline:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
}

/* ----------------------------------------------------------
   11. FORMS
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  color: var(--color-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-white);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* ----------------------------------------------------------
   12. ALERTS / FLASH MESSAGES
   ---------------------------------------------------------- */
.alert {
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: #ecfdf5;
  border-color: var(--color-accent);
  color: var(--color-primary);
}

.alert-error {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

/* ----------------------------------------------------------
   13. UTILITIES
   ---------------------------------------------------------- */
.text-muted     { color: var(--color-text-muted) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-small     { font-size: 0.88rem; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.06em; }

.bg-soft        { background: var(--color-bg-soft); }
.bg-primary     { background: var(--color-primary); color: var(--color-white); }

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* Spacing helpers */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.section-pad { padding: 3rem 0; }

/* ----------------------------------------------------------
   14. KRAAK / PDF VIEWER & ARCHIEF
   ---------------------------------------------------------- */
.pdf-container {
  position: relative;
  width: 100%;
  padding-bottom: 141.42%; /* Zorgt voor een perfecte A4 verhouding */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  background: var(--color-bg-soft);
}

.pdf-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Archief kaarten styling voor 4 kolommen */
.archive-card {
  padding: 1.5rem;
  gap: 1rem;
}

/* Duwt de downloadknop of 'niet beschikbaar' tekst altijd netjes naar de bodem */
.archive-card > div:first-child {
  flex-grow: 1; 
}

/* Zorg dat de knop de volledige breedte van de smalle kaart neemt */
.archive-card .btn {
  width: 100%;
  justify-content: center; 
}

.archive-card .text-muted.text-small {
  display: block;
  text-align: center;
  padding: 0.55rem 0;
}

/* ----------------------------------------------------------
   15. RESPONSIVE
   ---------------------------------------------------------- */

/* Tablet - 2 column cards*/
@media (max-width: 900px) {
  .card-grid, 
  .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-grid .footer-col:first-child {
    grid-column: 1 / -1;
  }
}

/* Mobile - single column, hamburger nav */
@media (max-width: 640px) {
  :root {
    --header-h:       65px;
    --container-pad:  1rem;
  }

  .site-logo img    { height: 40px; }
  .logo-fallback    { font-size: 1.8rem; }
  .site-org-name    { display: none; }

  /* Show hamburger, hide desktop links */
  .nav-toggle  { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    height: auto;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--color-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 199;
  }

  .nav-links.is-open { display: flex; }

  .nav-links li     { width: 100%; }

  .nav-links a {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    width: 100%;
  }

  .card-grid,
  .card-grid-2,
  .card-grid-4 { grid-template-columns: 1fr; }

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

  .footer-grid .footer-col:first-child {
    grid-column: auto;
  }

  main { padding: 0 0 3rem; }
}

/* ----------------------------------------------------------
   16. FOTO'S & LIGHTBOX
   ---------------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease);
  box-shadow: var(--shadow-sm);
}

.photo-thumb:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
  z-index: 2;
}

/* Lightbox Background */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.95); /* Deep dark blue/black */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* Lightbox Image Container */
.lightbox-content {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  height: 100%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Lightbox Controls */
.lightbox-nav, .lightbox-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 1rem;
  transition: color var(--ease), transform var(--ease);
}

.lightbox-nav:hover, .lightbox-close:hover {
  color: var(--color-accent-light);
}

.lightbox-nav:active {
  transform: scale(0.9);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
  z-index: 10000;
}

/* Hide navigation arrows on very small screens to rely on taps (optional) or just scale them down */
@media (max-width: 640px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav { font-size: 1.8rem; padding: 0.5rem; }
  .lightbox-content { padding: 0; }
}

/* ----------------------------------------------------------
   17. BESTUUR
   ---------------------------------------------------------- */
.person-card {
  text-align: center;
}

/* Forceert de foto in een perfect vierkant (1:1 verhouding) bovenaan de kaart */
.person-card .card-img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}

.person-card .card-body {
  padding: 1.5rem 1.2rem;
}

.person-role {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: -0.2rem;
  margin-bottom: 1.2rem;
}

.person-contact {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.person-contact p {
  margin-bottom: 0.8rem;
}

.person-contact a {
  display: block;
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 0.3rem;
}

.person-contact a:hover {
  color: var(--color-accent-light);
}

.email-icon {
  color: var(--color-primary);
  transition: color var(--ease), transform var(--ease);
}

.email-icon:hover {
  color: var(--color-accent-light);
  transform: scale(1.1);
}
