/*
Theme Name:        Oberschule Bückeburg
Theme URI:         https://obs-bbg.de
Author:            Homepage-AG der Oberschule Bückeburg
Author URI:        https://obs-bbg.de
Description:       Modernes, freundliches WordPress-Theme für weiterführende Schulen. Entwickelt für die
                    Oberschule Bückeburg auf Basis des schuleigenen Grün-Logos. Bringt eigene Kopf-/Fußzeile,
                    einen Hero-Bereich für die Startseite (per Customizer editierbar), automatische
                    Unternavigation & Karten-Übersichten aus der WordPress-Seitenhierarchie sowie ein Set an
                    Shortcodes für Hinweisboxen, Karten, Personen-Kacheln, Downloads, Zeitleisten und mehr mit.
Version:            1.0.0
Requires at least:  6.0
Tested up to:       6.6
Requires PHP:       7.4
License:            GNU General Public License v2 or later
License URI:        https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:        obs-bueckeburg
Tags:               education, one-column, custom-menu, custom-logo, translation-ready, block-patterns

Dieses Theme basiert auf dem Farbkonzept des Original-Logos der Oberschule Bückeburg (Grün #72a042).
*/

/* ============================================
   Basis-Stylesheet
   ============================================ */

:root {
  --green: #72a042;
  --green-dark: #547a2e;
  --green-darker: #3f5c22;
  --green-light: #eaf2e2;
  --green-lighter: #f5f9f0;
  --ink: #1c2117;
  --ink-soft: #4a5142;
  --paper: #ffffff;
  --border: #e1e7d8;
  --shadow: 0 10px 30px -12px rgba(28, 33, 23, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1180px;
  --font-head: 'Baloo 2', 'Quicksand', system-ui, sans-serif;
  --font-body: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--green-darker);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green-darker); text-decoration: underline; }

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--green-darker);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--green-darker);
  color: #eef4e6;
  font-size: 0.82rem;
}
.topbar .container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  justify-content: space-between;
  padding-top: 7px;
  padding-bottom: 7px;
}
.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.topbar a {
  color: #eef4e6;
  opacity: 0.92;
}
.topbar a:hover { color: #fff; opacity: 1; text-decoration: underline; }
.topbar-tools a {
  background: rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 6px;
}
.topbar-tools a:hover { background: rgba(255,255,255,0.22); text-decoration: none; }

/* ---------- Header / main nav ---------- */
header.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 56px; width: auto; }
.brand-text {
  font-family: var(--font-head);
  line-height: 1.1;
}
.brand-text strong { display: block; font-size: 1.05rem; color: var(--ink); }
.brand-text span { display: block; font-size: 0.82rem; color: var(--ink-soft); }

nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
}
nav.main-nav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] {
  background: var(--green-light);
  color: var(--green-darker);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: var(--green);
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-light) 0%, #ffffff 65%);
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero .container {
  display: block;
  max-width: 760px;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 { margin-bottom: 0.35em; }
.hero-lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; box-shadow: var(--shadow); }
.btn-outline { background: #fff; border-color: var(--green); color: var(--green-darker); }
.btn-outline:hover { background: var(--green-light); color: var(--green-darker); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--green-lighter); }
.section-head { max-width: 720px; margin-bottom: 34px; }
.section-head p { color: var(--ink-soft); }
.kicker {
  color: var(--green-dark);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  display: block;
}

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card .icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-light);
  border-radius: 12px;
  margin-bottom: 14px;
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card a.card-link { font-weight: 700; }

