:root {
  --crimson: #c8102e;
  --crimson-dark: #9c0c22;
  --cream: #faf6f0;
  --cream-deep: #f1e9dc;
  --ink: #2b2420;
  --ink-soft: #6b5f54;
  --border: #e7ddcd;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 36, 32, 0.08);
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans KR", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

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

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max);
  margin: 0 auto;
  gap: 16px;
}

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

.brand img { width: auto; height: 40px; }

.brand-text .name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.brand-text .tagline {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

nav.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover { background: var(--cream-deep); }

nav.main-nav a.active {
  background: var(--crimson);
  color: #fff;
}

.lang-toggle {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}

.lang-toggle button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
}

.lang-toggle button.active {
  background: var(--crimson);
  color: #fff;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 62vh;
  display: flex;
  align-items: center;
  color: #fff;
  background: #2a1d15;
}

/* full-width background slideshow (images managed in /kadmin → 홈 → 메인 슬라이드) */
.hero-bg { position: absolute; inset: 0; }
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 18, 10, 0.55), rgba(20, 12, 8, 0.72));
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-slide.active { opacity: 1; }

.hero-inner {
  position: relative;
  width: 100%;
  padding: 70px 24px;
  max-width: var(--max);
  margin: 0 auto;
}
.hero-copy { max-width: 720px; }

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 14px;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero p.lead {
  font-size: 1.05rem;
  color: #f0e9df;
  margin: 0 0 24px;
  max-width: 52ch;
}

.hero-dots {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  padding: 0;
  cursor: pointer;
}
.hero-dots .dot.active { background: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--crimson);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover { background: var(--crimson-dark); }
.btn:active { transform: translateY(1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.8);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }

.section-title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700;
  margin: 0 0 8px;
}

.section-sub {
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 70ch;
}

.section-head { margin-bottom: 36px; }
.section-sub-wide { max-width: none; }

/* level cards */
.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.level-card {
  background: url("../img/chalkboard-bg.jpg") center/cover no-repeat;
  border-radius: var(--radius);
  padding: 28px 38px 54px;
  color: #eafbea;
  box-shadow: var(--shadow);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.level-card .tag {
  align-self: flex-start;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.level-card h3 { margin: 0; font-size: 1.3rem; }
.level-card .codes { font-size: 0.85rem; opacity: 0.85; margin-bottom: 4px; }
.level-card ul { margin: 0; padding-left: 18px; font-size: 0.9rem; line-height: 1.5; }
.level-card li { margin-bottom: 6px; }

/* notice / semester box */
.notice-box {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 6px solid var(--crimson);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow);
}

.notice-box h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.notice-box dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 20px;
  margin: 0;
}

.notice-box dt { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.notice-box dd { margin: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* teacher cards */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.team-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.team-card .avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--crimson);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 12px;
}

.team-card .name { font-weight: 700; margin-bottom: 2px; }
.team-card .role { font-size: 0.84rem; color: var(--crimson); margin-bottom: 8px; font-weight: 600; }
.team-card .meta { font-size: 0.84rem; color: var(--ink-soft); }
.team-card .meta a { color: var(--ink-soft); text-decoration: underline; }

/* about hero image band */
.image-band {
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.image-band img { width: 100%; height: 100%; object-fit: cover; }

.prose p { margin: 0 0 16px; color: var(--ink); }

/* class page */
.doc-list {
  display: grid;
  gap: 10px;
  margin: 0 0 48px;
}
.doc-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 600;
  transition: border-color 0.15s ease;
}
.doc-list a:hover { border-color: var(--crimson); }
.doc-list a .doc-icon { color: var(--crimson); display: inline-flex; flex-shrink: 0; margin-left: 12px; }
.doc-list a:hover .doc-icon { color: var(--crimson-dark); }

.level-list {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.level-row:last-child { border-bottom: none; }

.level-row .book-thumb {
  flex: 0 0 96px;
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--cream-deep);
  border: 1px solid var(--border);
}
.level-row .book-thumb img { width: 100%; height: 100%; object-fit: cover; }

.level-row .divider {
  align-self: stretch;
  width: 2px;
  background: var(--crimson);
  opacity: 0.25;
  border-radius: 2px;
  flex-shrink: 0;
}

.level-row .content { flex: 1; min-width: 0; }
.level-row h3 { margin: 0 0 2px; font-size: 1.1rem; }
.level-row .codes { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 8px; }
.level-row p { font-size: 0.9rem; margin: 0; }

.level-row .btn { flex-shrink: 0; padding: 9px 18px; font-size: 0.85rem; }

/* gallery */
.gallery-section { margin-bottom: 44px; }
.gallery-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--crimson);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--cream-deep);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px 8px;
  font-size: 0.82rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.65));
}

