/* SZÍNEK – az egész oldal alapszínei itt módosíthatók. */
:root {
  --ink: #493a30;
  --brown: #6b4934;
  --accent: #875735;
  --cream: #faf7e9;
  --paper: #fff;
  --line: #e4dbce;
  --muted: #6e655e;
  --soft: #f6f3ed;
}

/* ALAPBEÁLLÍTÁSOK – szöveg, linkek, gombok és fókuszjelzés. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #eeeae3;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.7;
}
a {
  color: var(--brown);
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration-thickness: 2px;
}
button {
  font: inherit;
  cursor: pointer;
  min-height: 44px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
:focus-visible {
  outline: 3px solid #185ea0;
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: #fff;
  padding: 12px 20px;
}
.skip-link:focus {
  top: 12px;
}

/* AZ OLDAL KERETE ÉS A FEJLÉC */
.site {
  max-width: 1240px;
  margin: auto;
  background: var(--paper);
  min-height: 100vh;
  box-shadow: 0 0 40px #493a3010;
}
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  background: var(--cream);
  border-bottom: 4px solid var(--brown);
  padding: 6px 20px;
  transition:
    padding 180ms ease,
    box-shadow 180ms ease;
}

/* Görgetéskor a navigáció alacsonyabb lesz, és finom árnyékot kap. */
.nav-wrap.is-compact {
  padding-top: 0;
  padding-bottom: 0;
  box-shadow: 0 4px 12px #493a3026;
}

#main-nav a {
  transition: padding 180ms ease;
}

.nav-wrap.is-compact #main-nav a {
  padding-top: 10px;
  padding-bottom: 10px;
}

.nav-wrap > .accessibility-toggle {
  grid-column: 2;
  grid-row: 1;
  color: var(--brown);
}

/* Üresen nem foglal helyet; mobilon ide nyílik az oldalsáv. */
#mobile-sidebar-slot {
  grid-column: 1 / -1;
}

html {
  scroll-padding-top: 110px;
}
#main-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
#main-nav a {
  display: block;
  padding: 17px 13px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
#main-nav a:hover,
#main-nav a[aria-current] {
  background: #eae2cd;
  color: #49321f;
}
.menu-toggle {
  display: none;
}

/* KÖZÖS BANNER – közvetlenül a rögzített navigáció alatt.
   A banner a tartalommal görgethető, ezért a navbár alá csúszik.
   Az eredeti kép teljes egészében látszik; mobilon arányosan kisebb. */
.site-banner {
  display: block;
  position: relative;
  background: #b98357;
}

.site-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* MORZSAMENÜ, KÉTHASÁBOS ELRENDEZÉS ÉS CÍMSOROK */
.breadcrumbs {
  padding: 14px 34px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 38px;
  padding: 32px 34px 60px;
}
main {
  min-width: 0;
}

/* HOSSZABB SZÖVEGEK – új aloldalakon is automatikusan sorkizártak.
   A külön középre/jobbra igazított részek (pl. képek, aláírás) megtartják az igazításukat.
   Más szöveges elemen a prose osztállyal kérhető ugyanez a megjelenés. */
