@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap');

:root {
  --bg:         #E8DFD0;
  --surface:    #D9C9A8;
  --card-light: #F5EFE6;
  --mid:        #6B7570;
  --dark:       #3A3F3C;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.site-header {
  background: var(--dark);
  color: var(--card-light);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header a {
  color: var(--card-light);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-header nav a {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.site-header nav a:hover { opacity: 1; }

/* ── CONTAINER ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container > .search-bar:first-child { margin-top: 2.5rem; }

/* ── SEARCH + FILTERS ── */
.search-bar {
  margin: 2rem 0 1rem;
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1.2rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--card-light);
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--dark); }
.search-bar input::placeholder { color: var(--mid); }

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  border: 2px solid var(--dark);
  background: transparent;
  color: var(--dark);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-btn:hover,
.tag-btn.active {
  background: var(--dark);
  color: var(--card-light);
}

/* ── RECEPT GRID ── */
.recepten-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.recept-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.recept-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(58, 63, 60, 0.15);
}

.recept-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--mid);
}

.recept-card__img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: #c4b9a8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none'%3E%3Cpath d='M20 12v20M16 12c0 4.4 3.6 8 8 8s8-3.6 8-8M24 32v4c0 2.2-1.8 4-4 4h0c-2.2 0-4-1.8-4-4v-4' stroke='%23a89880' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40 12v6c0 3.3 2.7 6 6 6h0v8M46 32v4c0 2.2-1.8 4-4 4h0c-2.2 0-4-1.8-4-4v-4M38 12c0 6 8 6 8 12' stroke='%23a89880' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline x1='12' y1='48' x2='52' y2='48' stroke='%23a89880' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 64px 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.recept-card__body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.recept-card__title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.recept-card__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--mid);
  font-weight: 500;
}

.recept-card__beschrijving {
  font-size: 0.82rem;
  color: var(--mid);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recept-card__bron {
  font-size: 0.75rem;
  color: var(--mid);
  opacity: 0.7;
  margin-top: 0.15rem;
  font-style: italic;
}

.recept-card__match {
  font-size: 0.78rem;
  color: var(--mid);
  font-style: italic;
}

.recept-card__meta-sep::before {
  content: '·';
  margin: 0 0.15rem;
}

.recept-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: var(--bg);
  color: var(--dark);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── LEGE STAAT ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--mid);
  grid-column: 1 / -1;
}
.empty-state p { font-size: 1.1rem; }

/* ── DETAIL PAGINA ── */
.recept-hero {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.recept-hero-placeholder {
  width: 100%;
  height: 300px;
  background: #c4b9a8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 64 64' fill='none'%3E%3Cpath d='M20 12v20M16 12c0 4.4 3.6 8 8 8s8-3.6 8-8M24 32v4c0 2.2-1.8 4-4 4h0c-2.2 0-4-1.8-4-4v-4' stroke='%23a89880' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40 12v6c0 3.3 2.7 6 6 6h0v8M46 32v4c0 2.2-1.8 4-4 4h0c-2.2 0-4-1.8-4-4v-4M38 12c0 6 8 6 8 12' stroke='%23a89880' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cline x1='12' y1='48' x2='52' y2='48' stroke='%23a89880' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 96px 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.recept-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.recept-detail__header { margin-bottom: 1.5rem; }

.recept-detail__title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin-bottom: 0.75rem;
}

.recept-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--mid);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.recept-detail__meta span { display: flex; align-items: center; gap: 0.3rem; }

.recept-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}

/* ── PORTIESCHALER ── */
.portie-schaler {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  width: fit-content;
}

.portie-schaler label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
}

.portie-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--dark);
  background: transparent;
  color: var(--dark);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s;
}
.portie-btn:hover { background: var(--dark); color: var(--card-light); }

.portie-aantal {
  font-size: 1.1rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: center;
}

/* ── CONTENT GRID ── */
.recept-content {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 640px) {
  .recept-content { grid-template-columns: 1fr; }
  .recept-detail__title { font-size: 1.5rem; }
}

/* ── INGREDIËNTEN BLOK ── */
.ingredienten-blok {
  background: var(--dark);
  color: var(--card-light);
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 1rem;
}

.blok-titel {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.ingredienten-lijst {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ingredienten-lijst li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.95rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(245, 239, 230, 0.15);
  cursor: pointer;
  transition: opacity 0.2s;
  user-select: none;
}
.ingredienten-lijst li:last-child { border-bottom: none; padding-bottom: 0; }
.ingredienten-lijst li:hover { opacity: 0.8; }

.ingredienten-lijst li.ing--gedaan {
  opacity: 0.35;
}
.ingredienten-lijst li.ing--gedaan .ingredient-naam {
  text-decoration: line-through;
  text-decoration-color: rgba(245, 239, 230, 0.5);
}

.ingredient-naam { flex: 1; }
.ingredient-hoeveelheid {
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
}

/* ── STAPPEN BLOK ── */
.stappen-blok {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kookmodus-btn {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.6rem 1.2rem;
  background: var(--dark);
  color: var(--card-light);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.kookmodus-btn:hover { opacity: 0.85; }

.stap {
  background: var(--mid);
  color: var(--card-light);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  user-select: none;
}
.stap:hover { opacity: 0.9; }

.stap--gedaan {
  opacity: 0.4;
}
.stap--gedaan .stap-tekst {
  text-decoration: line-through;
  text-decoration-color: rgba(245, 239, 230, 0.5);
}
.stap--gedaan .stap-nummer::after {
  content: ' ✓';
  font-size: 1rem;
}

.stap-nummer {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.5rem;
  opacity: 0.6;
}

.stap-tekst {
  font-size: 0.97rem;
  line-height: 1.65;
}

/* ── KOOKMODUS OVERLAY ── */
.kookmodus-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--dark);
  color: var(--card-light);
  z-index: 1000;
  flex-direction: column;
}
.kookmodus-overlay.actief {
  display: flex;
}

.km-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(245, 239, 230, 0.1);
  flex-shrink: 0;
}

