/* shared/css/base.css */
/* eschoolweb base styles. Structure, accessibility and the look of every shared block.
   A theme sets the design tokens below and adds its own layout rules in theme.css. */

:root {
  --es-bg: #ffffff;
  --es-fg: #1b1f24;
  --es-muted: #5b6470;
  --es-surface: #f5f6f8;
  --es-border: #dfe3e8;
  --es-primary: #1f3a6e;
  --es-primary-fg: #ffffff;
  --es-accent: #c9962b;
  --es-link: var(--es-primary);
  --es-radius: 8px;
  --es-max: 1120px;
  --es-gutter: 20px;
  --es-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --es-font-head: var(--es-font);
  --es-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 18px rgba(0, 0, 0, 0.07);
  --es-ratio: 16 / 7; /* slider shape */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--es-font); font-size: 1rem; line-height: 1.65; color: var(--es-fg); background: var(--es-bg); }
img, svg { max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--es-font-head); line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--es-link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--es-accent); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- helpers ---------- */
.es-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.es-skip { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 10px 16px; background: var(--es-primary); color: var(--es-primary-fg); border-radius: var(--es-radius); text-decoration: none; }
.es-skip:focus { top: 8px; }
.es-wrap { width: 100%; max-width: var(--es-max); margin-inline: auto; padding-inline: var(--es-gutter); }
.es-narrow { max-width: 780px; }
.es-section { padding-block: clamp(28px, 5vw, 56px); }
.es-i { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.es-lead { font-size: 1.15rem; color: var(--es-muted); max-width: 60ch; }
.es-h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
.es-h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-top: 1.6em; }
.es-prose p { white-space: pre-line; max-width: 70ch; }
.es-prose--lead p:first-child { font-size: 1.15rem; }
.es-back { margin-top: 2em; }
.es-back a { text-decoration: none; }

.es-logo { width: 56px; height: 56px; object-fit: contain; flex: none; }
.es-monogram { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--es-primary); color: var(--es-primary-fg); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; flex: none; }

