/* ==========================================================
   Gradus – angličtina
   Styl: clean editorial s teplým školním nádechem
   Inkoust + papír + terakota + šalvěj
   ========================================================== */

:root {
  color-scheme: light;

  /* Barvy */
  --color-paper: #f6f0e4;
  --color-paper-deep: #ece3d0;
  --color-surface: #fffdf7;
  --color-ink: #1d2a44;
  --color-ink-soft: #4b5873;
  --color-ink-faint: #6d7791;
  --color-primary: #c4472b;
  --color-primary-dark: #9c3119;
  --color-primary-tint: #f6dcd2;
  --color-secondary: #3f6b57;
  --color-secondary-dark: #2c4f3f;
  --color-secondary-tint: #dbe8de;
  --color-accent: #e9b949;
  --color-accent-tint: #f8ebc6;
  --color-line: #d9cfba;
  --color-line-strong: #b9ac90;
  --color-on-dark: #f6f0e4;
  --color-on-dark-soft: #c9d0de;
  --color-night: #1d2a44;
  --color-night-deep: #131c31;

  /* Typografie */
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-article: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
  --text-h3: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --text-h2: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  --text-h1: clamp(1.9rem, 1.4rem + 2.6vw, 3.6rem);
  --leading-body: 1.75;
  --leading-article: 1.8;
  --leading-tight: 1.2;

  /* Spacing */
  --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;

  /* Tvary */
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --border-thin: 1px solid var(--color-line);
  --border-strong: 2px solid var(--color-ink);

  /* Stíny (vždy s rozostřením) */
  --shadow-card: 0 2px 10px rgba(29, 42, 68, 0.07);
  --shadow-card-hover: 0 14px 32px rgba(29, 42, 68, 0.16);
  --shadow-header: 0 8px 24px rgba(29, 42, 68, 0.14);
  --shadow-soft: 0 6px 18px rgba(29, 42, 68, 0.1);

  /* Gradienty */
  --gradient-hero: linear-gradient(160deg, var(--color-paper-deep) 0%, var(--color-paper) 70%);
  --gradient-sidebar: linear-gradient(180deg, var(--color-secondary-tint) 0%, var(--color-paper) 100%);
  --gradient-footer: linear-gradient(180deg, var(--color-night) 0%, var(--color-night-deep) 100%);

  /* Layout */
  --container: 1240px;
  --container-pad: 1.25rem;
  --reading-width: 68ch;
  --header-height: 4.5rem;
  --tap-size: 2.75rem;

  /* Pohyb */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed-fast: 0.18s;
  --speed-base: 0.28s;
}

/* ---------- Reset a základ ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + var(--space-sm));
  scrollbar-color: var(--color-primary) var(--color-paper-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-size-adjust: from-font;
  line-height: var(--leading-body);
  color: var(--color-ink);
  background-color: var(--color-paper);
  background-image: radial-gradient(var(--color-line) 1px, transparent 1px);
  background-size: 22px 22px;
  caret-color: var(--color-primary);
  accent-color: var(--color-primary);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--color-accent);
  color: var(--color-night);
}

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

a {
  color: var(--color-primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--speed-fast) var(--ease);
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-size-adjust: from-font;
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--color-night);
  text-wrap: balance;
  margin: 0 0 var(--space-sm);
}

h1 { font-size: var(--text-h1); letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); letter-spacing: -0.01em; }
h3 { font-size: var(--text-h3); }

p {
  margin: 0 0 var(--space-sm);
}

ul, ol {
  margin: 0;
  padding: 0;
}

/* ---------- Wrapper ---------- */
.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper > main {
  flex: 1 0 auto;
}

/* ---------- Hlavička (sticky) ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-night);
  color: var(--color-on-dark);
  border-bottom: 4px solid var(--color-accent);
  container-type: scroll-state;
  container-name: site-header;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  max-width: var(--container);
  min-height: var(--header-height);
  margin: 0 auto;
  padding: var(--space-xs) var(--container-pad);
  transition: min-height var(--speed-base) var(--ease), padding var(--speed-base) var(--ease);
}

@supports (container-type: scroll-state) {
  .header {
    transition: box-shadow var(--speed-base) var(--ease);
  }

  @container site-header scroll-state(stuck: top) {
    .header__inner {
      min-height: 3.5rem;
      padding-block: var(--space-2xs);
    }
  }
}

.header__logo {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header__logo a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-size);
  color: var(--color-on-dark);
  text-decoration: none;
}

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

.header__logo img {
  width: auto;
  height: 2.75rem;
  max-width: 220px;
  object-fit: contain;
}

.header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap-size);
  height: var(--tap-size);
  padding: 0;
  background: transparent;
  border: 2px solid var(--color-on-dark-soft);
  border-radius: var(--radius-md);
  color: var(--color-on-dark);
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}

.header__toggle svg {
  stroke: currentColor;
}

.header__toggle:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------- Navigace v hlavičce ---------- */
.nav ul {
  list-style: none;
}

