/*
 * Weeklies: home pages (/ and /de/). Loaded after base.css.
 *
 * The hero is a two-page Planner spread drawn by the page (planner-week.js fills in the
 * visitor's current week). It is an illustration, captioned as one, never a screenshot.
 * The rest stays quiet: ruled sections, left aligned, like pages of a notebook.
 * Logical properties throughout, so longer German text and right-to-left need no extra rules.
 */

/* Sample calendar colors for the illustrations only (users' calendars bring their own).
   --dot-*: the same colors for the dots of busy time. As in the app's CalendarDotStyle, a color
   under 3:1 on the card (4.5:1 with Increase Contrast) is drawn darker in its own hue. */
:root {
    --cal-work: #3B6FD8; --cal-home: #3F9A54; --cal-family: #D98A2B;
    --dot-work: var(--cal-work); --dot-home: var(--cal-home); --dot-family: #B87525;
}
@media (prefers-color-scheme: dark) {
    :root { --cal-work: #7EA3EE; --cal-home: #72C186; --cal-family: #EDB063; --dot-family: var(--cal-family); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
    :root { --dot-home: #368347; --dot-family: #A36820; }
}

/* =========================================================================
   Hero
   ========================================================================= */

.hero { padding-block: clamp(2rem, 6vw, 4.5rem) 0; }
.hero h1 { max-width: 14ch; margin-bottom: 0.35em; }
.lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); line-height: 1.5; max-width: 34rem; }
.availability { color: var(--ink-2); }

.hero-figure { margin: clamp(2rem, 5vw, 3.5rem) 0 0; }
.illustration { margin: 0; }   /* no default figure indent: the drawings get the column's full width */
.hero-figure figcaption, .illustration figcaption {
    margin-top: 0.75rem; color: var(--ink-2); font-size: 0.9rem;
}

/* =========================================================================
   The spread: two pages on the desk, the gutter between them
   ========================================================================= */

.spread {
    background: var(--desk);
    border-radius: 14px;
    padding: clamp(10px, 2vw, 22px);
}

.spread-bar {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem;
    padding: 0 0.35rem 0.75rem;
    font-family: var(--serif); font-weight: 600; font-size: clamp(1rem, 2vw, 1.2rem);
}
.week-number {
    font-family: var(--sans); font-weight: 400; font-size: 0.8rem; color: var(--ink-2);
    border: 1px solid var(--rule); border-radius: 4px; padding: 0 0.35rem;
}

.pages { display: grid; grid-template-columns: 1fr; box-shadow: var(--shadow); border-radius: 6px; }

.page {
    display: grid; grid-template-rows: repeat(3, minmax(6.5rem, auto));
    background: var(--card);
}
.page-left { border-radius: 6px 6px 0 0; }
.page-right { border-radius: 0 0 6px 6px; border-top: 1px solid var(--rule); }

/* Side by side from tablet width, the gutter shading the inner edges as in a bound book. */
@media (min-width: 48rem) {
    .pages { grid-template-columns: 1fr 1fr; }
    .page { grid-template-rows: repeat(3, minmax(9.5rem, auto)); }
    .page-left {
        border-radius: 6px 0 0 6px;
        background: linear-gradient(to left, rgb(31 29 26 / 0.07), transparent 2.25rem) var(--card);
    }
    .page-right {
        border-radius: 0 6px 6px 0; border-top: 0; border-inline-start: 1px solid var(--rule);
        background: linear-gradient(to right, rgb(31 29 26 / 0.07), transparent 2.25rem) var(--card);
    }
}

