/* Bakomi – green theme taken from the logo.
   Colours: --color-primary (buttons, links, green sections), --color-leaf (the logo's leaf green: decoration only,
   too light for text), --color-forest (dark sections, footer). Schooma's sections and cards read the first four. */
:root {
  --color-primary: #3E6B3B;
  --color-primary-dark: #2C4F2A;
  --color-leaf: #6FA06E;
  --color-leaf-soft: #DCE8D8;
  --color-forest: #1F3320;
  --color-text: #22291F;
  --color-muted: #55604E;
  --color-background: #FBFBF7;
  --color-surface: #EEF3EA;
  --color-line: #DDE5D8;
  --max-width: 1080px;
  --radius: 20px;
  --font-head: "Nunito", "Nunito Sans", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-background);
}

body {
  margin: 0;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
h2 { font-size: clamp(26px, 3.4vw, 32px); margin: 1.6em 0 .6em; }
h3 { font-size: 20px; margin: 1.4em 0 .4em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--color-primary-dark); }

:focus-visible { outline: 3px solid var(--color-leaf); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--color-line);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.school-name {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.school-name:hover { color: var(--color-primary-dark); }
.logo { height: 52px; width: auto; display: block; }

.menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
}
.menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--color-text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.menu a:hover { background: var(--color-surface); color: var(--color-primary-dark); }
.menu li.active > a { background: var(--color-leaf-soft); color: var(--color-primary-dark); }
.menu li { position: relative; }
.menu li.has-children > a::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin: 0 0 3px 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .6;
}

/* sub-pages: a dropdown under their page */
.menu li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(31, 51, 32, .14);
  flex-direction: column;
  gap: 2px;
  z-index: 21;
}
.menu li ul a { border-radius: 10px; font-weight: 600; }
.menu li:hover > ul,
.menu li:focus-within > ul { display: flex; }

.menu-toggle {
  display: none;
  min-height: 44px;
  padding: 8px 18px;
  background: #fff;
  color: var(--color-text);
  border: 1.5px solid var(--color-line);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- page body ---------- */
main.wrap { padding-bottom: 32px; }
.hero { padding: 32px 0 8px; }
.hero h1 { margin: 0; }

.content {
  padding: 40px 0 24px;
  overflow-wrap: anywhere;
}
.content > h1 {
  margin: 0 0 24px;
  font-size: clamp(34px, 5vw, 48px);
  color: var(--color-primary-dark);
}
.content > h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 6px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--color-leaf);
}
.content > h2:first-child { margin-top: 0; }
.content img { max-width: 100%; height: auto; border-radius: 14px; }
.content li::marker { color: var(--color-leaf); }
.content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-radius: 16px;
  background: var(--color-surface);
  font-size: 1.1em;
}
.content hr { border: 0; height: 1px; background: var(--color-line); margin: 40px 0; }
.content table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.content th, .content td { padding: 10px 12px; border-bottom: 1px solid var(--color-line); text-align: left; }
.content th { font-weight: 700; background: var(--color-surface); }