.link-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.link-card:hover { border-color: var(--green); background: var(--green-lighter); text-decoration: none; }
.link-card strong { display: block; color: var(--ink); font-size: 1.02rem; }
.link-card span { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Info box / notices ---------- */
.notice-list { display: flex; flex-direction: column; gap: 16px; }
.notice {
  border-left: 4px solid var(--green);
  background: var(--green-lighter);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.notice p:last-child { margin-bottom: 0; }

.help-box {
  background: #fdf6e9;
  border: 1px solid #ecdcac;
  border-radius: var(--radius);
  padding: 26px 28px;
}
.help-box h3 { color: #7a5b12; }
.help-box .hotline {
  display: inline-block;
  background: #fff;
  border: 1px solid #ecdcac;
  border-radius: 10px;
  padding: 10px 16px;
  margin: 6px 8px 0 0;
  font-weight: 700;
}

/* ---------- People / avatars ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; }
.person {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 14px;
}
.person .avatar {
  width: 92px; height: 92px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.person .avatar svg { width: 100%; height: 100%; }
.person strong { display: block; }
.person span { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.95rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
th { background: var(--green-light); color: var(--green-darker); }
tr:nth-child(even) td { background: #fafcf7; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--green-darker); }

/* ---------- Page header (inner pages) ---------- */
.page-hero {
  background: var(--green-darker);
  color: #fff;
  padding: 40px 0 46px;
}
.page-hero h1 { color: #fff; }
.page-hero p { color: #dfeacd; max-width: 60ch; }
.page-hero .breadcrumb, .page-hero .breadcrumb a { color: #cfe3b6; }

/* ---------- Sub-nav (Untermenü) ---------- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
}
.subnav a {
  background: var(--green-light);
  color: var(--green-darker);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
}
.subnav a:hover, .subnav a.active {
  background: var(--green);
  color: #fff;
  text-decoration: none;
}

/* ---------- Timeline (Termine) ---------- */
.timeline-month h3 {
  border-bottom: 2px solid var(--green-light);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.timeline-month { margin-bottom: 34px; }
.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.timeline-item .date { font-weight: 700; color: var(--green-dark); }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--green-lighter);
}
.gallery-item .frame {
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
}
.gallery-item .frame svg { width: 60%; height: 60%; }
.gallery-item figcaption { padding: 10px 14px; font-size: 0.85rem; color: var(--ink-soft); }
.gallery-item { margin: 0; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--ink);
  color: #d8ddd0;
  padding: 50px 0 24px;
  margin-top: 40px;
}
footer.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
footer.site-footer a { color: #c7cfba; }
footer.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { height: 42px; filter: brightness(0) invert(1); opacity: 0.95; }
.footer-bottom {
  border-top: 1px solid #333a2d;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9aa38a;
}
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0; }

/* ---------- Misc ---------- */
.tag {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-darker);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0 6px 6px 0;
}
.stat-row { display: flex; flex-wrap: wrap; gap: 26px; margin: 18px 0; }
.stat { min-width: 120px; }
.stat strong { display: block; font-size: 2rem; color: var(--green-dark); font-family: var(--font-head); }
.stat span { color: var(--ink-soft); font-size: 0.88rem; }

.download-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.download-list a {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-lighter);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--ink);
}
.download-list a:hover { background: var(--green-light); text-decoration: none; }
.download-list .ext {
  background: var(--green);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.press-year { margin-bottom: 8px; margin-top: 26px; }
.press-list { list-style: none; padding: 0; }
.press-list li {
  display: flex; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}
.press-list .press-date { color: var(--ink-soft); min-width: 92px; }
.press-list .press-source { color: var(--green-dark); font-weight: 700; min-width: 190px; }

blockquote {
  border-left: 4px solid var(--green);
  margin: 1.2em 0;
  padding: 4px 20px;
  color: var(--ink-soft);
  font-style: italic;
}

.legal h2 { margin-top: 1.6em; }
.legal h2:first-child { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .topbar .container { justify-content: flex-start; }
  .nav-toggle { display: inline-flex; align-items:center; gap:6px;}
  nav.main-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 10px 16px 18px;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; }
  nav.main-nav a { display: block; padding: 12px 10px; }
  .header-inner { flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 100px 1fr; }
}

/* ============================================
   WordPress-Kern: Menüs, Blöcke, Bedienhilfen
   ============================================ */

/* aktiver Menüpunkt (von WordPress automatisch vergebene Klassen) */
nav.main-nav .current-menu-item > a,
nav.main-nav .current_page_item > a,
nav.main-nav .current-menu-ancestor > a {
  background: var(--green-light);
  color: var(--green-darker);
}
.subnav .current-menu-item > a,
.subnav a.active { background: var(--green); color: #fff; }

.topbar .current-menu-item > a { text-decoration: underline; }

/* Screenreader-Text (Standard-WordPress-Klasse) */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #fff; color: var(--ink); display: block;
  height: auto; width: auto; padding: 12px 18px; left: 6px; top: 6px;
  clip: auto; clip-path: none; z-index: 999999;
  text-decoration: none; border-radius: 8px; box-shadow: var(--shadow);
}

/* Gutenberg-Grundblöcke an das Designsystem anpassen */
.entry-content { max-width: 100%; }
.entry-content > * { margin-left: auto; margin-right: auto; }
.entry-content .alignwide { max-width: 1180px; }
.entry-content .alignfull { max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* Startseite: völlig frei gestaltbarer Inhalt (kein festes Hero-Layout mehr).
   Normale Absätze/Überschriften/Bilder bekommen eine angenehme Lesebreite,
   per Block-Ausrichtung "breit" bzw. "voll" lässt sich jederzeit ausbrechen –
   und mit dem Shortcode [obs_section] lassen sich zusätzlich beliebig viele
   vollbreite Bereiche mit eigenem Hintergrund frei anordnen. */
.front-page-content { padding-top: 40px; padding-bottom: 20px; }
.front-page-content > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}
.front-page-content > .alignwide {
  max-width: 1180px;
}
.front-page-content > .alignfull,
.front-page-content > .obs-section {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 0;
  padding-right: 0;
}
.front-page-content > .obs-section > .container { padding-top: 0; padding-bottom: 0; }

.obs-section { padding: 56px 0; }
.obs-section.pad-small { padding: 30px 0; }
.obs-section.pad-large { padding: 80px 0; }
.obs-section.bg-alt   { background: var(--green-lighter); }
.obs-section.bg-white  { background: #fff; }
.obs-section.bg-dark   { background: var(--green-darker); color: #fff; }
.obs-section.bg-dark h1, .obs-section.bg-dark h2, .obs-section.bg-dark h3 { color: #fff; }
.obs-section.bg-dark a:not(.btn) { color: #dfeacd; }
.obs-section.bg-hero   { background: linear-gradient(135deg, var(--green-light) 0%, #ffffff 65%); }

.entry-content table { width: 100%; }
.entry-content figure.wp-block-table { overflow-x: auto; }
.entry-content .wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.entry-content .wp-block-image img { border-radius: var(--radius-sm); }
.entry-content blockquote.wp-block-quote { border-left: 4px solid var(--green); padding-left: 20px; }
.entry-content .wp-block-button__link {
  display: inline-flex; align-items:center; gap:8px; padding: 12px 22px; border-radius: 999px;
  font-weight: 700; background: var(--green); color: #fff; text-decoration: none;
}
.entry-content .wp-block-button__link:hover { background: var(--green-dark); }
.entry-content .wp-block-separator { border-top: 1px solid var(--border); }

/* Suchformular */
.search-form { display: flex; gap: 8px; margin: 20px 0; }
.search-form input[type="search"] {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px;
}
.search-form button {
  background: var(--green); color: #fff; border: none; padding: 10px 18px; border-radius: 999px; font-weight: 700; cursor: pointer;
}

/* Blog-/Archiv-Karten (index.php, search.php) */
.post-list { display: grid; gap: 22px; }
.post-card { background:#fff; border:1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.post-card .post-meta { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 6px; }
.pagination { display:flex; gap:10px; margin-top: 30px; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 999px; border:1px solid var(--border); color: var(--ink);
}
.pagination .current { background: var(--green); color:#fff; border-color: var(--green); }

/* Custom Logo Fallback als Text, falls kein Bild hinterlegt ist */
.brand .site-title-text { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
