/* ============================================================
   Alltagskompass – Editorial Stylesheet
   Farben: Tinte #22333B · Papier #FBF9F3 · Petrol #0F6E74 · Bernstein #E8A13C
   Schrift: Georgia (Display) · Systemschrift (Text/UI)
   ============================================================ */

:root {
  --ink: #22333B;
  --ink-soft: #4A5A63;
  --paper: #FBF9F3;
  --paper-deep: #F2EEE3;
  --line: #E2DCCC;
  --brand: #0F6E74;
  --brand-dark: #12333A;
  --amber: #E8A13C;
  --cat: var(--brand);
  --serif: Georgia, 'Times New Roman', 'DejaVu Serif', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1160px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34,51,59,.06), 0 8px 24px rgba(34,51,59,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand-dark);
  color: #fff; padding: 10px 18px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Kopfbereich ---------- */
.topbar {
  background: var(--brand-dark); color: #EDE7D9;
  font-size: .8rem; letter-spacing: .06em;
}
.topbar-inner { display: flex; justify-content: space-between; padding-top: 7px; padding-bottom: 7px; }
.topbar-date { opacity: .8; }

.site-header {
  background: var(--paper); border-bottom: 3px double var(--line);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 14px; padding-bottom: 12px; flex-wrap: wrap; }
.brand img { width: clamp(210px, 26vw, 300px); height: auto; }

.main-nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: 8px 13px; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: .95rem; border-radius: 8px;
}
.main-nav a:hover { background: var(--paper-deep); color: var(--brand-dark); }
.main-nav a.active { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); border-radius: 8px 8px 0 0; }

.menu-toggle { display: none; background: none; border: 2px solid var(--ink); border-radius: 8px; padding: 9px 10px; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2.5px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Typografische Bausteine ---------- */
.kicker {
  display: inline-block; font-size: .74rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--cat);
  border-top: 3px solid var(--cat); padding-top: 6px; margin-bottom: 10px;
}
.kicker-hero { color: var(--cat); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  border-bottom: 3px double var(--line); margin: 0 0 22px; padding-bottom: 8px;
}
.section-title { font-family: var(--serif); font-size: 1.55rem; margin: 0; letter-spacing: .01em; }
.section-more { font-weight: 600; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.section-space { margin: 40px auto 56px; }

.btn {
  display: inline-block; background: var(--brand-dark); color: #fff !important;
  font-weight: 700; text-decoration: none; padding: 12px 22px; border-radius: 8px;
  border: none; font-size: 1rem; cursor: pointer;
}
.btn:hover { background: var(--brand); }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--paper-deep), var(--paper)); border-bottom: 1px solid var(--line); }
.hero-inner {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px;
  align-items: center; padding-top: 40px; padding-bottom: 44px;
}
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-title { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.18; margin: 6px 0 14px; }
.hero-title a { color: var(--ink); text-decoration: none; }
.hero-title a:hover { color: var(--brand-dark); text-decoration: underline; text-decoration-color: var(--cat); text-underline-offset: 6px; }
.hero-teaser { font-size: 1.13rem; color: var(--ink-soft); margin: 0 0 14px; }
.hero .btn { margin-top: 8px; }

/* ---------- Layout mit Seitenleiste ---------- */
.layout-main { display: grid; grid-template-columns: 1fr 320px; gap: 44px; margin-top: 48px; margin-bottom: 20px; }
.content-col > section { margin-bottom: 48px; }

.sidebar .widget { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; margin-bottom: 26px; }
.widget-title {
  font-family: var(--serif); font-size: 1.15rem; margin: 0 0 14px;
  padding-bottom: 8px; border-bottom: 3px double var(--line);
}
.top-list { list-style: none; margin: 0; padding: 0; counter-reset: top; }
.top-list li + li { border-top: 1px solid var(--line); }
.top-list a { display: flex; gap: 14px; padding: 12px 2px; text-decoration: none; color: var(--ink); align-items: baseline; }
.top-list a:hover .top-text { color: var(--brand-dark); text-decoration: underline; }
.top-num { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--amber); min-width: 26px; line-height: 1; }
.top-text { font-weight: 600; font-size: .95rem; line-height: 1.4; }
.top-kicker { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 3px; }

