/* Ideal Kindergarten — global styles (loaded on every page after tokens.css).
   Purpose: components shared by all pages — focus/skip helpers, buttons, badges, section title, header (.ik-nav), footer (.ik-footer), back-to-top, dialog and the update banner.
   Rule: only add a style here if two or more pages use it; page-only styles live in pages/<page>.css. Colours/spacing come from tokens.css only. */

/* ---------- 1. Helpers ---------- */
html { scroll-behavior: smooth; } /* in-page links glide; reduced-motion turns it off (see tokens.css) */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--space-4); top: -80px; z-index: 60; padding: var(--space-2) var(--space-4); background: var(--sky-600); color: var(--on-sky); border-radius: var(--radius-md); font-weight: 600; }
.skip:focus { top: var(--space-2); }

/* ---------- 2. Buttons, badges, section title ---------- */
/* Button — label + optional arrow that slides on hover */
.ik-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 46px; padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); border: 2px solid transparent; font: 600 16px/1.2 var(--font-body); text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s, color .2s, border-color .2s; }
.ik-btn:hover { transform: translateY(-2px); }
.ik-btn:active { transform: translateY(0); }
.ik-btn .arrow { transition: transform .25s var(--ease-out); }
.ik-btn:hover .arrow { transform: translateX(4px); }
.ik-btn--primary { background: var(--sky-600); color: var(--on-sky); box-shadow: 0 6px 16px rgba(31,95,186,.25); }
.ik-btn--primary:hover { background: var(--sky-700); box-shadow: 0 10px 22px rgba(31,95,186,.32); }
.ik-btn--secondary { background: var(--surface-100); color: var(--ink); border-color: var(--line-strong); }
.ik-btn--secondary:hover { border-color: var(--sky-600); color: var(--sky-700); box-shadow: var(--shadow-card); }
.ik-btn--maroon { background: var(--maroon-900); color: var(--on-maroon); }
.ik-btn--maroon:hover { box-shadow: 0 10px 22px rgba(60,0,8,.3); }
.ik-btn--block { width: 100%; }

.ik-badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); border-radius: var(--radius-sm); font: 600 13px/22px var(--font-body); }
.ik-badge--new { background: var(--maroon-900); color: var(--on-maroon); }
.ik-badge--info { background: var(--sky-100); color: var(--sky-700); }

/* Section title with the epaulette stripe; the stripe stretches when the section is hovered */
.ik-section-title { display: grid; justify-items: center; gap: var(--space-3); margin: 0 0 var(--space-8); text-align: center; }
.ik-section-title h2 { margin: 0; font: 700 30px/40px var(--font-display); color: var(--ink); }
.ik-section-title p { margin: 0; max-width: 58ch; color: var(--ink-muted); }
.ik-section-title--start { justify-items: start; text-align: left; }
.ik-stripe { display: flex; gap: 4px; }
.ik-stripe::before, .ik-stripe::after { content: ""; height: 4px; border-radius: 2px; transition: width .5s var(--ease-out); }
.ik-stripe::before { width: 40px; background: var(--sky-600); }
.ik-stripe::after { width: 16px; background: var(--maroon-900); }
.section:hover .ik-stripe::before { width: 64px; }
@media (max-width: 480px) { .ik-section-title h2 { font-size: 26px; line-height: 36px; } }

/* ---------- 3. Header (.ik-nav) — rendered by assets/js/layout.js on every page ----------
   Breakpoints (see tokens.css): mobile ≤ 600px, tablet ≤ 900px, desktop > 900px. */
