/* ==========================================================================
   Template Grundschule Geltendorf (Joomla 5) – rp-network.de
   Schriften lokal (SIL OFL), keine externen Ressourcen
   ========================================================================== */

@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/nunito-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Comic Neue"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/comic-neue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Comic Neue"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/comic-neue-latin-700-normal.woff2") format("woff2"); }

:root {
  --gs-green-top: #d4eea5;
  --gs-green-bottom: #fbfdf6;
  --gs-sky: #c1eaf0;
  --gs-sky-soft: #e4f6f9;
  --gs-teal: #78cedd;
  --gs-teal-ink: #0f4c57;
  --gs-lilac: #8e3f87;
  --gs-lilac-dark: #6f2f69;
  --gs-orange: #c2410c;
  --gs-text: #24303d;
  --gs-muted: #52616f;
  --gs-card: #ffffff;
  --gs-line: #d6e6ea;
  --gs-radius: 16px;
  --gs-shadow: 0 2px 4px rgba(15, 76, 87, .06), 0 8px 24px rgba(15, 76, 87, .08);
  --gs-font: "Nunito", "Segoe UI", Tahoma, Arial, sans-serif;
  --gs-font-fun: "Comic Neue", "Comic Sans MS", "Nunito", sans-serif;
  --gs-max: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--gs-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--gs-text);
  background: var(--gs-green-bottom) linear-gradient(to bottom, var(--gs-green-top) 0, var(--gs-green-bottom) 560px) no-repeat;
}

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

a { color: var(--gs-lilac); text-underline-offset: .15em; }
a:hover, a:focus { color: var(--gs-lilac-dark); }
:focus-visible { outline: 3px solid var(--gs-lilac); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--gs-font-fun);
  font-weight: 700;
  line-height: 1.25;
  color: var(--gs-orange);
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.85rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, table { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--gs-max); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--gs-lilac); color: #fff; padding: .6em 1em; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }

.visually-hidden, .element-invisible, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Kopfbereich
   -------------------------------------------------------------------------- */
.site-header { background: var(--gs-sky); padding: 24px 0 0; }

.header-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 667px);
  align-items: end;
  gap: 24px;
}

