/* Ritta recepty – redakční vzhled
   Barvy a písma jen z --brand-*, rozložení dodává společný základ (base-v7). */

:root {
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;

  --c-surface-2: color-mix(in srgb, var(--brand-bg) 60%, var(--brand-border));
  --c-border-strong: color-mix(in srgb, var(--brand-border) 55%, var(--brand-text));
  --c-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, var(--brand-text));
  --c-primary-soft: color-mix(in srgb, var(--brand-primary) 10%, var(--brand-surface));
  --c-accent-soft: color-mix(in srgb, var(--brand-accent) 14%, var(--brand-surface));
  --c-text-soft: color-mix(in srgb, var(--brand-text) 82%, var(--brand-surface));
  --c-footer-muted: color-mix(in srgb, var(--brand-footer-text) 78%, var(--brand-footer-bg));
  --c-footer-line: color-mix(in srgb, var(--brand-footer-text) 22%, var(--brand-footer-bg));
  --c-header-line: color-mix(in srgb, var(--brand-header-text) 14%, var(--brand-header-bg));
  --c-photo-fade: color-mix(in srgb, var(--brand-text) 70%, transparent);

  --shadow-soft: 0 6px 18px color-mix(in srgb, var(--brand-text) 10%, transparent);
  --shadow-header: 0 8px 24px color-mix(in srgb, var(--brand-text) 12%, transparent);
  --shadow-popup: 0 16px 40px color-mix(in srgb, var(--brand-text) 22%, transparent);

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-h1: clamp(1.875rem, 1.4rem + 2vw, 3rem);
  --fs-h2: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  --fs-h3: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --fs-card: clamp(1.1875rem, 1.1rem + 0.35vw, 1.4375rem);

  --measure: 68ch;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --header-h: 4.5rem;
}

/* ---------- Základ ---------- */

html {
  color-scheme: light;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-color: var(--c-border-strong) var(--brand-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--brand-bg);
  color: var(--brand-text);
  font-family: var(--brand-font-body);
  font-size: var(--fs-base);
  font-size-adjust: from-font;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}

input,
textarea,
select {
  caret-color: var(--brand-accent);
  accent-color: var(--brand-accent);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--c-primary-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--brand-font-heading);
  font-weight: var(--brand-heading-weight);
  font-size-adjust: from-font;
  line-height: 1.2;
  color: var(--brand-text);
  text-wrap: balance;
  margin-top: 0;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--fs-h3);
}

p {
  text-wrap: pretty;
}

/* ---------- Hlavička (světlá, přilepená) ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-header-bg);
  color: var(--brand-header-text);
  border-bottom: 1px solid var(--c-header-line);
  container-type: scroll-state;
  container-name: site-header;
}

.header__inner {
  padding-block: var(--space-xs);
  transition: padding 0.3s var(--ease);
}

@supports (container-type: scroll-state) {
  @container site-header scroll-state(stuck: top) {
    .header__inner {
      padding-block: var(--space-2xs);
      box-shadow: var(--shadow-header);
    }
  }
}

.header__logo,
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1em;
  color: var(--brand-header-text);
  font-family: var(--brand-font-heading);
  font-weight: var(--brand-heading-weight);
  font-size: 1.375rem;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.logo__mark {
  color: var(--brand-primary);
}

.logo__name {
  color: var(--brand-header-text);
  letter-spacing: -0.01em;
}

.logo__tld {
  color: var(--brand-primary);
  font-size: 0.65em;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .header__logo,
  .logo {
    font-size: 1.625rem;
  }
}

.header__toggle {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: var(--brand-header-text);
  border: 1px solid var(--c-header-line);
  border-radius: var(--brand-radius);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header__toggle svg {
  stroke: currentColor;
}

.header__toggle:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
}

/* ---------- Menu rubrik (lišta pod hlavičkou) ---------- */

.tray {
  background: var(--brand-surface);
  border-bottom: 1px solid var(--brand-border);
}

