/* =================================================================
   1. ROOT PREMENNÉ A GLOBÁTNY ZÁKLAD
================================================================= */
:root {
  /* Farebná paleta: Teplý papier, hlboké tóny a knižná elegancia */
  --bg-main: #fbf9f5;          /* Jemne tónované biele pozadie (pripomína papier) */
  --bg-section: #f3efe6;     /* Mäkký krémový odtieň pre sekcie a zvýraznenie */
  --bg-article: #ffffff;
  
  --text-primary: #2d3136;   /* Hlboká bridlicovo-sivá pre špičkovú čitateľnosť */
  --text-secondary: #5c636d; /* Jemnejšia sivá pre sekundárne texty */
  
  --green-primary: #1f3a32;  /* Elegantná lesná zelená */
  --green-hover: #12241e;    /* Tmavší odtieň zelenej pri hoveri */
  --green-dark: #1b2a4a;     /* Hlboká polnočná modrá pre kontrastné prvky */
  --text-green: #1f3a32;

  --accent-gold: #b8860b;    /* Bohatá a hrejivá zlatá (DarkGoldenrod) */
  --accent-beige: #e9e0cb;   /* Výraznejší béžový tón pre aktívne stavy */

  --neutral-border: #e0d8cc; /* Jemná, prirodzená linka pre ohraničenia */
  --neutral-light: #f7f5f0;
  --neutral-border-soft: #ffffff;

  /* Nová typografia – Knižná klasika (Serif nadpisy + Sans-Serif text) */
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", "Segoe UI", sans-serif;
  
  --radius: 12px;            /* Modernejší, oblejší vzhľad rohov */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Plynulejší prechod */
  
  /* Hlbšie, vrstvené tiene pre moderný 3D efekt */
  --shadow: 0 4px 16px -2px rgba(45, 49, 54, 0.06), 0 2px 4px -2px rgba(45, 49, 54, 0.04);
  --shadow-hover: 0 12px 28px -4px rgba(45, 49, 54, 0.12), 0 4px 8px -2px rgba(45, 49, 54, 0.06);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-main);
  font-size: 1rem;         
  line-height: 1.7;   
}

a {
  color: var(--green-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-gold);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 3px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--accent-gold);
  margin-top: 0;
  margin-bottom: 0.6em;
  line-height: 1.25;
}

h1 {
  font-size: 2.4rem;     /* ~38 px */
  text-align: center;
  letter-spacing: 0.4px;
}

h2 {
  font-size: 1.9rem;     /* ~30 px */
  letter-spacing: 0.3px;
  margin-top: 1.8rem;
}

h3 {
  font-size: 1.45rem;    /* ~23 px */
  letter-spacing: 0.2px;
  margin-top: 1.4rem;
}

h4 {
  font-size: 1.2rem;     /* ~19 px */
  margin-top: 1.2rem;
}

p {
  margin-bottom: 1.1em;
  font-size: 1rem;       
  line-height: 1.7;
}

small {
  font-size: 0.875rem;
}

section {
  margin-bottom: 2.5rem;
}

ul, ol {
  margin: 0.4rem 0 1.2rem 1.4rem;
  padding: 0;
}
ul li, ol li {
  margin: 0.25rem 0;
  line-height: 1.7;
  font-size: 1rem;
}

/* =================================================================
   2. HLAVIČKA A NAVIGÁCIA
================================================================= */
.site-header {
    text-align: center;
}

header {
    overflow: visible !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding-bottom: 16px;
}

.header-top {
    padding-top: 20px;
}

.hamburger {
    display: none;
    cursor: pointer;
    width: 40px;
    height: 32px;
    margin: 12px auto 0 auto;
    padding: 0;
    border: none;
    background: none;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 4px;
    margin: 6px 0;
    background-color: var(--green-dark);
    border-radius: 3px;
    transition: 0.3s ease;
}

.nav-wrapper {
    margin-top: 15px;
}

nav {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-container {
    display: flex;
    gap: 18px;
    transition: max-height 0.35s ease-in-out;
    overflow: hidden;
    max-height: 1000px;
}

.nav-container a {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all var(--transition);
}

.nav-container a:hover {
    background-color: var(--accent-beige);
    color: var(--accent-gold);
    transform: translateY(-2px);
}

.nav-container a.active {
    background-color: var(--accent-beige);
    color: var(--accent-gold);
    transform: translateY(-2px);
}

/* =================================================================
   3. HLASNÝ OBSAH, KARTY A SEKCIE
================================================================= */
main {
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    background-color: var(--bg-article);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.6s ease-in;
    font-size: 1.05rem;
    line-height: 1.7;
}

main a {
  color: var(--green-primary);
  text-decoration: underline;
  transition: color var(--transition);
}

main a:hover {
  color: var(--accent-gold);
}

main p {
  margin-bottom: 1.1em;
}

main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 25px auto;
  border-radius: 6px;
}

#cardGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 30px;
}

#cardGrid.list {
  grid-template-columns: 1fr;
}

.card {
  background-color: var(--bg-article);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  font-size: 1rem;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

#cardGrid.list .card {
  box-shadow: none;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--neutral-border);
  padding: 18px 0;
  transform: none;
}

.card .badge {
  display: inline-block;
  background-color: var(--accent-gold);
  color: white;
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 12px;
  font-family: var(--font-sans);
}

.card .title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-gold);
  transition: color var(--transition);
  font-family: var(--font-serif);
}

.card .quote {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 1rem;
  font-family: var(--font-serif);
}

.card .source {
  color: var(--text-green);
  font-size: 0.95rem;
  display: none;
}

#controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 25px;
  font-family: var(--font-sans);
  font-size: 1rem;
  background-color: var(--bg-article);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 14px 0px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  z-index: 50;
}

#controls input,
#controls select,
#controls button {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-article);
  border: 1px solid var(--neutral-border);
  border-radius: var(--radius);
  transition: border var(--transition), box-shadow var(--transition);
  font-size: 1rem;
}

#controls input:focus,
#controls select:focus,
#controls button:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(31,58,50,0.2);
}

.hidden { display: none; }
.highlight { background-color: var(--bg-section); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   4. ŠPECIÁLNE SEKCIE A DROPDOWN
================================================================= */
.svetlo-rocnik .rocnik-uvod {
  margin-bottom: 2.5rem;
}

.svetlo-rocnik .rocnik-uvod h1 {
  margin-bottom: 1rem;
}

.svetlo-rocnik .vydania h2 {
  margin-bottom: 1.5rem;
}

.svetlo-rocnik ol {
  padding-left: 1.4rem;
  margin-left: 0;
}

.svetlo-rocnik ol li {
  margin-bottom: 1rem;
  padding-left: 0.2rem;
  line-height: 1.6;
}

.svetlo-rocnik ol li u {
  font-weight: 600;
  text-decoration: none;
}

.svetlo-rocnik .navigacia-spat {
  margin-top: 3rem;
  font-size: 0.95rem;
}

.custom-dropdown {
  position: relative;
  width: 100%;
  max-width: 280px;
  font-size: 1rem;
  cursor: pointer;
}

.dropdown-selected {
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--neutral-border);
  border-radius: 6px;
  transition: 0.2s ease;
}

.dropdown-selected:hover {
  border-color: var(--accent-gold);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--neutral-border);
  border-radius: 6px;
  margin-top: 4px;
  padding: 0;
  list-style: none;
  display: none;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.dropdown-options li {
  padding: 12px 16px;
  transition: 0.15s ease;
  font-size: 1rem;
}

.dropdown-options li:hover {
  background: var(--bg-section);
}

.article-content ul {
  margin: 0.4rem 0 1.1rem 1.4rem;
  padding: 0;
}

.article-content ul li {
  margin: 0.2rem 0;
  line-height: 1.55;
  padding-left: 0.2rem;
}

.article-content p + ul {
  margin-top: 0.3rem;
}

.article-content ul + p {
  margin-top: 0.6rem;
}

.article-content ul ul {
  margin-left: 1.2rem;
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}

.article-content img,
.book-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
}