.brand { padding-bottom: 28px; }
.brand-link { text-decoration: none; }
.site-title {
  display: block;
  font-family: var(--gs-font-fun);
  font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem);
  line-height: 1.05;
  color: var(--gs-lilac);
  letter-spacing: -.01em;
}
.tagline {
  margin: .5em 0 .8em;
  font-family: var(--gs-font-fun);
  font-size: 1.25rem;
  color: var(--gs-teal-ink);
}
.header-contact { margin: 0; font-weight: 700; }
.header-contact a {
  display: inline-flex; align-items: center; gap: .4em;
  color: var(--gs-teal-ink); text-decoration: none;
  background: rgba(255, 255, 255, .7); padding: .35em .9em; border-radius: 999px;
}
.header-contact a:hover { background: #fff; }

.header-photo { position: relative; line-height: 0; }
.header-photo > img:first-child {
  display: block; width: 100%;
  border-radius: var(--gs-radius) var(--gs-radius) 0 0;
}
.header-logo {
  position: absolute;
  top: -14px; right: 18px;
  width: clamp(96px, 22%, 150px);
  filter: drop-shadow(0 4px 10px rgba(15, 76, 87, .25));
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-nav { background: var(--gs-teal); box-shadow: 0 2px 0 rgba(15, 76, 87, .12); position: relative; z-index: 10; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav .mod-menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 0; }
.site-nav .mod-menu > li > a,
.site-nav .mod-menu > li > span {
  display: block;
  padding: .5em 1em;
  border-radius: 999px;
  font-weight: 800;
  color: var(--gs-teal-ink);
  text-decoration: none;
}
.site-nav .mod-menu > li > a:hover,
.site-nav .mod-menu > li > a:focus { background: rgba(255, 255, 255, .55); color: var(--gs-teal-ink); }
.site-nav .mod-menu > li.current > a,
.site-nav .mod-menu > li.active > a { background: #fff; color: var(--gs-lilac); }

.nav-toggle {
  display: none;
  align-items: center; gap: .6em;
  margin: 8px 0; padding: .55em 1em;
  font: inherit; font-weight: 800; color: var(--gs-teal-ink);
  background: rgba(255, 255, 255, .6); border: 0; border-radius: 999px; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

/* --------------------------------------------------------------------------
   Seitenlayout
   -------------------------------------------------------------------------- */
.page { padding-top: 24px; padding-bottom: 48px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.has-sidebar .layout { grid-template-columns: minmax(0, 1fr) 300px; }

.content {
  background: var(--gs-card);
  border-radius: var(--gs-radius);
  box-shadow: var(--gs-shadow);
  padding: clamp(20px, 3vw, 40px);
  min-width: 0;
  overflow-wrap: anywhere;
}
.content:focus { outline: none; }

/* Alte Inhalte: feste Breiten und Abstände zähmen */
.content img { height: auto !important; }
.content table { max-width: 100%; border-collapse: collapse; }
.content td, .content th { padding: .35em .6em; vertical-align: top; }
.content iframe { max-width: 100%; }
.content hr { border: 0; border-top: 2px dashed var(--gs-line); margin: 2em 0; }

/* Artikel-Kopf */
.page-header { margin-bottom: 1em; }
.page-header h1, .page-header h2 { margin-bottom: .2em; }
.item-page .article-info, .blog-featured .article-info, dl.article-info { display: none; }
.blog-featured .item + .item { border-top: 2px dashed var(--gs-line); margin-top: 2em; padding-top: 2em; }

/* Breadcrumbs */
.breadcrumbs-wrap { margin-bottom: 16px; font-size: .95rem; }
.breadcrumbs-wrap ol, .breadcrumbs-wrap ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3em; align-items: center; }
.breadcrumbs-wrap li { color: var(--gs-muted); }
.breadcrumbs-wrap .mod-breadcrumbs__here { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.breadcrumbs-wrap .breadcrumb-item + .breadcrumb-item::before { content: "›"; margin-right: .3em; color: var(--gs-muted); }
.breadcrumbs-wrap .divider, .breadcrumbs-wrap .icon-location { display: none; }
.breadcrumbs-wrap a { color: var(--gs-teal-ink); }

/* --------------------------------------------------------------------------
   Seitenleiste / Module (Chrome „card“)
   -------------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--gs-card);
  border-radius: var(--gs-radius);
  box-shadow: var(--gs-shadow);
  overflow: hidden;
}
.card-header {
  margin: 0;
  padding: .7em 1.1em;
  background: var(--gs-sky);
  color: var(--gs-teal-ink);
  font-family: var(--gs-font-fun);
  font-size: 1.3rem;
}
.card-body { padding: 1.1em; }
.card-body > :last-child { margin-bottom: 0; }
.sidebar .card-body { text-align: center; }
.main-top, .main-bottom { margin-bottom: 20px; }

/* --------------------------------------------------------------------------
   Buttons, Formulare, Meldungen
   -------------------------------------------------------------------------- */
.btn, button.btn, input[type="submit"], .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .65em 1.3em;
  font: inherit; font-weight: 800; line-height: 1.2;
  color: #fff; background: var(--gs-lilac);
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
}
.btn:hover, .btn:focus, input[type="submit"]:hover { background: var(--gs-lilac-dark); color: #fff; }
.btn-secondary { background: var(--gs-sky); color: var(--gs-teal-ink); }
.btn-secondary:hover { background: var(--gs-teal); color: var(--gs-teal-ink); }
.btn-termine::after { content: "↗"; font-weight: 400; }
.small, small { font-size: .875rem; color: var(--gs-muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], textarea, select, .form-control, .form-select {
  width: 100%; max-width: 32rem;
  padding: .6em .8em;
  font: inherit; color: var(--gs-text);
  background: #fff; border: 2px solid var(--gs-line); border-radius: 10px;
}
input:focus, textarea:focus, select:focus { border-color: var(--gs-teal); outline: none; box-shadow: 0 0 0 3px rgba(120, 206, 221, .45); }
label, .form-label { display: block; font-weight: 700; margin-bottom: .3em; }
.control-group, .mb-3 { margin-bottom: 1em; }

/* Passkey-/Login-Buttons (SVG ohne feste Größe) */
.plg_system_webauthn_login_button svg, .com-users-login__submit svg, button[class*="webauthn"] svg, .btn svg { width: 1.25em; height: 1.25em; flex: none; }

/* Systemmeldungen */
joomla-alert, .alert { display: block; border-radius: 12px; padding: 1em 1.2em; margin-bottom: 1.2em; background: var(--gs-sky-soft); border: 2px solid var(--gs-sky); }

/* Kontaktseite */
.com-contact .contact-address, .com-contact address { font-style: normal; }
.contact-address { display: block; margin: 0 0 1em; }
.contact-address::after { content: ""; display: table; clear: both; }
.contact-address dt { float: left; clear: left; width: 1.8em; color: var(--gs-teal-ink); }
.contact-address dd { margin: 0 0 .35em 1.8em; }

/* --------------------------------------------------------------------------
   Fußbereich
   -------------------------------------------------------------------------- */
.site-footer { background: var(--gs-sky); color: var(--gs-teal-ink); padding: 28px 0; margin-top: 8px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: center; }
.site-footer a { color: var(--gs-teal-ink); font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4em 1.4em; }
.site-footer .mod-menu a { text-decoration: none; }
.site-footer .mod-menu a:hover { text-decoration: underline; }

/* Fehlerseite */
.error-box { max-width: 720px; margin: 0 auto; text-align: center; }
.error-debug { text-align: left; white-space: pre-wrap; font-size: .85rem; }

/* --------------------------------------------------------------------------
   Responsiv
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .has-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 760px) {
  .site-header { padding-top: 16px; }
  .header-grid { grid-template-columns: 1fr; gap: 12px; }
  .brand { padding-bottom: 0; padding-right: 110px; }
  .header-photo > img:first-child { border-radius: 12px 12px 0 0; }
  .header-logo { top: auto; bottom: calc(100% - 4px); right: 8px; width: 104px; }
  .tagline { font-size: 1.05rem; margin-bottom: .6em; }
  .header-contact a { font-size: .95rem; }

  .nav-toggle { display: inline-flex; }
  .nav-panel { display: none; padding-bottom: 10px; }
  .site-nav.is-open .nav-panel { display: block; }
  .site-nav .mod-menu { flex-direction: column; padding: 0; }
  .site-nav .mod-menu > li > a { border-radius: 10px; padding: .7em 1em; }

  .page { padding-top: 16px; }
  .content { border-radius: 12px; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}

@media print {
  .site-nav, .sidebar, .header-photo, .breadcrumbs-wrap, .skip-link { display: none !important; }
  body { background: #fff; }
  .content { box-shadow: none; padding: 0; }
}
