/* Tiší učitelé – site styles, ported from prototype v5 (prototype/css/site.css) without the prototype-only bar.
   Colours only through semantic tokens (tokens.css).
   Sizes are set for the usual 100 % zoom: no CSS zoom or transform: scale. */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
}
body.page-profile { background: var(--page-profile); }
img, svg { max-width: 100%; }
h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }

/* side padding of full-width bands so that the content lines up with the container (max. ~1140 px) */
:root { --edge: max(var(--gutter), calc((100% - var(--container)) / 2)); }

/* dark / light surfaces */
.bg-hero { background: var(--hero-bg); }
.bg-candle { background: var(--candle-bg); }
.on-dark { color: var(--text); }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 12px 20px; border-radius: var(--radius);
  font-weight: 600; text-decoration: none; outline: 3px solid var(--focus); outline-offset: 2px;
}
.skip-link:focus { top: 12px; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible,
[tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.focus-target:focus { outline: none; }

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

/* ---------- typography ---------- */
.serif { font-family: var(--font-serif); }
.eyebrow {
  font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--eyebrow); font-weight: 600;
}
.h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.1; letter-spacing: -.015em; color: var(--heading); }
.h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -.005em; color: var(--heading); }
.h2--md { font-size: clamp(26px, 2.7vw, 34px); line-height: 1.15; }
.h2--sm { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.18; }
.h3 { font-family: var(--font-serif); font-weight: 500; font-size: 24px; line-height: 1.2; color: var(--heading); }
.lead-italic { font-family: var(--font-serif); font-style: italic; font-size: clamp(21px, 2vw, 26px); line-height: 1.3; color: var(--text-2); }
.motto {
  font-family: var(--font-serif); font-style: italic; font-weight: 500; letter-spacing: .06em;
  font-size: clamp(18px, 1.8vw, 22px); color: var(--eyebrow); display: flex; align-items: center; gap: 14px;
}
.motto::before { content: ''; width: 32px; height: 1.5px; background: var(--rule); flex: none; }
.lede { font-size: 18px; color: var(--text-3); max-width: 660px; }
.muted { color: var(--text-muted); }
.small { font-size: 15.5px; }
.xsmall { font-size: 14.5px; }
.lnum { font-variant-numeric: lining-nums; }
.t2 { color: var(--text-2); }
.t3 { color: var(--text-3); }

/* ---------- layout ---------- */
.section { padding: var(--section-y) var(--gutter); }
.section--tight { padding-top: clamp(36px, 4.5vw, 60px); padding-bottom: clamp(36px, 4.5vw, 60px); }
.section--hero { padding-top: clamp(24px, 3.4vw, 48px); padding-bottom: clamp(28px, 3.8vw, 52px); }
.section--surface { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.container { max-width: var(--container); margin: 0 auto; }
.container--md { max-width: 940px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; }
.stack-8 { gap: 8px; } .stack-12 { gap: 12px; } .stack-16 { gap: 14px; }
.stack-20 { gap: 16px; } .stack-24 { gap: 18px; } .stack-32 { gap: 24px; }
.stack-48 { gap: 32px; } .stack-56 { gap: 36px; }
.row { display: flex; flex-wrap: wrap; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 0 24px; background: var(--btn-bg); color: var(--btn-fg);
  border: 0; border-radius: var(--radius); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .2s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { background: var(--btn-active); }
.btn svg { transition: transform .2s; }
.btn:hover svg { transform: translateX(4px); }
.btn--down:hover svg { transform: translateY(3px); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 18px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  color: var(--text); font: inherit; font-size: 16px; line-height: 1.3; cursor: pointer;
  text-decoration: none; transition: background .2s, color .2s;
}
.chip:hover { background: var(--chip-hover); }
.chip:active { background: var(--chip-active); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--chip-on-bg); color: var(--chip-on-fg); border-color: var(--chip-on-bg); }
.chip[aria-pressed="true"]:hover, .chip[aria-current="page"]:hover { background: var(--chip-on-bg); }
.link {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--link);
  text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 4px;
}
.link:hover { text-decoration-color: currentColor; }
.link:active { text-decoration-thickness: 2px; }
.link--arrow { gap: 10px; text-decoration: none; font-weight: 600; color: var(--heading); }
.link--arrow svg { transition: transform .2s; }
.link--arrow:hover svg { transform: translateX(4px); }

/* ---------- labels and notes ---------- */
.pill {
  display: inline-block; align-self: flex-start; border: 1px solid var(--pill-border); border-radius: 999px;
  padding: 4px 14px; font-size: 14.5px; color: var(--pill-fg); background: var(--pill-bg);
}
.placeholder-box {
  border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 20px;
  background: var(--surface); font-size: 15.5px; color: var(--text-muted); line-height: 1.5;
}
.section--surface .placeholder-box { background: var(--page); }
.on-dark .placeholder-box { background: transparent; }

