/* ==========================================================================
   Materská škola Dopravná 60, Levice — stylesheet (v2)
   Light/dark via CSS custom properties + [data-theme="dark"].
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --rose: #C15B67;
  --rose-dark: #A24552;
  --rose-tint: #F6E6E5;
  --sage: #7C9473;
  --sage-tint: #E7EEE1;
  --sun: #E8A93B;
  --sun-tint: #FBF0DC;
  --cream: #FBF6EF;
  --ink: #3A2E2C;
  --ink-soft: #6B5C58;
  --white: #FFFFFF;

  --bg: var(--cream);
  --surface: var(--white);
  --surface-2: #F5EEE6;
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --border: rgba(58, 46, 44, 0.10);
  --hero-grad: linear-gradient(135deg, #C15B67 0%, #A24552 100%);
  --header-bg: var(--white);
  --footer-bg: var(--ink);
  --footer-text: rgba(255, 255, 255, 0.82);
  --footer-muted: rgba(255, 255, 255, 0.55);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(58, 46, 44, 0.08);
  --shadow-lg: 0 18px 44px rgba(58, 46, 44, 0.14);
  --max: 900px;

  color-scheme: light;
}

[data-theme="dark"] {
  --cream: #1D1917;
  --ink: #EFE7E1;
  --ink-soft: #B8A9A2;
  --white: #262120;
  --rose-tint: #3A2629;
  --sage-tint: #253028;
  --sun-tint: #372E1E;

  --bg: #171412;
  --surface: #262120;
  --surface-2: #2E2826;
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --border: rgba(239, 231, 225, 0.12);
  --hero-grad: linear-gradient(135deg, #8F4550 0%, #6E2F39 100%);
  --header-bg: #201C1A;
  --footer-bg: #141110;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}

main { flex: 1 0 auto; }
.site-footer { flex: none; }

h1, h2, h3, .logo-text {
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}

p { margin: 0 0 1em; }
a { color: var(--rose-dark); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--rose); }
[data-theme="dark"] a { color: #E8909A; }
[data-theme="dark"] a:hover { color: #F0AAB1; }

img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 4px; }
/* ---------- Banner ---------- */
.site-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 44px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
  position: relative;
}
.site-banner:hover { filter: brightness(1.06); }
.site-banner .banner-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-banner .banner-close:hover { background: rgba(0, 0, 0, 0.28); }

/* ---------- Header & nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s ease;
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; }
.logo-img { width: 100%; height: 100%; display: block; object-fit: contain; }
.logo-text { font-size: 1.05rem; font-weight: 700; margin: 0; }
.logo-text small {
  display: block;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.theme-toggle:hover { background: var(--rose-tint); border-color: var(--rose); color: var(--rose-dark); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 20px; height: 20px; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: none;
  background: var(--rose-tint);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--rose-dark);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav { max-height: 0; overflow: hidden; transition: max-height .25s ease; background: var(--header-bg); }
.site-nav.open { max-height: 560px; }
.site-nav ul { list-style: none; margin: 0 auto; padding: 4px 20px 16px; max-width: var(--max); }
.site-nav li { border-top: 1px solid var(--border); }
.site-nav li:first-child { border-top: none; }
.site-nav a { display: block; padding: 12px 4px; text-decoration: none; color: var(--text); font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--rose-dark); }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .site-nav { max-height: none; overflow: visible; }
  .site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0 20px 14px; }
  .site-nav li { border-top: none; }
  .site-nav a { padding: 4px 2px; font-size: 0.94rem; }
}

/* ---------- Hero ---------- */
.page-hero {
  background: var(--hero-grad);
  color: #fff;
  padding: 46px 20px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 80% -20%, rgba(255,255,255,0.14), transparent 60%);
  pointer-events: none;
}
.page-hero h1 { color: #fff; font-size: clamp(1.5rem, 5vw, 2.3rem); max-width: 740px; margin: 0 auto; }
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.16);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ---------- Main content ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 36px 20px 10px; }
section { margin-bottom: 40px; }

.lead { font-size: 1.1rem; color: var(--text-soft); }

/* Markdown-rendered prose */
.prose h2 { font-size: 1.35rem; margin-top: 0.2em; }
.prose h3 { font-size: 1.12rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose img { border-radius: var(--radius-md); display: block; margin: 0 auto; }
.prose blockquote {
  margin: 0 0 1em;
  padding: 4px 18px;
  border-left: 4px solid var(--sage);
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* ---------- Cards (generic) ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 24px;
  transition: background-color .25s ease;
}
.card + .card { margin-top: 18px; }

/* Cards block (image + title + text) */
.cards-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: 1fr 1fr; } }
.card-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, background-color .25s ease;
}
.card-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.card-item .card-body { padding: 18px 20px 20px; }
.card-item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card-item p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 0; }

