/* =========================================================
   โรงเรียนมัธยมวัดบึงทองหลาง — site theme
   School colours: แสด (orange) + ดำ (black). Motif: the two-band flag.
   ========================================================= */
:root {
  --brand: #F26B1D;        /* แสด */
  --brand-deep: #C9500B;   /* pressed / hover */
  --flame: #FF9E2C;        /* ดอกทองหลาง highlight */
  --ink: #1C1714;          /* ดำ — warm black for text & band */
  --paper: #FFFFFF;
  --tint: #FFF4EA;         /* warm section wash */
  --line: #EEDFD1;
  --muted: #6E625A;
  --radius: 14px;
  --font-head: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-primary: var(--brand);
  --bs-link-color: var(--brand-deep);
  --bs-link-hover-color: var(--ink);
}

html { scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-family: var(--font-head); font-weight: 600; line-height: 1.35; }
a { color: var(--brand-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--flame); outline-offset: 2px; border-radius: 4px; }
.text-brand { color: var(--brand) !important; }
.skip-link { position: absolute; z-index: 2000; left: 1rem; top: 1rem; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 8px; }

.btn-brand { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--brand-deep); --bs-btn-hover-border-color: var(--brand-deep); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-deep); --bs-btn-active-border-color: var(--brand-deep); --bs-btn-active-color: #fff;
  font-weight: 500; border-radius: 999px; padding-inline: 1.15rem; }
.btn-outline-dark { border-radius: 999px; padding-inline: 1.15rem; }

