/* =========================================================
   Mischa Andriessen — de bewerkpagina van de agenda
   Inktblauw, met in het midden een vel warm papier.
   Geen glans, geen gloed, geen schaduwspel.
   ========================================================= */

@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-cursief.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --inktblauw: #162030;
  --papier: #f4efe3;
  --inkt: #1d2230;          /* blauwzwarte inkt op het papier */
  --grijs: #645f57;
  --lijn: #d9d1c1;
  --kantlijn: #b9604c;      /* de rode kantlijn van een schrift */
  --rood: #8a3b2a;
  --op-blauw: #e9e3d6;
  --letter: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --zacht: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { background: var(--inktblauw); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--inktblauw);
  color: var(--inkt);
  font-family: var(--letter);
  font-size: 1.1875rem;
  line-height: 1.55;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, ol { margin: 0; }
h1, h2 { font-weight: 400; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--rood); outline-offset: 3px; border-radius: 2px; }

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

[hidden] { display: none !important; }

.kamer {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.5rem;
  padding: clamp(1rem, 4vw, 3rem) clamp(0.75rem, 3vw, 2rem);
}

/* ---------- kleine tekstknoppen ---------- */

.klein {
  border: 0;
  background: none;
  padding: 0.35rem 0;
  min-height: 2.25rem;
  cursor: pointer;
  color: var(--grijs);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  font-size: 1.02rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--lijn);
  text-underline-offset: 0.3em;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}
.klein:hover { color: var(--inkt); text-decoration-color: currentColor; }

/* ---------- het slot ---------- */

.slot {
  width: min(100%, 25rem);
  background: var(--papier);
  padding: 2.25rem clamp(1.25rem, 5vw, 2.25rem) 2rem;
  display: grid;
  justify-items: center;
  text-align: center;
}
.slot-pen {
  view-transition-name: pen;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  color: var(--inkt);
}
.slot-pen svg { width: 1.6rem; height: 1.6rem; }

.slot-wacht { color: var(--grijs); font-style: italic; }

