/* ==========================================================================
   Železniční doprava a cesty – "Signal & Steel"
   Industrial editorial: ocelová tmavě modrá, signální oranžová, štěrkový
   šedý podklad, kolejnicové linky, technické tvary.
   ========================================================================== */

:root {
  /* Barvy – základ */
  --color-bg: #ecebe6;
  --color-bg-alt: #dedcd4;
  --color-surface: #fbfaf7;
  --color-surface-dark: #14202e;
  --color-surface-darker: #0b141e;
  --color-ink: #16202b;
  --color-ink-soft: #4a5766;
  --color-ink-invert: #f3f1ea;
  --color-ink-invert-soft: #aab4c0;
  --color-primary: #1f3a56;
  --color-primary-dark: #14263a;
  --color-accent: #f26a1b;
  --color-accent-dark: #c9500c;
  --color-accent-soft: #fde5d3;
  --color-signal: #f2c230;
  --color-line: #c9c6bb;
  --color-line-strong: #16202b;
  --color-link: #1f4f86;
  --color-link-hover: #c9500c;
  --color-overlay: rgba(11, 20, 30, 0.6);

  /* Gradienty */
  --gradient-header: linear-gradient(135deg, #0b141e 0%, #1f3a56 100%);
  --gradient-hero: linear-gradient(120deg, #14202e 0%, #1f3a56 60%, #2c5079 100%);
  --gradient-accent: linear-gradient(90deg, #f26a1b 0%, #f2c230 100%);
  --gradient-image-fade: linear-gradient(180deg, rgba(11, 20, 30, 0) 40%, rgba(11, 20, 30, 0.85) 100%);
  --gradient-rail: repeating-linear-gradient(90deg, #16202b 0 14px, transparent 14px 24px);

  /* Typografie */
  --font-heading: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", Impact, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-ui: "Barlow", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-md: 1.25rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-2xl: 2.5rem;
  --text-3xl: 3.25rem;

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-body: 1.78;

  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  /* Layout */
  --container-max: 1240px;
  --container-pad: 1rem;
  --sidebar-width: 320px;
  --header-height: 72px;
  --progress-height: 4px;

  /* Tvary */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;
  --border-thin: 1px solid var(--color-line);
  --border-strong: 2px solid var(--color-line-strong);
  --cut-corner: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  --cut-corner-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);

  /* Stíny */
  --shadow-card: 0 1px 0 rgba(22, 32, 43, 0.08), 0 6px 18px rgba(22, 32, 43, 0.06);
  --shadow-card-hover: 0 2px 0 rgba(22, 32, 43, 0.1), 0 16px 32px rgba(22, 32, 43, 0.16);
  --shadow-header: 0 4px 20px rgba(11, 20, 30, 0.35);
  --shadow-block: 6px 6px 0 var(--color-accent);
  --shadow-block-sm: 3px 3px 0 var(--color-accent);

  /* Animace */
  --ease-out: cubic-bezier(0.22, 0.8, 0.28, 1);
  --duration-fast: 0.2s;
  --duration-base: 0.3s;
  --duration-slow: 0.6s;
}

/* ==========================================================================
   Reset & základ
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  background-image: var(--gradient-rail);
  background-size: 100% 6px;
  background-repeat: no-repeat;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

a:hover,
a:focus-visible {
  color: var(--color-link-hover);
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--color-ink);
  margin: 0 0 var(--space-md);
}

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

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================================================
   Progress bar
   ========================================================================== */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  height: var(--progress-height);
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--gradient-header);
  color: var(--color-ink-invert);
  border-bottom: 4px solid var(--color-accent);
  transition: box-shadow var(--duration-base) ease, padding var(--duration-base) ease;
}

.header.is-stuck {
  box-shadow: var(--shadow-header);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  max-width: var(--container-max);
  min-height: var(--header-height);
  margin: 0 auto;
  padding: var(--space-sm) var(--container-pad);
}

.header__logo {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.header__logo a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-ink-invert);
  text-decoration: none;
}

.header__logo a::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

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

.header__logo img {
  max-height: 48px;
  width: auto;
}

.header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--color-ink-invert);
  border-radius: var(--radius-none);
  color: var(--color-ink-invert);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.header__toggle svg {
  stroke: var(--color-ink-invert);
}

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

/* Navigace v hlavičce */

.header .nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  list-style: none;
}

.header .nav a {
  display: block;
  padding: var(--space-xs) var(--space-md);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-invert-soft);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.header .nav a:hover {
  color: var(--color-ink-invert);
  border-bottom-color: var(--color-accent);
}

/* Tray menu (kategorie pod hlavičkou) */

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

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

.tray__inner::-webkit-scrollbar {
  display: none;
}

