@import url('/assets/css/school-ui.css');

:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --text: #172033;
  --muted: #5d687c;
  --line: #dce3ee;
  --primary: #175cd3;
  --primary-strong: #124aa9;
  --accent: #0e887b;
  --focus: #f59e0b;
  --danger: #b42318;
  --shadow: 0 14px 38px rgba(24, 39, 75, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --page: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1421;
    --surface: #151f30;
    --surface-soft: #182a47;
    --text: #f2f5fa;
    --muted: #abb7c9;
    --line: #2a3850;
    --primary: #77a9ff;
    --primary-strong: #9bc0ff;
    --accent: #56d3c4;
    --focus: #fbbf24;
    --danger: #fda29b;
    --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-width: 320px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

button, input, select { font: inherit; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-180%);
  border-radius: 0.65rem;
  background: var(--text);
  color: var(--surface);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding-top: env(safe-area-inset-top);
  backdrop-filter: blur(14px);
}

.nav {
  width: min(100% - 2rem, var(--page));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand img { width: 40px; height: 40px; object-fit: contain; }

.nav-actions, .nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-actions { min-width: 0; }
.nav-links a {
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  display: inline-flex;
  align-items: center;
  border-radius: 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: var(--surface-soft);
  color: var(--primary);
}
.nav-links a[href="/auth/logout"] { margin-left: 0.15rem; border: 1px solid var(--line); }

.nav-toggle {
  width: 44px;
  height: 44px;
  padding: 10px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle span { width: 21px; height: 2px; border-radius: 999px; background: currentColor; transition: transform 160ms ease, opacity 160ms ease; }
.nav[data-open="true"] .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav[data-open="true"] .nav-toggle span:nth-child(2) { opacity: 0; }
.nav[data-open="true"] .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.language-switcher {
  width: auto;
  min-width: 92px;
  min-height: 44px;
  padding: 0.55rem 2rem 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.container { width: min(100% - 2rem, var(--page)); margin-inline: auto; }

.page-main { padding: clamp(2rem, 5vw, 4.5rem) 0 4rem; }
.page-heading { max-width: 760px; margin-bottom: 2rem; }
.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.8rem; font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.08; letter-spacing: -0.045em; }
h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); line-height: 1.2; letter-spacing: -0.025em; }
h3 { font-size: 1.05rem; line-height: 1.35; }
.lede { max-width: 65ch; margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.18rem); }

.site-footer {
  padding: 1.35rem max(1rem, env(safe-area-inset-right)) max(1.35rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.notice {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--text);
}
.notice svg { flex: 0 0 22px; margin-top: 0.12rem; color: var(--primary); }
.notice p { margin: 0; }

.placeholder-card {
  max-width: 720px;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.placeholder-card p:last-child { margin-bottom: 0; color: var(--muted); }

@media (max-width: 860px) {
  .nav { min-height: 64px; flex-wrap: wrap; padding-block: 0.6rem; }
  .brand { min-width: 0; }
  .brand span { max-width: min(52vw, 18rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { display: grid; flex: 0 0 auto; }
  .nav-actions { width: 100%; padding: 0.25rem 0 0.65rem; align-items: stretch; flex-direction: column; gap: 0.65rem; }
  .nav-enhanced .nav-actions { display: none; }
  .nav-enhanced .nav[data-open="true"] .nav-actions { display: flex; }
  .nav-links { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
  .nav-links a { justify-content: center; padding-inline: 0.6rem; border: 1px solid transparent; text-align: center; }
  .nav-links a[href="/auth/logout"] { margin-left: 0; }
  .language-switcher { width: 100%; }
}

@media (max-width: 430px) {
  .container, .nav { width: min(100% - 1.25rem, var(--page)); }
  .nav-links a { font-size: 0.83rem; }
  .brand span { max-width: 56vw; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* Keep the school navigation on one row; the existing menu handles narrow screens. */
.site-header .brand{flex-shrink:0;white-space:nowrap}
.site-header .nav-links a{white-space:nowrap}
.site-header .language-switcher{width:96px;min-width:96px;max-width:96px;flex:0 0 96px}
.site-header .nav-actions>.theme-picker{flex-shrink:0}
@media(min-width:1101px){.site-header .nav-links{gap:2px}.site-header .nav-links a{padding-inline:.6rem;font-size:.85rem}.site-header .nav-actions{gap:8px}}
@media(max-width:1100px){.site-header .language-switcher{flex:none;width:100%;max-width:none}.site-header .nav-links a[href="/help/"]{min-height:44px}}
