:root {
  --color-primary: #2159a0;
  --color-primary-dark: #163e73;
  --color-accent: #4fc3f7;
  --color-text: #222222;
  --color-text-muted: #666666;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-border: #e3e7ee;

  --font-main: "Source Sans Pro", Arial, sans-serif;

  /* --- Rozostupy / tvary --- */
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 40, 80, 0.08);
  --shadow-hover: 0 6px 18px rgba(20, 40, 80, 0.14);
  --max-width: 650px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  text-align: center;
}

header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  padding: clamp(16px, 3vw, 26px) clamp(16px, 4vw, 32px);
}

header h1 {
  margin: 0 0 14px 0;
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 600;
  letter-spacing: 0.2px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  text-align: left;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 16.5px;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.25s ease, background 0.25s ease, text-shadow 0.25s ease;
}

nav ul li a:hover,
nav ul li a:focus,
nav ul li a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

nav ul li.has-dropdown > a::after {
  content: " \25BE";
  font-size: 11px;
  opacity: 0.8;
}

nav ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-primary-dark);
  min-width: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  padding: 6px;
  z-index: 20;
}

nav ul li:hover > ul,
nav ul li:focus-within > ul {
  display: block;
}

nav ul li ul li a {
  padding: 10px 14px;
  white-space: normal;
  border-radius: 6px;
}

main {
  width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(16px, 5vw, 40px);
  text-align: left;
  margin: clamp(20px, 5vw, 40px) auto;
  max-width: min(1300px, 100%);
}

main p.zvyraznene {
  font-size: 1.25em;
}

main h2 {
  margin-top: 0;
  color: var(--color-primary);
  font-weight: 700;
  font-size: clamp(35px, 2.4vw, 25px);
  text-align: center;
}

main h2:not(:first-child) {
  margin-top: 1.6em;
}

h3 {  
  font-weight: 600;
  font-size: clamp(30px, 2.4vw, 25px);
  text-align: left;
  color: var(--color-primary-dark);
}

main a {
  color: var(--color-primary);
}

main ul {
  padding-left: 22px;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.6em 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
 
main table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  min-width: 560px;
}
 
main table caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  color: var(--color-primary-dark);
  padding: 10px 14px;
}
 
main th,
main td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}
 
main th {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  white-space: nowrap;
}
 
main tbody tr:nth-child(even) {
  background: var(--color-bg);
}
 
main tbody tr:last-child td {
  border-bottom: none;
}
 
main td .meta {
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  color: var(--color-text-muted);
  line-height: 1.5;
}
 
main td.num {
  text-align: center;
  white-space: nowrap;
}

.goals-row {
  display: flex;
  flex-wrap: wrap;
  margin: 1.8em 0;
}
 
.goal-item {
  flex: 1 1 0;
  min-width: 140px;
  padding: 0 20px;
  text-align: center;
  border-left: 1px solid var(--color-border);
}
 
.goal-item:first-child {
  border-left: none;
  padding-left: 0;
}
 
.goal-item:last-child {
  padding-right: 0;
}
 
.goal-number {
  display: block;
  font-size: 2.6em;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 10px;
}
 
.goal-text {
  font-size: 0.95em;
  color: var(--color-text);
}

/* =========================
   ZOZNAM UČEBNÍC
   ========================= */
.book-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1.6em 0;
}
 
.book-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 36px);
  padding: 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}
 
.book-item:hover,
.book-item:focus-visible {
  background-color: #eeeeee;
}
 
.book-cover {
  flex: 0 0 auto;
  width: 120px;
  height: 171px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
 
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
 
.book-info {
  flex: 1 1 auto;
  padding-right: 32px;
}
 
.book-title {
  color: var(--color-primary);
  font-size: 1.3em;
  font-weight: 700;
  margin: 0 0 6px 0;
}
 
.book-author {
  color: var(--color-text-muted);
  font-size: 0.95em;
}

.book-source {
  margin: 4px 0 0 0;
  font-size: 0.9em;
  font-style: italic;
  color: var(--color-primary-dark);
}

/* Ikony v pravom hornom rohu */
.book-item[href^="http"]::after,
.book-item[href$=".pdf" i]::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  background-color: var(--color-text-muted);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  transition: background-color 0.2s ease;
}

.book-item[href^="http"]::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E");
}

.book-item[href$=".pdf" i]::after {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='9' y1='13' x2='15' y2='13'/%3E%3Cline x1='9' y1='17' x2='15' y2='17'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='9' y1='13' x2='15' y2='13'/%3E%3Cline x1='9' y1='17' x2='15' y2='17'/%3E%3C/svg%3E");
}

.book-item:hover::after,
.book-item:focus-visible::after {
  background-color: var(--color-primary);
}

/* =========================
   VYHĽADÁVANIE A TLAČIDLÁ
   ========================= */
.search-box {
  margin: 1.2em 0 1.6em 0;
  text-align: center;
}

.search-box input {
  width: 100%;
  max-width: 520px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1em;
  color: var(--color-text);
  background: #eeeeee;
  border: 2px solid transparent;
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease;
}

.search-box input::placeholder {
  color: var(--color-text-muted);
}

.search-box input:focus {
  border-color: var(--color-primary);
}

.book-item.is-hidden {
  display: none;
}

.search-empty {
  text-align: center;
  color: var(--color-text-muted);
  margin: 1.6em 0;
}

.external-link {
  margin: 2em auto;
  text-align: center;
}

.btn-outline {
  display: inline-block;
  padding: 16px 44px;
  font-size: 1.25em;
  background: #ffffff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--color-primary);
  color: #ffffff;
}

.external-link p {
  margin: 16px 0 0 0;
  padding: 0 16px;
  text-align: center;
  color: var(--color-text-muted);
}

/* =========================
   FOOTER
   ========================= */
footer {
  text-align: center;
  padding: 22px 16px;
  font-size: 14px;
  color: var(--color-text-muted);
}


/* ===================================================
   RESPONZÍVNE ÚPRAVY (@media queries)
   =================================================== */

@media (max-width: 850px) {
  nav ul {
    justify-content: center;
  }
  
  nav ul li ul {
    position: static;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.15);
    margin-top: 4px;
    min-width: 100%;
  }
}

@media (max-width: 700px) {
  /* Zloženie cieľov projektu pod seba */
  .goals-row {
    flex-direction: column;
  }
 
  .goal-item {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 20px 0;
  }
 
  .goal-item:first-child {
    border-top: none;
    padding-top: 0;
  }

  /* Zloženie kníh (obrázok nad text) pre lepšiu čitateľnosť na mobile */
  .book-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-info {
    padding-right: 0;
  }

  .book-cover {
    width: 130px;
    height: 185px;
  }
}

@media (max-width: 480px) {
  header {
    padding: 16px 12px;
  }

  header h1 {
    font-size: 20px;
  }
 
  nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  nav ul li a {
    font-size: 14.5px;
    padding: 8px 12px;
    text-align: center;
  }
 
  main {
    width: 100%;
    padding: 0 12px;
  }
 
  main h2 {
    font-size: 21px;
  }

  h3 {
    font-size: 22px;
  }

  .btn-outline {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1em;
  }

  .search-box input {
    padding: 10px 16px;
    font-size: 0.95em;
  }
}