.tray ul {
  display: flex;
  gap: var(--space-2xs);
  list-style: none;
  white-space: nowrap;
}

.tray a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-invert-soft);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease, background-color var(--duration-fast) ease;
}

.tray a:hover {
  color: var(--color-ink-invert);
  background: var(--color-primary-dark);
  border-bottom-color: var(--color-accent);
}

/* Mobilní menu (řízeno pouze přes display) */

.smallnav {
  position: fixed;
  inset: 0;
  z-index: 900;
  padding: var(--space-3xl) var(--space-xl) var(--space-xl);
  background: var(--color-surface-darker);
  overflow-y: auto;
}

.smallnav__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--color-ink-invert);
  border: 0;
  border-radius: var(--radius-none);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

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

.smallnav ul {
  list-style: none;
}

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

.smallnav a {
  display: block;
  padding: var(--space-md) 0;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-ink-invert);
  text-decoration: none;
  transition: color var(--duration-fast) ease, padding-left var(--duration-base) var(--ease-out);
}

.smallnav a:hover {
  color: var(--color-accent);
  padding-left: var(--space-md);
}

/* ==========================================================================
   Top sekce (top-news, top-articles)
   ========================================================================== */

.top {
  background: var(--gradient-hero);
  color: var(--color-ink-invert);
  padding: var(--space-xl) 0;
  border-bottom: 4px solid var(--color-signal);
}

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

.top .article {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-darker);
  border: 1px solid var(--color-primary);
  border-top: 4px solid var(--color-accent);
  box-shadow: none;
  transition: transform var(--duration-base) var(--ease-out), border-color var(--duration-base) ease;
}

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

.top .article__title,
.top .article__title a {
  color: var(--color-ink-invert);
}

.top .article__title a:hover {
  color: var(--color-signal);
}

.top .article__perex {
  color: var(--color-ink-invert-soft);
}

.top .article__category,
.top .article__category a {
  color: var(--color-signal);
}

/* ==========================================================================
   Hlavní layout
   ========================================================================== */

.main {
  flex: 1 0 auto;
  padding: var(--space-xl) 0 var(--space-2xl);
}

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

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

.content {
  min-width: 0;
}

.page-title {
  position: relative;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  font-size: var(--text-2xl);
  font-weight: 800;
}

.page-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  height: 6px;
  background: var(--gradient-accent);
}

.section-heading {
  margin: var(--space-2xl) 0 var(--space-lg);
  padding-left: var(--space-md);
  font-size: var(--text-xl);
  border-left: 8px solid var(--color-accent);
}

/* ==========================================================================
   Vyhledávání
   ========================================================================== */

.search-form form {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--color-surface);
  border: var(--border-strong);
  box-shadow: var(--shadow-block-sm);
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: 0;
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
}

.search-form input[type="text"]:focus {
  outline: none;
  background: var(--color-accent-soft);
}

.search-form input[type="submit"] {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-surface-dark);
  border: 0;
  color: var(--color-ink-invert);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

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

/* ==========================================================================
   Karty článků
   ========================================================================== */

.articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.article {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-surface);
  border: var(--border-thin);
  border-left: 5px solid var(--color-primary);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) ease, border-left-color var(--duration-base) ease;
}

.article:hover {
  transform: translateY(-5px);
  border-left-color: var(--color-accent);
  box-shadow: var(--shadow-card-hover);
}

.article__image {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.article__image a {
  display: block;
}

.article__image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out), filter var(--duration-base) ease;
}

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

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

.article__title {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.article__title a {
  color: var(--color-ink);
  text-decoration: none;
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 3px;
  transition: background-size var(--duration-base) var(--ease-out), color var(--duration-fast) ease;
}

.article__title a:hover {
  color: var(--color-ink);
  background-size: 100% 3px;
}

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

.article__category {
  order: -1;
  display: inline-block;
  margin: 0 0 var(--space-sm);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-ink-soft);
}

.article__category a {
  color: var(--color-accent-dark);
  text-decoration: none;
}

.article__category a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.article__date {
  margin: auto 0 0;
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-line);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-soft);
}

/* První článek ve výpisu jako velký */

.articles .article:first-child {
  border-left-width: 8px;
}

.articles .article:first-child .article__title {
  font-size: var(--text-xl);
}

/* Karty v sekcích bottom */

.bottom {
  margin-top: var(--space-2xl);
}

.bottom__title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: 0 0 var(--space-lg);
  font-size: var(--text-xl);
  font-weight: 800;
}

.bottom__title::after {
  content: "";
  flex: 1;
  height: 4px;
  background: var(--gradient-rail);
  background-size: 100% 100%;
  opacity: 0.5;
}

