/* =============================================
   WEEKMENU — Stylesheet
   Licht, snel, groen subtiel accent
   ============================================= */

:root {
  --green-50:  #f2f7f2;
  --green-100: #e4efe4;
  --green-200: #c4dcc4;
  --green-400: #7ab57a;
  --green-600: #4a8a4a;
  --green-800: #2d5a2d;

  --text-primary:   #1a2b1a;
  --text-secondary: #4a5c4a;
  --text-muted:     #8a9d8a;

  --bg:        #fafcfa;
  --bg-card:   #ffffff;
  --border:    #dce8dc;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(40,80,40,.07);
  --shadow-md: 0 4px 16px rgba(40,80,40,.10);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ─────────────────────────────────── */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.leaf {
  color: var(--green-400);
  font-size: 1.1rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--green-800);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.week-badge {
  background: var(--green-100);
  color: var(--green-600);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--green-200);
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.alert-error {
  background: #fff5f5;
  border-top: 1px solid #fcc;
  color: #c53030;
  font-size: 0.85rem;
  padding: 0.5rem 1.5rem;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--green-600);
  color: #fff;
  border-color: var(--green-600);
}
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }

.btn-secondary {
  background: var(--green-50);
  color: var(--green-800);
  border-color: var(--green-200);
}
.btn-secondary:hover { background: var(--green-100); }

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

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

/* ── Main / Week Grid ────────────────────────── */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.week-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.grid-row + .grid-row {
  border-top: 1px solid var(--border);
}

.grid-cell {
  padding: 0.75rem 0.6rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.grid-cell:last-child { border-right: none; }

/* Rij 1 – Dag */
.row-days { background: var(--green-50); }

.cell-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.day-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--green-800);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.day-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Rij 2 – Afbeelding placeholder */
.row-images { background: var(--bg-card); }

.cell-image { padding: 0.6rem; }

.image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--green-50);
  border: 1px dashed var(--green-200);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}

.placeholder-icon {
  color: var(--green-200);
  font-size: 1.2rem;
}

/* Rij 3 – Receptnaam */
.row-recipes { background: var(--bg-card); }

.cell-recipe {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

.recipe-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
}

.recipe-empty {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Rij 4 – Bron */
.row-sources { background: var(--green-50); }

.cell-source {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-link {
  font-size: 0.75rem;
  color: var(--green-600);
  text-decoration: none;
  word-break: break-all;
}
.source-link:hover { text-decoration: underline; color: var(--green-800); }

.source-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ── Modals ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,40,20,.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--green-800);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-footer {
  padding: 0.9rem 1.25rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ── Forms ───────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  transition: border-color .15s;
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 2px rgba(122,181,122,.15);
}

.field-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.required { color: #c53030; }

.form-msg {
  font-size: 0.8rem;
  min-height: 1.2em;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all .2s;
}

.form-msg.success {
  color: var(--green-600);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 0.4rem 0.7rem;
}

.form-msg.error {
  color: #c53030;
  background: #fff5f5;
  border: 1px solid #fcc;
  padding: 0.4rem 0.7rem;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .week-grid { overflow-x: auto; }
  .grid-row  { min-width: 560px; }
  .main-content { padding: 1rem 0.75rem 2rem; }
  .header-inner { padding: 0.75rem 0.75rem; }
}

@media (max-width: 500px) {
  .header-title h1 { font-size: 1.2rem; }
  .btn { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
  .week-badge { display: none; }
}