.ik-nav { font-family: var(--font-body); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: box-shadow .3s, border-color .3s; }
.ik-nav.is-scrolled { box-shadow: 0 6px 20px rgba(37,49,71,.08); border-color: var(--line); }
.ik-nav__inner { max-width: 1160px; margin: 0 auto; padding: var(--space-3) var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.ik-nav__brand { display: flex; align-items: center; gap: var(--space-3); color: var(--ink); text-decoration: none; min-width: 0; }
.ik-nav__brand img { width: 52px; height: 52px; border-radius: 50%; transition: transform .6s var(--ease-spring); }
.ik-nav__brand:hover img { transform: rotate(-12deg) scale(1.06); }
.ik-nav__name { font: 700 20px/1.1 var(--font-display); }
.ik-nav__links { display: flex; gap: var(--space-1); margin: 0 0 0 auto; padding: 0; list-style: none; }
.ik-nav__links a { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 42px; padding: 0 var(--space-4); border-radius: var(--radius-pill); color: var(--ink); font-weight: 600; text-decoration: none; transition: color .2s, background-color .2s; }
.ik-nav__links a svg, .ik-nav__links a i { color: var(--sky-600); transition: transform .3s var(--ease-spring); }
.ik-nav__links a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 6px; height: 1px; border-radius: 1px; background: var(--maroon-900); opacity: .5; transition: left .3s var(--ease-out), right .3s var(--ease-out); }
.ik-nav__links a:hover { color: var(--sky-700); }
.ik-nav__links a:hover::after { left: var(--space-4); right: var(--space-4); }
.ik-nav__links a:hover svg { transform: translateY(-2px) scale(1.12); }
.ik-nav__links a[aria-current="page"] { background: var(--sky-100); color: var(--sky-700); }
.ik-nav__links a[aria-current="page"]::after { display: none; }
.ik-lang { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 42px; padding: 0 var(--space-4); border: 1.5px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface-100); color: var(--ink); font: 600 14px/1 var(--font-body); cursor: pointer; transition: border-color .2s, color .2s, transform .25s var(--ease-out); }
.ik-lang:hover { border-color: var(--sky-600); color: var(--sky-700); transform: translateY(-1px); }
.ik-nav__menu { display: none; min-width: 44px; min-height: 44px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-100); color: var(--ink); font-size: 18px; cursor: pointer; }
/* Tablet and mobile (≤ --bp-tablet): links and language button move into the side drawer */
@media (max-width: 900px) {
  .ik-nav__links, .ik-nav__inner > .ik-lang { display: none; }
  .ik-nav__menu { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
}
/* Mobile (≤ --bp-mobile): logo only, the school name is hidden */
@media (max-width: 600px) { .ik-nav__name { display: none; } }

/* Side drawer (tablet + mobile) — rendered by layout.js at the end of <body> */
.ik-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(15,26,44,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease-out); }
.ik-overlay.is-open { opacity: 1; pointer-events: auto; }
.ik-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; display: flex; flex-direction: column; width: min(300px, 85vw); padding: var(--space-4); background: var(--surface-100); color: var(--ink); font-family: var(--font-body); box-shadow: var(--shadow-raised); transform: translateX(100%); visibility: hidden; transition: transform .3s var(--ease-out), visibility 0s .3s; }
.ik-drawer.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease-out); }
.ik-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-2) var(--space-4); font: 700 22px/1.3 var(--font-display); }
.ik-drawer__close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink); font-size: 22px; cursor: pointer; transition: background-color .2s, transform .3s var(--ease-spring); }
.ik-drawer__close:hover { background: var(--sky-100); transform: rotate(90deg); }
.ik-drawer__links { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.ik-drawer__links a { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--ink); font-weight: 600; text-decoration: none; transition: background-color .2s, color .2s, transform .25s var(--ease-out); }
.ik-drawer__links a i { color: var(--sky-600); width: 22px; text-align: center; }
.ik-drawer__links a:hover { background: var(--sky-050); color: var(--sky-700); transform: translateX(4px); }
.ik-drawer__links a[aria-current="page"] { background: var(--sky-100); color: var(--sky-700); }
.ik-drawer .ik-lang { margin-top: auto; align-self: flex-start; }
.no-scroll { overflow: hidden; }
@media (min-width: 901px) { .ik-drawer, .ik-overlay { display: none; } }
@media (prefers-reduced-motion: reduce) { .ik-drawer, .ik-overlay { transition: none; } }