.header .nav ul {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  justify-content: flex-end;
}

.header .nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-size);
  padding: 0 var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-on-dark);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.header .nav a:hover {
  background: var(--color-accent);
  color: var(--color-night);
}

/* ---------- Pruh kategorií (tray) ---------- */
.tray {
  background: var(--color-primary);
}

.tray__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.tray ul {
  display: none;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  list-style: none;
}

.tray a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-size);
  padding: 0 var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-surface);
  text-decoration: none;
  transition: background-color var(--speed-fast) var(--ease);
}

.tray a:hover {
  background: var(--color-primary-dark);
  color: var(--color-surface);
}

/* ---------- Mobilní menu (pouze display) ---------- */
.smallnav {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  background: var(--color-paper);
}

.smallnav__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-size);
  height: var(--tap-size);
  padding: 0;
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease);
}

.smallnav__close:hover {
  background: var(--color-accent);
}

.smallnav ul {
  list-style: none;
  margin-top: var(--space-lg);
}

.smallnav li {
  border-bottom: var(--border-thin);
}

.smallnav a {
  display: block;
  padding: var(--space-sm) var(--space-2xs);
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: 800;
  color: var(--color-night);
  text-decoration: none;
}

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

/* ---------- Top bloky (hero) ---------- */
.top {
  background: var(--gradient-hero);
  border-bottom: var(--border-thin);
}

.top__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-lg) var(--container-pad);
}

.top .article {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--speed-base) var(--ease), box-shadow var(--speed-base) var(--ease);
}

.top .article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.top .article__title {
  font-size: var(--text-h3);
}

.top-news .article:first-child .article__title {
  font-size: var(--text-h2);
}

/* ---------- Hlavní layout ---------- */
.main__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-lg) var(--container-pad) var(--space-xl);
}

.content {
  min-width: 0;
}

.main__inner > .search-form {
  grid-column: 1 / -1;
}

/* ---------- Nadpisy sekcí ---------- */
.section-title {
  position: relative;
  display: inline-block;
  margin: 0 0 var(--space-md);
  padding: var(--space-2xs) var(--space-md);
  font-size: var(--text-h2);
  background: var(--color-accent-tint);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
}

.section-title--main {
  font-size: var(--text-h1);
  padding: var(--space-xs) var(--space-lg);
  background: var(--color-primary-tint);
  transform: rotate(-1deg);
}

/* ---------- Vyhledávání ---------- */
.search-form form {
  display: flex;
  gap: var(--space-2xs);
  padding: var(--space-2xs);
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.search-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap-size);
  padding: 0 var(--space-md);
  font: inherit;
  color: var(--color-ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
}

.search-form input[type="text"]::placeholder {
  color: var(--color-ink-faint);
}

.search-form input[type="submit"] {
  min-height: var(--tap-size);
  padding: 0 var(--space-md);
  font: inherit;
  font-weight: 700;
  color: var(--color-surface);
  background: var(--color-primary);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease);
}

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

/* ---------- Karty článků ---------- */
.articles,
.bottom__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
}

.content .article,
.bottom .article {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--speed-base) var(--ease), box-shadow var(--speed-base) var(--ease), border-color var(--speed-base) var(--ease);
}

.content .article:hover,
.bottom .article:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-ink);
}

.article__image {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-paper-deep);
}

.article__image a {
  display: block;
  width: 100%;
  height: 100%;
}

.article__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.article:hover .article__image img {
  transform: scale(1.05);
}

.article__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-md);
}

.article__category {
  order: -1;
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-secondary-dark);
}

.article__category a {
  display: inline-block;
  padding: 0.1rem var(--space-xs);
  color: var(--color-secondary-dark);
  background: var(--color-secondary-tint);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.article__category a:hover {
  background: var(--color-secondary);
  color: var(--color-surface);
}

.article__title {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-h3);
  line-height: 1.25;
}

.article__title a {
  color: var(--color-night);
  text-decoration: none;
  transition: color var(--speed-fast) var(--ease);
}

.article__title a:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.article__perex {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-ink-soft);
  text-wrap: pretty;
}

