/* ============================================================
   SPURZEIT – RESPONSIVE OVERRIDES (Curated Home)
   Datei: assets/css/spurzeit-responsive.css

   Prinzip:
   - screen.css = Grunddesign (Desktop/Default)
   - spurzeit-responsive.css = Breakpoints + Overrides

   Breakpoints:
   - Mobile: <= 720px
   - Tablet: 768–1024px (iPad mini/air)
   - Desktop: >= 1200px (Artikelbreite / Canvas)
   ============================================================ */


/* ============================================================
   1) MOBILE (<= 720px)
   ============================================================ */
@media (max-width: 720px) {

  /* ------------------------------------------------------------
     A) Curated Hero: Bild oben, Text unten (NUR Layout-Fix)
     WICHTIG: Keine Typo-Anpassung hier!
     ------------------------------------------------------------ */
  .home-template .hero-curated .hero-box {
    display: flex !important;
    flex-direction: column !important;
  }

  .home-template .hero-curated .hero-image {
    width: 100% !important;
    flex: 0 0 auto !important;
  }

  .home-template .hero-curated .hero-image a,
  .home-template .hero-curated .hero-image img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
  }

  .home-template .hero-curated .hero-content {
    width: 100% !important;
    padding: 18px 18px 22px !important;
  }

  /* CTA fingerfreundlich, ohne Optik zu ändern */
  .home-template .hero-curated .hero-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }


  /* ------------------------------------------------------------
     B) Kapitel-Übergänge: Hero -> Ausgabe
     ------------------------------------------------------------ */
  .home-template .hero-curated {
    margin-bottom: 36px;
  }

  .home-template .sp-issue-block {
    padding-top: 18px;
  }

  .home-template .sp-issue-block::before {
    content: "";
    display: block;
    width: 56px;
    height: 1px;
    margin: 0 auto 14px;
    background: rgba(0, 0, 0, 0.18);
  }


  /* ------------------------------------------------------------
     C) “Mehr entdecken” = sekundär (optisch leiser + getrennt)
     ------------------------------------------------------------ */
  .home-template .gh-featured-block.sp-featured-block {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,.12);
  }

  .home-template .gh-featured-block.sp-featured-block .gh-container-title {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 14px;
  }


  /* ------------------------------------------------------------
     D) Featured Feed: Mobile als Stack (Bild oben, Text unten)
     -> killt das 72px Thumbnail-Layout zuverlässig
     ------------------------------------------------------------ */
  .home-template .gh-featured-block.sp-featured-block .gh-featured-feed {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-featured-feed > article.gh-card,
  .home-template .gh-featured-block.sp-featured-block .gh-featured-feed > * {
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
    flex: 1 1 auto !important;
  }

  .home-template .gh-featured-block.sp-featured-block article.gh-card > .gh-card-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image-link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
    aspect-ratio: 21 / 9 !important; /* flacher = weniger dominant */
    border-radius: 16px;
    overflow: hidden;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-wrapper {
    width: 100% !important;
    min-width: 0 !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-title {
    font-size: 1.15rem;
    line-height: 1.15;
  }

  /* Umbruch entschärfen */
  .home-template .gh-featured-block.sp-featured-block .sp-card-topic,
  .home-template .gh-featured-block.sp-featured-block .gh-card-title {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: auto;
  }

  .home-template .gh-featured-block.sp-featured-block .sp-card-topic {
    white-space: normal !important;
  }
}


/* ============================================================
   2) TABLET (iPad mini/air: 768–1024px)
   Ziel: “Mehr entdecken” nicht dominanter als Issue.
   - 2 Spalten
   - Card intern horizontaler Teaser (Bild links)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {

  .home-template .gh-featured-block.sp-featured-block .gh-featured-feed {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }

  .home-template .gh-featured-block.sp-featured-block article.gh-card > .gh-card-link {
    display: flex !important;
    flex-direction: row !important;
    gap: 14px !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image-link {
    flex: 0 0 42% !important;
    max-width: 42% !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    overflow: hidden;
    border-radius: 14px;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-wrapper {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .home-template .gh-featured-block.sp-featured-block .gh-card-title {
    font-size: 1.6rem;
    line-height: 1.15;
  }

  .home-template .gh-featured-block.sp-featured-block .sp-card-topic {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: auto;
  }
}


/* ============================================================
   3) FEATURED EXCERPT REGEL (NUR "Mehr entdecken")
   Excerpt: Mobile + Tablet AUS, Desktop AN
   ============================================================ */
@media (max-width: 1024px) {
  .home-template .gh-featured-block.sp-featured-block .gh-card-excerpt {
    display: none !important;
  }
}


/* ============================================================
   4) KATEGORIE/TAG-LINK (überall gleich)
   Einheitlicher redaktioneller Textlink statt Button/Chip
   ============================================================ */
.sp-card-topics {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Reiner Textlink (killt Chip-Look zuverlässig) */
.sp-card-topics .sp-card-topic {
  display: inline !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;

  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;

  color: rgba(0, 0, 0, 0.62);
  text-decoration: none;
}

/* Dezenter Trenner zwischen mehreren Tags */
.sp-card-topics .sp-card-topic + .sp-card-topic::before {
  content: "·";
  display: inline-block;
  margin: 0 8px;
  color: rgba(0, 0, 0, 0.35);
}

/* Hover/Fokus: eindeutig, aber leise */
.sp-card-topics .sp-card-topic:hover,
.sp-card-topics .sp-card-topic:focus-visible {
  color: rgba(0, 0, 0, 0.88);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Mobile: noch leiser */
@media (max-width: 720px) {
  .sp-card-topics .sp-card-topic {
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.58);
  }
}


/* ============================================================
   5) ISSUE: Schloss + Datum eindeutig zuordnen (Mobile + Tablet)
   Ziel:
   - Schloss & Datum sind IMMER direkt zusammen (eine Einheit)
   - gehören sichtbar zum Artikel (nicht "zum nächsten" rutschen)
   - Trennerlinie läuft NICHT durch die Meta-Zeile
   Gilt NUR im Issue-Block, NUR bis Tablet (<=1024px)
   ============================================================ */
@media (max-width: 1024px) {

  /* A) Falls irgendwo Positioning reingekommen ist: zurück in den Flow */
  .home-template .sp-issue-block .gh-card-date,
  .home-template .sp-issue-block time.gh-card-date,
  .home-template .sp-issue-block .gh-card-access,
  .home-template .sp-issue-block .gh-access {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    float: none !important;
  }

  /* B) Meta-Zeile als Badge (einheitlich Mobile + Tablet) */
  .home-template .sp-issue-block .gh-card-meta,
  .home-template .sp-issue-block .gh-card-footer {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;

    margin-top: 10px !important;
    padding: 4px 10px !important;

    border: 1px solid rgba(0,0,0,0.12) !important;
    border-radius: 999px !important;
    background: rgba(0,0,0,0.02) !important;

    line-height: 1 !important;
    opacity: 0.92 !important;

    /* über der Trennerlinie */
    position: relative !important;
    z-index: 2 !important;
  }

  /* C) Schloss-Icon sauber */
  .home-template .sp-issue-block .gh-card-access,
  .home-template .sp-issue-block .gh-access {
    display: inline-flex !important;
    align-items: center !important;
    opacity: 0.85 !important;
  }

  .home-template .sp-issue-block .gh-card-access svg,
  .home-template .sp-issue-block .gh-access svg {
    width: 14px !important;
    height: 14px !important;
    flex: 0 0 auto !important;
    transform: translateY(1px) !important;
    opacity: 0.85 !important;
  }

  /* D) Datum ruhig, eindeutig */
  .home-template .sp-issue-block .gh-card-date,
  .home-template .sp-issue-block time.gh-card-date {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;

    font-size: 0.92rem !important;
    letter-spacing: 0.02em !important;
    color: rgba(0,0,0,0.60) !important;

    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  /* E) Trennerlinie: nicht am Link, sondern AFTER am Artikel */
  .home-template .sp-issue-block .gh-card-link {
    border-bottom: 0 !important;
  }

  .home-template .sp-issue-block article.gh-card {
    position: relative !important;
    padding-bottom: 16px !important; /* Platz für die Linie */
    margin-bottom: 16px !important;  /* Abstand zur nächsten Card */
  }

  .home-template .sp-issue-block article.gh-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 1px;
    background: rgba(0,0,0,0.12);
    z-index: 1; /* liegt unter dem Badge */
  }

  .home-template .sp-issue-block article.gh-card:last-child::after {
    display: none;
  }
}

/* Mobile-Feinheit: minimal kleinere Meta-Typo */
@media (max-width: 720px) {
  .home-template .sp-issue-block .gh-card-date,
  .home-template .sp-issue-block time.gh-card-date {
    font-size: 0.9rem !important;
  }
}


/* ------------------------------------------------------------
   ISSUE (Mobile): mehr Luft zwischen Bild und Tag/Label
   Ziel: Tag-Label klebt nicht am Bild
   ------------------------------------------------------------ */
@media (max-width: 720px) {

  /* Dein Tag-Container (Spurenzeit) */
  .home-template .sp-issue-block .sp-card-topics {
    margin-top: 10px !important;
  }

  /* Fallback für Source/Ghost Standard-Tag-Elemente */
  .home-template .sp-issue-block .gh-card-tag,
  .home-template .sp-issue-block .gh-card-topic {
    margin-top: 10px !important;
    display: inline-block;
  }
}


/* ============================================================
   SPURZEIT – POST: Desktop-Lesespalte (FINAL)
   Ziel:
   - Essays auf Desktop deutlich breiter
   - Mobile & Tablet unverändert
   - Ghost Canvas korrekt nutzen
   ============================================================ */

@media (min-width: 1200px) {

  /* Canvas: mittlere Lesespalte breiter machen */
  .post-template .gh-content.gh-canvas.is-body {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1040px)
      minmax(0, 1fr) !important;
  }

  /* Standard-Inhalt sitzt in der Mitte */
  .post-template .gh-content.gh-canvas.is-body > * {
    grid-column: 2 !important;
  }

  /* Wide & Full bleiben erlaubt */
  .post-template .gh-content.gh-canvas.is-body > .kg-width-wide,
  .post-template .gh-content.gh-canvas.is-body > .kg-width-full {
    grid-column: 1 / -1 !important;
  }

  /* Wide geführt, nicht randlos */
  .post-template .gh-content.gh-canvas.is-body > .kg-width-wide {
    width: 100% !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ============================================================
   SPURZEIT – POST: Abstand Kommentarbereich → Weitere Spuren
   Ziel:
   - Desktop: weniger „Leerraum-Wüste“
   - Mobile/Tablet unverändert
   ============================================================ */

@media (min-width: 1200px) {

  /* Kommentarbereich etwas kompakter */
  .post-template .gh-comments,
  .post-template .gh-comments-wrapper {
    margin-bottom: 48px !important;
  }

  /* Block "Weitere Spuren" näher heranholen */
  .post-template .gh-more-posts,
  .post-template .gh-related-posts {
    margin-top: 48px !important;
  }
}

/* ============================================================
   SPURZEIT – Mobile Menu: Logo NICHT abschneiden + X sauber
   (Drop-in Fix, am Ende der spurzeit-responsive.css)
   ============================================================ */

@media (max-width: 900px) {

  /* 1) Nichts darf das Logo oben abschneiden */
  #gh-navigation,
  #gh-navigation .gh-navigation-inner,
  #gh-navigation .gh-navigation-brand {
    overflow: visible !important;
  }

  /* 2) Topbar (Logo links, Burger rechts) stabil machen */
  #gh-navigation .gh-navigation-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }

  /* 3) Logo darf nicht “links rauslaufen” */
  #gh-navigation .gh-navigation-logo {
    display: flex !important;
    align-items: center !important;
    max-width: calc(100% - 56px) !important; /* Platz für Burger */
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  #gh-navigation .gh-navigation-logo img {
    display: block !important;
    height: 28px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    transform: none !important;
  }

  /* 4) Menü selbst: Overlay unter der Topbar */
  #gh-navigation .gh-navigation-menu {
    display: none;
  }

  #gh-navigation.is-open .gh-navigation-menu {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 64px !important;      /* Höhe der Topbar (ggf. 56–72 testen) */
    bottom: 0 !important;
    background: var(--background-color, #f1eddf) !important;
    padding: 28px 18px !important;
    overflow: auto !important;
    z-index: 9999 !important;
  }

  #gh-navigation.is-open .gh-navigation-menu .nav {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    align-items: center !important;
  }

  #gh-navigation.is-open .gh-navigation-menu .nav a {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }

  /* 5) Burger-Button: Hamburger vs X sauber umschalten
        (dein Button enthält 2 SVGs – 1. Hamburger, 2. X) */
  #gh-navigation .gh-burger svg {
    display: none !important;
  }
  #gh-navigation .gh-burger svg:first-child {
    display: block !important; /* default: Hamburger */
  }
  #gh-navigation.is-open .gh-burger svg:first-child {
    display: none !important;  /* open: Hamburger aus */
  }
  #gh-navigation.is-open .gh-burger svg:last-child {
    display: block !important; /* open: X an */
  }

  /* 6) X muss sichtbar und klickbar bleiben */
  #gh-navigation .gh-burger {
    position: relative !important;
    z-index: 10001 !important;
  }
}

