/* ==========================================================
   main.css — sjednocený základ pro pralesy.cz
   ----------------------------------------------------------
   Obsahuje: proměnné, typografii, grid, tlačítka, karty, TOC
   Ostré rohy, klidné barvy, čistý layout
   ========================================================== */

/* === PROMĚNNÉ === */
:root {
  --fg: #0b2e13;          /* hlavní text */
  --acc: #2e7d32;         /* akcentní zeleň */
  --ink: #1b1b1f;         /* tělový text */
  --muted: #475569;       /* sekundární text */
  --bg: #ffffff;          /* pozadí */
  --bg-alt: #f6f8f6;      /* alternativní pozadí sekce */
  --maxw: 1200px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* === ZÁKLAD === */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* === TYPOGRAFIE === */
h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  margin: 0 0 1rem;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 2.4vw + 1rem, 3rem); line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 1.6vw + 1rem, 2.2rem); line-height: 1.2; }
h3 { font-size: 1.25rem; line-height: 1.25; }

p { margin: 0 0 1rem; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === KONTEJNER === */
.container {
  width: min(100%, var(--maxw));
  margin-inline: auto;
  padding-inline: 1rem;
}
.section {
  padding: 4rem 0;
  scroll-margin-top: 2rem;
}
.section--alt {
  background: var(--bg-alt);
}

/* === GRIDY === */
.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.text-center {
  text-align: center;
}

/* === TLAČÍTKA === */
.btn {
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1rem;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.btn--primary:hover {
  background: #1e6023;
}
.btn--ghost {
  border: 1px solid var(--acc);
  color: var(--acc);
  background: transparent;
}
.btn--ghost:hover {
  background: var(--acc);
  color: #fff;
}

/* === KARTY === */
.card {
  background: #fff;

  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(0,0,0,0.12);
}
.card__header {
  display: flex;
  justify-content: flex-end;
  border-bottom: 2px solid tomato;
  margin-bottom: 0.5rem;
}
.card__category-overlay {

  top: 0.75rem;
  right: 0.75rem;
  background: var(--accent-color, #3b82f6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  backdrop-filter: blur(2px);
   position: relative;
  overflow: hidden;
  background: #fff;
}
.card__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
}
.card__media {
  aspect-ratio: 16/9;
  background: #f5f6f7;
  overflow: hidden;
  position: relative;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card__body {
  padding: 1rem 1.25rem;
}
.card__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.card__excerpt {
  color: var(--muted);
  font-size: 0.95rem;
}

/* === TOC / OSNOVA === */
.toc-box {
  background: #f8f9fa;
  border: 1px solid #ddd;
  padding: 1rem;
  position: sticky;
  top: 2rem;
}
.toc-box h3 {
  margin-top: 0;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--acc);
  margin-bottom: 0.75rem;
}
.toc-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-box a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: #333;
  transition: all 0.2s ease;
}
.toc-box a:hover {
  background: #e6f0f8;
  color: var(--acc);
}
.toc-box a.is-active {
  background: var(--acc);
  color: #fff;
  font-weight: 600;
}

/* === MEDIA === */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === ACCESSIBILITY === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* Site-main varianty */
.site-main--o-nas,
.site-main--gallery,
.site-main--fotogalerie,
.site-main--historie,
.site-main--lide,
.site-main--lokality,
.site-main--metody,
.site-main--archive {
  background: var(--bg);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  font-size: 1rem;
}
.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid #ddd;
  color: var(--ink);
  text-decoration: none;
}
.pagination a:hover {
  background: var(--acc);
  color: #fff;
}
.pagination .current {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
/* === RESPONSIVITA === */
@media (max-width: 900px) {
  .section { padding: 2.5rem 0; }
  .card__body { padding: 0.9rem 1rem; }
}

.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.single-sidebar {
  position: sticky;
  top: 2rem;
}

.single-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.single-toc a {
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
}

.single-toc a.is-active {
  font-weight: 600;
  color: var(--acc);
}

@media (max-width: 768px) {
  .single-grid {
    grid-template-columns: 1fr;
  }
  .single-sidebar {
    position: static;
  }
}
/* === LAYOUT OBSAHU === */
.single-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.single-obsah {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.6;
}
.single-kapitola {
  min-width: 0;
  scroll-margin-top: 2rem;
}
.single-kapitola[hidden] {
  display: none;
}
.single-obsah .wp-block-table {
  overflow-x: auto;
}
.single-obsah table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}
.single-obsah th,
.single-obsah td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.single-obsah td a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.single-sidebar {
  position: sticky;
  top: 2rem;
}

/* === OSNOVA (TOC) === */
.single-osnova {
  padding: 1rem;
  background: #f8f9fa;
  border: 1px solid #ddd;
}
.single-osnova h3 {
  margin-top: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 2px solid var(--acc);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.single-osnova h3 a {
  color: inherit;
  display: block;
  padding: 0;
  text-decoration: none;
}
.single-osnova h3 a:hover,
.single-osnova h3 a.is-active {
  background: transparent;
  color: var(--acc);
}
.single-osnova ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.single-osnova li {
  border-bottom: 1px solid #e5e7eb;
}
.single-osnova a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
}
.single-osnova a:hover {
  background: #e6f0f8;
  color: var(--acc);
}
.single-osnova a.is-active {
  background: var(--acc);
  color: #fff;
  font-weight: 600;
}