/* ---------- Top bar ---------- */
.topbar { background: var(--ink); color: #e9ddd2; font-size: .82rem; padding: .35rem 0; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { color: var(--flame); }
.topbar i { color: var(--flame); margin-right: .2rem; }

/* ---------- Masthead: orange field, emblem, flag band ---------- */
.masthead {
  position: relative;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 196, 92, .55) 0%, rgba(255, 196, 92, 0) 55%),
    linear-gradient(100deg, #E2560A 0%, #F26B1D 45%, #FF8A1F 100%);
  overflow: hidden;
}
.masthead::after { /* faint flower-ray pattern echoing the emblem's rays */
  content: ""; position: absolute; inset: 0;
  background: repeating-conic-gradient(from 200deg at 92% 120%, rgba(255,255,255,.09) 0 6deg, transparent 6deg 16deg);
  pointer-events: none;
}
.masthead-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.5rem; padding-block: 1.1rem; }
.brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-emblem { width: 72px; height: auto; background: #fff; border-radius: 50%; padding: 9px 11px; box-shadow: 0 0 0 4px rgba(255,255,255,.35); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.35rem, 3.2vw, 2.15rem); line-height: 1.15; text-shadow: 0 2px 0 rgba(120, 40, 0, .25); }
.brand-en { font-size: clamp(.78rem, 1.6vw, .98rem); opacity: .92; letter-spacing: .01em; }
.masthead-search { margin-left: auto; background: rgba(255,255,255,.95); border-radius: 999px; padding: 3px; width: 320px; }
.masthead-search .form-control { border: 0; background: transparent; border-radius: 999px; padding-left: 1rem; box-shadow: none; }
.masthead-search .btn { color: var(--brand-deep); border-radius: 999px; }
.flag-band { height: 8px; background: linear-gradient(to bottom, var(--brand) 0 50%, var(--ink) 50% 100%); position: relative; z-index: 1; }
.masthead .flag-band { background: var(--ink); height: 6px; }

/* ---------- Main nav ---------- */
.mainnav { background: #fff; border-bottom: 1px solid var(--line); padding-block: 0; box-shadow: 0 6px 18px -14px rgba(60, 25, 0, .35); }
.mainnav .nav-link { font-family: var(--font-head); font-weight: 500; color: var(--ink); padding: .95rem .85rem !important; position: relative; }
.mainnav .nav-link:hover, .mainnav .nav-link.active, .mainnav .show > .nav-link { color: var(--brand-deep); }
.mainnav .nav-link.active::after, .mainnav .nav-link:hover::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 0; height: 3px; background: var(--brand); border-radius: 3px 3px 0 0; }
.mainnav .dropdown-menu { border: 0; border-top: 3px solid var(--brand); border-radius: 0 0 12px 12px; box-shadow: 0 18px 40px -18px rgba(40, 15, 0, .4); padding: .4rem; min-width: 260px; max-height: 70vh; overflow: auto; }
.mainnav .dropdown-item { border-radius: 8px; padding: .5rem .8rem; white-space: normal; font-size: .95rem; }
.mainnav .dropdown-item:hover, .mainnav .dropdown-item:focus { background: var(--tint); color: var(--brand-deep); }
.mainnav .navbar-toggler { border: 0; font-size: 1.8rem; color: var(--ink); box-shadow: none; }
.mainnav .navbar-brand { font-family: var(--font-head); font-weight: 700; color: var(--brand-deep); }
@media (min-width: 992px) {
  .mainnav .dropdown:hover > .dropdown-menu { display: block; margin-top: 0; }
}
@media (max-width: 991.98px) {
  .mainnav .navbar-collapse { max-height: 75vh; overflow: auto; padding-bottom: .5rem; }
  .mainnav .nav-link { padding: .6rem .25rem !important; border-bottom: 1px solid var(--line); }
  .mainnav .nav-link::after { display: none; }
  .mainnav .dropdown-menu { box-shadow: none; border-top: 0; padding-left: .75rem; }
  .masthead-inner { padding-block: .8rem; }
  .brand-emblem { width: 56px; padding: 7px 8px; }
}

/* ---------- Page head ---------- */
.page-head { background: var(--tint); border-bottom: 1px solid var(--line); padding: 1.6rem 0 1.4rem; }
.page-head h1 { font-size: clamp(1.45rem, 3vw, 2.1rem); margin: 0; font-weight: 700; }
.page-head h1::before { content: ""; display: inline-block; width: .5em; height: .9em; margin-right: .55em; vertical-align: -.05em;
  background: linear-gradient(to bottom, var(--brand) 0 55%, var(--ink) 55% 100%); border-radius: 2px; }
.breadcrumb { font-size: .85rem; margin-bottom: .3rem; }

/* ---------- Sections ---------- */
.section { padding: 3.25rem 0; }
.section-sm { padding: 2.25rem 0 3.5rem; }
.section-tint { background: var(--tint); }
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; }
.section-head h2 { font-size: 1.4rem; margin: 0; font-weight: 700; }
.section-head .more { margin-left: auto; font-size: .9rem; white-space: nowrap; text-decoration: none; font-weight: 500; }
.section-head .more:hover { text-decoration: underline; }
.block-h { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 1rem; padding-left: .75rem; border-left: 5px solid var(--brand); }
.empty { color: var(--muted); background: var(--tint); border-radius: var(--radius); padding: 1.25rem 1.5rem; }

