/* desk.css: the writing desk for the iPad, in the look of the website (base.css: palette, fonts, timing).
   iPad values: every control at least 48 px, every text at least 18 px. Only transform and opacity move;
   desk.js plays the motions and asks "prefers-reduced-motion" itself. */
.desk { --control: 48px; --bar-height: 72px; font-size: 18px; line-height: 1.45; min-height: 100vh; min-height: 100dvh; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; } /* the views and faces switch with hidden; no class may show them again */
h1, h2 { margin: 0; font-weight: 400; }
p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.view { position: relative; z-index: 6; }

/* ---------- buttons: pill with a 1 px ink border; .primary is the one filled sienna button of a view ---------- */
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: var(--control); padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 500 18px/1.2 var(--sans); text-decoration: none; cursor: pointer; hyphens: manual; -webkit-hyphens: manual; }
.button:hover { background: rgb(38 35 30 / 0.07); }
.button:active { transform: translateY(1px); }
.button.primary { border-color: var(--sienna); background: var(--sienna); color: var(--sand-light); }
.button.primary:hover { border-color: var(--sienna-deep); background: var(--sienna-deep); }
.button.quiet { border-color: transparent; text-decoration: underline; text-underline-offset: 0.22em; }
.button.danger { color: var(--error); border-color: var(--error); }
.button.quiet.danger { border-color: transparent; }
.button[aria-disabled="true"], .button:disabled { cursor: default; transform: none; }
.file-button:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.quiet-link { display: inline-flex; align-items: center; min-height: var(--control); padding: 0 var(--s2); border: 0; background: none; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.back { display: inline-flex; align-items: center; gap: var(--s1); min-height: var(--control); padding-right: var(--s2); font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) { .button { transition: background-color 0.2s ease-out, transform 0.1s; } }

/* ---------- small shared parts ---------- */
.brand { color: var(--ink-soft); font: italic 400 20px/1.3 var(--serif); }
.label { display: block; color: var(--ink-soft); font: 500 18px/1.3 var(--sans); letter-spacing: 0.02em; }
.input { display: block; width: 100%; min-height: var(--control); padding: 10px 14px; border: 1px solid var(--ink-soft); border-radius: 4px; background: #fbf8f2; font-size: 18px; }
.input[aria-invalid="true"] { border: 2px solid var(--error); }
.hint { color: var(--ink-soft); }
.field-error { display: flex; gap: var(--s1); margin-top: 6px; color: var(--error); font-weight: 500; }
.field-error::before { content: "!"; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--error); color: var(--sand-light); font-weight: 700; }
.pointer { display: inline-flex; align-items: flex-end; gap: 4px; color: var(--sienna); font: 400 24px/1.05 var(--hand); hyphens: manual; -webkit-hyphens: manual; }
.pointer svg { flex: none; overflow: visible; }
.line-title { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); font: italic 400 26px/1.2 var(--serif); }
.line-title::before, .line-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: 12px var(--gutter); }

/* ---------- sign in ---------- */
.login { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: var(--s3) var(--gutter); }
.login-box { width: min(100%, 440px); text-align: center; }
.login-box h1 { margin: 4px 0 var(--s4); font-size: clamp(36px, 6vw, 48px); }
.login-form { display: grid; gap: var(--s1); text-align: left; }
.login-form .button { margin-top: var(--s2); width: 100%; }

/* ---------- overview "Zwei Kapitel" ---------- */
.home { display: flex; min-height: 100vh; min-height: 100dvh; }
.home-inner { width: min(100% - 2 * var(--gutter), 780px); margin: auto; padding-block: var(--s5) var(--s3); text-align: center; }
.home-head { margin-bottom: var(--s5); }
.home-head h1 { margin-top: 4px; font-size: clamp(40px, 6vw, 52px); letter-spacing: -0.01em; }
.home-question { margin-top: var(--s1); color: var(--ink-soft); }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s3); }
.way-new { position: relative; }
.way { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; min-height: 200px; padding: var(--s4) var(--s3);
  border: 1px solid var(--ink-soft); border-radius: 4px; background: var(--sand-light); text-decoration: none; }