.eyebrow {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* ---------- sections (Schooma's .s) ---------- */
.s { margin: 32px 0; }
.s-light, .s-accent, .s-dark, .s-image {
  border-radius: 28px;
  padding: 40px clamp(20px, 4vw, 44px);
}
.s-light {
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 160, 110, .16) 0, rgba(111, 160, 110, 0) 34%),
    var(--color-surface);
}
.s-accent {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, 0) 38%),
    var(--color-primary);
}
.s-dark {
  --s-background: var(--color-forest);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 160, 110, .32) 0, rgba(111, 160, 110, 0) 42%),
    var(--color-forest);
}
.s-accent h2, .s-accent h3, .s-dark h2, .s-dark h3, .s-image h2, .s-image h3 { color: #fff; }
.s-accent .eyebrow, .s-dark .eyebrow, .s-image .eyebrow { color: var(--color-leaf-soft); }
.s-accent .card h3, .s-dark .card h3, .s-image .card h3 { color: var(--color-text); }
.s h2 { margin-top: 0; }
.s-full.s-light, .s-full.s-accent, .s-full.s-dark { border-radius: 0; }

/* home: the first section is the welcome */
.home > .s:first-child {
  margin-top: 8px;
  padding-top: clamp(36px, 6vw, 64px);
  padding-bottom: clamp(36px, 6vw, 64px);
}
.home > .s:first-child h2 {
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 22ch;
  color: var(--color-primary-dark);
}
.home > .s:first-child p:not(.eyebrow) { font-size: 18px; max-width: 64ch; }
.home > .s:first-child { position: relative; overflow: hidden; }
.home > .s:first-child > * { position: relative; z-index: 1; }
/* two leaves from the logo, on the right of the welcome */
.home > .s-light:first-child::before,
.home > .s-light:first-child::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 0 80% 0 80%;
  pointer-events: none;
}
.home > .s-light:first-child::before {
  width: 240px; height: 240px;
  right: 48px; top: 50%;
  margin-top: -170px;
  background: var(--color-leaf);
  opacity: .9;
  transform: rotate(-8deg);
}
.home > .s-light:first-child::after {
  width: 140px; height: 140px;
  right: 250px; top: 50%;
  margin-top: 30px;
  background: var(--color-primary);
  opacity: .85;
  transform: rotate(14deg);
}
.home > .s-light:first-child > p:not(.eyebrow) { max-width: 58ch; }
@media (max-width: 1100px) {
  .home > .s-light:first-child::before { width: 160px; height: 160px; right: -40px; top: 24px; margin-top: 0; opacity: .25; }
  .home > .s-light:first-child::after { display: none; }
}
.home > .s-dark:first-child h2, .home > .s-accent:first-child h2, .home > .s-image:first-child h2 { color: #fff; }

/* ---------- cards (Schooma's .card) ---------- */
.cards { gap: 20px; margin: 20px 0; }
.card {
  padding: 22px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 51, 32, .04);
}
.card > img:first-child {
  width: calc(100% + 44px);
  margin: -22px -22px 16px;
}
.card > .b-cover:first-child { margin: -22px -22px 16px; overflow: hidden; }
.card h3 { font-size: 20px; margin: 0 0 8px; }
.card p { margin: 0 0 8px; }
/* a card with just one sentence (e.g. Profil žiaka) gets a small leaf */
.card > p:only-child::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin-bottom: 12px;
  border-radius: 0 80% 0 80%;
  background: var(--color-leaf);
}
.card > p:only-child { font-weight: 600; }

/* ---------- buttons ---------- */
a.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  box-sizing: border-box;
  padding: 11px 24px;
  margin: 4px 6px 4px 0;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
a.button:hover, a.button:focus-visible { background: var(--color-primary-dark); color: #fff; filter: none; }
a.button:active { transform: translateY(1px); }
.s-accent a.button, .s-dark a.button, .s-image a.button { background: #fff; color: var(--color-primary-dark); }
.s-accent a.button:hover, .s-dark a.button:hover, .s-image a.button:hover { background: var(--color-leaf-soft); color: var(--color-primary-dark); }

/* lists inside a light section (e.g. Školné): one row per item */
.s-light > ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.s-light > ul > li {
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 14px;
}
.s-light > ul > li > p { margin: 0; }
.s-light > ul > li strong { color: var(--color-primary-dark); font-size: 1.15em; }

/* ---------- live blocks ---------- */
.b-news .card { transition: transform .15s, box-shadow .15s; }
.b-news .card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31, 51, 32, .12); }
.b-news .card h3 a { color: var(--color-text); text-decoration: none; }
.b-news .card h3 a:hover { color: var(--color-primary); }
.b-news .b-cover img { transition: transform .3s; }
.b-news .card:hover .b-cover img { transform: scale(1.04); }
.b-date { color: var(--color-primary); font-weight: 700; opacity: 1; font-size: 14px; }
.b-news .card > p:last-child {
  color: var(--color-muted);
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.b-more { margin-top: 16px; }
.b-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1.5px solid var(--color-primary);
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.b-more a:hover { background: var(--color-primary); color: #fff; }
.b-contact dt { color: var(--color-muted); }
.b-photo { border-radius: 14px; }

/* ---------- sub-pages and attachments ---------- */
.subpages {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.subpages a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.subpages a::after { content: "→"; color: var(--color-leaf); font-size: 22px; }
.subpages a:hover { transform: translateY(-2px); border-color: var(--color-leaf); box-shadow: 0 10px 24px rgba(31, 51, 32, .1); }

.attachments { list-style: none; padding: 0; display: grid; gap: 8px; }
.attachments li {
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}
.attachments a { font-weight: 700; }
.attachments .size { color: var(--color-muted); font-size: 0.9em; }

/* ---------- news lists and posts ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-line); }
.news-item h2, .news-item h3 { margin: 0; font-size: 1.15rem; }
.news-item p { margin: 4px 0; }
.cover { flex: none; width: 160px; height: 110px; object-fit: cover; border-radius: 12px; }
.cover-large { width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }
.content.post { max-width: 760px; margin: 0 auto; }
.content.post > h1::after { display: none; }

/* A post's photos below its text: a mosaic of the first five (as on social networks). */
.photos {
  display: grid;
  gap: 4px;
  margin: 24px 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.photos .photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--color-surface);
}
.photos img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; border-radius: 0; }
.photos .photo:hover img { transform: scale(1.03); }
.photos-1 { aspect-ratio: auto; }
.photos-1 img { height: auto; max-height: 560px; }
.photos-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.photos-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.photos-3 .photo:first-child { grid-row: span 2; }
.photos-4 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 2fr 1fr; }
.photos-4 .photo:first-child { grid-column: span 3; }
.photos-5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 3fr 2fr; }
.photos-5 .photo { grid-column: span 2; }
.photos-5 .photo:nth-child(-n + 2) { grid-column: span 3; }
.photos .more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 51, 32, 0.55);
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