.slot-vorm { width: 100%; display: grid; justify-items: center; }
.slot-label {
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.slot-label + .slot-veld { margin-bottom: 0.5rem; }
.slot-veld + .slot-label { margin-top: 1.25rem; font-size: 1.25rem; }
.slot-uitleg { margin-bottom: 1.5rem; line-height: 1.45; text-wrap: balance; }
.slot-veld {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.4rem 0.1rem;
  border: 0;
  border-bottom: 1px solid var(--inkt);
  border-radius: 0;
  background: transparent;
  text-align: center;
  letter-spacing: 0.02em;
}
.slot-veld:focus { outline: none; border-bottom-color: var(--rood); box-shadow: 0 1px 0 0 var(--rood); }
.slot-hint { margin-top: 0.75rem; font-size: 0.95rem; color: var(--grijs); line-height: 1.4; }
.slot-fout {
  min-height: 1.6em;
  margin-top: 0.6rem;
  font-style: italic;
  color: var(--rood);
}
.slot-fout:empty { visibility: hidden; }
.slot-knoppen {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}
.open {
  min-height: 2.75rem;
  padding: 0.4rem 1.4rem 0.45rem;
  border: 1px solid var(--inkt);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-size: 1.1rem;
  transition: background-color 200ms ease, color 200ms ease;
}
.open:hover { background: var(--inkt); color: var(--papier); }
.open[disabled] { opacity: 0.5; cursor: progress; }

.val { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.terug { font-size: 1rem; }
.terug a {
  color: var(--op-blauw);
  text-decoration-color: rgba(233, 227, 214, 0.4);
  text-underline-offset: 0.25em;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
}
.terug a:hover { text-decoration-color: currentColor; }

/* ---------- het schrift ---------- */

.schrift {
  position: relative;
  width: min(100%, 48rem);
  background: var(--papier);
  padding: 1.25rem clamp(1.25rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem) clamp(1.75rem, 8vw, 5.5rem);
  align-self: start;
}
/* de kantlijn */
.schrift::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: clamp(0.9rem, 5vw - 0.25rem, 3.6rem);
  width: 1px;
  background: var(--kantlijn);
  opacity: 0.55;
}

.schrift-kop { display: flex; justify-content: flex-end; margin-bottom: clamp(1.5rem, 5vw, 3rem); }

.groet {
  font-style: italic;
  font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.groet:focus { outline: none; }
.volgende { margin-top: 0.75rem; color: var(--grijs); }

.tussenkop {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  margin-bottom: 0.5rem;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.16em;
  font-size: 1.02rem;
  color: var(--grijs);
}

.regels { list-style: none; padding: 0; border-top: 1px solid var(--lijn); }

.regel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.1rem;
  padding: 0.85rem 0 0.9rem;
  border-bottom: 1px solid var(--lijn);
}
.regel-datum {
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.1em;
  font-size: 1rem;
  color: var(--rood);
}
.regel-titel { line-height: 1.35; }
.regel-waar { color: var(--grijs); line-height: 1.4; font-size: 1.02rem; }
.regel-link { font-size: 0.95rem; color: var(--grijs); overflow-wrap: anywhere; }
.regel-acties { display: flex; gap: 1.25rem; align-items: baseline; flex-wrap: wrap; }
.regel-acties .klein { min-height: 2rem; padding-block: 0.15rem; }
.regel-acties .vraag { font-style: italic; color: var(--inkt); }
.regel-acties .notitie { font-style: italic; color: var(--inkt); }

.regels--eerder .regel-titel,
.regels--eerder .regel-datum { color: var(--grijs); }

@media (min-width: 40rem) {
  .regel {
    grid-template-columns: 13rem minmax(0, 1fr) auto;
    column-gap: 1.5rem;
    align-items: baseline;
  }
  .regel-datum { grid-column: 1; grid-row: 1 / span 3; }
  .regel-wat { grid-column: 2; }
  .regel-acties { grid-column: 3; grid-row: 1; justify-content: flex-end; gap: 1rem; }
}

/* doorstrepen: een lijn die zichzelf trekt, daarna verdwijnt de regel */
.regel::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 3.3rem;          /* door de titel, niet door de datum erboven */
  height: 1px;
  background: var(--inkt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
@media (min-width: 40rem) {
  .regel::after { top: 1.65rem; }   /* hier staan datum en titel naast elkaar */
}
.regel.doorgestreept::after { transform: scaleX(1); transition: transform 420ms var(--zacht); }
.regel.doorgestreept .regel-wat,
.regel.doorgestreept .regel-datum { opacity: 0.55; transition: opacity 420ms ease; }
.regel.weg { opacity: 0; transition: opacity 320ms ease; }

/* ---------- een nieuwe of gewijzigde regel: velden op gelinieerd papier ---------- */

.regel--vorm { display: block; padding-block: 1rem 1.25rem; }
.velden {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.25rem;
}
.veld { display: grid; gap: 0.1rem; min-width: 0; }
.veld--breed { grid-column: 1 / -1; }
.veld label {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.12em;
  font-size: 0.98rem;
  color: var(--grijs);
}
.veld .optioneel { font-variant-caps: normal; letter-spacing: 0; font-style: italic; }
.veld input {
  width: 100%;
  min-width: 0;
  font-size: 1.12rem;
  padding: 0.3rem 0.05rem 0.25rem;
  border: 0;
  border-bottom: 1px solid #b9b0a0;
  border-radius: 0;
  background: transparent;
  color: var(--inkt);
}
.veld input:focus { outline: none; border-bottom-color: var(--rood); box-shadow: 0 1px 0 0 var(--rood); }
.veld input[type="date"] { min-height: 2.4rem; }
.vorm-fout { margin-top: 0.75rem; font-style: italic; color: var(--rood); min-height: 1.5em; }
.vorm-fout:empty { display: none; }
.vorm-knoppen { display: flex; gap: 1.5rem; align-items: center; margin-top: 1rem; }
.vorm-knoppen .open { min-height: 2.5rem; padding: 0.3rem 1.2rem 0.35rem; }

@media (max-width: 30rem) {
  .velden { grid-template-columns: minmax(0, 1fr); }
}

.toevoegen-plek { padding-top: 0.75rem; }
.toevoegen { color: var(--inkt); }
.toevoegen::before { content: "+ "; }

.leeg { padding: 0.85rem 0; font-style: italic; color: var(--grijs); border-bottom: 1px solid var(--lijn); }

/* ---------- bewegen: zacht, en nooit langer dan driekwart seconde ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 320ms; }
  ::view-transition-group(pen) { animation-duration: 650ms; animation-timing-function: var(--zacht); }

  /* het notitieboek slaat open: het papier opent vanaf de rug */
  .schrift.opent { animation: openslaan 720ms var(--zacht) both; }
  .schrift.opent > * { animation: inkt 520ms 260ms ease-out both; }
  @keyframes openslaan {
    from { clip-path: inset(0 100% 0 0); transform: scale(0.985); }
    to { clip-path: inset(0 0 0 0); transform: none; }
  }
  @keyframes inkt { from { opacity: 0; } }

  .slot.dicht { animation: dicht 260ms ease-in both; }
  @keyframes dicht { to { opacity: 0; transform: scale(0.98); } }

  .regel--vorm, .regel.nieuw { animation: inkt 360ms ease-out both; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