.tray ul,
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tray a {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--brand-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tray a:hover {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.header .nav a {
  color: var(--brand-header-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header .nav a:hover {
  color: var(--brand-primary);
}

/* ---------- Mobilní menu ---------- */

.smallnav {
  background: var(--brand-surface);
  color: var(--brand-text);
}

.smallnav ul {
  list-style: none;
  margin: 0;
  padding: var(--space-sm);
}

.smallnav li {
  border-bottom: 1px solid var(--brand-border);
}

.smallnav a {
  display: block;
  padding: var(--space-sm) var(--space-2xs);
  color: var(--brand-text);
  font-family: var(--brand-font-heading);
  font-weight: var(--brand-heading-weight);
  font-size: 1.25rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.smallnav a:hover {
  color: var(--brand-primary);
}

.smallnav__close {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.smallnav__close svg {
  stroke: var(--brand-text);
}

.smallnav__close:hover {
  background: var(--c-surface-2);
}

/* ---------- Vyhledávání ---------- */

.search-form form {
  display: flex;
  gap: var(--space-2xs);
}

.search-form input[type="text"] {
  flex: 1;
  min-height: 44px;
  padding: 0 var(--space-sm);
  background: var(--brand-surface);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  font-family: var(--brand-font-body);
  font-size: var(--fs-base);
  transition: border-color 0.2s ease;
}

.search-form input[type="text"]:hover {
  border-color: var(--c-border-strong);
}

.search-form input[type="submit"] {
  min-height: 44px;
  padding: 0 var(--space-md);
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  border: 1px solid var(--brand-primary);
  border-radius: var(--brand-radius);
  font-family: var(--brand-font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.search-form input[type="submit"]:hover {
  background: var(--c-primary-hover);
  border-color: var(--c-primary-hover);
}

/* ---------- Výpisy článků (karty bez rámečku, oddělené linkou) ---------- */

.article {
  container-type: inline-size;
  container-name: card;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--brand-border);
  padding-block-end: var(--space-md);
  margin-block-end: var(--space-md);
}

.article__image {
  margin: 0 0 var(--space-xs);
  overflow: hidden;
  border-radius: var(--brand-radius);
  background: var(--c-surface-2);
}

.article__image a {
  display: block;
}

.article__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--brand-radius);
}

.article__title {
  margin: 0 0 var(--space-2xs);
  font-size: var(--fs-card);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.article__title a {
  color: var(--brand-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article__title a:hover {
  color: var(--brand-primary);
}

.article__perex {
  margin: 0 0 var(--space-xs);
  color: var(--brand-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.article__category {
  margin: 0 0 var(--space-3xs);
  font-size: var(--fs-xs);
  line-height: 1.8;
  color: var(--brand-muted);
}

.article__category a {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  border-radius: var(--brand-radius);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.article__category a:hover {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
}

.article__date {
  margin: 0;
  color: var(--brand-muted);
  font-size: var(--fs-xs);
}

@container card (min-width: 22rem) {
  .article__title {
    font-size: calc(var(--fs-card) * 1.1);
  }
}

/* ---------- Sekce rubrik na úvodní stránce ---------- */

.bottom--category {
  margin-block: var(--space-xl);
}

.bottom__title {
  display: flex;
  align-items: baseline;
  margin: 0 0 var(--space-md);
  padding-block-end: var(--space-xs);
  border-bottom: 2px solid var(--brand-text);
  font-size: var(--fs-h2);
}

.bottom__title a {
  color: var(--brand-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bottom__title a:hover {
  color: var(--brand-primary);
}

/* ---------- Horní bloky (top-news, top-articles) ---------- */

.top {
  background: var(--brand-bg);
}

.top .article__image {
  position: relative;
}

/* ---------- Článek ---------- */

.text {
  background: transparent;
}

.text__title {
  margin-bottom: var(--space-md);
  font-size: var(--fs-h1);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.text__cover {
  margin: 0 0 var(--space-lg);
}

.text__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--brand-radius);
}

.text__body {
  max-width: var(--measure);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--brand-text);
}

.text__body p {
  margin: 0 0 1.2em;
}

.text__body h2 {
  margin: 2em 0 0.7em;
  font-size: var(--fs-h2);
}

.text__body h3 {
  margin: 1.8em 0 0.6em;
  font-size: var(--fs-h3);
}

.text__body a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.text__body a:hover {
  color: var(--c-primary-hover);
  text-decoration-thickness: 2px;
}

.text__body ul,
.text__body ol {
  margin: 0 0 1.3em;
  padding-left: 1.4em;
}

.text__body li {
  margin-bottom: 0.4em;
}

.text__body li::marker {
  color: var(--brand-primary);
}

.text__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--brand-radius);
}

.text__body img.author {
  float: right;
  width: 9rem;
  height: 9rem;
  margin: 0 0 var(--space-sm) var(--space-md);
  object-fit: cover;
  border-radius: var(--brand-radius);
}

.text__body blockquote {
  margin: 1.6em 0;
  padding: var(--space-xs) var(--space-md);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0;
  color: var(--c-text-soft);
  font-family: var(--brand-font-heading);
  font-size: 1.1875rem;
  font-style: italic;
}

.text__body blockquote p:last-child {
  margin-bottom: 0;
}

.text__body table {
  display: block;
  max-width: 100%;
  margin: 1.6em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.text__body th,
.text__body td {
  padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--brand-border);
  text-align: left;
  vertical-align: top;
}

.text__body table tr:first-child th,
.text__body table tr:first-child td {
  background: var(--c-primary-soft);
  color: var(--brand-text);
  font-weight: 700;
}

.text__body tbody tr:nth-child(even) td {
  background: var(--c-surface-2);
}

.text__body iframe {
  display: block;
  margin: 1.6em 0;
  border: 0;
  border-radius: var(--brand-radius);
}

.table-of-content {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
}

.table-of-content > span {
  display: block;
  margin-bottom: var(--space-2xs);
  font-family: var(--brand-font-heading);
  font-weight: var(--brand-heading-weight);
  font-size: 1.1875rem;
  color: var(--brand-text);
}

.table-of-content ul,
.table-of-content ol {
  margin: 0;
  padding-left: 1.2em;
  font-size: var(--fs-sm);
}

.table-of-content a {
  text-decoration: none;
}

.table-of-content a:hover {
  text-decoration: underline;
}

.text__info {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: var(--fs-sm);
}

.text__info p {
  margin: 0 0 var(--space-3xs);
}

.text__info a {
  color: var(--brand-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.text__info a:hover {
  color: var(--brand-primary);
}

/* ---------- Stránkování ---------- */

.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
}

.pagination li {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-muted);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-xs);
  background: var(--brand-surface);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pagination a:hover {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  border-color: var(--brand-primary);
}

.pagination .pagination__active {
  background: var(--brand-text);
  color: var(--brand-surface);
  border: 1px solid var(--brand-text);
  border-radius: var(--brand-radius);
  font-weight: 700;
}

/* ---------- Spodní panel (sloupce odkazů) a widgety ---------- */

.prefooter {
  margin-top: var(--space-xl);
  background: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  color: var(--brand-text);
}

.prefooter__inner {
  padding-block: var(--space-xl);
}

.sidebar h3:not(.article__title),
.prefooter h3:not(.article__title) {
  margin: 0 0 var(--space-sm);
  padding-bottom: var(--space-2xs);
  border-bottom: 2px solid var(--brand-text);
  font-size: 1.1875rem;
  line-height: 1.25;
}

.sidebar .nav ul,
.prefooter .nav ul,
.tags,
.promo,
.authors {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
}

.sidebar .nav li,
.prefooter .nav li,
.promo li,
.authors li {
  border-bottom: 1px solid var(--brand-border);
}

.sidebar .nav a,
.prefooter .nav a,
.authors a {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 36px;
  padding: var(--space-2xs) 0;
  color: var(--brand-text);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar .nav a:hover,
.prefooter .nav a:hover,
.authors a:hover {
  color: var(--brand-primary);
}

.prefooter svg {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--brand-primary);
}

.promo li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2xs);
  padding: var(--space-2xs) 0;
  font-size: var(--fs-sm);
}

.promo a {
  color: var(--brand-text);
}

.promo a:hover {
  color: var(--brand-primary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.tags a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  min-height: 32px;
  padding: 0.2rem 0.75rem;
  background: var(--brand-bg);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  font-size: var(--fs-xs);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tags a:hover {
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  border-color: var(--brand-primary);
}

.tags a:hover svg {
  stroke: var(--brand-on-primary);
}

.sidebar .article,
.prefooter .article {
  padding-block-end: var(--space-xs);
  margin-block-end: var(--space-xs);
}

.sidebar .article__image,
.prefooter .article__image {
  margin-bottom: var(--space-2xs);
}

.sidebar .article__title,
.prefooter .article__title {
  font-size: 1.0625rem;
  line-height: 1.3;
}

.similar .article__title {
  font-size: 1.0625rem;
}

/* ---------- Patička (tmavá) ---------- */

.footer {
  background: var(--brand-footer-bg);
  color: var(--brand-footer-text);
  border-top: 1px solid var(--c-footer-line);
}

.footer__inner {
  padding-block: var(--space-lg);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.footer p {
  margin: 0 0 var(--space-3xs);
  color: var(--c-footer-muted);
}

.footer a {
  color: var(--brand-footer-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.footer a:hover {
  color: var(--brand-accent);
}

.footer a:focus-visible {
  outline-color: var(--brand-footer-text);
}

/* ---------- Popup ---------- */

.popup {
  background: var(--brand-surface);
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  box-shadow: var(--shadow-popup);
}

.popup button {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: var(--brand-text);
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.popup button:hover {
  color: var(--brand-primary);
}

/* ---------- Pohyb ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Template::addOverflowGuard: dlouhé slovo nebo doména v titulku nepřeteče úzký sloupec ani kartu */
:where(body) { overflow-wrap: break-word; }
:where(h1, h2, h3, h4, h5, h6, .article__title, .sidebar a) { overflow-wrap: anywhere; }