/* The news as a stream: each post with its text and photos; long texts cut until "Show more". */
.kind-news .content { max-width: 760px; margin: 0 auto; }
.news-stream { display: grid; gap: 24px; max-width: 760px; margin: 0 auto 32px; }
.news-post {
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--color-line);
  overflow-wrap: anywhere;
}
.news-post header h2 { margin: 0; font-size: 1.45rem; }
.news-post header h2 a { color: var(--color-text); text-decoration: none; }
.news-post header h2 a:hover { color: var(--color-primary); }
.news-post header .date { margin: 2px 0 12px; }
.news-post .photos { margin: 16px -24px -24px; border-radius: 0 0 var(--radius) var(--radius); }
.news-post .attachments { margin: 12px 0 0; }
.post-text > :first-child { margin-top: 0; }
.post-text img { max-width: 100%; height: auto; }
/* links pasted from Facebook keep their own blue: show them in the site's green */
.post-text a, .content.post a { color: var(--color-primary) !important; }
.post-text img[width="16"], .content img[width="16"] { border-radius: 0; vertical-align: -2px; }
.post-text.clamped {
  max-height: 16em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.show-more {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.stream-status { text-align: center; color: var(--color-muted); }
.date { color: var(--color-primary); font-weight: 700; font-size: 0.9rem; }
.pager { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; max-width: 760px; margin: 0 auto; }
.latest-news { padding-bottom: 32px; }

/* The photo viewer (script.js): the whole screen, the photo fitted, arrows, swiping on phones. */
.viewer {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(0, 0, 0, 0.94); }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.viewer button,
.viewer .viewer-original {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.viewer button:hover,
.viewer button:focus-visible,
.viewer .viewer-original:hover,
.viewer .viewer-original:focus-visible { background: rgba(255, 255, 255, 0.25); }
.viewer .viewer-original {
  top: 12px;
  right: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
}
.viewer .viewer-close { top: 12px; right: 12px; }
.viewer .viewer-previous { left: 12px; top: calc(50% - 24px); }
.viewer .viewer-next { right: 12px; top: calc(50% - 24px); }
.viewer .viewer-count {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.9rem;
  text-shadow: 0 0 4px #000;
}
body:has(.viewer[open]) { overflow: hidden; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--color-forest);
  color: #C9D8C4;
  padding: 56px 0 28px;
  font-size: 15px;
}
.site-footer a { color: #E4EEE1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { margin: 4px 0; }
.site-footer ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 32px;
}
.footer-name {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px !important;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 24px;
  color: #fff;
}
.footer-logo { height: 40px; width: auto; padding: 6px; background: #fff; border-radius: 12px; }
.footer-head {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #A9BBA4;
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #A9BBA4;
}
.footer-bottom a { color: #A9BBA4; }

/* ---------- phones: the menu opens with its button ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .logo { height: 44px; }
  .school-name { font-size: 22px; }
  .menu-toggle { display: block; }
  .menu { display: none; width: 100%; padding-bottom: 8px; }
  .menu.open { display: block; }
  .menu ul { flex-direction: column; }
  .menu a { border-radius: 12px; }
  .menu li.has-children > a::after { display: none; }
  .menu li ul {
    display: flex;
    position: static;
    min-width: 0;
    padding: 0 0 4px 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .content { padding-top: 28px; }
  .s-light, .s-accent, .s-dark, .s-image { border-radius: 20px; }
  .news-item { flex-direction: column; }
  .cover { width: 100%; height: 180px; }
  .news-post { padding: 18px; }
  .news-post .photos { margin: 16px -18px -18px; }
}