/* ---------- header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 24px; padding: 6px var(--edge); background: var(--header-bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; min-height: 48px; text-decoration: none; }
.brand img { display: block; height: 34px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-nav a { display: flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; text-decoration: none; color: var(--text-3); }
.site-nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.site-nav a:active { color: var(--heading); text-decoration-thickness: 2px; }
.site-nav a[aria-current="page"] { color: var(--heading); font-weight: 600; }

/* ---------- landing: hero with the full identity ---------- */
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.hero-text { max-width: 560px; }
.hero-statement {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(34px, 3.6vw, 50px);
  line-height: 1.12; letter-spacing: -.012em; color: var(--heading);
}
.hero-copy { max-width: 520px; color: var(--text-3); }
.hero-logo { margin: 0; display: flex; justify-content: center; }
.hero-logo img { display: block; width: min(400px, 100%); height: auto; }

/* "quiet light" motif (colours change with the palette via CSS variables) */
.q-flame { fill: var(--art-flame); }
.q-flame-in { fill: var(--art-flame-inner); }
.q-line { fill: none; stroke: var(--art-flame); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.q-line--soft { stroke-opacity: .5; stroke-width: 1; }


/* ---------- donor list: calm, compact list ---------- */
/* Row = name + available dates; a link only for persons with their own page. Both groups have the same visual weight. */
.donor-list { list-style: none; margin: 0; padding: 0; columns: 2 420px; column-gap: clamp(32px, 5vw, 72px); border-top: 1px solid var(--line-2); }
.donor {
  break-inside: avoid; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0 20px; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--line-2);
}
.donor__info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
.donor__name { font-family: var(--font-serif); font-weight: 500; font-size: 24px; line-height: 1.25; color: var(--heading); }
.donor__dates { margin: 0; font-size: 15.5px; color: var(--text-muted); }
.donor__link { font-size: 16px; }
.accent { display: block; width: 44px; height: 33px; margin-bottom: 4px; }
.accent svg { display: block; width: 100%; height: 100%; --art-flame: var(--gold-deep); --art-flame-inner: var(--gold-deep); }

/* ---------- candle ---------- */
.candle-grid {
  max-width: 900px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 28px clamp(28px, 5vw, 64px); align-items: center;
}
.candle-fig { display: flex; justify-content: center; }
.candle-art {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
}
.candle-art--common { max-height: 280px; }
.candle-art--single { width: min(100%, 200px); max-height: 320px; }
.candle-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: inherit;
  object-fit: contain;
}
.candle-art__flames {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .6s ease;
  z-index: 1;
}
.candle-art__lines { position: relative; z-index: 2; display: block; width: 100%; height: auto; }
[data-lit="true"] .candle-art__flames {
  opacity: 1;
  animation: candle-glow-pulse 2.8s ease-in-out infinite;
}
@keyframes candle-glow-pulse {
  0%, 100% { opacity: .9; }
  50% { opacity: 1; }
}
/* Legacy SVG candle (unused on public candle sections; keep tokens for flame-wall). */
.candle-svg { width: 130px; height: auto; overflow: visible; }
.candle--lg .candle-svg { width: 150px; }
.candle-svg .glow { transition: opacity 1.2s ease; opacity: 0; }
.candle-svg .flame { transform-origin: 50% 100%; animation: flick 2.6s ease-in-out infinite; display: none; }
[data-lit="true"] .candle-svg .glow { opacity: 1; }
[data-lit="true"] .candle-svg .flame { display: block; }
.candle-svg.static-lit .glow { opacity: 1; }
.candle-svg.static-lit .flame { display: block; }
.c-glow-s { stop-color: var(--flame-glow); }
.c-flame-o { fill: var(--flame-outer); }
.c-flame-i { fill: var(--flame-inner); }
.c-body { fill: var(--candle-body); stroke: var(--candle-body-line); }
.c-plate { fill: var(--candle-plate); }
.c-wick { stroke: var(--candle-wick); }
@keyframes flick { 0%, 100% { transform: scale(1, 1) rotate(-1deg); } 50% { transform: scale(.96, 1.05) rotate(1.5deg); } }
@media (max-width: 680px) {
  .candle-art--common { max-height: 220px; width: 100%; }
  .candle-art--single { max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .candle-art__flames { transition: none; }
  [data-lit="true"] .candle-art__flames { animation: none; opacity: 1; }
}

.lit-message {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 20px; color: var(--text);
}
.lit-message .serif { font-size: 22px; line-height: 1.25; }
.phrase-group { display: flex; flex-direction: column; gap: 8px; }
.flame-wall { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.flame-wall svg { width: 18px; height: 28px; }
.flame-wall .flame { transform-origin: 50% 100%; animation: flick 2.6s ease-in-out infinite; }
.w-o { fill: var(--flame-outer); }
.w-mine { fill: var(--flame-mine); }
.w-i { fill: var(--flame-inner); }

/* ---------- thanks wall ---------- */
.wall { display: flex; flex-direction: column; gap: 24px; max-width: var(--container); margin: 0 auto; }
.wall__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.wall__head-copy { max-width: 680px; display: flex; flex-direction: column; gap: 8px; }
.wall__head-copy .lead { color: var(--text-3); }
.wall__title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(28px, 3.1vw, 38px); line-height: 1.1; margin: 0; color: var(--heading); }
.wall-form {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 3px;
  padding: clamp(16px, 2.4vw, 26px); max-width: 680px; display: flex; flex-direction: column; gap: 16px;
}
.wall-form h3 { font-family: var(--font-serif); font-weight: 500; font-size: 28px; line-height: 1.2; color: var(--heading); }
.demo-note {
  background: var(--demo-bg); border: 1px solid var(--demo-border); border-radius: var(--radius);
  padding: 8px 14px; font-size: 15px; color: var(--demo-fg); line-height: 1.45;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-weight: 600; }
.input, .textarea {
  width: 100%; border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--field-bg); color: var(--text);
  font: inherit; font-size: 17px; padding: 0 12px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 1; }