.bottom__title a {
  display: inline-block;
  padding: var(--space-2xs) var(--space-md);
  background: var(--color-surface-dark);
  color: var(--color-ink-invert);
  text-decoration: none;
  clip-path: var(--cut-corner-sm);
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease;
}

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

.bottom__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.bottom--similar {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: var(--border-strong);
}

/* Animace karet (script.js) */

.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-base) ease, border-left-color var(--duration-base) ease;
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.js-reveal.is-visible:hover {
  transform: translateY(-5px);
}

/* ==========================================================================
   Detail článku
   ========================================================================== */

.text {
  background: var(--color-surface);
  border: var(--border-thin);
  border-top: 6px solid var(--color-accent);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.text__title {
  margin-bottom: var(--space-lg);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1.05;
}

.text__cover {
  margin: 0 calc(var(--space-md) * -1) var(--space-xl);
}

.text__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.text__body {
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

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

.text__body h2 {
  position: relative;
  margin: var(--space-2xl) 0 var(--space-md);
  padding-left: var(--space-md);
  font-size: var(--text-xl);
  border-left: 8px solid var(--color-accent);
}

.text__body h3 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-lg);
  color: var(--color-primary);
}

.text__body h4 {
  margin: var(--space-lg) 0 var(--space-sm);
  font-size: var(--text-md);
}

.text__body p {
  margin-bottom: var(--space-lg);
}

.text__body a {
  color: var(--color-link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}

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

.text__body ul,
.text__body ol {
  margin: 0 0 var(--space-lg);
  padding-left: var(--space-xl);
}

.text__body li {
  margin-bottom: var(--space-xs);
}

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

.text__body ol li::marker {
  color: var(--color-primary);
  font-weight: 700;
}

.text__body blockquote {
  margin: var(--space-xl) 0;
  padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-xl);
  background: var(--color-bg);
  border-left: 8px solid var(--color-signal);
  font-size: var(--text-md);
  font-style: italic;
}

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

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

.text__body figure {
  margin: var(--space-xl) 0;
}

.text__body figcaption {
  padding-top: var(--space-xs);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.text__body iframe {
  margin: var(--space-lg) 0;
  border: 0;
}

.text__body code {
  padding: 0.1em 0.4em;
  background: var(--color-bg-alt);
  font-size: 0.9em;
}

.text__body pre {
  padding: var(--space-md);
  background: var(--color-surface-darker);
  color: var(--color-ink-invert);
  overflow-x: auto;
}

.text__body hr {
  height: 6px;
  margin: var(--space-2xl) 0;
  background: var(--gradient-rail);
  border: 0;
  opacity: 0.4;
}

/* Tabulky – text zarovnaný vždy doleva */

.text__body table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: var(--space-xl) 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.text__body table thead th {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-dark);
  color: var(--color-ink-invert);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  border-bottom: 4px solid var(--color-accent);
}

.text__body table tbody td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-line);
}

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

.text__body table tbody tr:hover {
  background: var(--color-accent-soft);
}

/* Obsah článku */

.table-of-content {
  margin: 0 0 var(--space-xl);
  padding: var(--space-lg);
  background: var(--color-bg);
  border: var(--border-strong);
  box-shadow: var(--shadow-block-sm);
}

.table-of-content > span {
  display: block;
  margin-bottom: var(--space-sm);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.table-of-content ul,
.table-of-content ol {
  margin: 0;
  padding-left: var(--space-lg);
}

.table-of-content li {
  margin-bottom: var(--space-2xs);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

.table-of-content a {
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
}

.table-of-content a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* Meta informace */

.text__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-2xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg);
  border-top: 4px solid var(--color-line-strong);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-ink-soft);
}

.text__info p {
  margin: 0;
}

.text__info a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.text__info a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* Autor */

.text--author .text__body img.author {
  float: left;
  width: 140px;
  height: 140px;
  margin: 0 var(--space-lg) var(--space-md) 0;
  object-fit: cover;
  border: 4px solid var(--color-surface-dark);
  box-shadow: var(--shadow-block-sm);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  min-width: 0;
  padding: var(--space-lg);
  background: var(--color-surface-dark);
  color: var(--color-ink-invert);
  border-top: 6px solid var(--color-signal);
}

.sidebar h3 {
  position: relative;
  margin: var(--space-xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-ink-invert);
  letter-spacing: var(--tracking-wide);
}

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

.sidebar h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  background: var(--color-accent);
}

.sidebar a {
  color: var(--color-ink-invert);
  text-decoration: none;
}

.sidebar a:hover {
  color: var(--color-signal);
}

.sidebar ul {
  list-style: none;
}

.sidebar .nav li,
.sidebar .authors li {
  border-bottom: 1px solid var(--color-primary);
}

