/*
 * EKG child theme
 * Quark-v1 appearance on top of Quark2.
 */

/* ---------- Colours and typography ---------- */

:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  color-scheme: light;

  --ekg-orange: #d87716;
  --ekg-orange-dark: #b45f0e;
  --ekg-blue: #284b7a;
  --ekg-text: #3a414e;
  --ekg-muted: #66758c;
  --ekg-border: #dce3ef;
  --ekg-page-width: 1000px;

  --q2-bg: #fff;
  --q2-bg-elev: #fff;
  --q2-bg-muted: #f4f4f4;
  --q2-text: var(--ekg-text);
  --q2-text-strong: #303742;
  --q2-text-muted: var(--ekg-muted);
  --q2-text-inverse: #fff;
  --q2-border-ring: rgba(172, 179, 194, 0.3);
  --q2-border-strong: rgba(172, 179, 194, 0.55);
  --q2-divider: rgba(172, 179, 194, 0.3);
  --q2-nav-bg: #fff;
  --q2-nav-border: rgba(172, 179, 194, 0.2);
  --q2-accent: var(--ekg-orange);
  --q2-link: var(--ekg-orange);
  --q2-focus-ring: rgba(216, 119, 22, 0.35);

  --pico-font-family-sans-serif:
    -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
  --pico-font-family-display: var(--pico-font-family-sans-serif);
  --pico-background-color: #fff;
  --pico-color: var(--ekg-text);
  --pico-primary: var(--ekg-orange);
  --pico-primary-hover: var(--ekg-orange-dark);
  --pico-primary-background: var(--ekg-orange);
  --pico-primary-border: var(--ekg-orange);
}

html,
body,
#body-wrapper {
  background: #fff;
}

html {
  font-size: 17px;
  scrollbar-gutter: stable;
}

body {
  color: var(--ekg-text);
  font-family: var(--pico-font-family-sans-serif);
  font-feature-settings: normal;
}

a {
  color: var(--ekg-orange);
}

a:hover,
a:focus {
  color: var(--ekg-orange-dark);
}

h1,
h2,
h3,
h4,
h5,
h6,
.display,
.h-display {
  color: var(--ekg-text);
  font-family: var(--pico-font-family-display);
  letter-spacing: normal;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
}

h2::before {
  display: none;
  content: none;
}

p,
li {
  line-height: 1.6;
}

/* ---------- Main layout ---------- */

.container {
  max-width: var(--ekg-page-width);
}

#body-wrapper {
  padding-block: 2rem;
}

.ekg-page {
  max-width: 960px;
  margin-inline: auto;
}

.ekg-page > :first-child {
  margin-top: 0;
}

body.schoolflyer-wide .ekg-page {
  max-width: none;
}

img {
  max-width: 100%;
}

/* ---------- Header and navigation ---------- */

#header,
body.header-transparent #header,
body.header-transparent.scrolled #header {
  z-index: 500;
  min-height: 4rem;
  background: #fff;
  border-bottom: 1px solid rgba(172, 179, 194, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#header .navbar,
.header-animated.scrolled #header .navbar {
  min-height: 4rem;
  gap: 1rem;
}

#header .navbar-section.logo {
  align-self: stretch;
}

#header .navbar-brand {
  min-height: 4rem;
}

#header .navbar-brand img,
#header .navbar-brand svg {
  width: auto;
  height: 42px;
  max-height: 42px;
}

#header .desktop-menu,
#header .dropmenu > ul,
#header .dropmenu ul.navigation {
  gap: 0;
}

#header .dropmenu a {
  padding: 0.5rem 1rem;
  color: #454d5d;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: normal;
  background: transparent;
  border-radius: 0;
}

#header .dropmenu a:hover,
#header .dropmenu a:focus,
#header .dropmenu a.active,
#header .dropmenu a.active:hover {
  color: var(--ekg-orange);
  background: transparent;
}

#header .dropmenu ul ul,
#header .dropmenu li > ul {
  z-index: 600;
  padding: 0.4rem 0;
  background: #fff;
  border-radius: 0;
  box-shadow: 0 0.3rem 1rem rgba(69, 77, 93, 0.2);
}

#header .dropmenu li > ul a {
  padding: 0.45rem 0.8rem;
  font-weight: 500;
}

/* Quark v1 was light-only and had no visible theme control. */
#header .navbar-section.actions,
.overlay > div:last-child {
  display: none;
}

.mobile-menu {
  top: 0;
  right: 0;
}

