/* Hallmark · genre: editorial · macrostructure: Long Document · theme: Garden · enrichment: user logo (mask-tinted) + Tier-B hand-built SVG track diagram + labelled photo slots · nav: N9 · footer: Ft6
 * tone: editorial-quiet · anchor hue: 140 (leaf-green)
 * audience: horse owners & nervous handlers (inferred) · use: course enquiry (inferred)
 * knobs: N9 cta=text+arrow, wordmark=serif · F3 columns=4, rules=every row · Ft6 signoff=roman, ps=yes, width=60ch
 * contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · tokens: pass (48) · mobile: pass (34, 49, 50–57)
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4
 */

/* ── Base ───────────────────────────────────────────── */

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

html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: normal;
  color: var(--color-ink);
  letter-spacing: var(--tracking-display);
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}

p { margin: 0; }

::selection { background: var(--color-paper-3); color: var(--color-ink); }

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

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

/* ── Links (C3 typographic) ─────────────────────────── */

.link {
  color: var(--color-ink);
  text-decoration-line: underline;
  text-decoration-color: var(--color-rule-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  white-space: nowrap;
  transition: text-decoration-color var(--dur-short) var(--ease-out);
}
.link:hover {
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}
.link:active { color: var(--color-accent); }

/* ── N9 edge-aligned nav ────────────────────────────── */

.nav-edge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  max-width: var(--page-max);
  margin-inline: auto;
  padding: var(--space-lg) var(--page-gutter);
}
.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.link--nav {
  font-size: var(--text-sm);
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

/* ── Document grid ──────────────────────────────────────
   Left-biased: a narrow left gutter, the reading column,
   then a wide right margin that holds captions and lets
   photos break out of the measure. */

.doc {
  display: grid;
  grid-template-columns:
    [full-start] minmax(0, 1fr)
    [text-start] minmax(0, var(--measure)) [text-end]
    minmax(0, 2.2fr) [full-end];
  column-gap: var(--space-2xl);
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}
.doc > * { grid-column: text; min-width: 0; }

/* ── Brand logo (user-supplied artwork, tinted via mask) ── */

.brand-logo {
  grid-column: text-end / full-end;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 28rem;
  aspect-ratio: 773 / 521;
  margin-top: var(--space-2xl);
  background-color: var(--color-ink);
  -webkit-mask: url("assets/logo-ranc-dybi.png") center / contain no-repeat;
          mask: url("assets/logo-ranc-dybi.png") center / contain no-repeat;
  animation: settle var(--dur-long) var(--ease-out) both;
}
@media (forced-colors: active) {
  .brand-logo { background-color: CanvasText; }
}

/* ── Opening ────────────────────────────────────────── */

.opening {
  grid-row: 1;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-3xl);
  display: grid;
  gap: var(--space-lg);
  animation: settle var(--dur-long) var(--ease-out) both;
}
.stamp {
  font-size: var(--text-sm);
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-caps);
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.display {
  font-size: var(--text-display);
  line-height: var(--lh-tight);
  max-width: 12ch;
}
.lede {
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--color-ink);
  max-width: 34rem;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Photo plates (labelled slots until real photos arrive) ── */

.plate {
  margin: var(--space-xl) 0 var(--space-2xl);
  display: grid;
  gap: var(--space-sm);
}
.plate--wide   { grid-column: text-start / full-end; }
.plate--offset { grid-column: text; max-width: 30rem; justify-self: end; }

.slot {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--color-slot-line) 14px 15px),
    var(--color-slot);
  border-radius: var(--radius-input);
  display: grid;
  place-items: end start;
  padding: var(--space-md);
}
.slot--tall { aspect-ratio: 4 / 5; }
.slot__label {
  font-size: var(--text-xs);
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-caps);
  color: var(--color-neutral);
  background: var(--color-paper);
  padding: var(--space-2xs) var(--space-xs);
  border-radius: var(--space-2xs);
}
.margin-note {
  font-size: var(--text-sm);
  font-style: italic;
  line-height: 1.45;
  color: var(--color-muted);
  max-width: 34ch;
}

/* ── Prose ──────────────────────────────────────────── */

.prose {
  hyphens: auto;
  display: grid;
  gap: var(--space-md);
  padding-block: var(--space-md) var(--space-xl);
}
.prose--inner { padding: 0; }

/* S4 inline heads: the heading emerges inside the paragraph */
.head-inline {
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-caps);
  font-weight: 600;
  color: var(--color-ink);
  margin-right: var(--space-2xs);
}

