/* Wachzeit-Rechner - eigenstaendiges Design.
   Klassennamen und Struktur folgen absichtlich dem Muster des
   Eisprungrechners (topbar, hero, panel, result-block, info-grid, ...),
   die Palette ist eine andere: tiefes Nachtblau statt Violett. */

:root {
    color-scheme: light;
    --ink: #23282b;
    --muted: #5f6368;
    --line: #e3e7ea;
    --surface: #ffffff;
    --soft: #fbf8f5;
    --brand: #3f4f8f;
    --brand-dark: #2c3866;
    --brand-soft: #97a3cc;
    --accent: #d98246;
    --warm: #fdf3e7;
    --warm-line: #f0d9bd;
    --nav-bg: #26314f;
    --hero-bg:
        linear-gradient(125deg, rgba(30, 39, 64, 0.98), rgba(63, 79, 143, 0.92)),
        radial-gradient(circle at 84% 22%, rgba(255, 214, 153, 0.42), transparent 32%);
    --button-bg: linear-gradient(135deg, #47599c, #2f3c6c);
    --button-shadow: rgba(44, 56, 102, 0.24);
    --focus-ring: rgba(63, 79, 143, 0.2);
    --input-line: #c2c9da;
    --highlight-bg: linear-gradient(180deg, #f2f5fc, #ffffff);
    --highlight-line: #d2daee;
    --highlight-orb: rgba(217, 130, 70, 0.14);
    --pill-bg: #f4f6fc;
    --pill-line: #d8e0f0;
    --table-line: #eef1f5;
    --table-head: #f7f9fc;
    --row-hover: #fafbfe;
    --band-active: #eef3ff;
    --article-point: #f7f9fc;
    --page-glow-1: rgba(198, 211, 244, 0.34);
    --page-glow-2: rgba(255, 219, 176, 0.26);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --shadow: 0 18px 44px rgba(30, 39, 64, 0.09);
    --shadow-hover: 0 24px 54px rgba(30, 39, 64, 0.15);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, var(--page-glow-1), transparent 28rem),
        radial-gradient(circle at 100% 18%, var(--page-glow-2), transparent 25rem),
        var(--soft);
    font-family: "Nunito Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--brand-dark);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.08em;
}

a:hover {
    color: var(--accent);
}

.topbar {
    position: relative;
    z-index: 10;
    color: white;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 24px rgba(30, 39, 64, 0.08);
}

.nav {
    max-width: 1160px;
    margin: 0 auto;
    min-height: 72px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    color: white;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.95rem;
    font-weight: 700;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
}

.nav-links a:hover {
    color: white;
    transform: translateY(-1px);
}

.hero {
    position: relative;
    overflow: hidden;
    color: white;
    background: var(--hero-bg);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 360px;
    height: 360px;
    right: -120px;
    top: -120px;
    background: rgba(255, 255, 255, 0.10);
}

.hero::after {
    width: 220px;
    height: 220px;
    right: 18%;
    bottom: -150px;
    border: 34px solid rgba(255, 255, 255, 0.07);
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1160px;
    margin: 0 auto;
    padding: 36px 24px 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: center;
}

.hero-inner > * {
    min-width: 0;
}

.hero h1 {
    margin: 0 0 18px;
    max-width: 760px;
    font-size: clamp(2rem, 3.2vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: 0;
    /* Silbentrennung per CSS statt Soft-Hyphen im Markup (lang="de"). */
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

.hero p {
    margin: 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(0.98rem, 1.4vw, 1.08rem);
}

.hero-panel {
    padding: 18px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 34px rgba(20, 26, 44, 0.14);
    backdrop-filter: blur(12px);
}

.hero-panel strong {
    display: block;
    margin-bottom: 10px;
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: 0;
}

.hero-panel span {
    color: rgba(255, 255, 255, 0.84);
}

.wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 24px 44px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    scroll-margin-top: 88px;
}

.panel,
.result-block,
.legal-card,
.info-box,
.article-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.panel {
    padding: 26px;
}

.calculator-panel {
    padding: 28px;
}

.calculator-panel .muted {
    max-width: 860px;
    margin-bottom: 22px;
}

.calculator-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 20px 24px;
    align-items: start;
}

.calculator-panel .form-group,
.calculator-panel .checkbox-group {
    margin-bottom: 0;
}

.calculator-panel [data-due-date-group] {
    max-width: calc((100% - 24px) / 2);
    margin-top: 20px;
}

.calculator-panel button {
    width: auto;
    min-width: 280px;
    margin-top: 24px;
}

.calculator-results {
    display: grid;
    gap: 20px;
}

.panel h2,
.result-block h2,
.section h2 {
    margin: 0 0 14px;
    font-size: 1.42rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.form-group {
    margin-bottom: 17px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 850;
}

input[type="date"],
input[type="time"],
input[type="number"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--input-line);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:hover {
    border-color: var(--brand-soft);
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--focus-ring);
    transform: translateY(-1px);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 17px;
    padding: 13px 14px;
    background: var(--pill-bg);
    border: 1px solid var(--pill-line);
    border-radius: var(--radius-sm);
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: var(--brand);
}

.checkbox-group label {
    margin: 0;
    font-weight: 800;
}

small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 12px 19px;
    color: white;
    background: var(--button-bg);
    box-shadow: 0 10px 24px var(--button-shadow);
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button {
    width: 100%;
}

button:hover,
.button:hover {
    color: white;
    filter: brightness(0.97) saturate(1.08);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px var(--button-shadow);
}

button:active,
.button:active {
    transform: translateY(0);
}

.error {
    display: none;
    margin-bottom: 16px;
    padding: 13px 14px;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-sm);
}