/* === MINI MAPA V SIDEBARU === */
.single-sidebar__mapa .mapa-lokalita {
  width: 100%;
  height: 297px;
  border: 1px solid #ccc;
  overflow: hidden;
}

.mapa-single {
  width: 100%;
  height: 320px;
  border: 1px solid #ccc;
  overflow: hidden;
}


/* === RESPONSIVITA === */
@media (max-width: 900px) {
  .single-grid {
    grid-template-columns: 1fr;
  }
  .single-sidebar {
    position: static;
    top: 0;
    margin-top: 2rem;
  }
}
.breadcrumbs {
  font-size: 0.9rem;
  margin: 1.5rem 0;
  color: #555;
}

.breadcrumbs a {
  color: var(--fg);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs__sep {
  color: #999;
  margin: 0 0.25rem;
}

.breadcrumbs__current {
  color: #999;
}

.single-related-auto {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.related-cards {
  border-top: 1px solid #d8e2dc;
  padding-top: 1.25rem;
}

.related-cards__title {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.related-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.related-card {
  border: 1px solid #d8e2dc;
  background: #fff;
  min-width: 0;
}

.related-card__link {
  color: inherit;
  display: grid;
  height: 100%;
  text-decoration: none;
}

.related-card__link:hover {
  text-decoration: none;
}

.related-card__media {
  aspect-ratio: 16 / 9;
  background: #eef3ef;
  overflow: hidden;
}

.related-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.related-card__link:hover .related-card__media img {
  transform: scale(1.03);
}

.related-card__body {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
}

.related-card__type {
  color: var(--acc);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.related-card__heading {
  color: var(--fg);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.related-card__excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.relation-context {
  border-top: 1px solid #d8e2dc;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
}

.relation-context__title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.relation-context__groups {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.relation-context__group {
  min-width: 0;
}

.relation-context__label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.relation-context__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.relation-context__link {
  border: 1px solid #d8e2dc;
  color: var(--fg);
  display: inline-block;
  font-size: 0.92rem;
  line-height: 1.25;
  padding: 0.38rem 0.55rem;
  text-decoration: none;
}

.relation-context__link:hover {
  background: #e7f5ec;
  border-color: var(--acc);
  text-decoration: none;
}

.publication-meta {
  border: 1px solid #d8e2dc;
  background: #f8faf8;
  margin-bottom: 2rem;
  padding: 1.25rem;
}

.publication-meta h2 {
  margin-top: 0;
}

.publication-meta__citation {
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  margin: 0 0 1rem;
}

.publication-meta__list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.publication-meta__item {
  display: grid;
  gap: 0.25rem;
  grid-template-columns: minmax(120px, 0.3fr) 1fr;
}

.publication-meta__item dt {
  color: var(--muted);
  font-weight: 700;
}

.publication-meta__item dd {
  margin: 0;
}

.publication-attachments {
  border: 1px solid #d8e2dc;
  background: #fff;
  margin-bottom: 2rem;
  padding: 1.25rem;
}

.publication-attachments h2 {
  margin-top: 0;
}

.publication-attachments__list {
  display: grid;
  gap: 0.75rem;
}

.publication-attachment__link {
  align-items: center;
  border: 1px solid #d8e2dc;
  color: var(--fg);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(64px, max-content) 1fr;
  padding: 0.85rem 1rem;
  text-decoration: none;
}

.publication-attachment__link:hover {
  border-color: var(--acc);
}

.publication-attachment__type {
  background: #e7f5ec;
  color: #1f6b3a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  text-align: center;
  text-transform: uppercase;
}

.publication-attachment__title {
  font-weight: 700;
  line-height: 1.35;
}

.data-request-form {
  background: #fff;
  border: 1px solid #d8e2dc;
  padding: 1.25rem;
}

.data-request-form h2,
.data-request-form__title {
  color: var(--fg);
  font-size: clamp(1.35rem, 1.1vw + 1rem, 1.8rem);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.data-request-form__intro,
.data-request-form__message,
.data-request-form__conditions {
  color: var(--muted);
}

.data-request-form__conditions {
  background: #f8faf8;
  border: 1px solid #d8e2dc;
  margin: 1rem 0;
  padding: 1rem;
}

.data-request-form__conditions h3 {
  color: var(--fg);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.data-request-form__message {
  background: #f3faf5;
  border: 1px solid #d8e2dc;
  padding: 0.75rem;
}

.data-request-form__fields {
  display: grid;
  gap: 1rem;
}

.data-request-form__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.data-request-form label {
  color: var(--fg);
  display: grid;
  font-weight: 700;
  gap: 0.35rem;
}

.data-request-form input[type="text"],
.data-request-form input[type="email"],
.data-request-form textarea {
  border: 1px solid #cfd8d1;
  font: inherit;
  padding: 0.65rem 0.7rem;
  width: 100%;
}

.data-request-form textarea {
  resize: vertical;
}

.data-request-form__agreement {
  align-items: start;
  display: flex;
  flex-direction: row;
  font-weight: 400;
}

.data-request-form__agreement input {
  margin-top: 0.2rem;
}

.data-request-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.data-request-form__trap {
  left: -9999px;
  position: absolute;
}

@media (max-width: 640px) {
  .publication-meta__item {
    grid-template-columns: 1fr;
  }

  .publication-attachment__link {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .data-request-form__grid {
    grid-template-columns: 1fr;
  }
}