button.button_container,
.button_container {
  position: absolute;
  top: 1.3rem;
  right: 1rem;
  width: 28px;
  height: 24px;
  padding: 0;
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

button.button_container:hover,
button.button_container:focus {
  background: transparent;
  box-shadow: none;
}

.button_container span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--ekg-orange);
  border-radius: 0;
}

.button_container span:nth-of-type(1) { top: 0; }
.button_container span:nth-of-type(2) { top: 8px; }
.button_container span:nth-of-type(3) { top: 16px; }

.button_container.active .top {
  transform: translateY(8px) rotate(45deg);
  background: #fff;
}

.button_container.active .middle {
  background: #fff;
}

.button_container.active .bottom {
  transform: translateY(-8px) rotate(-45deg);
  background: #fff;
}

@media (max-width: 860px) {
  #header .navbar,
  .header-animated.scrolled #header .navbar,
  #header .navbar-brand {
    min-height: 4rem;
  }

  .mobile-menu {
    z-index: 720;
  }

  .mobile-menu .button_container {
    z-index: 730;
  }

  .overlay {
    z-index: 700;
    background: rgba(0, 0, 0, 0.95);
  }

  .overlay .overlay-menu a {
    color: #fff;
  }

  .overlay .overlay-menu a:hover,
  .overlay .overlay-menu a:focus,
  .overlay .overlay-menu a.active {
    color: var(--ekg-orange);
  }

  .overlay .overlay-menu ul ul {
    border-left-color: rgba(255, 255, 255, 0.2);
  }

  .overlay .overlay-menu ul ul a {
    color: rgba(255, 255, 255, 0.75);
  }
}

/* ---------- Start page ---------- */

.ekg-home #body-wrapper {
  padding-top: 1.5rem;
}

.ekg-home-hero {
  position: relative;
  min-height: 420px;
  margin-bottom: 2rem;
  overflow: hidden;
  background: #1f3f6f;
  border-radius: 14px;
  box-shadow: 0 16px 30px rgba(15, 27, 45, 0.18);
}

.ekg-home-hero-media {
  position: absolute;
  inset: 0 0 0 34%;
}

.ekg-home-hero-media::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: linear-gradient(115deg, rgba(11, 31, 60, 0.06), rgba(11, 31, 60, 0.5));
}

.ekg-home-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ekg-home-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(46%, 560px);
  min-height: 420px;
  padding: 2.1rem 2.1rem 2.4rem;
  color: #fff;
  background: var(--ekg-blue);
  clip-path: polygon(0 0, 84% 0, 100% 100%, 0 100%);
}

.ekg-home-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--ekg-orange);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ekg-home-hero-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.85rem, 3.25vw, 3.2rem);
  line-height: 1.07;
}

.ekg-home-quicklinks {
  position: absolute;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  width: min(300px, 34%);
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(209, 216, 230, 0.9);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

.ekg-home-quicklinks h2 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ekg-home-quicklinks ul {
  display: grid;
  flex: 1;
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ekg-home-quicklinks li {
  margin: 0;
}

.ekg-home-quicklinks a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0.4rem 0.6rem;
  color: #20344f;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  border: 1px solid #dce3ef;
  border-radius: 6px;
}

.ekg-home-quicklinks a:hover,
.ekg-home-quicklinks a:focus {
  color: #fff;
  background: #2f5e96;
  border-color: #2f5e96;
}

@media (max-width: 980px) {
  .ekg-home-hero {
    min-height: 0;
  }

  .ekg-home-hero-media {
    position: relative;
    inset: auto;
    height: 260px;
  }

  .ekg-home-hero-copy {
    width: 100%;
    min-height: 0;
    padding: 1.2rem;
    clip-path: none;
  }

  .ekg-home-quicklinks {
    position: static;
    display: block;
    width: 100%;
    border-top: 0;
    border-radius: 0 0 10px 10px;
  }

  .ekg-home-quicklinks ul {
    display: grid;
    grid-template-rows: none;
  }

  .ekg-home-quicklinks a {
    min-height: 2.6rem;
  }
}

/* Admission box */

.ekg-admission {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1rem;
  margin: 1.4rem 0;
  padding: 1.35rem;
  background: #dfe4ec;
  border: 1px solid #d3dae5;
  border-radius: 12px;
}

.ekg-admission-copy h2 {
  margin: 0.1rem 0 0.65rem;
}

.ekg-admission-kicker {
  margin: 0;
  color: #3d4a5e;
}

.ekg-admission-copy p {
  max-width: 52ch;
  margin: 0 0 0.85rem;
  color: #354254;
}

.ekg-admission-actions,
.ekg-calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ekg-admission-media {
  min-height: 220px;
  overflow: hidden;
  border-radius: 10px;
}

.ekg-admission-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .ekg-admission {
    grid-template-columns: 1fr;
  }
}