/* ============================================================
   FIX: Logo im offenen Mobile-Menü wieder sichtbar machen
   ============================================================ */
@media (max-width: 900px) {

  /* Theme überschreibt das sehr wahrscheinlich -> zurückholen */
  #gh-navigation.is-open .gh-navigation-logo,
  #gh-navigation.is-open .gh-navigation-logo img {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Falls der Link selbst irgendwo "0 Breite" bekommt */
  #gh-navigation.is-open .gh-navigation-logo {
    max-width: calc(100% - 56px) !important;
  }

  #gh-navigation.is-open .gh-navigation-logo img {
    height: 28px !important;
    width: auto !important;
    max-width: 100% !important;
  }
}

@media (max-width: 900px) {
  #gh-navigation.is-open .gh-navigation-brand {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Start nur im Mobile-Menü anzeigen, auf Desktop ausblenden */
@media (min-width: 601px) {
  #gh-navigation .gh-navigation-menu .nav .nav-start,
  #gh-navigation .gh-navigation-menu .nav .nav-startseite {
    display: none !important;
  }
}


/* ============================================================
   SPURZEIT – Footer Mobile FINAL (stabil, ohne Nebenwirkungen)
   ============================================================ */
@media (max-width: 600px) {

  /* 0) Kill-Switch: alles, was irgendwo Striche/Separatoren zeichnet */
  .sp-footer-nav .nav > li::before,
  .sp-footer-nav .nav > li::after,
  .sp-footer-nav .nav > li > a::before,
  .sp-footer-nav .nav > li > a::after {
    content: none !important;
    display: none !important;
  }

  /* 1) Grid erzwingt das Layout (2 Spalten + Full-Width Items) */
  .gh-footer .sp-footer-nav .nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "start archiv"
      "line1  line1"
      "uber   uber"
      "doss   ausg"
      "line2  line2"
      "reg    reg"
      "pfl    pfl";
    gap: 14px 28px !important;
    justify-items: center;
    align-items: center;

    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    text-align: center;
  }

  /* 2) Altlasten neutralisieren, die alles einspaltig machen */
  .gh-footer .sp-footer-nav .nav > li {
    width: auto !important;
    flex: initial !important;
    flex-basis: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  /* 3) Grid-Areas zuweisen */
  .gh-footer .sp-footer-nav .nav > li.nav-startseite     { grid-area: start; }
  .gh-footer .sp-footer-nav .nav > li.nav-archiv         { grid-area: archiv; }
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit  { grid-area: uber; }
  .gh-footer .sp-footer-nav .nav > li.nav-dossiers       { grid-area: doss; }
  .gh-footer .sp-footer-nav .nav > li.nav-ausgaben       { grid-area: ausg; }
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren   { grid-area: reg; }
  .gh-footer .sp-footer-nav .nav > li.nav-pflichtangaben { grid-area: pfl; }

  /* 4) Die zwei Trennlinien bauen wir als pseudo-elements an den "Full-Width" Startpunkten */
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit,
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren {
    position: relative;
    padding-top: 12px !important;
    margin-top: 2px !important;
  }

  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit::before,
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 1px;
    background: rgba(0,0,0,0.18);
  }
}
/* ==============================
   FOOTER – Mobile (<=600px)
   2 Spalten + Gruppen-Trenner
   ============================== */