/* Class ("trieda") cards */
.class-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .class-grid { grid-template-columns: 1fr 1fr; } }
.class-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  border-top: 5px solid var(--accent, var(--sage));
  transition: transform .2s ease, box-shadow .2s ease, background-color .25s ease;
}
.class-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.class-card .badge {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent-tint, var(--sage-tint));
  color: var(--accent, var(--sage));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.class-card .badge svg { width: 36px; height: 36px; }
.class-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.class-card .age { color: var(--text-soft); font-weight: 600; font-size: 0.92rem; }
.class-card .teachers { margin-top: 10px; font-size: 0.96rem; }
.class-card .teachers div { margin-bottom: 2px; }

/* Fee table */
.fee-table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.fee-table td, .fee-table th { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.fee-table tr:last-child td { border-bottom: none; font-weight: 700; color: var(--rose-dark); }
[data-theme="dark"] .fee-table tr:last-child td { color: #E8909A; }

/* Document list */
.doc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.doc-item:last-child { border-bottom: none; }
.doc-icon {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  background: var(--rose-tint);
  display: flex; align-items: center; justify-content: center;
}
.doc-icon svg { width: 24px; height: 24px; }
.doc-item h3 { font-size: 1rem; margin: 0 0 4px; }
.doc-item .note { margin: 0; color: var(--text-soft); font-size: 0.9rem; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--rose); color: #fff !important;
  padding: 9px 16px; border-radius: 999px;
  font-weight: 700; font-size: 0.88rem; text-decoration: none; white-space: nowrap;
  border: 0; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--rose-dark); color: #fff !important; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
/* Event / gallery cards */
.event-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .event-grid { grid-template-columns: 1fr 1fr; } }
.event-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex; flex-direction: column; align-items: stretch;
  transition: transform .2s ease, box-shadow .2s ease, background-color .25s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-card .card-head { display: flex; align-items: center; gap: 14px; }
.event-card .badge {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sun); flex: none;
  display: flex; align-items: center; justify-content: center;
}
.event-card .badge svg { width: 24px; height: 24px; color: #fff; }
.event-card h3 { font-size: 1.02rem; margin: 0; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.photo-grid button.photo-thumb {
  padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 10px; overflow: hidden; aspect-ratio: 1 / 1; position: relative;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.photo-thumb:hover img { transform: scale(1.06); }
.photo-thumb .more-count {
  position: absolute; inset: 0; background: rgba(58,46,44,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem;
}

.photo-placeholder {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 26px 16px; text-align: center;
  color: var(--text-soft); font-size: 0.88rem; margin-top: 12px;
}

.map-frame { border: 0; width: 100%; height: 340px; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.map-section { margin-top: 20px; }

.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: none; }
.contact-list svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--rose-dark); }
[data-theme="dark"] .contact-list svg { color: #E8909A; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 34px 20px 24px;
  margin-top: 50px;
  font-size: 0.92rem;
}
.site-footer .footer-inner { max-width: var(--max); margin: 0 auto; }
.site-footer a { color: #fff; }
.site-footer p { margin: 0 0 6px; }
.site-footer .copyright {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.8rem; color: var(--footer-muted);
}

/* Empty state */
.empty-note { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.empty-note svg { width: 46px; height: 46px; margin-bottom: 14px; color: var(--sage); }

/* 404 */
.notfound { text-align: center; padding: 20px 20px 40px; }
.notfound-icon { color: var(--rose); margin-bottom: 12px; }
.notfound-icon svg { width: 60px; height: 60px; }
.notfound-text { color: var(--text-soft); font-size: 1.05rem; margin-bottom: 22px; }

/* ---------- Lightbox modal ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 28px; background: rgba(18, 12, 11, 0.9);
  opacity: 0; visibility: hidden; transition: opacity .25s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-figure { max-width: min(92vw, 1100px); max-height: 88vh; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; transform: scale(0.92); transition: transform .25s ease-in-out; }
.lightbox.open .lightbox-figure { transform: scale(1); }
.lightbox-figure img { max-width: 100%; max-height: 78vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); display: block; }
.lightbox-caption { color: rgba(255,255,255,0.88); font-size: 0.92rem; text-align: center; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-close:hover { background: rgba(255,255,255,0.26); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.14); color: #fff; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox-nav:hover { background: rgba(255,255,255,0.26); }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

/* ---------- Scroll reveal (gated behind .js so content is never hidden if JS fails) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--rose); color: #fff; font-size: 1.2rem; cursor: pointer;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--rose-dark); }

@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-nav { width: 40px; height: 40px; }
}