/* ---------- 4. Round icon button (carousel arrows, dialog close) ---------- */
.round-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface-100); color: var(--ink); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease-out); }
.round-btn:hover { background: var(--sky-600); border-color: var(--sky-600); color: var(--on-sky); transform: scale(1.06); }
.round-btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- 5. Dialog ---------- */
.ik-dialog { margin: auto; width: min(760px, calc(100% - 2 * var(--space-4))); max-height: calc(100% - 2 * var(--space-4)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface-100); color: var(--ink); box-shadow: 0 30px 80px rgba(15,26,44,.35); }
.ik-dialog::backdrop { background: rgba(15,26,44,.6); backdrop-filter: blur(4px); }
.ik-dialog[open] { animation: pop .35s var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.ik-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.ik-dialog__bar h3 { margin: 0; font: 700 18px/1.4 var(--font-display); }
.ik-dialog__content { padding: var(--space-4); display: grid; gap: var(--space-4); }
.ik-dialog__content img { width: 100%; border-radius: var(--radius-md); }

/* ---------- 6. Footer (.ik-footer) and back-to-top (.ik-top) ---------- */
.ik-footer { margin-top: var(--space-12); font-family: var(--font-body); background: var(--footer-bg); color: var(--footer-muted); padding: var(--space-12) max(var(--space-4), calc((100% - 1160px) / 2 + var(--space-4))) calc(var(--space-16) + env(safe-area-inset-bottom, 0px)); }
.ik-footer__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
@media (max-width: 860px) { .ik-footer__grid { grid-template-columns: minmax(0, 1fr); } }
.ik-footer h3 { margin: 0 0 var(--space-3); font: 700 17px/1.4 var(--font-display); color: var(--footer-ink); }
.ik-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.ik-footer li { display: flex; gap: var(--space-2); align-items: flex-start; }
.ik-footer li svg, .ik-footer li i { margin-top: 6px; flex: none; }
.ik-footer a { color: var(--footer-ink); text-decoration: none; text-underline-offset: 4px; }
.ik-footer a:hover { text-decoration: underline; }
.ik-footer :focus-visible { outline-color: var(--focus-inverse); }
.ik-footer__social { display: flex; gap: var(--space-2); }
.ik-footer__social a, .ik-footer__social a:hover { text-decoration: none; }
.ik-footer__social a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--footer-muted); color: var(--footer-ink); font-size: 18px; transition: background-color .25s, border-color .25s, transform .35s var(--ease-spring); }
.ik-footer__social a:hover { transform: translateY(-4px) rotate(-8deg); background: var(--sky-600); border-color: var(--sky-600); }
.ik-footer__base { margin: var(--space-8) 0 0; padding-top: var(--space-4); border-top: 1px solid rgba(255,255,255,.15); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); }
.ik-top { position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); z-index: 50; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--sky-600); color: var(--on-sky); border: 0; box-shadow: var(--shadow-raised); font-size: 18px; cursor: pointer; transition: transform .3s var(--ease-spring), background-color .2s, opacity .3s; }
.ik-top:hover { transform: translateY(-4px); background: var(--sky-700); }
.ik-top:hover svg, .ik-top:hover i { animation: nudge .6s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateY(-3px); } }