.lightbox {
  position: fixed; inset: 0; background: rgba(15,10,8,0.9);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(90vw, 900px); max-height: 82vh; border-radius: 10px; }
.lightbox .caption { color: #fff; text-align: center; margin-top: 14px; }
.lightbox .close {
  position: absolute; top: 24px; right: 28px;
  color: #fff; font-size: 1.8rem; cursor: pointer; line-height: 1;
  background: rgba(255,255,255,0.1); width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.map-wrap iframe { width: 100%; height: 420px; border: 0; display: block; }

.school-address {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}
.school-address h4 { margin: 0 0 8px; }
.school-address p { margin: 2px 0; color: var(--ink-soft); font-size: 0.92rem; }

form.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.field { display: grid; gap: 6px; }
.field label { font-size: 0.86rem; font-weight: 700; color: var(--ink-soft); }
.field input, .field textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--crimson);
  background: #fff;
}
.field textarea { min-height: 130px; resize: vertical; }

.form-note {
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--cream-deep);
  border-radius: 8px;
  padding: 10px 12px;
}

.form-status {
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
  padding: 10px 12px;
  border-radius: 8px;
}
.form-status.show { display: block; }
.form-status.ok { background: #e8f6ea; color: #1e7b34; }
.form-status.err { background: #fbe9e9; color: var(--crimson-dark); }

/* footer */
footer.site-footer {
  background: #221812;
  color: #e9ddcf;
  padding: 40px 0 28px;
  margin-top: 40px;
}
footer.site-footer .foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
footer.site-footer .name { font-weight: 700; color: #fff; margin-bottom: 6px; }
footer.site-footer p { margin: 2px 0; font-size: 0.88rem; color: #cfc0ae; }
footer.site-footer .foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer.site-footer .foot-nav a { font-size: 0.88rem; color: #e9ddcf; }
footer.site-footer .foot-nav a:hover { color: #fff; text-decoration: underline; }
footer.site-footer .copyright {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: #9a8b78;
}

/* lang visibility */
[data-ko] { display: none; }
html[lang="ko"] [data-ko] { display: revert; }
html[lang="ko"] [data-en] { display: none; }

/* responsive */
@media (max-width: 880px) {
  .hero-inner { text-align: center; }
  .hero-copy, .hero p.lead { margin-left: auto; margin-right: auto; }
  .level-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  nav.main-nav { display: none; }
  nav.main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
  }
  .nav-toggle { display: block; }
  .level-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .notice-box dl { grid-template-columns: 1fr; }
  .level-row { flex-wrap: wrap; }
  .level-row .divider { display: none; }
  .level-row .btn { width: 100%; text-align: center; }
}

.field select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--cream);
}
.field select:focus { outline: none; border-color: var(--crimson); background: #fff; }
.contact-form button[disabled] { opacity: 0.6; cursor: wait; }

[hidden] { display: none !important; }

button, select { font-family: inherit; }



.contact-grid > * { min-width: 0; }
.contact-form > * { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.lang-toggle button { white-space: nowrap; }

/* 6 menu items no longer fit on one line below ~1080px (English labels) → use the ☰ menu there too */
@media (max-width: 1080px) {
  nav.main-nav { display: none; }
  nav.main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
  }
  .nav-toggle { display: block; margin-left: auto; }
}
@media (max-width: 640px) {
  .header-top { padding: 10px 16px; gap: 10px; }
  .brand { gap: 8px; }
  .brand img { width: auto; height: 34px; }
  .brand-text .name { font-size: 0.95rem; line-height: 1.25; }
  .brand-text .tagline { display: none; }
  .lang-toggle button { padding: 5px 9px; }
}

/* ---------- online registration (register.html) — Google Forms style ---------- */
.gf-page {
  --gf-accent: var(--crimson);
  --gf-line: #dadce0;
  --gf-muted: #5f6368;
  background: #f6ecec;
  padding: 24px 0 56px;
}
.gf-wrap { max-width: 770px; margin: 0 auto; padding: 0 16px; display: grid; gap: 12px; }
.gf-form { display: grid; gap: 12px; }
.gf-card {
  background: #fff;
  border: 1px solid var(--gf-line);
  border-radius: 8px;
  padding: 24px;
  position: relative;
}
.gf-head { border-top: 10px solid var(--gf-accent); padding-top: 22px; }
.gf-head h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); font-weight: 500; line-height: 1.3; margin: 0 0 12px; }
.gf-head p { margin: 0 0 16px; color: var(--ink); white-space: pre-line; }
.gf-req-note { border-top: 1px solid var(--gf-line); margin: 0 -24px; padding: 14px 24px 0; font-size: 0.88rem; color: #d93025; }
.gf-req { color: #d93025; }

.gf-q { display: block; font-size: 1rem; font-weight: 500; color: #202124; margin-bottom: 4px; }
.gf-q-small { font-size: 0.92rem; margin-top: 22px; }
.gf-hint { font-size: 0.82rem; color: var(--gf-muted); margin-bottom: 4px; }

/* underline-only text fields */
.gf-input {
  display: block;
  width: 100%;
  max-width: 50%;
  border: none;
  border-bottom: 1px solid var(--gf-line);
  border-radius: 0;
  background: transparent;
  padding: 10px 0 6px;
  margin-top: 14px;
  font: inherit;
  font-size: 0.95rem;
  color: #202124;
  outline: none;
}
.gf-line { display: block; height: 2px; max-width: 50%; background: var(--gf-accent); transform: scaleX(0); transition: transform 0.25s ease; margin-top: -2px; }
.gf-input:focus + .gf-line { transform: scaleX(1); }

.gf-options { display: grid; gap: 4px; margin-top: 12px; }
.gf-option { display: flex; align-items: center; gap: 14px; padding: 6px 0; cursor: pointer; font-size: 0.95rem; }
.gf-option input, .gf-grid input { width: 20px; height: 20px; margin: 0; accent-color: var(--gf-accent); cursor: pointer; flex-shrink: 0; }

.gf-grid-wrap { overflow-x: auto; margin-top: 12px; }
.gf-grid { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 0.9rem; }
.gf-grid thead th { font-weight: 400; color: #202124; padding: 4px 6px; text-align: center; }
.gf-grid tbody tr { background: #f8f9fa; }
.gf-grid tbody th { text-align: left; font-weight: 400; padding: 14px 12px; border-radius: 4px 0 0 4px; white-space: nowrap; }
.gf-grid td { text-align: center; padding: 14px 6px; }
.gf-grid td:last-child { border-radius: 0 4px 4px 0; }

.gf-card.gf-error { border-color: #d93025; }
.gf-card.gf-error .gf-input { border-bottom-color: #d93025; }
.gf-error-msg { display: none; margin-top: 12px; font-size: 0.82rem; color: #d93025; }
.gf-error-msg::before { content: "! "; font-weight: 700; }
.gf-card.gf-error .gf-error-msg { display: block; }

.gf-status { border-radius: 8px; }
.gf-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.gf-submit {
  background: var(--gf-accent); color: #fff; border: none; border-radius: 4px;
  padding: 10px 24px; font: inherit; font-weight: 500; font-size: 0.95rem; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.gf-submit:hover { background: var(--crimson-dark); }
.gf-submit[disabled] { opacity: 0.6; cursor: wait; }
.gf-clear { background: none; border: none; color: var(--gf-accent); font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; padding: 8px; }
.gf-clear:hover { background: rgba(200, 16, 46, 0.06); border-radius: 4px; }
.gf-closed { text-align: center; }
.gf-closed p { margin: 0 0 16px; }

@media (max-width: 640px) {
  .gf-page { padding-top: 12px; }
  .gf-wrap { padding: 0 8px; }
  .gf-card { padding: 20px 16px; }
  .gf-req-note { margin: 0 -16px; padding: 12px 16px 0; }
  .gf-input, .gf-line { max-width: 100%; }
  .gf-grid { font-size: 0.82rem; }
  .gf-grid tbody th { padding: 12px 8px; }
  .gf-grid td { padding: 12px 2px; }
}
.gf-page + .site-footer { margin-top: 0; }

/* class page: textbook covers enlarge on click */
.level-row .book-thumb { padding: 0; cursor: zoom-in; font: inherit; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.level-row .book-thumb:hover { box-shadow: 0 6px 16px rgba(43, 36, 32, 0.18); transform: translateY(-1px); }
.level-row .book-thumb:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }
.lightbox .close { border: none; font-family: inherit; }
.lightbox img { background: #fff; }

/* Korean: break lines between words, not inside them */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- mobile vertical rhythm: every gap between blocks is 32px ---------- */
@media (max-width: 640px) {
  section { padding: 32px 0 0; }
  section[style] { padding-top: 32px !important; }  /* inner pages set padding-top inline */
  section:last-of-type { padding-bottom: 32px; }
  .hero { padding: 0; }
  .hero-inner { padding: 48px 20px; }
  .section-head { margin-bottom: 24px; }
  .section-sub { margin-bottom: 0; }
  .image-band { margin-bottom: 32px; }
  .prose { margin-bottom: 32px !important; }
  .doc-list { margin-bottom: 32px; }
  .gallery-section { margin-bottom: 32px; }
  .gallery-section:last-child { margin-bottom: 0; }
  .gf-page { padding: 32px 0; }
  footer.site-footer { margin-top: 0; padding: 32px 0 24px; }

  /* footer menu on one line */
  footer.site-footer .container { padding: 0 16px; }
  footer.site-footer .foot-nav { flex-wrap: nowrap; justify-content: space-between; gap: 6px; width: 100%; }
  footer.site-footer .foot-nav a { font-size: 0.8rem; white-space: nowrap; }
}

/* mobile header: school name in 2 tight lines ("Andrew Kim / Korean School") */
@media (max-width: 640px) {
  .header-top { gap: 8px; }
  .brand-text { display: block; line-height: 1.15; }
  .brand-text br { display: none; }
  .brand-text .name { display: block; font-size: 0.92rem; line-height: 1.15; text-wrap: balance; }
  .lang-toggle { padding: 2px; gap: 2px; }
  .lang-toggle button { padding: 4px 8px; font-size: 0.76rem; }
}

/* mobile notice boxes: tighter lines, label sits right above its value */
@media (max-width: 640px) {
  .notice-box { padding: 24px 22px; }
  .notice-box h3 { margin-bottom: 12px; line-height: 1.35; }
  .notice-box dl { row-gap: 0; line-height: 1.45; }
  .notice-box dt { margin-top: 12px; font-size: 0.9rem; }
  .notice-box dt:first-child { margin-top: 0; }
  .notice-box dd { margin-top: 2px; }
  .notice-box .notice-extra { line-height: 1.5; margin-top: 14px !important; }
}

/* mobile: keep "Online Registration — Click Here" on one line */
@media (max-width: 640px) {
  .notice-btn { white-space: nowrap; padding: 11px 16px; font-size: 0.88rem; }
}
@media (max-width: 400px) {
  .notice-box { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 400px) {
  #home-hero-btn { white-space: nowrap; padding: 11px 16px; font-size: 0.88rem; }
}

/* ---------- vertical rhythm on all screen sizes: 32px between blocks, 24px under headings ---------- */
section { padding: 32px 0 0; }
section[style] { padding-top: 32px !important; }   /* inner pages set padding-top inline */
section:last-of-type { padding-bottom: 32px; }
.hero { padding: 0; }
.section-head { margin-bottom: 24px; }
.section-sub { margin-bottom: 0; }
.image-band { margin-bottom: 32px; }
.prose { margin-bottom: 32px !important; }         /* about.html sets 56px inline */
.doc-list { margin-bottom: 32px; }
.gallery-section { margin-bottom: 32px; }
.gallery-section:last-child { margin-bottom: 0; }
.gf-page { padding: 32px 0; }
footer.site-footer { margin-top: 0; }

/* header brand: name and tagline stacked tightly (all screen sizes, both languages) */
.brand-text { display: block; line-height: 1.2; }
.brand-text br { display: none; }
.brand-text .name { display: block; line-height: 1.2; }
.brand-text .tagline { display: block; line-height: 1.25; margin-top: 2px; }
@media (max-width: 640px) {
  .brand-text .tagline { display: none; }            /* no room on phones */
  .brand-text .name { line-height: 1.15; }
}

/* 404 page */
.notfound { text-align: center; padding-block: 72px !important; }
.notfound .section-sub { margin: 8px auto 28px; }
.nf-code { font-size: 4.5rem; font-weight: 900; color: var(--crimson); line-height: 1; margin: 0 0 8px; opacity: 0.9; }
.nf-actions { display: flex; gap: 20px; justify-content: center; align-items: center; flex-wrap: wrap; }
.nf-link { color: var(--crimson); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- layout shift: reserve room for content that content.js draws after loading ---------- */
/* Keeps the footer below the screen until the real content arrives, so nothing visible jumps. */
#gallery-root:empty { min-height: 100vh; }
#level-list:empty { min-height: 100vh; }
#team-grid:empty { min-height: 60vh; }

/* ---------- mobile tap targets (≥ 40–44px) ---------- */
@media (max-width: 1080px) {
  .nav-toggle { min-width: 44px; min-height: 44px; font-size: 1.1rem; }
}
@media (max-width: 640px) {
  .lang-toggle button { min-height: 36px; }
  footer.site-footer .foot-nav a { display: inline-block; padding: 10px 0; min-width: 28px; text-align: center; }
  nav.main-nav.open a { padding: 12px 14px; }
  .team-card .meta a { display: inline-block; padding: 8px 0; }
  .school-address a { display: inline-block; padding: 6px 0; }
  .gf-option { padding: 10px 0; }
  .gf-option input, .gf-grid input { width: 24px; height: 24px; }
}

/* keyboard focus for gallery tiles */
.gallery-item:focus-visible { outline: 3px solid var(--crimson); outline-offset: 3px; }
/* the whole grid cell selects the radio, not just the small circle */
.gf-grid td { padding: 0; }
.gf-cell { display: flex; align-items: center; justify-content: center; min-height: 48px; cursor: pointer; }