.way:hover { background: #fbf8f2; }
.way:hover .way-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.way-title { font: 400 30px/1.15 var(--serif); }
.way-text { color: var(--ink-soft); }
.way-plus { position: relative; width: 52px; height: 52px; margin-bottom: var(--s1); border-radius: 50%; background: var(--sienna); }
.way-plus::before, .way-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 2px; background: var(--sand-light); transform: translate(-50%, -50%); }
.way-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.home-inner > section + section { margin-top: var(--s5); }
.ways-one { grid-template-columns: minmax(0, 1fr); max-width: 420px; margin-inline: auto; }
.way-paw { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--s1); border-radius: 50%; background: var(--sage); color: var(--ink); }
/* The planner's own start picture behind its tile, season like in the planner (3.12.2026); words on a light card */
.way-planer { --planer-picture: url("img/hogebusch-autumn.webp"); justify-content: flex-end; min-height: 260px; background: var(--planer-picture) center / cover no-repeat; }
.way.way-planer:hover { background: var(--planer-picture) center / cover no-repeat; }
html[data-season="winter"] .way-planer { --planer-picture: url("img/hogebusch-winter.webp"); }
html[data-season="spring"] .way-planer { --planer-picture: url("img/hogebusch-spring.webp"); }
html[data-season="summer"] .way-planer { --planer-picture: url("img/hogebusch-summer.webp"); }
.way-label { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 20px; border-radius: 12px; background: #fbf8f1; box-shadow: 0 2px 10px rgb(38 35 30 / 0.12); }
.way-strip { display: flex; justify-content: center; min-height: 52px; margin-bottom: var(--s1); }
.way-strip img { width: 48px; height: 52px; margin-inline: -6px; border: 3px solid var(--sand-light); border-radius: 3px; object-fit: cover; background: var(--sand-deep); }
.way-strip img:nth-child(1) { transform: rotate(-6deg); }
.way-strip img:nth-child(3) { transform: rotate(6deg); }
.home-pointer { position: absolute; right: calc(100% + 14px); top: 30%; flex-direction: column; align-items: flex-end; width: 132px; text-align: right; transform: rotate(-4deg); }
@media (max-width: 1099px) { .home-pointer { display: none; } }
.paws { display: flex; justify-content: center; gap: 14px; margin-block: var(--s5); color: var(--sky); }
.paws svg:nth-child(1) { transform: rotate(-10deg); }
.paws svg:nth-child(2) { transform: translateY(-6px) rotate(8deg); }
.home-quiet { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1) var(--s3); }