.article__date {
  margin: auto 0 0;
  font-size: var(--text-xs);
  color: var(--color-ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Variace design_article (zachovat třídy) */
.articles.list .article,
.articles.design-list .article {
  flex-direction: row;
}

/* ---------- Sekce bottom (kategorie na HP, podobné články) ---------- */
.bottom {
  margin: 0 0 var(--space-xl);
}

.bottom__title {
  margin: 0 0 var(--space-md);
  font-size: var(--text-h2);
}

.bottom__title a {
  display: inline-block;
  padding: var(--space-2xs) var(--space-md);
  color: var(--color-night);
  background: var(--color-accent-tint);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

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

/* ---------- Článek (klidný sloupec) ---------- */
.text {
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin: 0 0 var(--space-xl);
  box-shadow: var(--shadow-card);
}

.text__title {
  max-width: 24ch;
  margin: 0 0 var(--space-md);
  font-size: var(--text-h1);
  letter-spacing: -0.02em;
}

.text__cover {
  margin: 0 0 var(--space-lg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-paper-deep);
}

.text__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text__body {
  max-width: var(--reading-width);
  margin: 0 auto;
  font-size: var(--text-article);
  line-height: var(--leading-article);
  color: var(--color-ink);
}

.text__body::after {
  content: "";
  display: table;
  clear: both;
}

.text__body p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

.text__body h2 {
  margin: 2em 0 0.7em;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
}

.text__body h3 {
  margin: 1.8em 0 0.6em;
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);
}

.text__body h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.1rem;
}

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

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

.text__body ul,
.text__body ol {
  margin: 0 0 1.15em;
  padding-left: 1.5em;
}

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

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

.text__body blockquote {
  margin: 1.6em 0;
  padding: var(--space-xs) var(--space-md);
  color: var(--color-ink-soft);
  font-style: italic;
  border-left: 4px solid var(--color-accent);
}

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

.text__body img {
  margin: 1.6em auto;
  border-radius: var(--radius-sm);
}

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

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

.text__body hr {
  margin: 2em 0;
  border: 0;
  border-top: var(--border-thin);
}

/* Tabulky v článku */
.text__body table {
  display: block;
  max-width: 100%;
  margin: 1.6em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

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

.text__body table thead th,
.text__body table tr:first-child th,
.text__body table tr:first-child td {
  font-weight: 700;
  color: var(--color-night);
  background: var(--color-accent-tint);
}

.text__body table tbody tr:nth-child(even) td {
  background: var(--color-paper);
}

/* Obsah článku */
.table-of-content {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  background: var(--color-paper);
  border: var(--border-thin);
  border-radius: var(--radius-md);
}

.table-of-content > span {
  display: block;
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-night);
}

.table-of-content ul,
.table-of-content ol {
  padding-left: 1.25em;
}

.table-of-content a {
  color: var(--color-ink);
}

.table-of-content a:hover {
  color: var(--color-primary);
}

/* Informace pod článkem */
.text__info {
  max-width: var(--reading-width);
  margin: var(--space-lg) auto 0;
  padding: var(--space-md);
  font-size: var(--text-sm);
  background: var(--color-paper);
  border-radius: var(--radius-md);
}

.text__info p {
  margin: 0 0 var(--space-2xs);
  color: var(--color-ink-soft);
}

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

.text__info a {
  font-weight: 700;
}

/* Autorská a statická stránka */
.text--author .text__title,
.text--static .text__title {
  max-width: none;
}

/* ---------- Ukazatel průběhu čtení (jen CSS) ---------- */
.reading-progress {
  display: none;
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .reading-progress {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 60;
      height: 5px;
      background: var(--color-primary);
      transform-origin: left center;
      transform: scaleX(0);
      animation: reading-progress-grow linear both;
      animation-timeline: scroll(root);
    }

    @keyframes reading-progress-grow {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
  }
}

/* ---------- Stránkování ---------- */
.pagination {
  margin: var(--space-xl) 0 0;
}

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

.pagination li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-size);
  min-height: var(--tap-size);
  font-weight: 700;
  color: var(--color-ink-soft);
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-size);
  min-height: var(--tap-size);
  padding: 0 var(--space-sm);
  color: var(--color-night);
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease), border-color var(--speed-fast) var(--ease);
}

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

.pagination .pagination__active {
  padding: 0 var(--space-sm);
  color: var(--color-surface);
  background: var(--color-night);
  border-radius: var(--radius-pill);
}

/* ---------- Sidebar ---------- */
.sidebar {
  align-self: start;
  padding: var(--space-md);
  background: var(--gradient-sidebar);
  border: var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  container-type: inline-size;
}

.sidebar h3 {
  margin: var(--space-md) 0 var(--space-xs);
  padding-bottom: var(--space-2xs);
  font-size: 1.2rem;
  border-bottom: 2px dashed var(--color-secondary);
}

.sidebar h3:first-child {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar .nav li + li,
.sidebar .authors li + li {
  border-top: 1px dashed var(--color-line-strong);
}

.sidebar .nav a,
.sidebar .authors a {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--tap-size);
  font-weight: 700;
  color: var(--color-night);
  text-decoration: none;
  transition: color var(--speed-fast) var(--ease), padding-left var(--speed-fast) var(--ease);
}

.sidebar .nav a:hover,
.sidebar .authors a:hover {
  color: var(--color-primary);
  padding-left: var(--space-2xs);
}