.sidebar .nav a,
.sidebar .authors a {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  transition: padding-left var(--duration-base) var(--ease-out), color var(--duration-fast) ease;
}

.sidebar .nav a:hover,
.sidebar .authors a:hover {
  padding-left: var(--space-sm);
}

.sidebar .nav svg,
.sidebar .authors svg,
.sidebar .tags svg,
.sidebar .promo svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  stroke: var(--color-accent);
}

.sidebar .article {
  margin-bottom: var(--space-md);
  background: var(--color-surface-darker);
  border: 1px solid var(--color-primary);
  border-left: 4px solid var(--color-accent);
  box-shadow: none;
}

.sidebar .article__title {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-base);
}

.sidebar .article__title a {
  color: var(--color-ink-invert);
  background-image: none;
}

.sidebar .article__title a:hover {
  color: var(--color-signal);
}

.sidebar .article__image img {
  aspect-ratio: 16 / 9;
}

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

.sidebar .tags a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--color-ink-invert-soft);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  clip-path: var(--cut-corner-sm);
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.sidebar .tags a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-surface-darker);
}

.sidebar .promo li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-primary);
  font-size: var(--text-sm);
}

.sidebar .promo a {
  color: var(--color-signal);
  text-decoration: underline;
}

/* Spodní sidebar */

.prefooter {
  background: var(--color-surface-dark);
  border-top: 6px solid var(--color-accent);
}

.prefooter__inner.sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2xl) var(--container-pad);
  border-top: 0;
}

.prefooter .similar {
  min-width: 0;
}

/* ==========================================================================
   Stránkování
   ========================================================================== */

.pagination {
  margin-top: var(--space-2xl);
}

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

.pagination li {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--color-ink-soft);
}

.pagination li a,
.pagination li.pagination__active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-md);
  background: var(--color-surface);
  border: var(--border-strong);
  color: var(--color-ink);
  text-decoration: none;
  transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.pagination li a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-surface-darker);
  transform: translateY(-2px);
}

.pagination li.pagination__active {
  background: var(--color-surface-dark);
  border-color: var(--color-surface-dark);
  color: var(--color-ink-invert);
  box-shadow: var(--shadow-block-sm);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  margin-top: auto;
  background: var(--color-surface-darker);
  color: var(--color-ink-invert-soft);
  border-top: 6px solid var(--color-signal);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

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

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

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

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

/* ==========================================================================
   Popup
   ========================================================================== */

.popup {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  left: var(--space-md);
  z-index: 950;
  display: none;
  max-width: 420px;
  margin-left: auto;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: var(--border-strong);
  box-shadow: var(--shadow-block);
}

.popup #close {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--color-surface-dark);
  border: 0;
  color: var(--color-ink-invert);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--duration-fast) ease;
}

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

/* ==========================================================================
   Responzivita – tablet
   ========================================================================== */

@media (min-width: 600px) {
  :root {
    --container-pad: 1.5rem;
  }

  .search-form form {
    flex-direction: row;
  }

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

  .articles .article:first-child {
    grid-column: 1 / -1;
  }

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

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

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

  .text__cover {
    margin: 0 calc(var(--space-xl) * -1) var(--space-xl);
  }

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

  .text__info {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-xl);
  }
}

/* ==========================================================================
   Responzivita – mobil (menu)
   ========================================================================== */

@media (max-width: 767px) {
  .header__toggle {
    display: flex;
  }

  .header .nav {
    display: none;
  }

  .tray {
    display: none;
  }

  .text__title {
    font-size: var(--text-xl);
  }

  .page-title {
    font-size: var(--text-xl);
  }
}

@media (min-width: 768px) {
  .smallnav {
    display: none !important;
  }
}

/* ==========================================================================
   Responzivita – desktop
   ========================================================================== */

@media (min-width: 992px) {
  :root {
    --container-pad: 2rem;
  }

  .main__inner {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    align-items: start;
  }

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

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

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

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

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

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

  .text__title {
    font-size: var(--text-3xl);
  }

  .text__body {
    font-size: var(--text-md);
  }

  .article:nth-child(even) {
    margin-top: 0;
  }
}

@media (min-width: 1200px) {
  .article__body {
    padding: var(--space-lg) var(--space-lg) var(--space-lg);
  }
}

/* Omezení pohybu */

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

  .js-reveal {
    opacity: 1;
    transform: none;
  }
}

/* pojistka: obsah nesmí zůstat neviditelný, když se nenačte nebo spadne script.js (doplněno při nasazení šablony) */
html:not(.js) .js-reveal,
html.js-shown .js-reveal{ opacity:1 !important; visibility:visible !important; transform:none !important; }