/* ---------- editor "Nur schreiben" ---------- */
.editor { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.editor-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.editor-heading { flex: 1 1 240px; text-align: center; }
.editor-heading h1 { font-size: 30px; }
.editor-state { color: var(--ink-soft); }
.editor-head::after { content: ""; flex: 0 1 130px; }
.flip { flex: 1; display: grid; padding: var(--s3) var(--gutter); perspective: 1600px; }
.face { grid-area: 1 / 1; width: 100%; max-width: 1180px; margin-inline: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sheet { display: grid; gap: var(--s3) var(--s5); align-content: start; padding: clamp(16px, 3vw, 40px); border: 1px solid rgb(38 35 30 / 0.22); border-radius: 3px; background: var(--sand-light);
  box-shadow: 0 1px 0 rgb(38 35 30 / 0.06), 0 22px 40px -30px rgb(38 35 30 / 0.45); }
@media (min-width: 1000px) { .sheet { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.sheet-text { display: grid; gap: var(--s2); align-content: start; }
.field .label { margin-bottom: 6px; }
.title-input { font: 400 clamp(28px, 4vw, 36px)/1.2 var(--serif); }
.date-field .input { width: auto; min-width: 12em; }
.text-input { min-height: 220px; resize: vertical; font-size: 19px; line-height: 1.55; }
.text-field .hint { margin-top: 4px; }
.photos { display: grid; gap: var(--s2); align-content: start; padding: 12px 16px 16px; border: 1px dashed var(--ink-soft); border-radius: 3px; }
.photos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s1); }
.photo-count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: var(--s3) var(--s2); }
.photo-list:empty { display: none; }
.photo-item { display: grid; gap: 6px; align-content: start; transform-origin: 50% 0; }
.photo-thumb { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--sand-deep); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-number { position: absolute; left: 8px; top: 8px; min-width: 32px; padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--sand-light); font-weight: 600; line-height: 32px; text-align: center; }
.photo-progress { position: absolute; left: 8px; right: 8px; bottom: 10px; display: grid; gap: 4px; justify-items: start; }
.progress-percent { padding: 0 8px; border-radius: 999px; background: var(--ink); color: var(--sand-light); font-weight: 600; line-height: 30px; }
.progress-track { position: relative; width: 100%; height: 6px; overflow: hidden; border-radius: 3px; background: rgb(244 239 229 / 0.9); box-shadow: 0 0 0 1px rgb(38 35 30 / 0.35); }
.progress-bar { position: absolute; inset: 0; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.photo-failed { color: var(--error); font-weight: 500; }
.caption-input { padding-block: 8px; }
.photo-tools { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.tool { display: grid; place-items: center; width: var(--control); height: var(--control); border: 1px solid var(--ink-soft); border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; }
.tool:hover { background: rgb(38 35 30 / 0.07); }
.tool:disabled { opacity: 0.4; cursor: default; }
.photo-tools .button { margin-left: auto; padding-inline: 12px; }
.photo-add { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); }
.photo-pointer { transform: rotate(-2deg); }
.photo-pointer svg { margin-bottom: -6px; }
.photo-list:not(:empty) ~ .photo-add .photo-pointer { display: none; }
.editor-actions { position: sticky; bottom: 0; z-index: 7; justify-content: flex-end; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--sand); }
.publish { overflow: hidden; isolation: isolate; min-width: 12.5em; }
.publish-fill { position: absolute; inset: 0; z-index: -1; background: var(--sienna-deep); transform-origin: 0 50%; transform: scaleX(0); }
.publish.done .publish-fill { transform: none; }
.stamp { display: none; color: var(--sand-light); rotate: -12deg; }
.publish.done .stamp { display: block; }
@media (prefers-reduced-motion: no-preference) { .publish-fill, .progress-bar { transition: transform 0.3s var(--ease-swap); } }
@media (prefers-reduced-motion: reduce) { .publish-fill, .progress-track { display: none; } }

/* ---------- preview: the post as the blog window shows it ---------- */
.preview { align-self: start; max-width: 860px; padding: 16px clamp(20px, 4vw, 44px) clamp(24px, 4vw, 36px); border-radius: 8px; background: var(--sand-light);
  box-shadow: 0 24px 64px rgb(38 35 30 / 0.22), 0 2px 6px rgb(38 35 30 / 0.12); }
.preview-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s1) var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.preview-note { color: var(--ink-soft); }
.preview-date { margin-top: var(--s3); color: var(--ink-soft); font-weight: 500; }
.preview-title { margin-top: 6px; font: 700 clamp(30px, 4.4vw, 42px)/1.12 var(--serif); overflow-wrap: anywhere; }
.preview-text { margin-top: 20px; }
.preview-text p { max-width: 36em; font-size: 19px; line-height: 1.55; white-space: pre-line; }
.preview-text p + p { margin-top: 12px; }
.preview-strip { display: flex; gap: var(--s2); margin-top: var(--s3); overflow-x: auto; padding-bottom: var(--s1); }
.preview-strip:empty { display: none; }
.preview-strip figure { flex: none; margin: 0; width: min(70vw, 260px); }
.preview-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; }
.preview-strip figcaption { margin-top: 4px; color: var(--ink-soft); }