.sidebar svg {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
}

/* Články v sidebaru */
.sidebar .article {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--space-xs);
  align-items: center;
  margin: 0 0 var(--space-sm);
  padding: var(--space-2xs);
  background: var(--color-surface);
  border: var(--border-thin);
  border-radius: var(--radius-md);
  transition: transform var(--speed-base) var(--ease), box-shadow var(--speed-base) var(--ease);
}

.sidebar .article:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.sidebar .article__image {
  width: 6rem;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
}

.sidebar .article__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* Štítky */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.tags li {
  list-style: none;
}

.tags a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  min-height: 2rem;
  padding: 0.1rem var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-night);
  background: var(--color-surface);
  border: 1.5px solid var(--color-night);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.tags a:hover {
  color: var(--color-surface);
  background: var(--color-night);
}

/* Promo odkazy */
.promo li {
  display: flex;
  gap: var(--space-2xs);
  padding: var(--space-xs) 0;
  font-size: var(--text-sm);
}

.promo li + li {
  border-top: 1px dashed var(--color-line-strong);
}

.promo a {
  font-weight: 700;
}

@container (min-width: 520px) {
  .sidebar .article {
    grid-template-columns: 8rem minmax(0, 1fr);
  }

  .sidebar .article__image {
    width: 8rem;
  }
}

/* ---------- Sidebar dole (prefooter) ---------- */
.prefooter {
  background: var(--color-paper-deep);
  border-top: var(--border-strong);
}

.prefooter__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-xl) var(--container-pad);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.prefooter__inner h3 {
  margin-top: 0;
}

/* ---------- Patička ---------- */
.footer {
  flex-shrink: 0;
  color: var(--color-on-dark-soft);
  background: var(--gradient-footer);
  border-top: 4px solid var(--color-accent);
}

.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-lg) var(--container-pad);
  font-size: var(--text-sm);
}

.footer__inner p {
  margin: 0 0 var(--space-2xs);
}

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

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

/* ---------- Popup ---------- */
.popup {
  display: none;
  position: fixed;
  right: var(--space-sm);
  bottom: var(--space-sm);
  left: var(--space-sm);
  z-index: 200;
  max-width: 28rem;
  margin-left: auto;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-hover);
}

.popup #close {
  position: absolute;
  top: var(--space-2xs);
  right: var(--space-2xs);
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-size);
  height: var(--tap-size);
  padding: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-night);
  background: var(--color-paper);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
}

.popup #close:hover {
  color: var(--color-surface);
  background: var(--color-primary);
}

/* ---------- Reklamy ---------- */
[data-szn-ssp-ad] {
  max-width: 100%;
}

#sklik_top_id,
#sklik_bottom_id {
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
}

/* ==========================================================
   Responzivita (mobile-first)
   ========================================================== */
@media (max-width: 767px) {
  .header__toggle {
    display: flex;
  }

  .text__body img.author {
    float: none;
    margin-inline: auto;
  }
}

@media (min-width: 560px) {
  .articles,
  .bottom__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  :root {
    --container-pad: 2rem;
    --header-height: 5rem;
  }

  .header .nav ul,
  .tray ul {
    display: flex;
  }

  .header__toggle {
    display: none;
  }

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

  .prefooter__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-news .article:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .top-news .article:first-child .article__image {
    flex: 0 0 55%;
    aspect-ratio: auto;
    min-height: 18rem;
  }

  .top-news .article:first-child .article__body {
    justify-content: center;
    padding: var(--space-lg);
  }
}

@media (min-width: 1100px) {
  .main__inner {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: var(--space-xl);
  }

  .sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
  }

  .articles,
  .bottom__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-news .article:first-child {
    grid-column: span 3;
  }

  .prefooter__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .popup {
    left: auto;
  }
}

@media (min-width: 1400px) {
  .articles,
  .bottom__inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Omezení pohybu ---------- */
@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;
  }

  .content .article:hover,
  .bottom .article:hover,
  .top .article:hover,
  .sidebar .article:hover {
    transform: none;
  }

  .article:hover .article__image img {
    transform: none;
  }
}

/* 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; }

/* Oprava 24. 11. 2026 (barva ukazatele čtení): dřív oranžová nebo červená skoro na všech webech, teď barva odlišná od akcentu s kontrastem aspoň 3:1 vůči hlavičce */
.reading-progress { background: #e879f9; }

/* Oprava 24. 11. 2026 (logo): název webu jako logo čistě v CSS – typ „zvýrazňovač“, barva z ukazatele čtení */
.header .header__logo a:not(:has(img)) { background-image: linear-gradient(transparent 62%, rgba(232, 121, 249, 0.55) 62%); padding: 0 .12em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.header .header__logo a:not(:has(img)) { font-size: 1.1em; }
