/* style.css — DORFic. The Doric order in CSS: stone, ink, hairlines, flutes.
   No shadows, no radii, no ornament that isn't structural. */

:root {
  --bg: #efe9da;        /* limestone, lit */
  --panel: #e6dfcd;     /* limestone, shaded */
  --well: #f6f1e5;      /* reading surface */
  --ink: #2a2418;
  --ink-soft: #6f6350;
  --rule: #c7bca1;      /* scribed line */
  --clay: #a34a28;      /* painted accent, used sparingly */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--clay); text-decoration-color: var(--clay); }

/* ---- entablature (header) -------------------------------------------- */

.architrave {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--ink);
  box-shadow: 0 3px 0 -2px var(--rule);       /* the second, thinner regula */
  background:
    radial-gradient(circle at 6px 100%, var(--rule) 1.5px, transparent 1.7px)
    repeat-x left bottom / 12px 5px;          /* guttae */
}

.mark {
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-decoration: none;
}

.motto { color: var(--ink-soft); font-style: italic; }

.open-nav {
  margin-left: auto;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: none;
  border: 1px solid var(--ink);
  padding: 0.25rem 0.9rem;
  cursor: pointer;
}
.open-nav:hover, .open-nav:focus-visible { color: var(--clay); border-color: var(--clay); outline: none; }

/* ---- stylobate (the 3x3 grid) ----------------------------------------- */

.stylobate {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.cell { border: 0.5px solid var(--rule); min-height: 0; }

/* left column: the three covered cells, shown as a fluted wall */
.colonnade {
  grid-column: 1;
  grid-row: 1 / span 3;
  background:
    repeating-linear-gradient(90deg,
      var(--panel) 0 10px,
      var(--rule) 10px 11px);
  border-inline: 1px solid var(--ink);
}

.stage {
  grid-column: 2;
  grid-row: 2;
  background: var(--well);
  border: 1px solid var(--ink);
  padding: 1.4rem 1.6rem;
  overflow-y: auto;
}

/* the five open plates, placed around the stage */
.stylobate > .plate:nth-of-type(1) { grid-column: 2; grid-row: 1; }
.stylobate > .plate:nth-of-type(2) { grid-column: 3; grid-row: 1; }
.stylobate > .plate:nth-of-type(3) { grid-column: 3; grid-row: 2; }
.stylobate > .plate:nth-of-type(4) { grid-column: 2; grid-row: 3; }
.stylobate > .plate:nth-of-type(5) { grid-column: 3; grid-row: 3; }

.plate {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  text-decoration: none;
  background: var(--bg);
  transition: background 120ms ease;
}
.plate:hover { background: var(--panel); }
.plate-no { color: var(--ink-soft); font-size: 0.75rem; letter-spacing: 0.25em; }
.plate-title { font-weight: 700; line-height: 1.25; }
.plate-date { color: var(--ink-soft); font-size: 0.8rem; font-variant: small-caps; }
.plate-empty { cursor: default; }
.plate-empty:hover { background: var(--bg); }

/* ---- crepis (footer) --------------------------------------------------- */

.crepis {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lab-badge { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--ink-soft); }

/* ---- navigator (dialog over the left column / top cell) ---------------- */

.navigator {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  margin: 0;
  width: 33.34vw;
  max-width: 33.34vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-right: 1px solid var(--ink);
  padding: 0;
  background: var(--well);
  color: var(--ink);
  font: inherit;
  overflow-y: auto;
}

.navigator::backdrop {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
}

.navigator-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.85rem 1.1rem 0.7rem;
  border-bottom: 1px solid var(--ink);
  background:
    radial-gradient(circle at 6px 100%, var(--rule) 1.5px, transparent 1.7px)
    repeat-x left bottom / 12px 5px;
}

.navigator-title { text-transform: uppercase; letter-spacing: 0.32em; font-weight: 700; }

.close-nav {
  font: inherit;
  background: none;
  border: 1px solid var(--rule);
  padding: 0.15rem 0.7rem;
  cursor: pointer;
}
.close-nav:hover, .close-nav:focus-visible { color: var(--clay); border-color: var(--clay); outline: none; }

.nav-list { list-style: none; margin: 0; padding: 0.4rem 0; }
.nav-list li { border-bottom: 1px solid var(--rule); }
.nav-list a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
}
.nav-list a:hover { background: var(--panel); }
.nav-list a.active { box-shadow: inset 3px 0 0 var(--clay); }
.nav-date { color: var(--ink-soft); font-size: 0.8rem; font-variant: small-caps; }

/* ---- stage prose ------------------------------------------------------- */

.stage h1, .stage h2, .stage h3 {
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}
.stage h1 { text-transform: uppercase; border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; }
.stage h2 { margin-top: 1.6rem; }
.stage p { margin: 0.6rem 0; }
.stage ul, .stage ol { padding-left: 1.3rem; }
.stage code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--panel);
  padding: 0.1em 0.35em;
}
.stage pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 0.8rem 1rem;
  overflow-x: auto;
}
.stage pre code { background: none; padding: 0; }
.stage blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
}
.stage table { border-collapse: collapse; }
.stage th, .stage td { border: 1px solid var(--rule); padding: 0.3rem 0.7rem; }
.stage hr { border: 0; border-top: 1px solid var(--rule); margin: 1.4rem 0; }

/* ---- mobile: 2x1 grid, navigator covers the top cell ------------------- */

@media (max-width: 720px) {
  .stylobate {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(13rem, auto) minmax(0, 1fr);
  }
  .colonnade { grid-column: 1; grid-row: 1; grid-row: 1 / span 1; min-height: 13rem; }
  .stage { grid-column: 1; grid-row: 2; }
  .stylobate > .plate { display: none; }

  .navigator {
    width: 100vw;
    max-width: 100vw;
    height: 50dvh;
    max-height: 50dvh;
    bottom: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .plate { transition: none; }
}