main p,
.prose {
  text-align: justify;
  hyphens: auto;
}
h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  color: var(--brown);
  line-height: 1.3;
}
h1 {
  font-size: 2.2rem;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
h2 {
  font-size: 1.55rem;
}
h3 {
  font-size: 1.2rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: bold;
}

/* FŐOLDALI KÖSZÖNTŐ, HÍREK ÉS GYORSHIVATKOZÁSOK */
.welcome {
  padding: 28px;
  background: var(--soft);
  border-left: 4px solid #b8885f;
}
.welcome h2 {
  margin-top: 8px;
  font-size: 1.85rem;
}
.welcome p:last-child {
  margin-bottom: 0;
}
.lead {
  font-size: 1.12rem;
}
.button-link {
  display: inline-block;
  border: 1px solid var(--brown);
  padding: 8px 17px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.85rem;
  margin-top: 12px;
}
.section-heading {
  margin-top: 35px;
}
.news {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.news h3 {
  margin: 5px 0 10px;
}
.news p {
  margin: 0 0 10px;
}
.tag {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}
.quick-card {
  border: 1px solid var(--line);
  padding: 20px;
  text-decoration: none;
  background: var(--cream);
}
.quick-card strong {
  display: block;
  font:
    1.2rem Georgia,
    serif;
  margin-bottom: 7px;
}
.quick-card span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* JOBB OLDALI SÁV DOBOZAI */
.side-box {
  border: 1px solid var(--line);
  margin-bottom: 22px;
  padding: 20px;
  font-size: 0.85rem;
}
.side-box h2 {
  font-size: 1.15rem;
  border-bottom: 2px solid #bb875e;
  padding-bottom: 12px;
  margin: 0 0 15px;
}
.side-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-box li + li {
  border-top: 1px solid var(--line);
}
.side-box li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  text-decoration: none;
}
.side-box a {
  overflow-wrap: anywhere;
}
.contact-box {
  background: var(--cream);
}

/* LÁBLÉC ÉS ÁLTALÁNOS TARTALMI ELEMEK */
footer {
  background: var(--cream);
  border-top: 4px solid #bb875e;
  padding: 28px 34px;
  display: flex;
  justify-content: space-between;
  gap: 25px;
  font-size: 0.8rem;
}
footer p {
  margin: 5px 0;
}
.notice {
  padding: 15px 18px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.content-list li {
  margin: 12px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* AKADÁLYMENTES NÉZET – kontrasztos színek. */
.high-contrast {
  --ink: #fff;
  --brown: #ffeb3b;
  --accent: #ffeb3b;
  --cream: #111;
  --paper: #000;
  --line: #aaa;
  --muted: #eee;
  --soft: #111;
}
.high-contrast body {
  background: #000;
}
.high-contrast #main-nav a:hover,
.high-contrast #main-nav a[aria-current] {
  background: #333;
  color: #ffeb3b;
}
.high-contrast :focus-visible {
  outline-color: #0ff;
}
.high-contrast .skip-link {
  background: #000;
}
.high-contrast .welcome {
  border-color: #ffeb3b;
}
.high-contrast .side-box h2 {
  border-color: #ffeb3b;
}

/* KESKENYEBB KÉPERNYŐK – legfeljebb 950 pixel. */
@media (max-width: 950px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
    padding: 24px;
  }
  .nav-wrap {
    padding: 6px 10px;
  }
  #main-nav a {
    padding: 14px 10px;
  }
}

/* MOBILNÉZET – legfeljebb 700 pixel. */
@media (max-width: 700px) {
  .layout {
    display: block;
    padding: 24px 20px;
  }
  .layout aside {
    margin-top: 35px;
  }
  .breadcrumbs {
    padding: 12px 20px;
  }
  .menu-toggle {
    display: block;
    background: transparent;
    border: 0;
    color: var(--brown);
    padding: 10px;
  }
  #main-nav {
    display: none;
  }
  #main-nav.is-open {
    display: block;
  }
  #main-nav ul {
    display: block;
  }
  #main-nav a {
    border-top: 1px solid var(--line);
  }
  h1 {
    font-size: 1.8rem;
  }
  .welcome {
    padding: 20px;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  footer {
    flex-direction: column;
    padding: 24px 20px;
  }
}

/* CSÖKKENTETT MOZGÁS – a látogató rendszerbeállítása szerint. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* A RENDSZER SAJÁT KONTRASZTOS NÉZETE */
@media (forced-colors: active) {
  button,
  .side-box,
  .quick-card {
    border: 1px solid CanvasText;
  }
}

/* NYOMTATÁSI NÉZET */
@media print {
  .nav-wrap,
  aside,
  .skip-link {
    display: none;
  }
  .layout {
    display: block;
  }
  body {
    background: #fff;
  }
  footer {
    background: #fff;
  }
}

/* OLDALSÁVBAN MEGJELENŐ KÉPEK ÉS PROGRAMHIVATKOZÁSOK */
/* ÁTVETT CÍMLAPI CIKKEK – saját szövegük az index.html fájlban található. */
.home-article {
  padding: 24px 0;
  overflow-wrap: anywhere;
  display: flow-root;
}

.home-article h2 {
  margin-top: 0;
}

.home-article img {
  max-width: 100%;
  height: auto;
}