/* ---------- Buttons ---------- */

.ekg-button,
button.ekg-button {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0.58rem 0.92rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: var(--ekg-orange);
  border: 1px solid var(--ekg-orange);
  border-radius: 7px;
}

.ekg-button:hover,
.ekg-button:focus {
  color: #fff;
  text-decoration: none;
  background: var(--ekg-orange-dark);
  border-color: var(--ekg-orange-dark);
}

.ekg-button-compact {
  padding: 0.54rem 0.88rem;
}

.ekg-button-secondary {
  color: #243247;
  background: #fff;
  border-color: #cdd6e3;
}

.ekg-button-secondary:hover,
.ekg-button-secondary:focus {
  color: #243247;
  background: #eef2f8;
  border-color: #bdc8da;
}

/* ---------- News ---------- */

.ekg-home-news {
  margin: 2rem 0 2.2rem;
}

.ekg-home-news > h2 {
  margin: 0 0 1rem;
}

.ekg-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ekg-news-card {
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce2eb;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(20, 34, 53, 0.08);
}

.ekg-news-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ekg-news-card-link:hover {
  color: inherit;
  text-decoration: none;
}

.ekg-news-media {
  aspect-ratio: 16 / 9;
  background: #dce6f3;
}

.ekg-news-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ekg-news-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #2a4b77;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #cdd8ea, #e8eef8);
}

.ekg-news-body {
  padding: 0.9rem 0.95rem 1rem;
}

.ekg-news-body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
  line-height: 1.25;
}

.ekg-news-body p {
  margin: 0;
  color: #4f5b6d;
  font-size: 0.94rem;
  line-height: 1.4;
}

.ekg-news-date {
  margin-top: 0.7rem !important;
  padding-top: 0.55rem;
  color: #7f8da3 !important;
  font-size: 0.78rem !important;
  border-top: 1px solid #e0e6ef;
}

.ekg-home .ekg-news-body h3 {
  font-size: 0.9rem;
}

.ekg-home .ekg-news-body p {
  font-size: 0.8rem;
}

.ekg-news-actions {
  margin: 1rem 0 0;
  text-align: right;
}

@media (max-width: 900px) {
  .ekg-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .ekg-news-grid {
    grid-template-columns: 1fr;
  }

  .ekg-news-actions {
    text-align: left;
  }
}

/* ---------- Footer ---------- */

#footer.ekg-footer {
  padding: 0;
  color: var(--ekg-text);
  font-size: 1rem;
  text-align: left;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
}

.ekg-footer-grid {
  display: grid;
  grid-template-columns: 170px 160px minmax(0, 1fr);
}

.ekg-footer-brand,
.ekg-footer-links,
.ekg-footer-contact {
  padding: 2.25rem 1.5rem;
}

.ekg-footer-brand,
.ekg-footer-links {
  background: #efefef;
}

.ekg-footer-brand {
  display: grid;
  place-items: center;
}

.ekg-footer-brand img {
  width: min(100%, 180px);
  height: auto;
}

.ekg-footer h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ekg-footer-links {
  display: block;
}

#footer .ekg-footer-links ul {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .ekg-footer-links li {
  display: block;
  margin: 0.4rem 0;
  padding: 0;
}

#footer .ekg-footer-links a {
  color: #222;
  text-decoration: none;
}

#footer .ekg-footer-links a:hover {
  color: #222;
  text-decoration: underline;
}

.ekg-footer-contact {
  color: #fff;
  background: var(--ekg-blue);
}

.ekg-footer-contact h2,
#footer .ekg-footer-contact a {
  color: #fff;
}

.ekg-footer-contact-grid {
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) minmax(210px, 1fr);
  gap: 1.25rem 1.5rem;
}

.ekg-footer-contact address,
.ekg-footer-contact p {
  margin: 0 0 1rem;
  color: inherit;
  font-style: normal;
  line-height: 1.55;
}

.ekg-footer-contact strong {
  display: inline-block;
  margin-bottom: 0.15rem;
}

#footer .ekg-footer-email {
  font-size: 0.9rem;
  overflow-wrap: break-word;
  hyphens: none;
}

@media (max-width: 900px) {
  .ekg-footer-grid {
    grid-template-columns: 1fr;
  }

  .ekg-footer-brand,
  .ekg-footer-links,
  .ekg-footer-contact {
    padding: 1.5rem;
  }

  .ekg-footer-brand {
    display: none;
  }
}