.sidebar .widget-newsletter, .widget-newsletter { background: var(--brand-dark); color: #F0EBDD; border: none; }
.widget-newsletter .widget-title { color: #fff; border-color: rgba(255,255,255,.3); }
.widget-newsletter p { font-size: .93rem; color: #F0EBDD; }
.widget-newsletter input { background: #fff; color: var(--ink); }
.widget-newsletter input::placeholder { color: #6B7A83; }

/* ---------- Artikelkarten ---------- */
.card-grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.article-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
  border-top: 4px solid var(--cat);
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--paper-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; }
.card-title { font-family: var(--serif); font-size: 1.14rem; line-height: 1.32; margin: 2px 0 8px; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-color: var(--cat); text-underline-offset: 4px; }
.card-teaser { font-size: .92rem; color: var(--ink-soft); margin: 0 0 12px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; font-size: .8rem; color: var(--ink-soft); margin: 0; }

/* ---------- Ressort-Streifen ---------- */
.cat-strip { padding: 40px 0 46px; border-top: 1px solid var(--line); }
.cat-strip:nth-of-type(even) { background: #fff; }
.cat-strip .section-title { border-left: 6px solid var(--cat); padding-left: 12px; }

/* ---------- Alle Artikel + Filter ---------- */
.all-articles { padding: 48px 0 56px; border-top: 1px solid var(--line); background: var(--paper-deep); }
.filter-bar { margin-bottom: 26px; }
#article-search {
  width: 100%; max-width: 560px; padding: 13px 16px; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
#article-search:focus { border-color: var(--brand); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.chip {
  border: 2px solid var(--cat, var(--ink)); color: var(--cat, var(--ink)); background: #fff;
  padding: 7px 15px; border-radius: 999px; font-weight: 700; font-size: .86rem; cursor: pointer;
}
.chip:hover { background: var(--paper); }
.chip.active { background: var(--cat, var(--ink)); color: #fff; }
.no-results { font-size: 1.02rem; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; }

/* ---------- Newsletter-Band ---------- */
.newsletter-band { background: var(--brand-dark); color: #EDE7D9; padding: 46px 0; }
.newsletter-band h2 { font-family: var(--serif); color: #fff; margin: 0 0 8px; font-size: 1.6rem; }
.newsletter-band p { margin: 0; max-width: 56ch; }
.newsletter-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 34px; align-items: center; }

.newsletter-form { display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter-form input {
  flex: 1 1 200px; padding: 12px 14px; border-radius: 8px; border: 2px solid transparent;
  font-size: 1rem; min-width: 0;
}
.newsletter-form input:focus { border-color: var(--amber); outline: none; }
.newsletter-form button {
  background: var(--amber); color: #1A2228; border: 2px solid #1A2228; font-weight: 800;
  padding: 12px 20px; border-radius: 8px; cursor: pointer; font-size: 1rem;
  letter-spacing: .02em;
}
.newsletter-form button:hover { filter: brightness(1.06); }
.form-msg { flex-basis: 100%; margin: 2px 0 0; font-weight: 600; font-size: .92rem; min-height: 1.3em; }
.form-msg.ok { color: #8FD6A9; }
.widget-newsletter .form-msg.ok { color: #A9E5BF; }
.form-msg.err { color: #F0A9A9; }

/* ---------- Seitenkopf (Ressorts, statische Seiten) ---------- */
.page-head { background: linear-gradient(180deg, var(--paper-deep), var(--paper)); border-bottom: 1px solid var(--line); padding: 40px 0 34px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin: 4px 0 10px; }
.page-intro { max-width: 68ch; font-size: 1.1rem; color: var(--ink-soft); margin: 0; }

/* ---------- Artikelseite ---------- */
.progress-track { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 300; background: transparent; }
.progress-bar { height: 100%; width: 0; background: var(--cat, var(--amber)); transition: width .08s linear; }

.article-container { max-width: 780px; }
.breadcrumb { font-size: .88rem; margin: 26px 0 6px; color: var(--ink-soft); }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.18; margin: 6px 0 12px; }
.article-meta { color: var(--ink-soft); font-size: .95rem; margin: 0 0 24px; }
.author-link { font-weight: 600; }
.article-figure { margin: 0 0 30px; }
.article-figure img { border-radius: var(--radius); box-shadow: var(--shadow); }

.article-body { font-size: 1.09rem; }
.article-body .lead p { font-size: 1.2rem; line-height: 1.6; color: var(--ink); }
.article-body .lead p:first-child::first-letter {
  font-family: var(--serif); font-size: 3.3em; float: left; line-height: .82;
  padding: 4px 10px 0 0; color: var(--cat, var(--brand)); font-weight: 700;
}
.article-body h2 {
  font-family: var(--serif); font-size: 1.45rem; margin: 38px 0 12px;
  padding-top: 16px; border-top: 3px double var(--line);
}
.article-body h3 { font-family: var(--serif); font-size: 1.18rem; margin: 26px 0 8px; }
.article-body ul { padding-left: 22px; }
.article-body li { margin-bottom: 9px; }
.article-body li::marker { color: var(--cat, var(--brand)); }

.fazit {
  background: var(--paper-deep); border-left: 6px solid var(--cat, var(--brand));
  border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px; margin: 40px 0 10px;
}
.fazit h2 { border: none; margin: 0 0 8px; padding: 0; }
.fazit p { margin: 0; }

.author-box {
  display: flex; gap: 18px; align-items: flex-start; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 34px 0;
}
.author-avatar {
  flex: 0 0 62px; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: 1.25rem; font-family: var(--serif);
}
.author-name { font-weight: 800; margin: 0; }
.author-role { color: var(--ink-soft); font-size: .88rem; margin: 2px 0 8px; }
.author-bio { margin: 0; font-size: .95rem; }

.related { background: transparent; border-top: 1px solid var(--line); padding: 44px 0 54px; margin-top: 30px; }

/* ---------- Formulare (Kontakt) & Hinweise ---------- */
.notice {
  background: #FFF6E3; border: 1px solid var(--amber); border-left-width: 6px;
  border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 26px 0; font-size: .96rem;
}
.contact-form { max-width: 620px; margin: 10px 0 34px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.form-row input, .form-row textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--brand); outline: none; }
.contact-form .form-msg.ok { color: #1F7A4D; }
.contact-form .form-msg.err { color: #AE3B3B; }

/* ---------- Fußbereich ---------- */
.site-footer { background: var(--brand-dark); color: #D8D2C2; margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1fr; gap: 34px;
  padding-top: 46px; padding-bottom: 30px;
}
.footer-logo { margin-bottom: 12px; }
.footer-brand p { font-size: .92rem; line-height: 1.6; }
.site-footer h3 {
  color: #fff; font-family: var(--serif); font-size: 1.02rem;
  border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 8px; margin: 4px 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #D8D2C2; text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-articles li { line-height: 1.4; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; padding-bottom: 20px; font-size: .84rem; opacity: .8; }

/* ---------- Zurück nach oben ---------- */
.back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 48px; height: 48px;
  border-radius: 50%; border: none; background: var(--brand-dark); color: #fff;
  font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 150;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { background: var(--brand); }

/* ---------- Responsiv ---------- */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout-main { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .newsletter-inner { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body { font-size: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .topbar-inner { justify-content: center; }
  .topbar-date { display: none; }

  .menu-toggle { display: block; }
  .header-inner nav { flex-basis: 100%; }
  .main-nav {
    display: none; flex-direction: column; gap: 0;
    border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--paper-deep); }
  .main-nav a.active { box-shadow: inset 4px 0 0 var(--brand); padding-left: 14px; }

  .hero-inner { padding-top: 26px; padding-bottom: 30px; }
  .article-body .lead p:first-child::first-letter { font-size: 2.6em; }
  .author-box { flex-direction: column; }
}



/* ---------- SEO/speed image stability update ---------- */
.hero-media img,
.article-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}
.card-media img { object-position: center; }


/* ---------- Mobile header fix ----------
   The <nav> wrapper was still a flex item on mobile even when the <ul> menu
   was hidden. This created an empty second row / extra bottom padding.
*/
@media (max-width: 700px) {
  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .brand {
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .brand img {
    width: min(230px, calc(100vw - 120px));
    height: auto;
  }

  .menu-toggle {
    flex: 0 0 auto;
    padding: 7px 8px;
  }

  .menu-toggle span {
    width: 20px;
    height: 2px;
    margin: 4px 0;
  }

  .header-inner nav {
    display: none;
    position: absolute;
    left: 20px;
    right: 20px;
    top: calc(100% + 1px);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
    padding: 8px 0;
    z-index: 150;
  }

  .header-inner nav.is-open {
    display: block;
  }

  .header-inner nav .main-nav {
    margin: 0;
    padding: 0;
    border-top: 0;
    display: none;
    flex-direction: column;
  }

  .header-inner nav.is-open .main-nav,
  .header-inner nav .main-nav.open {
    display: flex;
  }
}


/* ---------- Homepage load-more pagination ---------- */
.article-card[hidden] { display: none !important; }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin: 26px 0 6px;
}

.load-more-btn {
  cursor: pointer;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: #fff;
  min-width: 210px;
  text-align: center;
}

.load-more-btn:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.load-more-btn[hidden] {
  display: none !important;
}


/* Article related-section background fix */
.article-body .related,
.related {
  background: transparent;
}


/* ---------- Unified article Fazit + related section ---------- */
.article-body .fazit-box {
  background: var(--paper-deep);
  border-left: 5px solid var(--cat, var(--brand));
  border-radius: 8px;
  padding: 22px 24px 20px;
  margin: 34px 0 34px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.article-body .fazit-box h2,
.article-body .fazit-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.article-body .fazit-box p:last-child {
  margin-bottom: 0;
}

.article-body .fazit-box + .related {
  margin-top: 34px;
}

.article-body .related,
.related {
  background: transparent;
}


/* ---------- Article line cleanup ----------
   Remove internal section separator lines inside article text.
   Keep only one divider before the related "Passend zum Thema" section.
*/
.article-body h2,
.article-body h3,
.article-body h4 {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

.article-body > h2,
.article-body > h3,
.article-body > h4 {
  padding-top: 0 !important;
}

.article-body .fazit-box h2,
.article-body .fazit-box h3,
.article-body .fazit-box h4 {
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding-top: 0 !important;
}

.article-body .fazit-box {
  margin-bottom: 36px;
}

.article-body .related {
  border-top: 1px solid var(--line) !important;
  margin-top: 38px !important;
  padding-top: 34px !important;
}

.article-body .related .section-head {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

.article-body .related h2,
.article-body .related .section-title {
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding-top: 0 !important;
}


/* ---------- Protected email reveal ---------- */
.email-protect {
  margin: 22px 0 28px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-deep);
}

.email-protect-compact {
  max-width: 620px;
}

.email-protect-intro {
  margin-top: 0;
  font-weight: 700;
}

.email-protect .form-row {
  margin-bottom: 14px;
}

.email-protect input {
  max-width: 420px;
}

.email-protect .form-msg a {
  font-weight: 700;
  word-break: break-word;
}