.input { min-height: 48px; }
.textarea { padding: 12px; line-height: 1.5; resize: vertical; min-height: 104px; }
.input:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.starters { display: flex; flex-wrap: wrap; gap: 8px; }
.starters .chip { min-height: 44px; border-radius: 22px; font-size: 15.5px; text-align: left; }
.error-text { color: var(--danger); font-weight: 600; margin: 0; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
.note-card { margin: 0; border: 1px solid var(--line-2); border-radius: 3px; padding: 18px 20px 16px; background: var(--surface); }
.note-card blockquote { margin: 0; font-family: var(--font-serif); font-weight: 500; line-height: 1.35; font-size: 21px; color: var(--heading); }
.note-card figcaption { margin-top: 10px; font-size: 14.5px; color: var(--text-muted); }
.note-card--pending { border: 1px dashed var(--line-strong); }
.note-card--pending .pending-label { font-size: 14px; color: var(--text-muted); font-weight: 600; margin: 0 0 8px; }
.empty-box { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px 20px; background: var(--surface); max-width: 680px; }
.empty-box .serif { font-size: 24px; line-height: 1.2; margin-bottom: 6px; color: var(--heading); }
.empty-box p:last-child { color: var(--text-3); }

/* ---------- list and search ---------- */
.page-head { padding: clamp(28px, 4vw, 52px) var(--gutter) 16px; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; max-width: 680px; }
.search-form .field { flex: 1 1 260px; }
.search-count { color: var(--text-muted); font-size: 15.5px; }

/* ---------- profile ---------- */
/* top of the profile: name and dates on one line (dates on a common baseline), intro text below; no decorative panel */
.profile-hero { padding-bottom: 4px; }
.profile-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 28px; }
.profile-title-row .profile-dates { padding-left: 28px; border-left: 1px solid var(--line-soft); line-height: 1.2; }
.profile-hero .profile-intro { margin-top: 6px; }
.list-note { padding-top: 8px; max-width: 680px; display: flex; flex-direction: column; gap: 8px; }
.list-note .serif { font-size: 24px; line-height: 1.2; color: var(--heading); }
.profile-name { font-family: var(--font-serif); font-weight: 500; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -.012em; overflow-wrap: anywhere; color: var(--heading); }
.profile-dates { font-family: var(--font-serif); font-size: clamp(22px, 2.3vw, 28px); color: var(--text-3); font-variant-numeric: lining-nums; }
.profile-intro { font-family: var(--font-serif); font-style: italic; font-size: clamp(20px, 2vw, 25px); line-height: 1.3; color: var(--text-2); max-width: 600px; }
/* life story: light backing, side column with a heading and an optional sentence, text at a readable line length */
.section--bio { border-top: 1px solid var(--line); }
.bio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px clamp(28px, 5vw, 72px); }
.bio__title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; color: var(--heading); margin: 0; }
.bio__pull { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-2); font-family: var(--font-serif); font-style: italic; font-size: 21px; line-height: 1.35; color: var(--text-2); }
.bio__text { max-width: 62ch; }
.bio__text p { margin: 0 0 16px; color: var(--text-3); }
.bio__text .bio-note { margin: 0; font-size: 14.5px; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; text-decoration: none; color: var(--heading); }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.return-band { background: var(--surface-2); border-top: 1px solid var(--line); }

/* ---------- footer ---------- */
.site-footer { padding: 32px var(--edge) 36px; background: var(--footer-bg); border-top: 1px solid var(--line-2); }
.site-footer__inner { max-width: var(--container); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer p { font-size: 15.5px; color: var(--text-muted); }
.footer-logo { display: block; width: min(250px, 100%); height: auto; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }

.noscript-box { padding: 20px var(--gutter); background: var(--notice); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-logo { order: -1; }
  .hero-logo img { width: min(300px, 82%); }
  .hero-text { max-width: none; }
  .profile-title-row .profile-dates { padding-left: 0; border-left: 0; }
  .bio { grid-template-columns: 1fr; }
  .donor__link { flex-basis: 100%; }
  .site-nav { gap: 0 16px; }
  .brand img { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .candle-svg .flame, .flame-wall .flame { animation: none; }
  .candle-svg .glow, .btn, .chip, .btn svg, .link--arrow svg { transition: none; }
}