.error.is-visible {
    display: block;
}

.result-block {
    margin-bottom: 20px;
    padding: 26px;
}

.highlight {
    position: relative;
    overflow: hidden;
    background: var(--highlight-bg);
    border-color: var(--highlight-line);
}

.highlight::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -65px;
    top: -70px;
    border-radius: 50%;
    background: var(--highlight-orb);
}

.metric {
    margin: 10px 0 4px;
    color: var(--brand-dark);
    font-size: clamp(2.3rem, 6vw, 3.6rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.045em;
}

.metric-label {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none;
}

.fact-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.fact-list li {
    padding: 14px;
    background: var(--pill-bg);
    border: 1px solid var(--pill-line);
    border-radius: var(--radius-md);
}

.fact-list strong {
    display: block;
    color: var(--brand-dark);
    font-size: 1.25rem;
    line-height: 1.2;
}

.fact-list span {
    color: var(--muted);
    font-size: 0.92rem;
}

/* Tagesplan als Zeitstrahl. Bewusst eine ol/li-Liste statt Canvas:
   vorlesbar, kopierbar, druckbar und ohne Neuzeichnen bei Resize. */
.plan-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.plan-item {
    position: relative;
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0 14px 0;
}

.plan-item + .plan-item {
    border-top: 1px dashed var(--line);
}

.plan-time {
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--brand-dark);
    font-variant-numeric: tabular-nums;
}

.plan-body {
    display: block;
}

.plan-body strong {
    display: block;
}

.plan-body .muted {
    display: block;
    font-size: 0.94rem;
}

.plan-item--nap .plan-time {
    color: var(--brand);
}

.plan-item--bedtime {
    margin-top: 6px;
    padding: 16px 16px 16px 14px;
    background: var(--nav-bg);
    border-radius: var(--radius-md);
    border-top: 0;
}

.plan-item--bedtime .plan-time,
.plan-item--bedtime strong {
    color: white;
}

.plan-item--bedtime .muted {
    color: rgba(255, 255, 255, 0.78);
}

/* Gegenprobe unter dem Tagesplan: wie viel Schlaf pro 24 h der Plan
   unterstellt, verglichen mit der belegten Referenzspanne. */
.sleep-check {
    margin: 20px 0 0;
    padding: 14px 16px;
    background: var(--article-point);
    border-left: 4px solid var(--brand);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.96rem;
}

.note-list {
    margin: 18px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.note-list li {
    margin-bottom: 8px;
}

/* Direktantwort unter der H1: die Passage, die von AI Overviews und
   Assistenten bevorzugt extrahiert wird. */
.lead-answer {
    margin: 0 0 18px;
    padding: 14px 16px;
    background: var(--article-point);
    border-left: 4px solid var(--brand-dark);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-size: 1.04rem;
}

/* Datentabellen scrollen auf schmalen Geraeten horizontal statt umzubrechen.
   Bewusst OHNE die max-height des Eisprungrechners: dessen Zyklustabelle hat
   ~30 gleichfoermige Zeilen, die Altersuebersicht hier nur 8 hohe - ein Deckel
   von 430px wuerde drei Altersgruppen verstecken und die nach einer Berechnung
   hervorgehobene Zeile aus dem Sichtbereich schieben. */
.table-scroll,
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 26px rgba(30, 39, 64, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.92rem;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--table-line);
    text-align: left;
    vertical-align: top;
}

thead th {
    color: var(--ink);
    background: var(--table-head);
    white-space: nowrap;
}

tbody th {
    font-weight: 800;
    white-space: nowrap;
}

tbody tr {
    transition: background 120ms ease;
}

tbody tr:hover {
    background: var(--row-hover);
}

tr.band-active,
tr.band-active:hover {
    background: var(--band-active);
}

.band-weeks {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.band-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    color: white;
    background: var(--brand);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}

