/* =========================================================
   Site școală – stiluri principale
   Toate dimensiunile în rem => scalarea fontului din panoul
   de accesibilitate funcționează pe tot site-ul.
   ========================================================= */

:root {
  --ink: #14274a;        /* albastru instituțional */
  --ink-2: #23407a;
  --gold: #f2c230;       /* accent (butoane, sublinieri) */
  --red: #b3122b;
  --bg: #ffffff;
  --bg-alt: #eef2f8;
  --text: #1b2433;
  --muted: #465267;
  --link: #1d4fa3;
  --border: #c9d3e1;
  --on-ink: #ffffff;
  --on-gold: #14274a;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;

  --a11y-scale: 1;
  --a11y-lh: 1;
  --radius: 4px;
  color-scheme: light;
}

/* ---------- Moduri de culoare (panoul de accesibilitate) ---------- */
html.a11y-color-light {
  --ink: #000; --ink-2: #000; --gold: #000; --red: #000;
  --bg: #fff; --bg-alt: #fff; --text: #000; --muted: #000;
  --link: #0000c8; --border: #000; --on-ink: #fff; --on-gold: #fff;
}
html.a11y-color-high {
  --ink: #000; --ink-2: #000; --gold: #ffea00; --red: #ffea00;
  --bg: #000; --bg-alt: #000; --text: #fff; --muted: #fff;
  --link: #ffea00; --border: #fff; --on-ink: #fff; --on-gold: #000;
  color-scheme: dark;
}
html.a11y-color-high .site img,
html.a11y-color-light .site img { outline: 2px solid var(--border); }
html.a11y-color-mono .site { filter: grayscale(1); }

