/* Ljudboksarkivet – Custom CSS */

html { scroll-behavior: smooth; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background-color: #FFAA17; color: #2D2E33; }

/* Line clamps */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Mobile menu transitions */
.mobile-menu { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0s linear 0s; }
.mobile-menu.hidden-menu { transform: translateX(100%); opacity: 0; pointer-events: none; visibility: hidden; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, visibility 0s linear 0.35s; }
body.menu-open { overflow: hidden; }

/* Tabs */
.genre-tab.active { color: #FFAA17; border-color: #FFAA17; }
.genre-panel { display: none; }
.genre-panel.active { display: block; }

/* Prose (artiklar + boksammanfattning) */
.prose-lba { color: #565656; line-height: 1.8; font-size: 16.5px; }
.prose-lba p { margin: 0 0 1.25em; }
.prose-lba p:last-child { margin-bottom: 0; }
.prose-lba a { color: #C77F00; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose-lba a:hover { color: #2D2E33; }
.prose-lba h2 { font-family: 'Jost', sans-serif; color: #222; font-weight: 600; font-size: 1.7rem; margin: 1.8em 0 0.6em; line-height: 1.25; }
.prose-lba h3 { font-family: 'Jost', sans-serif; color: #222; font-weight: 600; font-size: 1.3rem; margin: 1.5em 0 0.5em; }
.prose-lba strong { color: #222; font-weight: 700; }
.prose-lba ul, .prose-lba ol { padding-left: 1.4em; margin: 0 0 1.25em; }
.prose-lba ul { list-style: disc; }
.prose-lba ol { list-style: decimal; }
.prose-lba li { margin: 0.4em 0; }
.prose-lba li::marker { color: #FFAA17; }
.prose-lba blockquote {
    border-left: 3px solid #FFAA17;
    padding: 0.4em 0 0.4em 1.2em;
    margin: 1.5em 0;
    color: #444;
    font-style: italic;
    font-size: 1.05em;
}
.prose-lba img { border-radius: 12px; margin: 1.5em 0; max-width: 100%; height: auto; }
.prose-lba table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px; border: 1px solid #E5E5E5; border-radius: 10px; overflow: hidden; table-layout: auto; }
.prose-lba th { background: #F4F4F5; color: #222; font-weight: 700; text-align: left; padding: 11px 15px; border-bottom: 1px solid #E5E5E5; }
.prose-lba td { padding: 11px 15px; border-bottom: 1px solid #E5E5E5; vertical-align: top; }
.prose-lba tr:last-child td { border-bottom: none; }
/* Smala skärmar: tabellen scrollar inuti sig själv i stället för att hela sidan
   blir bredare än skärmen (policysidornas tabeller kan inte krympa under sitt
   längsta ord). */
@media (max-width: 640px) {
    .prose-lba table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .prose-lba th, .prose-lba td { padding: 9px 11px; }
}

/* Boksammanfattning på boksidan kan vara HTML */
.summary-html { color: #565656; line-height: 1.8; font-size: 16.5px; }
.summary-html p { margin: 0 0 1.1em; }
.summary-html p:last-child { margin-bottom: 0; }
.summary-html strong { color: #222; }
.summary-html em { font-style: italic; }
.summary-html br { display: block; content: ""; margin-top: 0.4em; }

/* Focus ring */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #FFAA17;
    outline-offset: 2px;
}

/* reCAPTCHA badge */
.grecaptcha-badge { visibility: hidden !important; opacity: 0 !important; }

/* Cookie banner */
html.cookie-acked #cookieBanner { display: none !important; }

/* Affiliate-CTA i artiklar (lyssna-vidare-knapp till ljudboksplattform) */
.affiliate-cta {
    margin: 2.2em 0;
    padding: 22px 24px;
    background: #2D2E33;
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 22px;
}
.affiliate-cta__text { flex: 1 1 250px; min-width: 0; }
.affiliate-cta__title {
    font-family: 'Jost', sans-serif;
    color: #fff;
    font-weight: 600;
    font-size: 1.18rem;
    line-height: 1.3;
    margin: 0 0 5px;
}
.affiliate-cta__desc { color: #C9C9CD; font-size: 14.5px; line-height: 1.55; margin: 0; }
.affiliate-cta__offer { color: #FFAA17; font-weight: 700; }
.affiliate-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    background: #FFAA17;
    color: #2D2E33 !important;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 9999px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .2s ease, transform .2s ease;
}
.affiliate-cta__btn:hover { background: #fff; transform: translateY(-1px); }
.affiliate-cta__btn i { font-size: 18px; }
@media (max-width: 480px) {
    .affiliate-cta__btn { width: 100%; justify-content: center; }
}

/* Serieblocket på författarsidor: dölj den inbyggda <details>-pilen (Safari). */
details > summary::-webkit-details-marker { display: none; }

/* Språkväljaren i footern (src/language_versions.php) – samma på båda språkversionerna */
.lang-switch { position: relative; display: inline-block; }
.lang-switch summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; user-select: none; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9999px; padding: 6px 14px; color: #D1D5DB; background: rgba(255, 255, 255, .04); transition: border-color .2s ease, color .2s ease; }
.lang-switch summary:hover, .lang-switch[open] summary { border-color: #FFAA17; color: #fff; }
.lang-switch summary .ti { font-size: 16px; line-height: 1; }
.lang-switch__chevron { transition: transform .2s ease; }
.lang-switch[open] .lang-switch__chevron { transform: rotate(180deg); }
.lang-switch__flag { display: inline-flex; width: 20px; height: 14px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); flex-shrink: 0; }
.lang-switch__flag svg { width: 100%; height: 100%; display: block; }
.lang-switch nav { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; min-width: 180px; padding: 6px; background: #2D2E33; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 2px; }
.lang-switch nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #E5E7EB; font-size: 14px; white-space: nowrap; text-decoration: none; }
.lang-switch nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.lang-switch nav a[aria-current='page'] { color: #FFAA17; font-weight: 600; }
.lang-switch__code { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; opacity: .5; }

/* Långa tyska sammansättningar (§3a): avstavning i rubriker, chips och kort, så att
   "Hörbuchneuerscheinungen" eller "Biografien aus Politik, Wirtschaft & Gesellschaft"
   inte spränger smala kolumner. Kräver <html lang="de">. overflow-wrap fångar namn
   och titlar som avstavningen inte känner till. */
h1, h2, h3, h4, .font-heading, .line-clamp-2, dd { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
a.rounded-full, span.rounded-full { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