.pull {
  margin: var(--space-xl) 0;
  padding-left: var(--space-lg);
  border-left: var(--rule-hair) solid var(--color-rule-2);
}
.pull p {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: var(--lh-snug);
  color: var(--color-ink);
}

/* ── Section heads (stacked, no eyebrows) ──────────── */

.section-title {
  font-size: var(--text-display-s);
  line-height: var(--lh-snug);
}
.section-intro {
  margin-top: var(--space-sm);
  color: var(--color-neutral);
  max-width: 34rem;
}

/* ── Contents (in-page index under the lede) ─────── */

.contents { margin-top: var(--space-md); display: grid; gap: var(--space-xs); }
.contents__label {
  font-size: var(--text-sm);
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-caps);
  color: var(--color-muted);
}
.contents ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-lg);
  font-size: var(--text-sm);
}
.contents li { display: inline-flex; align-items: center; min-height: 44px; }

/* ── Aktivní trekové ustájení: hand-built SVG track ── */

.track { padding-block: var(--space-2xl) var(--space-xl); display: grid; gap: var(--space-lg); }
.track__figure {
  margin: var(--space-md) 0 0;
  display: grid;
  gap: var(--space-lg);
}
.track__map { width: 100%; height: auto; display: block; }
.track__path { fill: none; stroke: var(--color-slot); stroke-width: 44; }
.track__pasture { fill: var(--color-paper-2); stroke: var(--color-rule); stroke-width: 1; }
.track__pasture-label {
  font-family: var(--font-body);
  font-size: 20px;
  font-style: italic;
  fill: var(--color-muted);
}
.track__stop circle { fill: var(--color-ink); }
.track__stop text {
  font-family: var(--font-display);
  font-size: 18px;
  fill: var(--color-accent-ink);
}
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm) var(--space-xl);
  font-size: var(--text-sm);
}
.legend li { display: flex; gap: var(--space-sm); align-items: baseline; }
.legend__n {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-accent-ink);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  transform: translateY(-0.1em);
}

/* ── Seberozvoj: lead line + hairline rows ─────────── */

.growth { padding-block: var(--space-2xl); display: grid; gap: var(--space-lg); }
.growth__lead {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: var(--lh-snug);
  color: var(--color-ink);
}
.rows { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: grid; }
.rows li {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: var(--space-md) var(--space-lg);
  padding-block: var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.rows li:last-child { border-bottom: var(--rule-hair) solid var(--color-rule); }
.rows__name { font-family: var(--font-display); color: var(--color-ink); }

/* ── Courses: F3 spec sheet, breaks wider than the measure ── */

.courses {
  grid-column: text-start / full-end;
  padding-block: var(--space-3xl) var(--space-2xl);
}
.courses .section-intro { max-width: 36rem; }

.spec {
  width: 100%;
  margin-top: var(--space-xl);
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.spec thead th {
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: var(--tracking-caps);
  color: var(--color-muted);
  text-align: left;
  padding: 0 var(--space-md) var(--space-xs) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule-2);
}
.spec tbody th,
.spec td {
  text-align: left;
  vertical-align: baseline;
  padding: var(--space-md) var(--space-md) var(--space-md) 0;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}
.spec tbody th {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-md);
  color: var(--color-ink);
  width: 26%;
  white-space: nowrap;
}
.spec td { color: var(--color-ink-2); }
.spec .num { white-space: nowrap; width: 9%; }
.spec .price[data-pending] { color: var(--color-muted); }

.fine {
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-neutral);
  max-width: 40rem;
}

/* ── Staying here ───────────────────────────────────── */

.stay {
  padding-block: var(--space-2xl);
  display: grid;
  gap: var(--space-lg);
}
.facts {
  margin: var(--space-md) 0 0;
  display: grid;
  gap: var(--space-lg) var(--space-xl);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.facts div {
  padding-top: var(--space-sm);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.facts dt {
  font-family: var(--font-display);
  color: var(--color-ink);
  margin-bottom: var(--space-2xs);
}
.facts dd { margin: 0; font-size: var(--text-sm); line-height: 1.55; }

/* ── Svatby, akce, semináře ────────────────────────── */

.events { padding-top: var(--space-3xl); }
.plate--tight { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.events__list { padding-bottom: var(--space-xl); }
.venues { margin: 0; display: grid; gap: var(--space-lg); }
.venues div {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: var(--space-md) var(--space-lg);
  align-items: baseline;
}
.venues dt { font-family: var(--font-display); font-size: var(--text-md); color: var(--color-ink); }
.venues dd { margin: 0; }

/* ── Enquiry form ───────────────────────────────────── */

.enquire {
  padding-block: var(--space-3xl) var(--space-2xl);
  scroll-margin-top: var(--space-lg);
}
.form {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-lg);
}
.field { display: grid; gap: var(--space-xs); min-width: 0; }
.field--full, .field--choice, .form__foot { grid-column: 1 / -1; }

.field > label, .field legend {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink);
}
.optional { font-weight: 400; color: var(--color-muted); }

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-ink);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-rule-2);
  border-radius: var(--radius-input);
  padding: var(--space-sm) var(--space-md);
  min-height: 48px;
  width: 100%;
  outline: 2px solid transparent;
  outline-offset: 1px;
  transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--color-muted); }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--color-neutral); background: var(--color-paper-2); }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; border-color: var(--color-focus); }