.home-article table {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.home-article hr {
  clear: both;
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.text-center {
  text-align: center;
}

/* ESEMÉNYNAPTÁR – egységes oszlopok, mobilon külön görgethető táblázat.
   A naptár szövege és időpontjai az esemenynaptar.html fájlban szerkeszthetők. */
.calendar-table {
  width: 100%;
  min-width: 740px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calendar-column-month {
  width: 14%;
}

.calendar-column-day {
  width: 16%;
}

.calendar-column-event {
  width: 40%;
}

.calendar-column-owner {
  width: 30%;
}

.calendar-table th,
.calendar-table td {
  padding: 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.calendar-table thead th,
.calendar-table .calendar-month {
  background: var(--cream);
  color: var(--brown);
  text-align: center;
}

.calendar-table p {
  margin: 0 0 8px;
}

.calendar-table p:last-child {
  margin-bottom: 0;
}

.calendar-table .calendar-month p,
.calendar-table thead th p,
.calendar-table .calendar-note,
.calendar-table .calendar-note p {
  text-align: center;
}

.calendar-table .calendar-day p,
.calendar-table .calendar-owner p {
  text-align: left;
  overflow-wrap: normal;
}

.calendar-table .calendar-day {
  font-variant-numeric: tabular-nums;
}

.calendar-note {
  background: var(--soft);
}

/* A görgetősáv láthatósága rendszerfüggő; a gombok mindig egyértelmű kezelést adnak. */
#calendar-scroll {
  width: 100%;
  overflow-x: scroll;
  scrollbar-width: auto;
  scrollbar-color: var(--brown) var(--soft);
}

.calendar-controls:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.85rem;
}

.calendar-scroll-buttons {
  display: flex;
  gap: 8px;
}

.calendar-scroll-buttons button {
  padding: 6px 12px;
  border: 1px solid var(--brown);
  color: var(--brown);
  background: var(--cream);
}

@media print {
  .calendar-controls {
    display: none !important;
  }
}

/* INTÉZMÉNYEGYSÉGEK – helyi aloldalak, képgalériák és képzési táblázatok. */
.unit-links {
  padding: 0;
  list-style: none;
}

.unit-links li {
  border-bottom: 1px solid var(--line);
}

.unit-links a {
  display: block;
  padding: 16px 12px;
  text-decoration: none;
}

.unit-links a:hover {
  background: var(--cream);
}

.unit-content {
  display: flow-root;
  overflow-wrap: anywhere;
}

.unit-content img {
  max-width: 100%;
  height: auto;
}

.unit-content h2,
.unit-content h3,
.unit-content h4 {
  clear: both;
}

.unit-content hr {
  clear: both;
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.unit-float-left {
  float: left;
  margin: 0 20px 16px 0;
}

.unit-float-right {
  float: right;
  margin: 0 0 16px 20px;
}

.unit-content .unit-float-left,
.unit-content .unit-float-right {
  max-width: 42%;
}

.unit-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.unit-table th,
.unit-table td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

.unit-table p {
  text-align: left;
}

.unit-gallery {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 16px;
  margin: 24px 0;
}

.unit-gallery figure {
  min-width: 0;
  margin: 0;
}

.unit-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid var(--line);
}

.unit-gallery figcaption {
  padding: 8px 0;
  font-size: 0.85rem;
}

.unit-missing-image {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--soft);
}

/* OLDALSÁVBÓL NYÍLÓ OLDALAK – pályázatok, beszámolók és archív tartalmak.
   A képek helyi fájlokból töltődnek, a táblázatok külön görgethetők. */
.sidebar-content {
  display: flow-root;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sidebar-content img {
  max-width: 100%;
  height: auto;
}

/* A bázisintézményi kép jobbra kerül, a szöveg mellette folytatódik. */
.sidebar-content .bazis-kep {
  float: right;
  width: min(34%, 220px);
  margin: 0 0 16px 22px;
}

@media (max-width: 640px) {
  .sidebar-content .bazis-kep {
    display: block;
    float: none;
    width: min(65%, 200px);
    margin: 0 auto 16px;
  }
}

.sidebar-content table {
  width: 100%;
  min-width: 540px;
  table-layout: fixed;
  border-collapse: collapse;
}

.sidebar-content th,
.sidebar-content td {
  padding: 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.sidebar-content hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.missing-media {
  font-size: 0.9rem;
  font-style: italic;
}

/* ISKOLÁNKRÓL – munkatársi táblázatok.
   Kis képernyőn csak a táblázat görgethető, az oldal szélessége nem változik. */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 24px 0;
}

.staff-table {
  width: 100%;
  min-width: 540px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
}

/* A sorszámnak 4 karakter + a cella kétoldali belső térköze jut.
   A név és a munkakör minden táblázatrészben ugyanott kezdődik. */
.staff-column-number {
  width: calc(4ch + 24px);
}

.staff-column-name {
  width: 32%;
}

.staff-table .staff-number,
.staff-table .staff-number p {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-variant-numeric: tabular-nums;
}

.staff-table th[scope="row"] {
  font-weight: normal;
}

.staff-table th,
.staff-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.staff-table p {
  margin: 0 0 6px;
  text-align: left;
}

.staff-table p:last-child {
  margin-bottom: 0;
}

.staff-table .staff-group {
  background: var(--cream);
  color: var(--brown);
  text-align: center;
}

.staff-table .staff-group h2,
.staff-table .staff-group p {
  margin: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
}

/* MÚLTUNK – a történeti szöveg és az archív képek közös megjelenése.
   A szakaszok külön maradnak, a képek mellett körbefut a sorkizárt szöveg. */
.history-section {
  display: flow-root;
  overflow-wrap: anywhere;
}

.history-section h2 {
  clear: both;
}

.history-image {
  width: 200px;
  max-width: 42%;
  height: auto;
  margin-bottom: 18px;
}

.history-image-left {
  float: left;
  margin-right: 20px;
}

.history-image-right {
  float: right;
  margin-left: 20px;
}

main > hr {
  clear: both;
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  .history-image {
    width: 120px;
  }
}

.text-right {
  text-align: right;
}

.home-article .welcome-portrait {
  float: right;
  width: 278px;
  max-width: 45%;
  margin: 0 0 20px 24px;
}

/* Kis képernyőn is maradjon olvasható hely a körbefutó szövegnek. */
@media (max-width: 480px) {
  .home-article .welcome-portrait {
    width: 120px;
    margin-left: 16px;
  }
}

.side-box img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
}
.sidebar-banner a {
  display: block;
  text-align: center;
}
/* A kisebb eredeti bázisintézményi kép is töltse ki a doboz szélességét. */
.sidebar-banner a[href$="/bazisintezmeny-2023.html"] img {
  width: 100%;
}
.sidebar-banner a span {
  display: block;
  margin-top: 10px;
}
.sidebar-banner h2 {
  font-size: 1rem;
}
.side-box nav a {
  overflow-wrap: anywhere;
}
.high-contrast .side-box img {
  background: #fff;
  padding: 4px;
}

/* AKADÁLYMENTESÍTÉS – egyetlen ikon, megfelelő méretű kattintható felülettel. */
.accessibility-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.accessibility-toggle[aria-pressed="true"] {
  color: #111;
  background: #ffeb3b;
}

.sidebar-toggle {
  display: none;
}

/* KÉT MOBILMENÜ – balra a navigáció, jobbra az oldalsáv. */
@media (max-width: 700px) {
  .nav-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .menu-toggle {
    justify-self: start;
  }

  .sidebar-toggle {
    display: block;
    justify-self: end;
    padding: 10px;
    color: var(--brown);
    background: transparent;
    border: 0;
    grid-column: 3;
    grid-row: 1;
  }

  .menu-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .menu-toggle,
  .sidebar-toggle {
    transition: padding 180ms ease;
  }

  .nav-wrap.is-compact .menu-toggle,
  .nav-wrap.is-compact .sidebar-toggle {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  #main-nav.is-open {
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
  }

  #main-nav,
  #mobile-sidebar-slot {
    grid-column: 1 / -1;
    min-width: 0;
  }

  #sidebar-panel {
    display: none;
  }

  #sidebar-panel.is-open {
    display: block;
    max-height: 70vh;
    max-height: 70dvh;
    padding: 16px 4px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
  }

  #sidebar-panel .side-box:last-child {
    margin-bottom: 0;
  }

  /* Mobilon tömörebb oldalsáv, középre igazított, nagyjából félméretű képekkel. */
  #sidebar-panel .side-box {
    padding: 14px;
    margin-bottom: 14px;
  }

  #sidebar-panel .side-box img {
    width: 50%;
    max-width: 160px;
    height: auto;
    margin: 8px auto;
  }
}