.es-btn { display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; padding: 0.55em 1.2em; border: 2px solid var(--es-primary); border-radius: var(--es-radius); background: var(--es-primary); color: var(--es-primary-fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.es-btn:hover { filter: brightness(1.1); }
.es-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.es-btn--ghost { background: transparent; color: var(--es-primary); }
.es-badge { display: inline-block; padding: 0.1em 0.65em; border-radius: 999px; background: var(--es-accent); color: #1b1f24; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.es-status, .es-empty { color: var(--es-muted); }
.es-error { color: #b00020; font-weight: 600; min-height: 1.5em; }

/* ---------- navigation ---------- */
.es-menu-btn { display: none; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--es-border); border-radius: var(--es-radius); background: transparent; color: inherit; cursor: pointer; }
.es-nav__list { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.es-nav a { text-decoration: none; color: inherit; padding: 0.4em 0; display: inline-block; border-bottom: 2px solid transparent; }
.es-nav a:hover, .es-nav a[aria-current="page"] { border-bottom-color: currentColor; }
@media (max-width: 860px) {
  .js .es-menu-btn { display: inline-flex; }
  .js .es-nav { display: none; }
  .js .es-nav.is-open { display: block; }
  .es-nav__list { flex-direction: column; gap: 0; }
  .es-nav a { display: block; padding: 0.7em 0; }
}

/* ---------- slider ---------- */
.es-slider { position: relative; overflow: hidden; background: #111; color: #fff; }
.es-slides { position: relative; aspect-ratio: var(--es-ratio); min-height: 240px; }
.es-slide { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity 0.9s ease, visibility 0.9s; }
.es-slide.is-active { opacity: 1; visibility: visible; }
.es-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.es-slide__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(16px, 4vw, 48px); padding-bottom: 64px; background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0)); }
.es-slide__title { font-family: var(--es-font-head); font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.15; margin: 0 0 0.3em; max-width: 24ch; }
.es-slide__text { font-size: clamp(1rem, 2vw, 1.25rem); margin: 0 0 1em; max-width: 50ch; }
.es-slider__ctl { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.es-slider__btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; }
.es-slider__btn:hover { background: rgba(0, 0, 0, 0.8); }
.es-slider__btn--toggle.is-paused svg { transform: none; }
.es-dots { display: flex; gap: 8px; }
.es-dot { width: 12px; height: 12px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.es-dot[aria-current="true"] { background: #fff; }
@media (max-width: 600px) { .es-slides { aspect-ratio: 4 / 3; } .es-slide__text { display: none; } }

/* ---------- gallery ---------- */
.es-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.es-gallery li { margin: 0; }
.es-gallery a { position: relative; display: block; overflow: hidden; border-radius: var(--es-radius); background: var(--es-surface); }
.es-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.4s ease; }
.es-gallery a:hover img { transform: scale(1.05); }
.es-gallery__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 8px; color: #fff; font-size: 0.9rem; background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent); }
.es-lightbox { border: 0; padding: 0; background: transparent; color: #fff; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.es-lightbox::backdrop { background: rgba(0, 0, 0, 0.9); }
.es-lightbox__fig { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 16px; }
.es-lightbox__img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.es-lightbox__cap { margin-top: 12px; text-align: center; }
.es-lightbox__btn { position: fixed; min-height: 44px; padding: 0 16px; border: 1px solid #fff; border-radius: var(--es-radius); background: rgba(0, 0, 0, 0.6); color: #fff; font: inherit; cursor: pointer; }
.es-lightbox__close { top: 12px; right: 12px; }
.es-lightbox__prev { left: 12px; top: 50%; }
.es-lightbox__next { right: 12px; top: 50%; }

/* ---------- live lists ---------- */
.es-list { list-style: none; margin: 0; padding: 0; }
.es-notices { display: grid; gap: 12px; }
.es-notice__link { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--es-border); border-radius: var(--es-radius); background: var(--es-bg); color: inherit; text-decoration: none; }
.es-notice__link:hover { border-color: var(--es-primary); box-shadow: var(--es-shadow); }
.es-notice__date { font-size: 0.85rem; color: var(--es-muted); }
.es-notice__title { font-weight: 700; font-size: 1.1rem; color: var(--es-primary); }
.es-notice__excerpt { color: var(--es-muted); }
.es-notice__link .es-badge { justify-self: start; }
.es-notice__excerpt:empty { display: none; }
.es-more { margin-top: 18px; }
.es-article__meta { color: var(--es-muted); }
.es-groups { display: grid; gap: 36px; }
.es-group__title { font-size: 1.4rem; padding-bottom: 8px; border-bottom: 2px solid var(--es-border); }
.es-staff { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.es-person { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--es-border); border-radius: var(--es-radius); background: var(--es-bg); }
.es-person__avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--es-primary); color: var(--es-primary-fg); font-weight: 700; flex: none; }
.es-person__text { display: grid; gap: 1px; min-width: 0; }
.es-person__role, .es-person__qual { font-size: 0.9rem; color: var(--es-muted); }
.es-person__role:empty, .es-person__qual:empty { display: none; }
.es-results { display: grid; gap: 12px; }
.es-result__link { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--es-border); border-radius: var(--es-radius); color: inherit; text-decoration: none; }
.es-result__link:hover { border-color: var(--es-primary); box-shadow: var(--es-shadow); }
.es-result__title { font-weight: 700; font-size: 1.1rem; color: var(--es-primary); }
.es-result__meta { color: var(--es-muted); font-size: 0.9rem; }
.es-result__go { font-weight: 600; }
.es-result__go::after { content: " →"; }

/* ---------- forms and marks card ---------- */
.es-result-title { font-size: 1.2rem; font-weight: 700; }
.es-form { display: grid; gap: 14px; max-width: 460px; }
.es-field { display: grid; gap: 6px; }
.es-field label { font-weight: 600; }
.es-field small { color: var(--es-muted); }
.es-field input, .es-field select { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid #8a93a0; border-radius: var(--es-radius); background: #fff; color: #1b1f24; font: inherit; }
.es-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 16px; }
.es-card-wrap { margin-top: 20px; }
.es-card { background: #fff; color: #111; border: 2px solid #222; padding: clamp(14px, 3vw, 28px); box-shadow: var(--es-shadow); font-family: Georgia, "Times New Roman", serif; }
.es-card__head { text-align: center; border-bottom: 2px solid #222; margin-bottom: 14px; padding-bottom: 10px; }
.es-card__school { font-size: clamp(1.2rem, 3.5vw, 1.7rem); margin: 0; }
.es-card__exam { margin: 4px 0 0; color: #444; }
.es-card__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; margin: 0 0 16px; }
.es-card__meta div { display: flex; gap: 6px; }
.es-card__meta dt { font-weight: 700; }
.es-card__meta dt::after { content: ":"; }
.es-card__meta dd { margin: 0; }
.es-card__tablewrap { overflow-x: auto; }
.es-card__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.es-card__table th, .es-card__table td { border: 1px solid #555; padding: 6px 10px; text-align: left; }
.es-card__table thead th { background: #eee; }
.es-card__table .es-num { text-align: right; }
.es-card__overall th, .es-card__overall td { background: #f3f3f3; font-weight: 700; }
.es-card__result { margin: 14px 0 6px; font-size: 1.1rem; }
.es-card__note { font-size: 0.8rem; color: #444; margin: 0; }

/* ---------- contact, social, stats, principal ---------- */
.es-contact { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 12px; }
.es-contact__item { display: flex; gap: 12px; align-items: flex-start; }
.es-contact__item .es-i { margin-top: 0.25em; color: var(--es-primary); }
.es-contact__label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--es-muted); }
.es-contact-page { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .es-contact-page { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.es-map { width: 100%; height: 360px; border: 0; border-radius: var(--es-radius); }
.es-social { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.es-social a { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; color: inherit; }
.es-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.es-stats li { text-align: center; }
.es-stats__value { display: block; font-family: var(--es-font-head); font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--es-primary); line-height: 1.1; }
.es-stats__label { color: var(--es-muted); }
.es-principal { display: grid; gap: 20px; align-items: start; }
@media (min-width: 700px) { .es-principal:has(.es-principal__photo) { grid-template-columns: 200px minmax(0, 1fr); } }
.es-principal__photo { width: 200px; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--es-radius); background: var(--es-surface); }
.es-principal__sign span { color: var(--es-muted); }

/* themes/modern/theme.css */
/* modern: indigo + teal, sticky glass header, split hero, rounded cards. Follows the visitor's light/dark setting. */
:root {
  --es-bg: #ffffff; --es-fg: #0f172a; --es-muted: #475569; --es-surface: #f4f5fb; --es-border: #e2e5f1;
  --es-primary: #4f46e5; --es-primary-fg: #ffffff; --es-accent: #14b8a6; --es-link: #4338ca;
  --es-radius: 16px; --es-max: 1180px; --es-ratio: 4 / 3;
  --es-font-head: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --es-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(79, 70, 229, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root, :root[data-theme="modern"] { --es-bg: #0b1020; --es-fg: #e8ebf7; --es-muted: #aab2cc; --es-surface: #131a31; --es-border: #263055; --es-primary: #6366f1; --es-link: #a5b4fc; --es-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
  .md-header { background: rgba(11, 16, 32, 0.78); }
  .es-field input, .es-field select { background: #131a31; color: #e8ebf7; border-color: #3a4672; }
  .es-notice__link, .es-person, .es-result__link { background: var(--es-surface); }
}
body { background: var(--es-bg); }
.md-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--es-border); transition: box-shadow 0.2s; }
.md-header.is-scrolled { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.10); }
.md-header__in { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.md-brand { display: flex; align-items: center; gap: 12px; color: var(--es-fg); text-decoration: none; font-weight: 700; }
.md-logo { width: 44px; height: 44px; font-size: 1rem; }
.md-brand__name { font-family: var(--es-font-head); line-height: 1.15; max-width: 22ch; }
.md-nav { margin-left: auto; }
.md-nav .es-nav__list { gap: 4px; }
.md-nav a { padding: 8px 14px; border-radius: 999px; border: 0; color: var(--es-muted); font-weight: 600; }
.md-nav a:hover { background: var(--es-surface); color: var(--es-fg); }
.md-nav a[aria-current="page"] { background: var(--es-primary); color: var(--es-primary-fg); }
.md-menu { margin-left: auto; color: var(--es-fg); }
.md-cta { padding-block: 6px; min-height: 40px; border-radius: 999px; }
@media (max-width: 1000px) { .md-cta { display: none; } .md-nav a { padding: 12px 10px; border-radius: 12px; } .md-nav { position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 8px var(--es-gutter) 16px; background: var(--es-bg); border-bottom: 1px solid var(--es-border); } .md-header__in { position: relative; } }

.md-hero { background: radial-gradient(900px 400px at 85% -10%, rgba(99, 102, 241, 0.22), transparent 60%), radial-gradient(700px 360px at -5% 20%, rgba(20, 184, 166, 0.18), transparent 60%); padding-block: clamp(28px, 6vw, 72px); }
.md-hero__grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 940px) { .md-hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.md-eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--es-surface); color: var(--es-link); font-size: 0.85rem; font-weight: 600; }
.md-hero__title { font-size: clamp(2.1rem, 5.4vw, 3.8rem); letter-spacing: -0.02em; margin-bottom: 0.3em; }
.md-hero__lead { font-size: 1.2rem; color: var(--es-muted); max-width: 46ch; }
.md-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.md-hero__media .es-slider { border-radius: 28px; box-shadow: var(--es-shadow); }
.md-slider .es-slide__cap { padding-bottom: 60px; }
.md-slider .es-slide__title { font-size: clamp(1.1rem, 2.4vw, 1.7rem); }
.md-statsbar { padding-block: 22px; border-block: 1px solid var(--es-border); background: var(--es-surface); }
.md-statsbar .es-stats__value { background: linear-gradient(90deg, #4f46e5, #14b8a6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.md-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.md-head .es-h2 { margin-top: 0; }
.md-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.md-card .es-notice__link { height: 100%; align-content: start; padding: 20px; border-radius: 20px; background: var(--es-bg); border-color: var(--es-border); transition: transform 0.2s, box-shadow 0.2s; }
.md-card .es-notice__link:hover { transform: translateY(-4px); }
.md-card .es-badge { justify-self: start; background: var(--es-accent); }
.md-tint { background: var(--es-surface); }
.md-bento { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.md-bento a { display: grid; gap: 6px; height: 100%; padding: 24px; border-radius: 24px; background: var(--es-bg); border: 1px solid var(--es-border); color: var(--es-fg); text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.md-bento a:hover { transform: translateY(-4px); box-shadow: var(--es-shadow); }
.md-bento .es-i { width: 2.2em; height: 2.2em; padding: 0.5em; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #4f46e5, #14b8a6); }
.md-bento span { color: var(--es-muted); }
.md-bento__i--1 a { background: linear-gradient(135deg, #4f46e5, #6d5df0); color: #fff; border: 0; }
.md-bento__i--1 span { color: #e0e3ff; }
.md-bento__i--1 .es-i { background: rgba(255, 255, 255, 0.2); }
.md-principal { background: var(--es-surface); padding: 24px; border-radius: 28px; }
.md-principal .es-principal__photo { border-radius: 50%; width: 180px; }
.md-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.md-gallery a { border-radius: 20px; }
.md-contact { background: linear-gradient(135deg, #4338ca, #0f766e); color: #fff; padding-block: 48px; }
.md-contact__in { display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) { .md-contact__in { grid-template-columns: 1fr 1.3fr; } }
.md-contact h2 { font-size: 2rem; }
.md-contact a { color: #fff; }
.md-contact .es-contact__item .es-i, .md-contact__list .es-contact__label { color: #c7f9ee; }

.md-pagehead { padding-block: 28px 0; }
.md-pagehead__box { padding: clamp(24px, 5vw, 48px); border-radius: 28px; background: linear-gradient(135deg, #4f46e5, #6d5df0 55%, #14b8a6); color: #fff; }
.md-pagehead .es-h1 { margin: 0; }
.md-pagehead .es-lead { color: #e6e9ff; margin: 8px 0 0; }
.md-footer { margin-top: 56px; background: var(--es-surface); border-top: 1px solid var(--es-border); }
.md-footer__grid { display: grid; gap: 32px; padding-block: 44px 24px; }
@media (min-width: 860px) { .md-footer__grid { grid-template-columns: 1.4fr 1fr 1.4fr; } }
.md-footer__h { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--es-muted); }
.md-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.md-footer__links a { color: var(--es-fg); text-decoration: none; }
.md-footer__bar { padding-block: 16px 28px; color: var(--es-muted); font-size: 0.9rem; }
.md-social a { border-color: var(--es-border); color: var(--es-fg); }
.md-footer .es-nav__list { flex-direction: column; }
.md-footer .es-contact__item .es-i { color: var(--es-primary); }

/* shared/css/print.css */
/* Printing the marks card: only the card is printed. Themes mark their page heading wrapper with class "es-pagehead". */
@media print {
  @page { margin: 14mm; }
  header, footer, nav, .es-skip, .es-menu-btn, .es-form, .es-actions, .es-back, .es-slider, .es-status,
  .es-pagehead, .es-h1, .es-lead, .es-result-title, .es-no-print { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .es-section { padding: 0 !important; }
  .es-wrap { max-width: none !important; padding: 0 !important; }
  .es-card { border: 1px solid #000; box-shadow: none; break-inside: avoid; }
  .es-card__tablewrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}
