/* ==========================================================================
   Materská škola Dopravná 60, Levice — shared stylesheet
   ========================================================================== */

@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');

:root {
  --rose: #C15B67;
  --rose-dark: #A24552;
  --rose-tint: #F6E6E5;
  --cream: #FBF6EF;
  --sage: #7C9473;
  --sage-tint: #E7EEE1;
  --sun: #E8A93B;
  --ink: #3A2E2C;
  --ink-soft: #6B5C58;
  --white: #FFFFFF;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 10px 30px rgba(58, 46, 44, 0.08);
  --max: 900px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* .site-header is not flex-sized (sticky, natural height);
   main grows to fill leftover space; footer sits after it,
   so short pages still push the footer to the bottom. */
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(--ink);
}

p { margin: 0 0 1em; }
a { color: var(--rose-dark); text-decoration-thickness: 1.5px; }
a:hover { color: var(--rose); }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; }

/* ---------- Header & nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid rgba(58,46,44,0.08);
}

.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(--ink);
}

.logo-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg { width: 24px; height: 24px; }

.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(--ink-soft);
}

.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(--white);
}

.site-nav.open { max-height: 480px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 4px 20px 16px;
  max-width: var(--max);
  margin: 0 auto;
}

.site-nav li { border-top: 1px solid rgba(58,46,44,0.06); }
.site-nav li:first-child { border-top: none; }

.site-nav a {
  display: block;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--ink);
  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 banner ---------- */

.page-hero {
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-dark) 100%);
  color: var(--white);
  padding: 42px 20px 46px;
  text-align: center;
}

.page-hero h1 {
  color: var(--white);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  max-width: 720px;
  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.08rem;
  color: var(--ink-soft);
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

.card + .card { margin-top: 18px; }

/* 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(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  border-top: 5px solid var(--accent, var(--sage));
}

.class-card .badge {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-tint, var(--sage-tint));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.class-card .badge svg { width: 30px; height: 30px; }

.class-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.class-card .age { color: var(--ink-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 rgba(58,46,44,0.08);
  text-align: left;
}
.fee-table tr:last-child td {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--rose);
  color: var(--rose-dark);
}

.info-box {
  background: var(--sage-tint);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.95rem;
}

/* Document / žiadosť list */
.doc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(58,46,44,0.08);
}
.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; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rose);
  color: var(--white) !important;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--rose-dark); color: var(--white) !important; }
.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(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.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: var(--white); }
.event-card h3 { font-size: 1.02rem; margin: 0; }

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

.map-frame {
  border: 0;
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.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 rgba(58,46,44,0.08);
}
.contact-list li:last-child { border-bottom: none; }
.contact-list svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--rose-dark); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.82);
  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: var(--white); }
.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: rgba(255,255,255,0.55);
}

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

/* ---------- JS-rendered grids: loading / empty states ---------- */

.js-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.grid-error {
  text-align: center;
  padding: 24px;
  color: var(--rose-dark);
  background: var(--rose-tint);
  border-radius: var(--radius-md);
}

/* ---------- Multi-photo gallery grid (inside event cards) ---------- */

.event-card { flex-direction: column; align-items: stretch; }
.event-card .card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.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:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

/* "+N more" overlay on the last visible thumb when a gallery has more photos than shown */
.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;
}

/* ---------- Lightbox modal ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(20, 14, 13, 0.88);
  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.45);
  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; }

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