.day {
    padding: 0.55rem 0.9rem 0.7rem;
    border-top: 1px solid var(--rule);
    min-width: 0;
    font-size: 0.86rem; line-height: 1.4;
}
.page > .day:first-child, .page > .shared:first-child { border-top: 0; }
.shared { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.shared > .day { border-top: 0; }
.shared > .day + .day { border-inline-start: 1px dashed var(--rule); }

.day-head { display: flex; align-items: baseline; gap: 0.45rem; margin-bottom: 0.3rem; font-family: var(--serif); }
.day-num { font-size: 1.35rem; font-weight: 600; line-height: 1; padding: 0.1rem 0.3rem; margin-inline-start: -0.3rem; border-radius: 6px; }
.day-name { color: var(--ink-2); font-size: 0.85rem; }

.day.is-today { background: linear-gradient(var(--accent-soft), transparent 70%); }
.day.is-today .day-num { background: var(--today); color: var(--card); }

.ev {
    display: flex; gap: 0.4rem; align-items: baseline; margin: 0 0 0.15rem; max-width: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ev::before {
    content: ""; flex: none; width: 3px; height: 0.95em; border-radius: 2px;
    align-self: center; background: var(--cal, var(--accent));
}
.ev .t { color: var(--ink-2); font-variant-numeric: tabular-nums; flex: none; }
.ev.allday { background: color-mix(in srgb, var(--cal) 16%, transparent); border-radius: 4px; padding-inline-end: 0.35rem; }
.ev.work { --cal: var(--cal-work); }
.ev.home { --cal: var(--cal-home); }
.ev.family { --cal: var(--cal-family); }

.day .note { border-top: 1px dashed var(--rule); margin-top: 0.35rem; padding-top: 0.3rem; }

/* =========================================================================
   A note, rendered the way the app's reading view draws it
   ========================================================================= */

.note p, .note ul { margin: 0; max-width: none; }
.note ul { list-style: none; padding: 0; }
.note li { display: flex; gap: 0.4rem; align-items: baseline; }
.note .n-h { font-family: var(--serif); font-weight: 700; }
.note .box {
    flex: none; width: 0.85em; height: 0.85em; border: 1.5px solid var(--accent); border-radius: 2px;
    position: relative; top: 0.1em;
}
.note .done .box::after {
    content: ""; position: absolute; inset-inline-start: 0.22em; top: 0.02em;
    width: 0.22em; height: 0.48em; border: solid var(--accent); border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
.note .done .txt { text-decoration: line-through; color: var(--ink-2); }
.note .bullet { color: var(--ink-2); }
.note .link { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }
.note code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; background: var(--accent-soft); border-radius: 3px; padding: 0 0.2em; }
.note .m { color: var(--mark); }

/* =========================================================================
   Chapters below the hero: ruled, left aligned
   ========================================================================= */

.chapter { padding-block: clamp(2.5rem, 7vw, 5rem) 0; }
.chapter > .wrap > h2 { padding-top: 1rem; border-top: 1px solid var(--rule); }

.chapter-grid { display: grid; gap: 1.5rem 3rem; align-items: start; }
@media (min-width: 56rem) {
    .chapter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
}

.plain-list { padding-inline-start: 1.15rem; margin: 0 0 1em; max-width: var(--measure); }
.plain-list li { margin-bottom: 0.35rem; }

/* The four layouts, each with a small diagram of its page structure: two by two, then in a row. */
.layouts { display: grid; gap: 2rem 2.5rem; list-style: none; padding: 0; margin: 1.5rem 0 1rem; }
@media (min-width: 40rem) { .layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .layouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.layouts h3 { margin-bottom: 0.3rem; }
.layouts p { font-size: 0.98rem; }

.diagram {
    display: grid; gap: 3px; height: 6.5rem; margin-bottom: 1rem;
    padding: 6px; background: var(--desk); border-radius: 8px;
}
.diagram i { display: block; background: var(--card); border-radius: 2px; }
.diagram i.today { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--today); }
.diagram.planner { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); grid-auto-flow: column; column-gap: 9px; }
.diagram.planner .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: none; }
.diagram.journal { grid-template-columns: 1fr 2.2fr; grid-template-rows: repeat(7, 1fr); }
.diagram.journal i.pane { grid-column: 2; grid-row: 1 / -1; }
.diagram.journal i:not(.pane) { grid-column: 1; }
.diagram.strip { grid-template-columns: repeat(7, 1fr); align-content: center; }
.diagram.strip i { height: 3.2rem; }
/* Desk: days 1-3 down the left column, 4 and 5 down the right, 6 and 7 along the bottom quarter
   below a thin rule track, each bottom cell as tall as a left one (the app's DeskArrangement). */
.diagram.desk {
    grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, 1fr) 2px repeat(2, 1fr); column-gap: 9px;
    grid-template-areas: "d1 d4" "d1 d4" "d2 d4" "d2 d5" "d3 d5" "d3 d5" ". ." "d6 d7" "d6 d7";
}
.diagram.desk i:nth-child(1) { grid-area: d1; }
.diagram.desk i:nth-child(2) { grid-area: d2; }
.diagram.desk i:nth-child(3) { grid-area: d3; }
.diagram.desk i:nth-child(4) { grid-area: d4; }
.diagram.desk i:nth-child(5) { grid-area: d5; }
.diagram.desk i:nth-child(6) { grid-area: d6; }
.diagram.desk i:nth-child(7) { grid-area: d7; }

/* Read and write: the same note in its two states. */
.states { display: grid; gap: 1rem; margin: 0; }
@media (min-width: 36rem) { .states { grid-template-columns: 1fr 1fr; } }
.state h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.state .note {
    background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
    padding: 0.9rem 1rem; font-size: 0.95rem; line-height: 1.55; min-height: 100%;
}
.state .note .n-h { font-size: 1.15rem; margin-bottom: 0.2rem; }
.states-grid { display: grid; grid-template-rows: auto 1fr; }

/* Spaces: the same day in two spaces. Own events in full; the other spaces' time as busy rows,
   time and "Busy" in the secondary ink beside a dotted bar in the color of the calendar behind
   it, and a conflict mark on an own event that overlaps it (the app's BusyRowView, BusyBar,
   SpaceChip and EventRowView). */
.spaces { display: grid; gap: 1rem; }
@media (min-width: 36rem) { .spaces { grid-template-columns: 1fr 1fr; } }
.space-day {
    min-width: 0; padding: 0.8rem 0.9rem; font-size: 0.86rem; line-height: 1.45;
    background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
}
.space-name {
    display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.5rem;
    font-family: var(--serif); font-weight: 600; font-size: 1.05rem;
}
.chip { flex: none; width: 5px; height: 1em; border-radius: 3px; background: var(--cal); }
.chip.work { --cal: var(--cal-work); }
.chip.home { --cal: var(--cal-home); }
.combo { white-space: nowrap; }   /* keeps a key combination on one line */
.ev.busy { color: var(--ink-2); }
.ev.busy::before {
    height: 1.15em;
    background: radial-gradient(circle closest-side, var(--dot, var(--ink-2)) 92%, transparent) center top / 3px 4.6px repeat-y;
}
.ev.busy.work { --dot: var(--dot-work); }
.ev.busy.home { --dot: var(--dot-home); }
.ev.busy.family { --dot: var(--dot-family); }
.ev .conflict {
    flex: none; align-self: center; display: grid; place-items: center;
    width: 0.95em; height: 0.95em; border: 1.3px solid var(--ink-2); border-radius: 50%;
    color: var(--ink-2); font-size: 0.95em; font-weight: 700; line-height: 1;
}
.ev .conflict::after { content: "!"; font-size: 0.68em; }

/* Mac: the keyboard, listed. */
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 0 0 1rem; max-width: var(--measure); }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; }

.closing { padding-block: clamp(3rem, 8vw, 5rem) 0; }
.closing .closing-line { font-family: var(--serif); font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.35; max-width: 30rem; }