/* ---------- Bază ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--a11y-scale));
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: calc(1.6 * var(--a11y-lh));
  color: var(--text);
  background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: calc(1.2 * var(--a11y-lh));
  color: var(--text);
  margin: 0 0 .6em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p, ul, ol, dl, table { margin: 0 0 1.1em; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ink);
}
html.a11y-color-high :focus-visible { outline-color: #ffea00; box-shadow: 0 0 0 6px #fff; }

.wrap { max-width: 74rem; margin-inline: auto; padding-inline: 1.25rem; }
.prose { max-width: 44rem; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -10rem; z-index: 10000;
  background: var(--gold); color: var(--on-gold); padding: .8rem 1.2rem;
  font-weight: 700; border-radius: var(--radius); text-decoration: none;
}
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }

/* ---------- Butoane ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .6rem 1.3rem;
  font: inherit; font-weight: 700; line-height: 1.2;
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn-ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
html.a11y-color-high .btn-ink { border-color: #fff; }

/* ---------- Antet ---------- */
.site-header { background: var(--bg); }
.tricolor { height: 6px; background: linear-gradient(90deg, #002b7f 0 33.33%, #fcd116 33.33% 66.66%, #ce1126 66.66%); }
html.a11y-color-high .tricolor, html.a11y-color-light .tricolor { background: var(--border); }

.nav-inner { display: flex; align-items: center; gap: 1rem; max-width: 86rem; }
.main-nav { flex: 1; }
.nav-cta { flex: none; margin-block: .45rem; }
.nav-cta[aria-current="page"] { outline: 2px solid #fff; outline-offset: 2px; }
.nav-toggle { display: none; }

/* bara de navigare */
.nav-bar { background: var(--ink); color: var(--on-ink); }
html.a11y-color-high .nav-bar, html.a11y-color-light .nav-bar { border-block: 2px solid var(--border); }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li { position: relative; margin: 0; }
.main-nav a, .sub-toggle {
  display: flex; align-items: center; gap: .4rem;
  min-height: 3.25rem; padding: .5rem .8rem;
  color: var(--on-ink); text-decoration: none;
  font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer;
  border-bottom: 4px solid transparent;
}
.main-nav > ul > li > a:hover, .sub-toggle:hover { border-bottom-color: var(--gold); }
.main-nav > ul > li > a[aria-current="page"], .has-sub.is-current > .sub-toggle { border-bottom-color: var(--gold); }
.sub-toggle .chev { width: .7em; height: .7em; transition: transform .15s; }
.sub-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.submenu {
  list-style: none; margin: 0; padding: .4rem 0;
  position: absolute; left: 0; top: 100%; z-index: 50; min-width: 17rem;
  background: var(--bg); border: 1px solid var(--border); border-top: 4px solid var(--gold);
  box-shadow: 0 12px 24px rgba(20, 39, 74, .18);
}
.sub-toggle[aria-expanded="false"] + .submenu { display: none; }
.submenu a { color: var(--text); font-weight: 500; min-height: 2.75rem; border-bottom: 0; padding: .55rem 1.1rem; }
.submenu a:hover { background: var(--bg-alt); text-decoration: underline; }
.submenu a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; }

@media (max-width: 75em) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem;
    padding: .5rem 1rem; font: inherit; font-weight: 700;
    background: var(--ink); color: var(--on-ink); border: 2px solid var(--ink); border-radius: var(--radius); cursor: pointer;
  }
  .nav-inner { flex-wrap: wrap; justify-content: space-between; padding-block: .6rem; }
  .nav-toggle { border-color: #fff; }
  .main-nav { display: none; flex-basis: 100%; order: 3; }
  .main-nav.is-open { display: block; }
  .main-nav > ul { flex-direction: column; padding-block: .5rem; }
  .main-nav a, .sub-toggle { width: 100%; justify-content: space-between; border-bottom: 0; border-left: 4px solid transparent; }
  .main-nav > ul > li > a[aria-current="page"], .has-sub.is-current > .sub-toggle { border-left-color: var(--gold); }
  .submenu { position: static; box-shadow: none; border: 0; border-left: 4px solid var(--gold); margin-left: 1rem; background: var(--bg); }
}

/* ---------- Hero cu identitatea școlii (pe toate paginile) ---------- */
.hero { position: relative; display: grid; background: #1b2433; min-height: clamp(24rem, 46vw, 36rem); }
.hero--compact { min-height: clamp(14rem, 22vw, 18rem); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* banda neagră semitransparentă, pe toată lățimea paginii */
.hero-band {
  position: relative; align-self: end; width: 100%;
  background: rgba(0, 0, 0, .66); color: #fff;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.hero-band-inner { display: flex; align-items: center; gap: 1.5rem; padding-block: 1.5rem; max-width: 86rem; }
.hero--compact .hero-band-inner { padding-block: 1rem; }
.hero-logo { width: 6rem; height: auto; flex: none; }
.hero--compact .hero-logo { width: 4.5rem; }
.hero-name {
  font-family: var(--font-head); font-weight: 700; color: #fff; margin: 0 0 .2em;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); line-height: calc(1.15 * var(--a11y-lh));
}
.hero--compact .hero-name { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); }
.hero-name a { color: #fff; text-decoration: none; }
.hero-name a:hover { text-decoration: underline; }
.hero-place { margin: 0; font-size: 1.05rem; }
html.a11y-color-high .hero-band, html.a11y-color-light .hero-band { background: #000; border-top: 2px solid #fff; }

/* sub fotografie: motto + butoane */
.hero-below { background: var(--ink); color: var(--on-ink); border-top: 4px solid var(--gold); }
html.a11y-color-high .hero-below, html.a11y-color-light .hero-below { border-bottom: 2px solid #fff; }
.hero-below-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
  padding-block: 1.1rem; max-width: 86rem;
}
.hero-motto { margin: 0; font-family: var(--font-head); font-style: italic; font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); color: var(--gold); }
html.a11y-color-light .hero-motto { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-actions .btn-outline { color: var(--on-ink); }
@media (max-width: 40em) {
  .hero-band-inner { gap: 1rem; padding-block: 1rem; }
  .hero-logo, .hero--compact .hero-logo { width: 3.5rem; }
}

/* ---------- Secțiuni ---------- */
.section { padding-block: clamp(3rem, 2rem + 4vw, 5rem); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 44rem; margin-bottom: 2rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
.split figure { margin: 0; }
.split img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.facts { list-style: none; padding: 0; display: grid; gap: .75rem; margin-bottom: 1.6rem; }
.facts li { padding-left: 1rem; border-left: 4px solid var(--gold); }
.facts strong { display: block; font-family: var(--font-head); font-size: 1.15rem; }
@media (max-width: 50em) { .split { grid-template-columns: 1fr; } }

/* ---------- Carusel ---------- */
.carousel { max-width: 62rem; }
.slide { margin: 0; }
.slide img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.slide figcaption { background: var(--ink); color: var(--on-ink); padding: 1rem 1.25rem; }
.slide figcaption strong { display: block; font-family: var(--font-head); font-size: 1.2rem; }
.slide.is-active { animation: fade .45s ease; }
@keyframes fade { from { opacity: .35; } to { opacity: 1; } }

.carousel-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: 2.75rem; min-height: 2.75rem; padding: .4rem .8rem;
  font: inherit; font-weight: 600; color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }
.carousel-dots { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.carousel-dots button {
  width: 2.25rem; height: 2.25rem; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.carousel-dots button::before {
  content: ""; width: .9rem; height: .9rem; border-radius: 50%;
  border: 2px solid var(--ink); background: transparent;
}
html.a11y-color-high .carousel-dots button::before { border-color: #fff; }
.carousel-dots button[aria-current="true"]::before { background: var(--ink); width: 1.6rem; border-radius: .5rem; }
html.a11y-color-high .carousel-dots button[aria-current="true"]::before { background: #ffea00; }
.carousel-counter { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Subpagini ---------- */
.page-head { background: var(--bg-alt); padding-block: 2rem 2.5rem; border-bottom: 1px solid var(--border); }
.page-head p { max-width: 44rem; color: var(--muted); font-size: 1.1rem; margin: 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; font-size: .95rem; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--muted); }

.content { padding-block: 3rem 4rem; }
.content-grid { display: grid; grid-template-columns: 15rem 1fr; gap: 3rem; align-items: start; }
.toc { position: sticky; top: calc(1rem + env(safe-area-inset-top, 0px)); border-left: 4px solid var(--gold); padding-left: 1rem; }
.toc h2 { font-size: 1.05rem; font-family: var(--font-body); }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: .4rem; }
/* pagina Contact: două coloane echilibrate */
.contact-grid { grid-template-columns: minmax(16rem, 1fr) 2fr; }
.info-stack { grid-template-columns: 1fr; gap: 0; }
.info-stack dd { margin-bottom: .8rem; overflow-wrap: anywhere; }
@media (max-width: 56em) { .content-grid { grid-template-columns: 1fr; } .toc { position: static; } }

.block { margin-bottom: 3rem; max-width: 50rem; }
.block > h2 { padding-bottom: .4rem; border-bottom: 2px solid var(--border); }

.doc-list { list-style: none; padding: 0; }
.doc-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--border);
}
.doc-name { font-weight: 600; }
.doc-meta { color: var(--muted); font-size: .95rem; flex-basis: 100%; }
.doc-status { font-size: .85rem; padding: .1rem .55rem; border: 1px solid var(--muted); border-radius: 1rem; color: var(--muted); white-space: nowrap; }

.info-list { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; }
.info-list dt { font-weight: 700; }
.info-list dd { margin: 0; }
@media (max-width: 36em) { .info-list { grid-template-columns: 1fr; } .info-list dd { margin-bottom: .6rem; } }

.table-wrap { overflow-x: auto; margin-bottom: 1.2em; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; }
caption { text-align: left; font-weight: 700; padding-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .8rem; border: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--bg-alt); }

.note { background: var(--bg-alt); border-left: 4px solid var(--ink); padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
html.a11y-color-high .note { border: 2px solid #fff; }

.news { list-style: none; padding: 0; display: grid; gap: 1.5rem; }
.news article { border-top: 4px solid var(--gold); padding-top: 1rem; }
.news h2 { font-size: 1.35rem; margin-bottom: .3em; }
.news time { color: var(--muted); font-size: .95rem; }

/* ---------- Formulare ---------- */
.form { max-width: 38rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; }
.field .hint { display: block; color: var(--muted); font-size: .92rem; margin-bottom: .35rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  padding: .7rem .8rem; border: 2px solid var(--muted); border-radius: var(--radius);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--red); }
.error { color: var(--red); font-weight: 600; margin: .35rem 0 0; }
.check { display: flex; gap: .7rem; align-items: flex-start; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .2rem; flex: none; }
.form-status:not(:empty) { padding: 1rem; border: 2px solid var(--ink); margin-top: 1rem; }

.map-box { border: 2px dashed var(--border); padding: 1.5rem; background: var(--bg-alt); }
.map-box iframe { width: 100%; height: 22rem; border: 0; display: block; }

/* ---------- Subsol ---------- */
.site-footer { background: var(--ink); color: var(--on-ink); padding-block: 3rem 1.5rem; margin-top: 0; }
html.a11y-color-high .site-footer { border-top: 2px solid #fff; }
.site-footer h2 { color: var(--on-ink); font-size: 1.15rem; font-family: var(--font-body); }
.site-footer a { color: var(--on-ink); }
html.a11y-color-high .site-footer a { color: #ffea00; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: .45rem; }
.footer-grid address { font-style: normal; }
.footer-btn {
  background: none; border: 0; padding: 0; color: var(--on-ink); font: inherit;
  text-decoration: underline; text-underline-offset: .18em; cursor: pointer; text-align: left;
}
html.a11y-color-high .footer-btn { color: #ffea00; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.3); margin-top: 2rem; padding-top: 1.25rem; font-size: .92rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* Mișcare redusă – implicit din sistemul de operare */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .nav-bar, .a11y-fab, .a11y-panel, .consent, .carousel-controls { display: none !important; }
}