/* ---------- "Meine Beiträge": calendar sheet with tools ---------- */
.posts-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.posts-head h1 { font-size: 30px; }
.posts-count { color: var(--ink-soft); font: 400 20px/1 var(--sans); }
.posts-body { width: 100%; max-width: calc(var(--max-width) + 2 * var(--gutter)); margin-inline: auto; padding: var(--s3) var(--gutter) var(--s8); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 52px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { display: inline-flex; align-items: baseline; gap: 8px; min-height: var(--control); margin-bottom: -1px; padding: 8px 20px 6px; border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; background: transparent; cursor: pointer; }
.tab-year { font: 400 24px/1 var(--serif); }
.tab-count { color: var(--ink-soft); }
.tabs [aria-selected="true"] { border-color: var(--line); background: var(--sand-light); box-shadow: inset 0 3px 0 var(--ink); }
.tabs [aria-selected="true"] .tab-year { font-weight: 600; }
.tabs [role="tab"]:focus-visible { outline-offset: -4px; }
.year-sheet { display: grid; grid-template-columns: 52px minmax(0, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--sand-light); }
.year-side { padding: 18px 0; border-right: 1px solid var(--line); color: var(--ink-soft); font: italic 400 22px/1 var(--serif); text-align: right; writing-mode: vertical-rl; transform: rotate(180deg); }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin: 0 -1px -1px 0; }
.cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cell-date { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cell-picture { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; color: var(--ink-soft); }
.cell-picture img { width: 100%; height: 100%; object-fit: cover; }
.cell-picture svg { width: 96px; height: auto; }
.cell-title { font: 400 21px/1.2 var(--serif); overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.cell-meta { color: var(--ink-soft); }
.cell-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1); margin-top: auto; }
.cell-tools .button { padding-inline: 16px; }
.empty { padding: var(--s4); color: var(--ink-soft); }

/* ---------- R26-11: the tile grows into the editor ---------- */
.grow-surface { position: fixed; inset: 0; z-index: 5; border: 1px solid var(--ink-soft); border-radius: 4px; background: var(--sand-light); transform-origin: 0 0; pointer-events: none; }

/* ---------- message at the bottom (stays until closed or replaced) and the short question before deleting ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--bar-height) + var(--s3)); z-index: 20; display: flex; align-items: center; gap: var(--s2); width: max-content; max-width: min(640px, calc(100vw - 32px));
  padding: var(--s1) var(--s1) var(--s1) var(--s3); border: 1px solid var(--ink); border-radius: 6px; background: var(--sand-light); box-shadow: 0 12px 32px -16px rgb(38 35 30 / 0.45); transform: translateX(-50%); }
.toast p { padding-block: var(--s1); }
.toast .button { flex: none; }
.toast-close { flex: none; display: grid; place-items: center; width: var(--control); height: var(--control); border: 0; border-radius: 50%; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; }
.toast-close:hover { background: rgb(38 35 30 / 0.08); }
@media (max-width: 599px) { .toast { left: var(--s2); right: var(--s2); width: auto; flex-wrap: wrap; transform: none; } }
.confirm { width: min(480px, calc(100vw - 32px)); padding: var(--s4); border: 1px solid var(--ink); border-radius: 6px; background: var(--sand-light); color: var(--ink); }
.confirm::backdrop { background: rgb(38 35 30 / 0.45); }
.confirm h2 { font: 400 28px/1.2 var(--serif); overflow-wrap: anywhere; }
.confirm p { margin-top: var(--s2); }
.confirm-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }

@media (max-width: 759px) {
  .tabs { padding-left: 0; }
  .tabs [role="tab"] { padding-inline: 14px; }
  .year-sheet { grid-template-columns: 36px minmax(0, 1fr); }
  .editor-head::after { display: none; }
  .editor-heading { text-align: left; }
  .editor-actions .button { flex: 1 1 auto; }
}
.input::placeholder { color: #6b6457; opacity: 1; } /* 5.6 : 1 on the field, lighter than typed text */