/* ---------- Hero: banners are posters, so show them whole on a blurred bed ---------- */
.hero { background: var(--ink); }
.hero-frame { position: relative; aspect-ratio: 16 / 6.2; max-height: 560px; width: 100%; overflow: hidden; }
.hero-bg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(28px) saturate(1.2) brightness(.7); }
.hero-img { position: relative; display: block; height: 100%; width: 100%; object-fit: contain; }
.hero .carousel-indicators [data-bs-target] { width: 26px; height: 5px; border-radius: 3px; background: #fff; }
.hero .carousel-indicators .active { background: var(--flame); }
@media (max-width: 767.98px) { .hero-frame { aspect-ratio: 4 / 3; } }

/* ---------- Service tiles ---------- */
.services { position: relative; z-index: 2; margin-top: -2.2rem; }
.service-grid { list-style: none; margin: 0; padding: .6rem; display: grid; grid-template-columns: repeat(8, 1fr); gap: .25rem;
  background: #fff; border-radius: 18px; box-shadow: 0 22px 50px -26px rgba(90, 35, 0, .55); border: 1px solid var(--line); }
.service-grid a { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .85rem .35rem; text-align: center;
  text-decoration: none; color: var(--ink); border-radius: 12px; font-size: .86rem; line-height: 1.35; font-weight: 500; height: 100%; }
.service-grid i { font-size: 1.55rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%;
  background: var(--tint); color: var(--brand-deep); transition: background .2s, color .2s; }
.service-grid a:hover i, .service-grid a:focus-visible i { background: var(--brand); color: #fff; }
@media (max-width: 991.98px) { .service-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 420px) { .service-grid { grid-template-columns: repeat(3, 1fr); } .services { margin-top: -1rem; } }

/* ---------- Poster grid (activity news) ---------- */
.poster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.poster-grid-wide { grid-template-columns: repeat(4, 1fr); }
.poster { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.poster-img { display: block; aspect-ratio: 1 / 1; background: var(--tint); overflow: hidden; }
.poster-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.poster:hover .poster-img img { transform: scale(1.04); }
.poster-body { padding: .6rem .75rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.poster-title { font-size: .88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; }
.poster-date { font-size: .78rem; color: var(--muted); }
.poster-lead { grid-column: span 2; grid-row: span 2; }
.poster-lead .poster-img { aspect-ratio: auto; flex: 1; min-height: 0; }
.poster-lead .poster-title { font-size: 1rem; }
@media (max-width: 991.98px) { .poster-grid-wide { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .poster-grid, .poster-grid-wide { grid-template-columns: repeat(2, 1fr); gap: .65rem; } }

/* ---------- Notice board ---------- */
.board-tabs { gap: .35rem; margin-bottom: .75rem; flex-wrap: wrap; }
.board-tabs .nav-link { border-radius: 999px; padding: .32rem .95rem; color: var(--ink); background: var(--tint); font-size: .9rem; font-weight: 500; border: 1px solid transparent; }
.board-tabs .nav-link.active { background: var(--ink); color: #fff; }
.board { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.board-list { list-style: none; margin: 0; padding: .25rem 0; }
.board-list li + li { border-top: 1px dashed var(--line); }
.board-list a { display: flex; gap: .7rem; padding: .7rem 1rem; text-decoration: none; color: var(--ink); line-height: 1.5; font-size: .94rem; }
.board-list a:hover { background: var(--tint); color: var(--brand-deep); }
.board-list i { color: var(--brand); margin-top: .15rem; flex: none; }
.board-list small { display: block; color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.board-list-plain { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.board-more { display: block; text-align: center; padding: .7rem; border-top: 1px solid var(--line); font-weight: 500; text-decoration: none; font-size: .9rem; }
.aside-h { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; }

/* ---------- Director / identity ---------- */
.director { margin: 0; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); height: 100%; display: flex; flex-direction: column; }
.director img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; background: var(--tint); }
.director figcaption { padding: 1rem 1.25rem; background: var(--ink); color: #fff; border-top: 5px solid var(--brand); }
.director-name { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; }
.director-pos { display: block; color: #f3d6bf; font-size: .9rem; }
.vision-block h2 { font-size: 1rem; font-weight: 600; color: var(--brand-deep); margin-bottom: .25rem; }
.vision-block p { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.4rem, 2.8vw, 2.15rem); line-height: 1.45; margin-bottom: 1.5rem; text-wrap: balance; }
.director-quote { border-left: 5px solid var(--brand); padding-left: 1.1rem; font-size: 1.05rem; margin-bottom: 1.5rem; }
.identity-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.identity-strip > div { padding: .9rem 1rem .9rem 0; }
.identity-strip > div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.identity-strip span { display: block; font-size: .82rem; color: var(--muted); }
.identity-strip strong { font-weight: 600; }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 3px; margin: 0 .3em 0 .1em; vertical-align: -.1em; }
.swatch-orange { background: var(--brand); } .swatch-black { background: var(--ink); }
@media (max-width: 767.98px) { .identity-strip { grid-template-columns: 1fr; } .identity-strip > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- Calendar / docs ---------- */
.calendar-embed, .map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.calendar-embed iframe { width: 100%; height: 470px; border: 0; display: block; }
.calendar-embed-lg iframe { height: 720px; }
.map-embed iframe { width: 100%; height: 440px; border: 0; display: block; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list a { display: flex; gap: .8rem; padding: .75rem .25rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); line-height: 1.5; }
.doc-list a:hover { color: var(--brand-deep); }
.doc-list i { font-size: 1.4rem; flex: none; }
.doc-list small { display: block; color: var(--muted); font-size: .8rem; }

.doc-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.doc-cat { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; }
.doc-cat:hover { border-color: var(--brand); background: var(--tint); color: var(--ink); }
.doc-cat i { font-size: 1.6rem; color: var(--brand); }
.doc-cat strong { display: block; font-weight: 600; line-height: 1.4; }
.doc-cat small { color: var(--muted); }
@media (max-width: 575.98px) { .doc-cats { grid-template-columns: 1fr; } }
.doc-group-h { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
.doc-table { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.doc-table table { margin: 0; }
.doc-table thead th { background: var(--ink); color: #fff; font-weight: 500; font-size: .9rem; border: 0; }
.doc-table td { border-color: var(--line); font-size: .94rem; }
.doc-title { font-weight: 500; }
.btn-file { border: 1px solid var(--line); background: #fff; border-radius: 999px; font-size: .8rem; margin: .1rem 0; }
.btn-file:hover { border-color: var(--brand); background: var(--tint); }

/* ---------- Side nav ---------- */
.side-nav { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; position: sticky; top: 76px; }
.side-nav a { padding: .65rem 1rem; text-decoration: none; color: var(--ink); border-left: 4px solid transparent; font-size: .94rem; line-height: 1.45; }
.side-nav a + a { border-top: 1px solid var(--line); }
.side-nav a:hover { background: var(--tint); }
.side-nav a.active { border-left-color: var(--brand); background: var(--tint); color: var(--brand-deep); font-weight: 600; }

/* ---------- Rich content (pages & news) ---------- */
.rich { overflow-wrap: anywhere; }
.rich img { max-width: 100%; height: auto; border-radius: 8px; }
.rich table { width: 100%; margin-bottom: 1rem; }
.rich table:not(.table) td, .rich table:not(.table) th { border: 1px solid var(--line); padding: .5rem .65rem; }
.rich h2, .rich h3 { margin-top: 1.5rem; }
.rich p { max-width: 75ch; }
.legacy-content { text-align: left; }
.legacy-content > div { margin-bottom: .35rem; }
.legacy-content img { margin: .35rem; }
.legacy-content .table { font-size: .94rem; }
.info-card { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--brand); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.info-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .5rem; }
.info-card p:last-child, .info-card ol:last-child { margin-bottom: 0; }
.mission-list li { margin-bottom: .6rem; padding-left: .25rem; }
.mission-list li::marker { color: var(--brand); font-weight: 700; font-family: var(--font-head); }
.page-updated { font-size: .8rem; color: var(--muted); margin-top: 2rem; }

.article-meta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; color: var(--muted); font-size: .9rem; }
.article-cover { margin: 0 0 1.25rem; }
.article-cover img { width: 100%; border-radius: var(--radius); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-top: 1.25rem; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }

.chip-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-block; padding: .3rem .9rem; border-radius: 999px; background: var(--tint); color: var(--ink); text-decoration: none; font-size: .88rem; font-weight: 500; }
.chip:hover { background: #ffe3cc; color: var(--ink); }
.chip.active { background: var(--brand); color: #fff; }

.news-rows { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.news-rows li + li { border-top: 1px solid var(--line); }
.news-rows a { display: flex; gap: 1rem; padding: .9rem 1.1rem; text-decoration: none; color: var(--ink); align-items: center; }
.news-rows a:hover { background: var(--tint); }
.news-rows img, .news-ico { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.news-ico { display: grid; place-items: center; background: var(--tint); color: var(--brand); font-size: 1.6rem; }
.news-title { display: block; font-weight: 500; line-height: 1.5; }
.news-meta { display: block; font-size: .82rem; color: var(--muted); }

/* ---------- Staff ---------- */
.exec-lead { display: flex; align-items: center; gap: 1.75rem; background: var(--ink); color: #fff; border-radius: 18px; padding: 1.5rem; border-bottom: 6px solid var(--brand); max-width: 760px; margin: 0 auto 1rem; }
.exec-lead img { width: 170px; aspect-ratio: 230 / 333; object-fit: cover; border-radius: 12px; border: 4px solid var(--brand); background: #fff; }
.exec-name { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; margin: 0; }
.exec-pos { color: #f3d6bf; margin: 0; }
@media (max-width: 575.98px) { .exec-lead { flex-direction: column; text-align: center; } }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.1rem; }
.staff-card { margin: 0; text-align: center; }
.staff-photo { display: block; aspect-ratio: 230 / 300; border-radius: 12px; overflow: hidden; background: var(--tint); border: 1px solid var(--line); }
.staff-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.staff-card.is-head .staff-photo { border: 3px solid var(--brand); }
.staff-name { display: block; font-weight: 600; margin-top: .55rem; line-height: 1.4; font-size: .95rem; }
.staff-pos { display: block; font-size: .82rem; color: var(--muted); line-height: 1.4; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.dept-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.dept-card img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.dept-name { padding: .75rem 1rem 0; font-weight: 600; line-height: 1.45; }
.dept-n { padding: 0 1rem .8rem; color: var(--muted); font-size: .85rem; }
.dept-card:hover { border-color: var(--brand); }

/* ---------- Quick-link banners ---------- */
.section-links { background: linear-gradient(to bottom, #fff 0, var(--tint) 100%); }
.link-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.link-grid a { display: block; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 8px 20px -16px rgba(90, 35, 0, .7); }
.link-grid img { width: 100%; aspect-ratio: 1000 / 300; object-fit: cover; display: block; transition: filter .2s; }
.link-grid a:hover img { filter: brightness(1.06) saturate(1.1); }
.link-fallback { display: flex; align-items: center; justify-content: center; aspect-ratio: 1000 / 300; padding: .5rem 1rem; text-align: center;
  background: linear-gradient(100deg, #E2560A, #FF8A1F); color: #fff; font-family: var(--font-head); font-weight: 600; line-height: 1.3; }
@media (max-width: 991.98px) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .link-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; } }

/* ---------- Contact ---------- */
.contact-list > div { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.contact-list dt { font-weight: 600; font-size: .9rem; color: var(--brand-deep); }
.contact-list dd { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9cdc3; font-size: .92rem; margin-top: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--flame); }
.footer-emblem { background: #fff; border-radius: 50%; padding: 7px 8px; width: 56px; height: auto; }
.footer-name { font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 1.15rem; margin-bottom: .35rem; }
.footer-h { font-family: var(--font-head); color: var(--flame); font-weight: 600; margin-bottom: .5rem; }
.footer-links li { margin-bottom: .3rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.stats > div { background: rgba(255,255,255,.06); border-radius: 10px; padding: .5rem .6rem; }
.stats dt { font-weight: 400; font-size: .78rem; color: #bfb0a4; }
.stats dd { margin: 0; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.footer-fb i { color: var(--flame); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: .9rem 0; font-size: .82rem; color: #a99a8e; }
.footer-bottom a { color: #a99a8e; }

/* ---------- Popup ---------- */
.popup-content { background: transparent; border: 0; }
.popup-content img { border-radius: 14px 14px 0 0; }
.popup-close { position: absolute; right: .6rem; top: .6rem; z-index: 2; background-color: rgba(0,0,0,.55); border-radius: 50%; padding: .6rem; opacity: 1; }
.popup-foot { background: #fff; border-radius: 0 0 14px 14px; padding: .75rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .mainnav, .site-footer, .services, .hero { display: none !important; }
}
.staff-photo img, .poster-img img, .director img { color: transparent; font-size: 0; }
@media (max-width: 575.98px) { .poster-lead .poster-img { aspect-ratio: 4 / 3; flex: none; } }

/* ---------- System & agency tiles (replace old image banners) ---------- */
.tile-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.tile { display: flex; align-items: center; gap: .8rem; height: 100%; padding: .8rem .9rem; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.tile:hover, .tile:focus-visible { border-color: var(--brand); background: #fffaf5; color: var(--ink); }
.tile-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem;
  color: #fff; background: linear-gradient(140deg, #FF8A1F 0%, var(--brand) 55%, var(--brand-deep) 100%); box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.tile-icon-img { background: var(--tint); overflow: hidden; }
.tile-icon-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-text { min-width: 0; flex: 1; line-height: 1.35; }
.tile-text strong { display: block; font-weight: 600; font-size: .95rem; }
.tile-text small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-go { color: #c9b8aa; font-size: .85rem; flex: none; }
.tile:hover .tile-go { color: var(--brand); }
.tile-grid-quiet .tile-icon { background: var(--ink); color: var(--flame); box-shadow: none; }
@media (max-width: 1199.98px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479.98px) {
  .tile-grid { gap: .5rem; }
  .tile { flex-direction: column; align-items: flex-start; gap: .55rem; padding: .75rem; }
  .tile-icon { width: 40px; height: 40px; font-size: 1.15rem; }
  .tile-text strong { font-size: .88rem; }
  .tile-text small, .tile-go { display: none; }
}

/* ---------- News band: dark ink band so colourful posters carry the colour ---------- */
.news-band { background: var(--ink); color: #fff; padding: 3rem 0 2.75rem; margin-top: 2.5rem; position: relative; }
.news-band::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--brand); }
.band-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.band-head h2 { margin: 0; font-weight: 700; font-size: 1.45rem; color: #fff; }
.band-tools { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.rail-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; display: grid; place-items: center; }
.rail-btn:hover { background: var(--brand); border-color: var(--brand); }
.rail-btn[disabled] { opacity: .3; pointer-events: none; }
.band-more { color: var(--flame); text-decoration: none; font-weight: 500; margin-left: .5rem; }
.band-more:hover { color: #fff; text-decoration: underline; }
.rail { list-style: none; margin: 0; padding: .25rem 0 1rem; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 1rem) / 5);
  gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #5b4d43 transparent; }
.rail::-webkit-scrollbar { height: 6px; } .rail::-webkit-scrollbar-thumb { background: #5b4d43; border-radius: 3px; }
.rail-item { scroll-snap-align: start; }
.poster-card { display: block; color: #fff; text-decoration: none; }
.poster-card-img { display: block; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: #2c241f; box-shadow: 0 14px 30px -18px #000; }
.poster-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s ease; color: transparent; }
.poster-card:hover .poster-card-img img, .poster-card:focus-visible .poster-card-img img { transform: scale(1.04); }
.poster-card-cap { display: block; padding: .6rem .15rem 0; }
.poster-card-date { display: block; font-size: .78rem; color: var(--flame); }
.poster-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; line-height: 1.45; }
@media (max-width: 1199.98px) { .rail { grid-auto-columns: calc((100% - 3 * 1rem) / 4); } }
@media (max-width: 767.98px) { .rail { grid-auto-columns: 44%; } .news-band { padding: 2.25rem 0 2rem; } }
@media (max-width: 479.98px) { .rail { grid-auto-columns: 62%; } .rail-btn { display: none; } }

/* ---------- Highlight (ITA / PISA / quality assessment) ---------- */
.highlight-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 1rem; align-items: start; }
.highlight-grid.no-tall { grid-template-columns: 1fr; }
.hl-wide { display: grid; gap: 1rem; }
.hl-card { display: block; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 24px -20px rgba(60, 25, 0, .7); }
.hl-card img { width: 100%; height: auto; display: block; transition: transform .3s ease; }
.hl-card:hover img { transform: scale(1.02); }
.hl-card:hover { border-color: var(--brand); }
@media (max-width: 991.98px) { .highlight-grid { grid-template-columns: 1fr 1fr; } .hl-wide { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .hl-wide { grid-template-columns: 1fr; } }

.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.contact-card p { display: flex; gap: .7rem; margin-bottom: .7rem; line-height: 1.55; }
.contact-card p i { color: var(--brand); font-size: 1.1rem; margin-top: .1rem; }
.calendar-embed iframe { height: 420px; }

/* ---------- Popups for important days ---------- */
.tl-popup .modal-dialog { max-width: 560px; }
.tl-popup .modal-dialog.modal-lg { max-width: 860px; }
.popup-card { border: 0; border-radius: 20px; overflow: hidden; position: relative; background: #fff; }
.popup-close { position: absolute; right: .8rem; top: .8rem; z-index: 3; background-color: rgba(255,255,255,.9); border-radius: 50%; padding: .55rem; opacity: 1; }
.popup-image { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; background: #111; }
.popup-body { position: relative; text-align: center; padding: 2.75rem 2rem 1.5rem; }
.popup-ornament { position: absolute; inset: 12px; border-radius: 14px; border: 2px solid currentColor; opacity: .35; pointer-events: none; }
.popup-emblem { width: 84px; height: auto; margin-bottom: 1rem; background: #fff; border-radius: 50%; padding: 10px 12px; }
.popup-portrait { max-width: 70%; max-height: 300px; border-radius: 12px; margin-bottom: 1rem; box-shadow: 0 12px 30px -16px rgba(0,0,0,.6); }
.popup-heading { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.3; margin-bottom: .6rem; text-wrap: balance; }
.popup-message { font-size: 1.08rem; line-height: 1.7; margin-bottom: 1rem; }
.popup-sign { font-size: .9rem; line-height: 1.7; opacity: .9; margin: 0; }
.popup-foot { display: flex; gap: .5rem; justify-content: center; padding: 0 1.5rem 1.6rem; }
.popup-image + .popup-foot, a + .popup-foot { padding-top: 1rem; background: #fff; }
.popup-enter { border-radius: 999px; padding: .5rem 1.6rem; font-weight: 600; background: var(--brand); color: #fff; border: 0; }
.popup-enter:hover { background: var(--brand-deep); color: #fff; }
.popup-more { border-radius: 999px; }
.popup-gold { background: radial-gradient(120% 90% at 50% 0%, #fff6cf 0%, #f7d66b 55%, #e8b630 100%); color: #5a3d00; }
.popup-gold .popup-enter { background: #7a5200; } .popup-gold .popup-more { color: #5a3d00; border-color: #5a3d00; }
.popup-purple { background: radial-gradient(120% 90% at 50% 0%, #f3e8ff 0%, #b996e8 55%, #6f3fb3 100%); color: #2d1150; }
.popup-purple .popup-enter { background: #4b1f86; } .popup-purple .popup-more { color: #2d1150; border-color: #2d1150; }
.popup-blue { background: radial-gradient(120% 90% at 50% 0%, #e8f2ff 0%, #8fb8ef 55%, #2f63b8 100%); color: #0d2a5c; }
.popup-blue .popup-enter { background: #14408a; } .popup-blue .popup-more { color: #0d2a5c; border-color: #0d2a5c; }
.popup-mourning { background: #111; color: #f2f2f2; }
.popup-mourning .popup-emblem { filter: grayscale(1); }
.popup-mourning .popup-enter { background: #f2f2f2; color: #111; }
.popup-school { background: linear-gradient(160deg, #FFF4EA 0%, #FFD7B5 60%, #FF9E2C 100%); color: var(--ink); }
.popup-school .popup-more { color: var(--ink); border-color: var(--ink); }

/* lightbox caption */
.lb-cap { color: #fff; text-align: center; margin-top: .75rem; display: flex; gap: .75rem; justify-content: center; align-items: center; flex-wrap: wrap; }

.poster-wall { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.poster-card-light { color: var(--ink); }
.poster-card-light .poster-card-img { background: var(--tint); box-shadow: 0 10px 22px -18px rgba(60,25,0,.8); }
.poster-card-light .poster-card-date { color: var(--brand-deep); }
@media (max-width: 1199.98px) { .poster-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .poster-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; } }
.director img { aspect-ratio: 1 / 1; }
.popup-card .popup-foot { background: transparent; border-radius: 0; padding-top: 0; }
.popup-card.popup-image-style .popup-foot, .popup-image ~ .popup-foot { background: #fff; padding-top: 1rem; }
