/* text.css — text pages (alergeny, ochrana-osobnich-udaju, cookies). Page owner: TASK-8.
   Builds on base.css primitives (.container, .eyebrow, .h1, .lead, .label-caps, tokens).

   .text-hero            light page header on --surface (eyebrow + Anton h1 + lead + updated date)
   .text-layout          body grid: sticky .toc (desktop) + .prose column (~68ch)
   .toc                  in-page table of contents
   .prose                long-form legal copy (h2 Anton, h3 Inter, lists, tables, .callout)
   mark.todo             placeholder needing the owner's input
   .allergens            allergen list (rows with number / name / dishes), :target highlighted
   ========================================================================== */

/* ---------- Page header ---------- */
.text-hero { background: var(--surface); border-bottom: 1px solid var(--border); }
.text-hero__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-block: 40px 36px; }
.text-hero__title { color: var(--text-primary); line-height: 1.2; }
.text-hero__lead { max-width: 62ch; }
.text-hero__meta { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.text-hero__meta .icon { width: 15px; height: 15px; color: var(--accent); }
@media (min-width: 1024px) {
  .text-hero__inner { gap: 16px; padding-block: 72px 64px; }
  .text-hero__meta { font-size: 14px; }
}

/* ---------- Body layout: TOC + prose ---------- */
.text-body { padding-block: 40px 64px; }
.text-layout { display: grid; gap: 32px; }
@media (min-width: 1024px) {
  .text-body { padding-block: 72px 112px; }
  .text-layout { grid-template-columns: 260px minmax(0, 68ch); gap: 96px; align-items: start; }
}

/* ---------- Table of contents ---------- */
.toc { padding: 20px; border-radius: var(--radius); background: var(--surface); }
.toc__title { margin-bottom: 12px; }
.toc__list { display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc__list a {
  display: flex; gap: 10px; padding: 6px 0;
  font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text-body);
  transition: color .2s var(--ease);
}
.toc__list a::before { counter-increment: toc; content: counter(toc) "."; min-width: 20px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.toc__list a:hover { color: var(--accent); }
@media (min-width: 1024px) {
  .toc { position: sticky; top: calc(var(--nav-h) + 32px); padding: 0 0 0 20px; border-radius: 0; background: none; border-left: 1px solid var(--border); }
  .toc__title { margin-bottom: 14px; }
}

/* ---------- Prose ---------- */
.prose { font-size: 16px; line-height: 1.7; color: var(--text-body); }
.prose > * + * { margin-top: 16px; }
.prose section + section { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border); }
.prose section > * + * { margin-top: 14px; }
.prose h2 {
  font-family: var(--font-heading); font-weight: 400; font-size: 24px; line-height: 1.2;
  text-transform: uppercase; color: var(--text-primary);
}
.prose h2 .prose__num { color: var(--accent); margin-right: 8px; }
.prose h3 { font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--text-primary); }
.prose section > h3 { margin-top: 24px; }
.prose strong { font-weight: 600; color: var(--text-primary); }
.prose a:not(.btn) { color: var(--accent); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:not(.btn):hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.prose ol { counter-reset: li; }
.prose ol > li { position: relative; padding-left: 28px; counter-increment: li; }
.prose ol > li::before { content: counter(li) "."; position: absolute; left: 0; font-weight: 600; color: var(--accent); }
.prose dl { display: grid; gap: 4px 24px; padding: 20px; border-radius: var(--radius); background: var(--surface); }
.prose dt { font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.prose dd + dt { margin-top: 10px; }
.prose dd { color: var(--text-primary); font-weight: 500; }
@media (min-width: 768px) {
  .prose dl { grid-template-columns: max-content 1fr; padding: 24px 28px; }
  .prose dd + dt { margin-top: 0; }
  .prose dt { padding-top: 3px; }
}
@media (min-width: 1024px) {
  .prose { font-size: 17px; }
  .prose h2 { font-size: 30px; }
  .prose section + section { margin-top: 48px; padding-top: 48px; }
}

/* Callout (info box) */
.callout { display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); color: var(--text-body); font-size: 15px; line-height: 1.6; }
.callout > .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.callout strong { color: var(--text-primary); font-weight: 600; }
.callout a { color: var(--accent); font-weight: 600; }
.callout a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1024px) { .callout { padding: 22px 26px; font-size: 16px; } }