.field input[aria-invalid="true"] { border-color: var(--color-error); }
.field__error { font-size: var(--text-sm); line-height: 1.4; min-height: 1lh; color: var(--color-error); }

.field--choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-xl); }
.field--choice legend { width: 100%; margin-bottom: var(--space-xs); }
.choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  font-weight: 400;
  cursor: pointer;
}
.choice input { accent-color: var(--color-accent); width: 1.1rem; height: 1.1rem; margin: 0; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
  margin-top: var(--space-xs);
}

/* Button — all 8 states */
.button {
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-accent-ink);
  background: var(--color-ink);
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: var(--radius-input);
  min-height: 48px;
  padding: var(--space-sm) var(--space-xl);
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.button:hover { background: var(--color-accent); border-color: var(--color-accent); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button[data-state="loading"] { cursor: progress; background: var(--color-neutral); border-color: var(--color-neutral); }
.button[data-state="error"] { background: var(--color-error); border-color: var(--color-error); }
.button[data-state="success"] { background: var(--color-accent); border-color: var(--color-accent); }

.form__status { font-size: var(--text-sm); color: var(--color-neutral); }
.form__status[data-tone="error"] { color: var(--color-error); }

/* ── Ft6 letter close ───────────────────────────────── */

/* Shares the .doc grid so the signoff lines up with the reading column */
.foot-letter {
  padding-block: var(--space-2xl) var(--space-3xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}
.foot-letter__close {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.35;
  color: var(--color-ink);
}
.foot-letter__sign { color: var(--color-accent); }
.foot-letter__ps {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-neutral);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 60rem) {
  .doc {
    grid-template-columns: [full-start text-start] minmax(0, 1fr) [text-end full-end];
    column-gap: 0;
  }
  .plate--offset { justify-self: stretch; max-width: none; }
  /* The logo sits right under the bar on narrow screens, so the text wordmark would repeat it. */
  .wordmark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-edge { justify-content: flex-end; }
  .brand-logo { grid-column: text; grid-row: auto; justify-self: start; max-width: 16rem; margin-top: var(--space-md); }
  .opening { grid-row: auto; padding-top: var(--space-lg); }
  .spec thead { display: none; }
  .spec, .spec tbody, .spec tr, .spec th, .spec td { display: block; width: auto; }
  .spec tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2xs) var(--space-md);
    padding-block: var(--space-md);
    border-bottom: var(--rule-hair) solid var(--color-rule);
  }
  .spec tbody th, .spec td { padding: 0; border: 0; }
  .spec tbody th { grid-column: 1; width: auto; white-space: normal; }
  .spec td:nth-of-type(1) { grid-column: 1 / -1; grid-row: 2; }
  .spec td:nth-of-type(2) { grid-column: 2; grid-row: 1; align-self: baseline; color: var(--color-muted); }
  .spec td:nth-of-type(3) { grid-column: 1 / -1; grid-row: 3; }
  .spec td:nth-of-type(3)::before { content: "Price "; font-variant-caps: all-small-caps; letter-spacing: var(--tracking-caps); }
}

@media (max-width: 40rem) {
  .opening { padding-top: var(--space-lg); padding-bottom: var(--space-2xl); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: minmax(0, 1fr); }
  .rows li, .venues div { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .pull p { font-size: var(--text-lg); }
  .button { width: 100%; }
}

@media (max-width: 24rem) {
  .wordmark { font-size: var(--text-base); }
  .nav-edge { gap: var(--space-sm); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .opening { animation-duration: 150ms; animation-name: fade; }
  *, *::before, *::after { transition-duration: 0ms !important; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