/* =================================================================
   5. VYHLEDÁVANIE A BREADCRUMBS
================================================================= */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    padding-left: 0;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.breadcrumb a {
    color: var(--green-primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb .sep {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.85rem;
}

.search-container {
    max-width: 1200px;
    margin: 30px auto 0 auto;
    padding: 0;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.search-container .search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-container .search-form input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-article);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-container .search-form input[type="text"]:focus {
    border-color: var(--green-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31,58,50,0.15);
}

.search-container .search-form button {
    padding: 12px 18px;
    background: var(--green-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-container .search-form button:hover {
    background: var(--accent-gold);
}

.search-container .result-count {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-container .result-item {
    border: 1px solid var(--neutral-border);
    padding: 18px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--bg-article);
}

.search-container .result-item:hover {
    background: var(--bg-section);
    box-shadow: var(--shadow-hover);
}

.search-container .result-item h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.search-container .result-item a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.search-container .result-item a:hover {
    color: var(--green-hover);
}

.search-container .result-item .snippet {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
}

.btn-back {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 18px;
    background: var(--accent-gold);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    background: var(--green-hover);
}

#noResults {
  text-align: center;
  margin: 40px auto;
  width: 100%;
  color: var(--green-dark);
}

#resultCount {
  text-align: center;
  color: var(--green-primary);
}

.news {
  padding: 0px 0px;
  margin: 40px 0;
  box-shadow: var(--shadow);
  font-family: var(--font-sans);
  line-height: 1.7;
  color: var(--text-primary);
}

.news h3 {
  font-size: 1.55rem;
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.news .date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-style: italic;
}

.news p {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.7;
}

.news ul {
  margin: 0.6rem 0 1.4rem 1.4rem;
  padding: 0;
  list-style-position: outside;
}

.news ul li {
  margin: 0.3rem 0;
  line-height: 1.55;
  color: var(--text-primary);
}

.news a {
  color: var(--green-primary);
  position: relative;
  text-decoration: underline;
  transition: color var(--transition);
}

.news a:hover {
  color: var(--accent-gold);
}

.rocniky {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.rocniky li a {
    display: block;
    padding: 0.3rem 0.6rem;
    background: var(--bg-section);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.rocniky li a:hover {
    background: var(--accent-beige);
    color: var(--accent-gold);
}

mark {
  background: #fff3a6;
  border-radius: 3px;
  box-shadow: 0 0 0 0px #fff3a6;
  animation: highlightFade 0.4s ease-out;
}

@keyframes highlightFade {
  from {
    background: transparent;
    box-shadow: 0 0 0 0px transparent;
  }
  to {
    background: #fff3a6;
    box-shadow: 0 0 0 0px #fff3a6;
  }
}

footer {
  background-color: var(--neutral-border-soft);
  text-align: center;
  padding: 18px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--neutral-border);
}


/* =================================================================
   6. RESPONSIVITA (MOBIL & TABLET)
================================================================= */

/* Mobil (0 – 600px) */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  main {
    padding: 18px;
    margin: 15px auto;
    border-radius: 8px;
    font-size: 1rem;
  }

  h1 { font-size: 1.9rem; line-height: 1.3; }
  h2 { font-size: 1.55rem; line-height: 1.35; }
  h3 { font-size: 1.25rem; line-height: 1.4; }
  h4 { font-size: 1.1rem; line-height: 1.45; }

  p {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  small {
    font-size: 0.8rem;
  }

  .hamburger {
    display: block;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    max-height: 0;
    overflow: hidden;
    gap: 8px;
  }

  .nav-container.active {
    max-height: 100vh;
    margin-top: 10px;
  }

  .nav-container a {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    font-size: 0.95rem;
  }

  .nav-container a.active {
    background-color: var(--accent-beige);
    color: var(--accent-gold);
  }

  #controls {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
  }

  #controls input,
  #controls select,
  #controls button {
    padding: 12px;
    font-size: 1rem;
  }

  #cardGrid {
    gap: 16px;
  }

  .card {
    padding: 16px;
    border-radius: 8px;
  }

  .card .title,
  .card .quote,
  .card .source {
    font-size: 1rem;
  }

  .card .badge {
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  footer {
    padding: 14px;
    font-size: 0.85rem;
  }

  .no-mobile {
    display: none;
  }

  .search-container .search-form {
    flex-direction: column;
  }

  .search-container .search-form button {
    width: 100%;
  }
}

/* Tablet (601 – 900px) */
@media (min-width: 601px) and (max-width: 900px) {
  html {
    font-size: 17px;
  }

  main {
    font-size: 1rem;
    padding: 28px;
    margin: 20px auto;
    border-radius: 10px;
  }

  h1 { font-size: 2.1rem; line-height: 1.28; }
  h2 { font-size: 1.7rem; line-height: 1.32; }
  h3 { font-size: 1.35rem; line-height: 1.38; }
  h4 { font-size: 1.2rem; line-height: 1.42; }

  p {
    font-size: 1rem;
    line-height: 1.7;
  }

  small {
    font-size: 0.85rem;
  }

  .hamburger {
    display: block;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    max-height: 0;
    overflow: hidden;
    gap: 12px;
  }

  .nav-container.active {
    max-height: 100vh;
    margin-top: 10px;
  }

  .nav-container a {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    font-size: 1rem;
  }

  .nav-container a.active {
    background-color: var(--accent-beige);
    color: var(--accent-gold);
  }

  #controls {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }

  #controls input,
  #controls select,
  #controls button {
    padding: 12px 14px;
    font-size: 1rem;
  }

  #cardGrid {
    gap: 20px;
  }

  .card {
    padding: 20px;
    border-radius: 10px;
  }

  .card .badge {
    font-size: 0.85rem;
    padding: 5px 12px;
  }

  footer {
    padding: 16px;
    font-size: 0.9rem;
  }
}

/* Spoločné pravidlo pre sticky filter na mobiloch a tabletoch (do 900px) */
@media (max-width: 900px) {
  #controls {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: rgba(251, 249, 245, 0.95);
    backdrop-filter: blur(6px);
    padding-top: 12px;
    padding-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border-bottom: 1px solid var(--neutral-border);
  }
}