/* style.css (CLEAN + FIXED) */
:root {
  --color-primary: #6A8E79;
  --color-accent: #A8C3A4;
  --color-bg: #E7EFEA;
  --color-card: #ffffff;
  --color-text: #2F3E36;
  --color-muted: #6f7c75;

  --radius-lg: 16px;
  --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.08);

  /* fallback header-offset; wordt door JS overschreven */
  --header-offset: 160px;
}

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

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

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top left, #f1f6f3, var(--color-bg));
  color: var(--color-text);
  scroll-behavior: smooth;
}

/* Zorgen dat ankers niet achter de sticky header vallen */
section,
details,
.viewer,
.map-card,
h2[id] {
  scroll-margin-top: var(--header-offset);
}

/* Screenreader-only */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================
   SKIP LINK (alleen bij focus)
========================= */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid rgba(106, 142, 121, 0.6);
  color: var(--color-text);
  text-decoration: none;
  z-index: 2000;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 12px;
  outline: none;
}

/* =========================
   HEADER / NAV
========================= */
header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(106, 142, 121, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

header.header-scrolled {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: rgba(106, 142, 121, 0.4);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.35rem 1rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

/* LOGO */
.logo {
  width: 100%;
  display: flex;
  justify-content: center;
}
.logo img {
  width: 100%;
  height: auto;
  display: block;
}

/* HAMBURGER MENU */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.25rem;
  margin-left: auto;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.nav-toggle-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle.nav-toggle-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.nav-toggle-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* NAV */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  width: 100%;
  align-items: center;
  overflow: visible;
}

/* =========================
   NAV BUTTON BASE (links + buttons)
   (Belangrijk: deze is “basis”, geen !important)
========================= */
.nav-link,
.nav-link:visited,
#ttsToggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;

  padding: 0.55rem 1.15rem;
  min-height: 42px;
  line-height: 1;
  white-space: nowrap;

  border-radius: 999px;
  border: 1px solid rgba(106, 142, 121, 0.25);
  background: rgba(106, 142, 121, 0.08);

  font-size: 0.95rem;
  color: var(--color-text);
  text-decoration: none;

  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* hover underline */
.nav-link::after,
#ttsToggle::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 999px;
  background: var(--color-primary);
  transform: scaleX(0);
  opacity: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-link:hover::after,
#ttsToggle:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

.nav-link:hover,
#ttsToggle:hover {
  background: rgba(106, 142, 121, 0.18);
  border-color: rgba(106, 142, 121, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

/* ICONEN */
.nav-icon {
  display: inline-flex;
}
.nav-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: currentColor;
  opacity: 1;
}

/* =========================
   ACCENT NAV (Locatie worden)
   (Belangrijk: komt NA de basis, met !important)
========================= */
a.nav-link.nav-link-accent,
a.nav-link.nav-link-accent:visited,
a.nav-link.nav-link-accent:active {
  background: var(--color-primary) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

a.nav-link.nav-link-accent::after {
  background: #ffffff;
}

a.nav-link.nav-link-accent:hover {
  background: #587565 !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

a.nav-link.nav-link-accent * {
  color: #ffffff !important;
}
a.nav-link.nav-link-accent svg {
  fill: currentColor !important;
}

/* =========================
   TTS DROPDOWN (vervormt header niet)
   Verwacht IDs: #ttsToggle, #ttsPanel
========================= */
#ttsToggle {
  border: 1px solid rgba(106, 142, 121, 0.25);
  cursor: pointer;
}

#ttsWrap,
.nav-tts {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Hidden moet altijd winnen */
#ttsPanel[hidden] {
  display: none !important;
}

#ttsPanel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1500;

  width: 320px;
  max-width: 90vw;

  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(106, 142, 121, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

#ttsPanel .tts-panel-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

#ttsPanel .tts-btn {
  flex: 1;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(106, 142, 121, 0.25);
  background: rgba(106, 142, 121, 0.10);
  color: var(--color-text);
  cursor: pointer;
  font-weight: 700;
}

#ttsPanel .tts-btn:hover {
  background: rgba(106, 142, 121, 0.18);
}

#ttsPanel .tts-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#ttsPanel .tts-label {
  display: block;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 6px 0;
}

#ttsPanel input[type="range"] {
  width: 100%;
}

/* =========================
   MOBIEL NAV
========================= */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
  }

  .main-nav.nav-open {
    display: flex;
  }

  .nav-link,
  #ttsToggle {
    width: 100%;
  }

  #ttsPanel {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-top: 0.25rem;
    box-shadow: var(--shadow-soft);
  }
}

/* =========================
   MAIN LAYOUT
========================= */
main {
  max-width: 1100px;
  margin: 2rem auto 3rem;
  padding: 0 1.25rem;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, rgba(106, 142, 121, 0.08), rgba(168, 195, 164, 0.06));
  border-radius: 24px;
  padding: 2.3rem;
  box-shadow: var(--shadow-soft);
}

.hero h1 {
  font-size: 2.2rem;
  margin-top: 0;
  color: var(--color-primary);
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

/* LABELTAGS */
.pill-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(106, 142, 121, 0.15);
  border: 1px solid rgba(106, 142, 121, 0.3);
  font-size: 0.85rem;
}

/* CTA BUTTON */
.primary-button-wrapper {
  margin-top: 1.5rem;
}