@media (max-width: 620px) {
  .ekg-footer-contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Child-page overview ---------- */

.ekg-child-overview {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--q2-divider);
}

.ekg-child-overview ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ekg-child-overview li {
  margin: 0;
  list-style: none;
}

.ekg-child-overview a {
  display: block;
  height: 100%;
  padding: 0.85rem 1rem;
  color: #303742;
  text-decoration: none;
  background: #f4f4f4;
  border: 1px solid var(--q2-border-ring);
  border-radius: 8px;
}

.ekg-child-overview a:hover,
.ekg-child-overview a:focus-visible {
  color: var(--ekg-orange);
  background: #fff;
  border-color: var(--q2-border-strong);
  box-shadow: 0 6px 15px rgba(20, 34, 53, 0.08);
}

.ekg-child-overview-empty {
  color: var(--ekg-muted);
  font-style: italic;
}

/* ---------- Tables, calendar and special pages ---------- */

#body-wrapper table {
  width: 100%;
  margin: 1rem 0 1.25rem;
  border-collapse: collapse;
}

#body-wrapper th,
#body-wrapper td {
  padding: 0.52rem 0.62rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--ekg-border);
}

#body-wrapper th {
  font-weight: 700;
  background: #f7f9fc;
}

#body-wrapper tbody tr:nth-child(even) {
  background: #fbfcff;
}

.ekg-calendar-consent {
  margin: 0.5rem 0 1rem;
  padding: 1.15rem 1.2rem;
  background: #f8fafc;
  border: 1px solid #d9e1ea;
  border-radius: 14px;
}

.ekg-calendar-consent h2 {
  margin-top: 0;
}

.ekg-calendar-actions {
  margin-top: 1rem;
}

.ekg-calendar-frame iframe {
  width: 100%;
  min-height: 78vh;
  background: #fff;
  border: 0;
  border-radius: 12px;
}

/* Kleines ABC */

.abc-accordion details {
  padding: 0.2rem 0;
  border-top: 1px solid #d9e1ea;
}

.abc-accordion details:last-child {
  border-bottom: 1px solid #d9e1ea;
}

.abc-accordion summary {
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.abc-accordion summary::-webkit-details-marker {
  display: none;
}

.abc-accordion summary::before {
  display: inline-block;
  width: 1.25rem;
  color: var(--ekg-orange);
  font-weight: 700;
  content: "+";
}

.abc-accordion details[open] summary::before {
  content: "−";
}

.abc-accordion .abc-content {
  padding: 0 0 1rem 1.25rem;
}

.abc-accordion .abc-letter {
  margin: 1.4rem 0 0.35rem;
  color: #31435f;
  font-size: 1.55rem;
}

.abc-action-row,
.abc-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.abc-action-row {
  margin: 0.5rem 0 1.25rem;
}

.abc-toggle-all,
.abc-quiz-start,
.abc-quiz-choice,
.abc-quiz-restart {
  width: auto;
  margin: 0;
  padding: 0.55rem 0.95rem;
  color: #fff;
  font-weight: 600;
  background: var(--ekg-orange);
  border: 1px solid var(--ekg-orange);
  border-radius: 0.45rem;
}

.abc-quiz-panel {
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  border: 1px solid #d9e1ea;
  border-radius: 0.65rem;
}

.abc-quiz-panel[hidden],
.abc-quiz-actions[hidden] {
  display: none;
}

.abc-quiz-kicker {
  margin: 0 0 0.35rem;
  color: #6b7a90;
  font-size: 0.9rem;
  font-weight: 600;
}

.abc-quiz-statement {
  margin: 0 0 1rem;
  color: #31435f;
  font-size: 1.1rem;
  font-weight: 600;
}

/* News image gallery */

.ekg-article-gallery {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f2;
}

.ekg-article-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.ekg-article-gallery-grid a {
  display: block;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ekg-border);
  border-radius: 8px;
}

.ekg-article-gallery-grid img {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.ekg-lightbox {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(8, 14, 24, 0.82);
}

.ekg-lightbox[hidden] {
  display: none;
}

.ekg-lightbox img {
  width: auto;
  max-width: min(1200px, 92vw);
  height: auto;
  max-height: 86vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.ekg-lightbox button {
  position: fixed;
  top: 16px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  border-radius: 50%;
}

.ekg-lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .ekg-article-gallery-grid {
    grid-template-columns: 1fr;
  }

  .ekg-article-gallery-grid img {
    height: auto;
  }
}