@media (max-width: 600px) {

  .gh-footer .sp-footer-nav .nav{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:10px 18px;
    margin:0;
    padding:0;
    list-style:none;
  }

  /* 2 Spalten */
  .gh-footer .sp-footer-nav .nav > li{
    flex: 0 0 calc(50% - 18px);
    display:flex;
    justify-content:center;
  }

  /* Gruppe 2 Start */
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit,
  /* Gruppe 3 Start */
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren{
    flex-basis:100%;
    position:relative;
    padding-top:12px;
    margin-top:2px;
  }

  /* horizontale Linie über Gruppe 2 + 3 */
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit::before,
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren::before{
    content:"";
    position:absolute;
    top:0;
    left:50%;
    transform:translateX(-50%);
    width:70px;
    height:1px;
    background:rgba(0,0,0,0.18);
  }

  /* Letztes Item (Pflichtangaben) volle Breite, wirkt logischer */
  .gh-footer .sp-footer-nav .nav > li.nav-pflichtangaben{
    flex-basis:100%;
  }
}

/* =========================================
   FOOTER – Mobile Feinschliff (<=600px)
   Linien subtiler + weniger Luft
   ========================================= */
@media (max-width: 600px) {

  /* etwas kompakter */
  .gh-footer .sp-footer-nav .nav{
    gap: 10px 18px;
  }

  /* Gruppe 2 + 3 Start: weniger Abstand */
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit,
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren{
    padding-top: 10px;     /* vorher 12 */
    margin-top: 0;         /* vorher 2–4 */
  }

  /* Linien: kürzer, heller, unauffälliger */
  .gh-footer .sp-footer-nav .nav > li.nav-uber-spurzeit::before,
  .gh-footer .sp-footer-nav .nav > li.nav-registrieren::before{
    width: 44px;                 /* vorher 60–70 */
    background: rgba(0,0,0,0.10);/* vorher ~0.18–0.22 */
  }
}


@media (max-width: 600px) {

  /* keine Linien mehr */
  .sp-footer-nav .nav > li::before{
    content: none !important;
  }

  /* Navigation wieder inline-Logik */
  .sp-footer-nav .nav{
    justify-content: center;
    gap: 8px 14px;
  }

  /* optischer Trenner als Pipe */
  .sp-footer-nav .nav > li:not(:last-child)::after{
    content: "|";
    margin-left: 14px;
    opacity: 0.35;
  }

  /* Gruppen umbrechen */
  .sp-footer-nav .nav .nav-uber-spurzeit,
  .sp-footer-nav .nav .nav-registrieren{
    flex-basis: 100%;
    justify-content: center;
  }

  /* kein Pipe am Zeilenende */
  .sp-footer-nav .nav .nav-archiv::after,
  .sp-footer-nav .nav .nav-ausgaben::after{
    content: "";
  }
}