.km-titel {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.7;
}

.km-sluiten {
  background: none;
  border: 1px solid rgba(245, 239, 230, 0.3);
  color: var(--card-light);
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.km-sluiten:hover { border-color: rgba(245, 239, 230, 0.7); }

.km-voortgang {
  display: flex;
  gap: 0.35rem;
  padding: 1rem 1.5rem 0;
  flex-shrink: 0;
}

.km-dot {
  height: 3px;
  border-radius: 2px;
  background: rgba(245, 239, 230, 0.2);
  flex: 1;
  transition: background 0.3s;
}
.km-dot.actief { background: var(--card-light); }
.km-dot.gedaan { background: rgba(245, 239, 230, 0.5); }

.km-inhoud {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.km-stap-tekst {
  font-size: clamp(1.3rem, 4vw, 2rem);
  line-height: 1.6;
  text-align: center;
  max-width: 600px;
}

.km-teller {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.5;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  padding: 0 1.5rem;
}

.km-nav {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  flex-shrink: 0;
}

.km-nav-btn {
  flex: 1;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid rgba(245, 239, 230, 0.2);
  background: transparent;
  color: var(--card-light);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.km-nav-btn:hover:not(:disabled) {
  background: rgba(245, 239, 230, 0.1);
  border-color: rgba(245, 239, 230, 0.5);
}
.km-nav-btn:disabled { opacity: 0.25; cursor: default; }
.km-nav-btn--volgende {
  background: rgba(245, 239, 230, 0.1);
  border-color: rgba(245, 239, 230, 0.4);
}
.km-nav-btn--klaar {
  background: var(--surface);
  color: var(--dark);
  border-color: var(--surface);
}
.km-nav-btn--klaar:hover { background: var(--card-light); border-color: var(--card-light); }

/* ── VOEDINGSWAARDEN ── */
.voeding-sectie {
  margin-top: 2rem;
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.voeding-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .voeding-grid { grid-template-columns: repeat(2, 1fr); }
}

.voeding-item {
  text-align: center;
}
.voeding-waarde {
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}
.voeding-label {
  font-size: 0.75rem;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── BRON ── */
.bron-label {
  display: block;
  margin-top: 1.5rem;
  color: var(--mid);
  font-size: 0.85rem;
}
.bron-link {
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--mid);
  transition: color 0.2s;
}
.bron-link:hover { color: var(--dark); }

/* ── TERUG KNOP ── */
.terug-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--mid);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}
.terug-link:hover { color: var(--dark); }

/* ── NIET GEVONDEN ── */
.not-found {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--mid);
}
.not-found h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--dark); }

/* ── PRINT KNOP ── */
.print-btn {
  display: inline-block;
  margin-top: 1.5rem;
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--dark);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.print-btn:hover { opacity: 0.75; }

/* ── PRINT WEERGAVE ── */
@media print {
  body {
    background: #fff;
    color: #1a1a1a;
    font-size: 11pt;
    line-height: 1.5;
  }

  .site-header,
  .terug-link,
  .portie-schaler,
  .kookmodus-btn,
  .kookmodus-overlay,
  .voeding-sectie,
  .bron-label,
  .print-btn,
  .recept-detail__tags { display: none !important; }

  .recept-hero { max-height: 250px; }

  .recept-detail { padding: 1rem 0; }

  .recept-detail__title {
    font-size: 22pt;
    color: #1a1a1a;
  }

  .recept-detail__meta {
    color: #555;
    font-size: 10pt;
    margin-bottom: 1rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.75rem;
  }

  .recept-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
  }

  .ingredienten-blok {
    background: #f5f5f0;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    position: static;
    break-inside: avoid;
  }

  .ingredienten-lijst li {
    border-bottom-color: #ddd;
    cursor: default;
    font-size: 10pt;
  }
  .ingredienten-lijst li.ing--gedaan {
    opacity: 1;
    text-decoration: none;
  }
  .ingredienten-lijst li.ing--gedaan .ingredient-naam {
    text-decoration: none;
  }

  .blok-titel {
    color: #555;
    font-size: 8pt;
  }

  .stap {
    background: #f5f5f0;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: default;
    break-inside: avoid;
  }
  .stap--gedaan { opacity: 1; }
  .stap--gedaan .stap-tekst { text-decoration: none; }
  .stap--gedaan .stap-nummer::after { content: ''; }

  .stap-nummer { color: #888; }
  .stap-tekst { font-size: 10pt; }
}