/* Placeholder that needs the owner's input */
mark.todo {
  padding: 1px 5px; border-radius: 4px;
  background: #FBF0DC; color: #7A4A0B;
  box-shadow: inset 0 -1px 0 #E6C48C;
  font-weight: 500; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Data table (cookies) — stacked rows on mobile */
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.data-table caption { text-align: left; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.data-table th { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); text-align: left; }
.data-table td strong { display: block; }
.data-table .data-table__sub { display: block; font-size: 13px; color: var(--text-muted); }
@media (max-width: 767px) {
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table, .data-table caption, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: 16px 0; border-top: 1px solid var(--border); }
  .data-table tr:last-child { border-bottom: 1px solid var(--border); }
  .data-table td + td { margin-top: 8px; }
  .data-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
}
@media (min-width: 768px) {
  .data-table th, .data-table td { padding: 14px 16px 14px 0; vertical-align: top; border-bottom: 1px solid var(--border); }
  .data-table thead th { padding-top: 0; padding-bottom: 12px; border-bottom-color: var(--text-primary); }
  .data-table td:first-child { width: 30%; }
  .data-table td:last-child { width: 22%; padding-right: 0; }
}

/* ==========================================================================
   ALLERGENS
   ========================================================================== */
.allergens-body { padding-block: 32px 64px; }
.allergens-head { display: none; }
.allergens { counter-reset: none; }
.allergen {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 12px;
  padding: 20px 0; border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.allergen:first-child { border-top: 1px solid var(--border); }
.allergen__num {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--accent);
  font-family: var(--font-heading); font-size: 20px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.allergen__head { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.allergen__name { font-family: var(--font-heading); font-weight: 400; font-size: 20px; line-height: 1.2; text-transform: uppercase; color: var(--text-primary); }
.allergen__desc { font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.allergen__dishes { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.allergen__count { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.allergen__none { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.allergen__none .icon { width: 16px; height: 16px; color: var(--veg); }
.dish-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dish-tag {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-primary);
  font-size: 13px; font-weight: 600; line-height: 1.25;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.dish-tag:hover { background: var(--accent); color: #fff; }
.dish-tag:focus-visible { border-radius: var(--radius-pill); }

/* Targeted from the menu (alergeny.html#alergen-7) */
.allergen:target { background: var(--surface); border-color: transparent; }
.allergen:target::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--accent); }
.allergen:target + .allergen { border-top-color: transparent; }
.allergen:target .allergen__num { background: var(--accent); color: #fff; }
.allergen:target .dish-tag { background: #fff; }
.allergen:target .dish-tag:hover { background: var(--accent); }
@media (max-width: 1023px) {
  .allergen:target { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
}
@media (prefers-reduced-motion: no-preference) {
  .allergen:target { animation: allergen-flash 1.2s var(--ease); }
  @keyframes allergen-flash { from { background: #F3E3CF; } }
}

.allergens-note { margin-top: 32px; }

@media (min-width: 768px) {
  .allergen { grid-template-columns: 52px minmax(0, 1fr); column-gap: 20px; }
  .allergen__num { width: 52px; height: 52px; font-size: 24px; }
  .allergen__dishes { grid-column: 2; }
}
@media (min-width: 1024px) {
  .allergens-body { padding-block: 56px 112px; }
  .allergens-head {
    display: grid; grid-template-columns: 52px minmax(0, 380px) minmax(0, 1fr); column-gap: 32px;
    padding-bottom: 14px;
  }
  .allergens-head span:first-child { text-align: center; }
  .allergen { grid-template-columns: 52px minmax(0, 380px) minmax(0, 1fr); column-gap: 32px; align-items: start; padding: 24px 0; }
  .allergen:target { padding-inline: 20px; margin-inline: -20px; }
  .allergen__head { align-self: start; padding-top: 4px; }
  .allergen__name { font-size: 22px; }
  .allergen__dishes { grid-column: 3; padding-top: 6px; }
  .allergens-note { margin-top: 40px; max-width: 880px; }
}