/* ---------- 7. Service-worker update banner (assets/js/sw-update.js) ---------- */
.sw-update-banner { position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--navy-900); color: var(--on-sky); border-radius: var(--radius-md); box-shadow: var(--shadow-raised); font-size: 15px; line-height: 24px; z-index: 10000; animation: sw-update-slide-in .3s var(--ease-out); }
.sw-update-banner-text { flex: 1; min-width: 0; }
.sw-update-banner-btn { flex-shrink: 0; min-height: 44px; padding: 0 var(--space-4); background: var(--sky-600); color: var(--on-sky); border: 0; border-radius: var(--radius-pill); font: 600 15px/1 var(--font-body); cursor: pointer; transition: background-color .2s; }
.sw-update-banner-btn:hover { background: var(--sky-700); }
.sw-update-banner-btn:focus-visible, .sw-update-banner-close:focus-visible { outline: 3px solid var(--focus-inverse); outline-offset: 2px; }
.sw-update-banner-btn:disabled { opacity: .7; cursor: progress; }
.sw-update-banner-close { flex-shrink: 0; min-width: 44px; min-height: 44px; background: transparent; color: var(--on-sky); border: 0; font-size: 24px; line-height: 1; cursor: pointer; opacity: .75; }
.sw-update-banner-close:hover { opacity: 1; }
@keyframes sw-update-slide-in { from { transform: translateY(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) { .sw-update-banner { left: auto; right: var(--space-6); bottom: var(--space-6); margin: 0; } }

/* ---------- 8. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ---------- Text link with arrow (home, contact) ---------- */
.text-link { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--sky-700); text-decoration: none; }
.text-link .arrow { transition: transform .25s var(--ease-out); }
.text-link:hover .arrow { transform: translateX(4px); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Shared page pieces (moved from home.css; used by home and about) ---------- */
body.page-home, body.page-about, body.page-gallery, body.page-contact, body.page-404 { margin: 0; background: var(--surface-000); color: var(--ink); font: 400 16px/27px var(--font-body); -webkit-font-smoothing: antialiased; }
.page-home img, .page-about img, .page-gallery img, .page-contact img { max-width: 100%; }
.page-home :where(a:not([class])), .page-about :where(a:not([class])), .page-gallery :where(a:not([class])), .page-contact :where(a:not([class])) { color: var(--sky-600); }
.page-wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--space-4); }
.section { padding-block: var(--space-16); }
.section--cream { background: var(--cream-050); }
.section--sky { background: var(--sky-050); }
@media (max-width: 480px) { .section { padding-block: var(--space-12); } }
.sky-clouds { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky-cloud { position: absolute; left: 0; fill: var(--surface-100); animation: cloud-lane linear infinite; will-change: transform; }
.sky-cloud--1 { top: 10%; width: 150px; opacity: .95; animation-duration: 70s; animation-delay: -12s; }
.sky-cloud--2 { top: 34%; width: 96px; opacity: .7; animation-duration: 95s; animation-delay: -58s; }
.sky-cloud--3 { top: 64%; width: 68px; opacity: .5; animation-duration: 120s; animation-delay: -30s; }
@keyframes cloud-lane { from { transform: translateX(-180px); } to { transform: translateX(calc(100vw + 40px)); } }
.hero-edge { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; height: 72px; pointer-events: none; }
.hero-edge svg { width: 100%; height: 100%; display: block; }
.hero-edge path { fill: var(--surface-000); }
.ik-feature__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--sky-100); color: var(--sky-700); font-size: 22px; transition: transform .5s var(--ease-spring), background-color .3s, color .3s; }
.skeleton { background: linear-gradient(90deg, var(--sky-100) 25%, var(--sky-050) 37%, var(--sky-100) 63%); background-size: 400% 100%; animation: ik-shimmer 1.4s ease infinite; border-radius: var(--radius-md); }
@keyframes ik-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.error-text { margin: 0; padding: var(--space-4); border-radius: var(--radius-md); background: var(--maroon-100); color: var(--maroon-900); font-weight: 600; }
.page-home .ik-footer, .page-about .ik-footer, .page-gallery .ik-footer, .page-contact .ik-footer, .page-404 .ik-footer { margin-top: 0; }

/* ---------- Page hero (title, icon, breadcrumb, clouds) — About, Gallery, Contact ---------- */
.page-hero { position: relative; overflow: hidden; background: var(--sky-100); padding: var(--space-12) 0 104px; text-align: center; }
.page-hero__inner { position: relative; z-index: 2; display: grid; justify-items: center; gap: var(--space-3); }
.crumbs { display: flex; gap: var(--space-2); align-items: center; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-muted); }
.crumbs a { color: var(--sky-700); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-hero h1 { margin: 0; font: 700 46px/56px var(--font-display); color: var(--ink); }
.page-hero p { margin: 0; font-size: 18px; color: var(--ink-muted); max-width: 52ch; }
.page-hero__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--sky-600); color: var(--on-sky); font-size: 26px; box-shadow: var(--shadow-raised); rotate: -6deg; transition: rotate .5s var(--ease-spring); }
.page-hero:hover .page-hero__icon { rotate: 6deg; }
/* Phones: a compact hero (icon beside the title) so content starts higher */
@media (max-width: 600px) {
  .page-hero { padding: var(--space-4) 0 56px; text-align: left; }
  .page-hero .hero-edge { height: 40px; }
  .page-hero__inner { grid-template-columns: auto 1fr; justify-items: start; align-items: center; column-gap: var(--space-3); row-gap: 2px; }
  .crumbs { grid-column: 1 / -1; font-size: 13px; margin-bottom: var(--space-2); }
  .page-hero__icon { grid-row: span 2; width: 48px; height: 48px; font-size: 20px; border-radius: var(--radius-md); }
  .page-hero h1 { font-size: 28px; line-height: 36px; }
  .page-hero p { font-size: 15px; line-height: 22px; }
  .page-hero .skeleton-hero-title { height: 32px; }
}
.page-hero .skeleton-hero-title { height: 48px; width: min(360px, 80%); }
.page-hero .skeleton-line { width: min(480px, 90%); }