.primary-button,
.primary-button:visited {
  padding: 0.7rem 1.6rem;
  background: var(--color-primary);
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button:hover {
  background: #587565;
  text-decoration: none;
}

/* TITELS */
.section-title {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-title.small {
  font-size: 1.3rem;
}

/* VIEWER */
.viewer {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--color-card);
  border-radius: 20px;
  border: 1px solid rgba(106, 142, 121, 0.25);
  box-shadow: var(--shadow-soft);
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.viewer-placeholder {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.viewer-frame-wrapper {
  display: none;
  margin-top: 1rem;
}

.viewer-frame-wrapper iframe {
  width: 100%;
  height: 600px;
  border-radius: 16px;
  border: none;
}

/* SLUIT PROTOCOL BUTTON */
.close-protocol-button {
  display: none;
  padding: 0.4rem 1.1rem;
  background: #C96868;
  color: #ffffff;
  border-radius: 999px;
  border: 1px solid rgba(120, 40, 40, 0.2);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.close-protocol-button.visible {
  display: inline-flex;
}

/* ACCORDIONS */
details {
  background: #ffffff;
  border: 1px solid rgba(106, 142, 121, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

summary::after {
  content: "›";
  transform: rotate(90deg);
  transition: transform 0.15s ease;
  color: var(--color-muted);
  font-size: 1.3rem;
  line-height: 1;
}

details[open] summary::after {
  transform: rotate(-90deg);
}

.accordion-content p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

/* TABEL */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th {
  background: rgba(106, 142, 121, 0.15);
  padding: 0.7rem;
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 0.7rem;
  border-bottom: 1px solid #d5ddd9;
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* DOC LINK BUTTON (Open) */
a.doc-link,
a.doc-link:visited,
table a.doc-link,
table a.doc-link:visited {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 72px;
  padding: 0.4rem 1rem !important;
  border-radius: 999px !important;

  background: var(--color-primary) !important;
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none !important;

  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

a.doc-link:hover {
  background: #587565 !important;
  text-decoration: none !important;
}

/* KAART */
.map-card {
  margin-top: 3rem;
  background: var(--color-card);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(106, 142, 121, 0.25);
}

.leaflet-container,
#praktijkMap {
  position: relative;
  z-index: 0;
}

#praktijkMap {
  width: 100%;
  height: 400px;
  border-radius: 16px;
  margin-top: 1rem;
  overflow: hidden;
}

/* DISCIPLINE FILTERS */
.discipline-filters {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
}

.discipline-filter-label {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(106, 142, 121, 0.08);
  border: 1px solid rgba(106, 142, 121, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.discipline-filter-label input {
  accent-color: var(--color-primary);
}

/* DISCIPLINE MARKER */
.discipline-marker-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.discipline-marker {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discipline-marker--fysio { background: #6A8E79; }
.discipline-marker--pedicure { background: #C97A95; }
.discipline-marker--podo { background: #E0A72E; }
.discipline-marker--os { background: #4F82C0; }
.discipline-marker--default { background: #666666; }

/* FOCUS (a11y) */
.nav-link:focus-visible,
a.doc-link:focus-visible,
.primary-button:focus-visible,
.close-protocol-button:focus-visible,
#ttsToggle:focus-visible,
#ttsPanel .tts-btn:focus-visible {
  outline: 3px solid rgba(106, 142, 121, 0.55);
  outline-offset: 3px;
}

/* FOOTER */
footer {
  max-width: 1100px;
  margin: 3rem auto 2rem;
  padding: 0 1.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Algemene links (knoppen zijn hierboven al “button-achtig”) */
a {
  color: #2f5c48;
}

a:hover {
  text-decoration: underline;
}

/* RESPONSIVE TABLE */
@media (max-width: 640px) {
  th:nth-child(2),
  th:nth-child(3),
  th:nth-child(4),
  td:nth-child(2),
  td:nth-child(3),
  td:nth-child(4) {
    white-space: nowrap;
  }

  .viewer-frame-wrapper iframe {
    height: 520px;
  }
  /* TTS icoon animatie tijdens voorlezen */
.tts-toggle.is-speaking .nav-icon svg {
  animation: tts-pulse 1.4s ease-in-out infinite;
}

@keyframes tts-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  50%  { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1);   opacity: 1; }
}
/* TTS icoon pulseert tijdens voorlezen */
.tts-toggle.is-speaking .nav-icon svg {
  animation: tts-pulse 1.4s ease-in-out infinite;
}

@keyframes tts-pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.15); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

  /* =========================
   VOORLEZEN: ACTIEVE STATUS
   (plak ALS ALLERLAATSTE)
========================= */

/* Als voorlezen actief is */
.tts-toggle.is-speaking {
  background: rgba(106, 142, 121, 0.18) !important;
  border-color: rgba(106, 142, 121, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(106, 142, 121, 0.25);
}

/* Icoon en tekst blijven netjes */
.tts-toggle.is-speaking,
.tts-toggle.is-speaking span,
.tts-toggle.is-speaking svg {
  color: var(--color-text) !important;
  fill: currentColor !important;
}

/* Hover blijft gewoon werken */
.tts-toggle.is-speaking:hover {
  background: rgba(106, 142, 121, 0.22) !important;
}


}