.section {
    padding: 42px 0;
    border-top: 1px solid var(--line);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.info-box {
    padding: 22px;
    min-width: 0;
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.info-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Auf /ratgeber sind die Kachel-Ueberschriften H2 (Hierarchie unter der H1),
   auf der Startseite H3 (unter der Sektions-H2) - optisch identisch. */
.info-box h2,
.info-box h3 {
    margin: 0 0 9px;
    font-size: 1.08rem;
    line-height: 1.3;
    letter-spacing: normal;
}

.safety-box {
    padding: 24px;
    background: var(--warm);
    border: 1px solid var(--warm-line);
    border-radius: var(--radius-lg);
}

.safety-box h2 {
    margin-top: 0;
}

.safety-box ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.safety-box li {
    margin-bottom: 7px;
}

.callout {
    margin: 24px 0;
    padding: 18px;
    background: var(--highlight-bg);
    border: 1px solid var(--highlight-line);
    border-radius: var(--radius-md);
}

.disclaimer {
    padding: 20px 22px;
    background: var(--article-point);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.disclaimer h2 {
    margin-top: 0;
}

.shop-band {
    background: var(--warm);
    border-top: 1px solid var(--warm-line);
    border-bottom: 1px solid var(--warm-line);
}

.shop-band .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.shop-band h2 {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.shop-band p {
    margin: 0;
}

footer {
    color: rgba(255, 255, 255, 0.78);
    background: var(--nav-bg);
}

footer .wrap {
    padding-top: 28px;
    padding-bottom: 28px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

footer a {
    color: white;
}

.legal-page {
    max-width: 860px;
}

.legal-card,
.article-card {
    padding: 30px;
}

.article-page {
    max-width: 920px;
}

.article-card h1 {
    margin: 0 0 16px;
    font-size: clamp(1.8rem, 3.8vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-wrap: balance;
    hyphens: auto;
}

.article-card h2 {
    margin: 38px 0 13px;
    font-size: 1.62rem;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.article-card h3 {
    margin: 26px 0 9px;
    font-size: 1.15rem;
}

.article-point {
    margin: 12px 0;
    padding: 12px 14px;
    background: var(--article-point);
    border-left: 4px solid var(--brand-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-point strong {
    color: var(--brand-dark);
}

.article-lede {
    color: var(--muted);
    font-size: 1.14rem;
}

.article-meta {
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Kontextueller Rechner-Link im ersten Drittel der Artikel. */
.inline-cta {
    margin: 0 0 18px;
    font-weight: 700;
}

.article-sources {
    color: var(--muted);
    font-size: 0.92rem;
}

/* Sichtbarer Platzhalter-Marker fuer die noch unbefuellten Ratgeber-Seiten.
   Verschwindet, sobald echte Texte eingesetzt werden. */
.draft-banner {
    margin: 0 0 22px;
    padding: 14px 16px;
    background: #fff7ed;
    border: 1px dashed #e6b980;
    border-radius: var(--radius-sm);
    color: #8a4b13;
}

.draft-banner strong {
    color: #7c3f0d;
}

.author-box {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    margin: 36px 0 18px;
    padding: 18px;
    background: var(--article-point);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.author-box img {
    width: 96px;
    height: 96px;
    border: 4px solid white;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(30, 39, 64, 0.12);
}

.author-box h2,
.author-box h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.author-box p {
    margin: 0;
}

.author-basis {
    margin-top: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.author-details {
    min-width: 0;
}

.author-role {
    margin: 0 0 8px;
    color: var(--brand-dark);
    font-weight: 800;
}

/* Social-Buttons der Autorinnenbox. Layout wie auf dem Eisprungrechner,
   Farben aus der Nachtblau-Palette dieser Seite. */
.author-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.author-social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--brand-dark);
    background: var(--pill-bg);
    border: 1px solid var(--pill-line);
    border-radius: 999px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.author-social-link:hover {
    color: var(--brand-dark);
    background: var(--band-active);
    border-color: var(--brand-soft);
    box-shadow: 0 8px 20px rgba(30, 39, 64, 0.12);
    transform: translateY(-1px);
}

.author-social-link:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.social-icon {
    flex: 0 0 auto;
}

/* Inaktiver Social-Button: Verlinkung bewusst entfernt, Element bleibt sichtbar. */
.social-btn--inactive {
    opacity: 0.55;
    cursor: default;
    box-shadow: none;
}

.social-btn--inactive:hover {
    background: var(--pill-bg);
    border-color: var(--pill-line);
    box-shadow: none;
    transform: none;
}

.faq-item h3 {
    margin-top: 0;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 860px) {
    .hero-inner,
    .calculator-grid,
    .info-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-inner {
        padding-top: 34px;
        padding-bottom: 30px;
    }

    .hero-panel {
        display: none;
    }

    .calculator-fields {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .calculator-panel [data-due-date-group] {
        max-width: none;
    }

    .shop-band .wrap,
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        flex-wrap: wrap;
    }

    .author-box {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .author-box img {
        width: 72px;
        height: 72px;
    }
}

@media (max-width: 560px) {
    .nav,
    .wrap,
    .hero-inner {
        padding-left: 18px;
        padding-right: 18px;
    }

    .panel,
    .result-block,
    .legal-card,
    .article-card {
        padding: 21px;
    }

    .calculator-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .calculator-panel button {
        width: 100%;
        min-width: 0;
    }

    .hero h1 {
        font-size: clamp(1.85rem, 9vw, 2.65rem);
    }

    .article-card h1 {
        font-size: clamp(1.65rem, 8vw, 2.45rem);
    }

    .nav-links {
        gap: 12px;
    }

    .plan-item {
        grid-template-columns: 66px minmax(0, 1fr);
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
