/* Språki-prat (podcasts) — extracted from sprakiprat.php's inline <style>. */
        .expired-notice {
            display: flex;
            align-items: center;
            padding: 1rem;
            background-color: #FEE2E2;
            border: 1px solid #FCA5A5;
            border-radius: 0.375rem;
        }

        .expired-notice .icon {
            width: 1.5rem;
            height: 1.5rem;
            color: #DC2626;
            margin-right: 0.75rem;
        }

        .expired-message {
            color: #991B1B;
            display: flex;
            flex-direction: column;
        }

        .mobile-only {
            display: none;
        }

        .desktop-only {
            display: block;
        }

        /* Mobile styles */
        @media (max-width: 768px) {
            .mobile-only {
                display: block;
            }

            .desktop-only {
                display: none;
            }

            .top-img2 {
                max-width: 150px !important;
            }

            .page-title {
                font-size: 2.8rem !important;
                margin-top: 0.5rem;
            }
        }

        .login-mobile {
            display: none;
            /* Hidden by default */
        }

        @media (max-width: 870px) {
            .login-mobile {
                display: flex;
                /* or block, depending on your layout needs */
            }
        }

        .login-status {
            position: relative;
            cursor: pointer;
        }

        .logout-popup {
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            background: white;
            padding: 10px;
            border-radius: 4px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            z-index: 1000;
        }

        .logout-popup a {
            color: #333;
            text-decoration: none;
            white-space: nowrap;
        }

        .logout-popup a:hover {
            color: #666;
        }

        /* Show popup when parent has active class */
        .login-status.active .logout-popup {
            display: block;
        }

        .footer-section a.text-muted:hover {
            color: #000000 !important;
            /* or any darker color you prefer */
            opacity: 1.8;
            transition: all 0.2s ease;
        }
        .top-img {

        }
/* Translation overlay */
.sprakiprat-translate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.sprakiprat-translate-overlay.visible {
    display: flex;
}
.translate-loading-box {
    background: white;
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.translate-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #fbc24b;
    border-radius: 50%;
    animation: translateSpin 1s linear infinite;
}
@keyframes translateSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.translate-message {
    color: var(--color-text-muted, #5f5238);
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.translate-loading-box.show-message .translate-message {
    opacity: 1;
}
    .text-content {
      max-width: 800px;
      text-align: left;
      margin-top: 20px;
      color: #6D5F4A;
      font-size: 20px;
    }

    @media screen and (max-width: 768px) {
      .text-content {
        width: 80%; /* Width for mobile devices */
      }
    }
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 0px 20px 20px;
  /* Reduced top padding */
}

.feature-item {
  flex: 0 1 330px;
  display: flex;
  flex-direction: column;
  background-color: #f7f4ee;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover,
.feature-item.selected {
  transform: translateY(-5px);
  background-color: #f2ece3;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.feature-icon {
  width: 50px;
  height: 50px;
  margin-right: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  /* Prevent icon from shrinking */
}

.feature-title {
  font-size: 1.9rem;
  font-weight: bold;
  color: var(--color-text-muted, #5f5238);
  margin: 0;
  /* Remove default margins */
}

.feature-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.feature-description {
  font-size: 1.0rem;
  color: #666;
  margin-bottom: 10px;
}

.feature-button {
  align-self: flex-start;
  padding: 8px 20px;
  background-color: #fbc24b;
  color: white !important;
  width: 150px;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
  margin-top: auto;
}

.feature-button:hover {
  background-color: #eea94d;
}
    .audio-player-container {
        width: 100%; /* Take full container width */
        max-width: 700px; /* Remove max-width restriction */
        margin: 0 auto 30px;
        background-color: #f7f4ee;
        border-radius: 10px;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Improve spacing between buttons */
    .audio-controls {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* Align to left instead of space-between */
        margin-bottom: 15px; /* Increased margin */
        gap: 30px; /* Add gap between elements */
    }
    
    /* Make play button more prominent */
    .play-button {
        background-color: #fbc24b;
        border: none;
        border-radius: 50%;
        width: 60px; /* Slightly larger */
        height: 60px; /* Slightly larger */
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: white;
        font-size: 24px; /* Slightly larger */
        transition: background-color 0.3s;
        margin-right: 20px; /* Add right margin */
    }
        .play-button:hover {
            background-color: #eea94d;
        }
        
    .speed-controls {
        display: flex;
        align-items: center;
        gap: 15px; /* Increased gap between speed buttons */
    }
        
        .speed-button {
            background-color: #827153;
            border: none;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: white;
            font-weight: bold;
            transition: background-color 0.3s;
        }
        
        .speed-button:hover {
            background-color: #6D5F4A;
        }
        
        .speed-display {
            font-size: 14px;
            color: var(--color-text-muted, #5f5238);
            width: 50px;
            text-align: center;
        }
        
        .timeline-container {
            width: 100%;
            position: relative;
        }
        
    .timeline-container {
        width: 100%;
        position: relative;
        margin-top: 10px;
    }
    
.timeline {
    position: relative; /* Make sure this is set */
    width: 100%;
    height: 8px;
    background-color: #E5DED1;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden; /* Important to keep progress contained */
}
    
    /* Improved time display */
    .time-display {
        display: flex;
        justify-content: space-between;
        color: var(--color-text-muted, #5f5238);
        font-size: 14px; /* Slightly larger */
        margin-top: 8px;
        font-weight: bold; /* Make it bold */
    }
.timeline-progress {
    position: absolute; /* Make sure this is absolute */
    top: 0;
    left: 0;
    height: 100%; /* Full height of timeline */
    background-color: #fbc24b; /* Bright yellow color to match your design */
    border-radius: 5px;
    z-index: 1; /* Make sure it's above the timeline */
} 
/* General text content styling */
.text-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    color: #6D5F4A;
    padding: 0 20px;
}

.text-content h1 {
    font-size: 2.2rem;
    color: var(--color-text-muted, #5f5238);
    text-align: center;
    margin-bottom: 25px;
}

.text-content h2 {
    font-size: 1.8rem;
    color: var(--color-text-muted, #5f5238);
    margin: 30px 0 15px;
}

.text-content h3 {
    font-size: 1.5rem;
    color: var(--color-text-muted, #5f5238);
    margin: 25px 0 10px;
}

.text-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.text-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .text-content {
        padding: 0 15px;
    }
    
    .text-content h1 {
        font-size: 1.8rem;
    }
    
    .text-content h2 {
        font-size: 1.5rem;
    }
    
    .text-content h3 {
        font-size: 1.3rem;
    }
    
    .text-content p {
        font-size: 1rem;
    }
}
.disclaimer-container {
    max-width: 800px;
    margin: 40px auto 20px;
    padding: 12px 15px;
    background-color: #f7f4ee;
    border-left: 3px solid #fbc24b;
    border-radius: 0 8px 8px 0;
}

.disclaimer-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted, #5f5238);
    text-align: center;
    font-style: italic;
}

@media (max-width: 768px) {
    .disclaimer-container {
        margin: 30px 15px 15px;
    }
}
/* Play button icon styles */
.play-icon {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent white;
    margin-left: 4px; /* Slight adjustment to center */
}

/* Pause icon state - hidden initially */
.pause-icon {
    display: block;
    width: 14px;
    height: 16px;
    position: relative;
}

.pause-icon:before, .pause-icon:after {
    content: "";
    position: absolute;
    width: 5px;
    height: 16px;
    background-color: white;
}

.pause-icon:before {
    left: 0;
}

.pause-icon:after {
    right: 0;
}
/* Glossary word styling */
.glossary-word {
    text-decoration: underline dotted #fbc24b;
    cursor: help;
    position: relative;
    color: #6D5F4A;
    font-weight: 500;
}
/* Glossary word styling */
.glossary-word {
    text-decoration: underline dotted #fbc24b;
    cursor: help;
    position: relative;
    color: #6D5F4A;
    font-weight: 500;
}

.glossary-word:hover {
    background-color: #fef9e7;
}

/* Popup styling */
.word-explanation-popup {
    position: absolute;
    background-color: #fff;
    border: 1px solid #fbc24b;
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    color: #6D5F4A;
    z-index: 1000;
    max-width: 300px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

/* Add a small arrow at the top of the popup */
.word-explanation-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 15px;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-top: 1px solid #fbc24b;
    border-left: 1px solid #fbc24b;
    transform: rotate(45deg);
}

/* Style for the explanation paragraph */
.popup-explanation {
    margin: 0 0 10px 0;
}

/* Style for the dictionary link */
.dictionary-link {
    margin-top: 8px;
    border-top: 1px solid #f2ece3;
    padding-top: 8px;
    color: var(--color-text-muted, #5f5238);
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s;
}

.dictionary-link:hover {
    color: #fbc24b;
    text-decoration: underline;
}
/* Improved Glossary Container Styling */
.glossary-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 25px;
    background-color: #f7f4ee;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

/* Improved heading */
.glossary-container h3 {
    color: var(--color-text-muted, #5f5238);
    margin: 0 0 20px 0;
    font-size: 1.7rem;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5ded1;
    text-align: center;
}

/* Enhanced list layout */
.glossary-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Better item styling */
.glossary-item {
    padding: 12px 15px;
    border-radius: 8px;
    background-color: white;
    border-left: 3px solid #fbc24b;
    transition: transform 0.2s, box-shadow 0.2s;
}

.glossary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* Term styling */
.glossary-term {
    font-weight: bold;
    color: #6D5F4A;
    display: block;
    margin-bottom: 6px;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.2s;
}

.glossary-term:hover {
    color:rgb(248, 190, 63) !important;
}

/* Explanation styling */
.glossary-explanation {
    color: var(--color-text-muted, #5f5238);
    font-size: 0.95rem;
    line-height: 1.5;
    display: block;
}

/* Responsive improvement */
@media (min-width: 768px) {
    .glossary-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .glossary-container h3 {
        font-size: 1.9rem;
    }
}

/* For smaller screens */
@media (max-width: 480px) {
    .glossary-container {
        padding: 20px 15px;
        margin: 30px 10px;
    }
    
    .glossary-item {
        padding: 10px 12px;
    }
}
/* Info text styling */
.glossary-info {
    text-align: center;
    color: var(--color-text-muted, #5f5238);
    font-size: 0.9rem;
    margin: -10px 0 20px 0;
    font-style: italic;
    position: relative;
}
/* Style for the regular clickable words - explicitly remove any decoration */
/* Tap-a-word popup, sentence popup and the dictionary modal are shared:
   /css/spraki-wordpopup.css (.sw/.ss/.sp) + ordbok-modal.js. */

/* Floating translate button */
.translate-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0;
    background: white;
    border: 2px solid #e0d5c5;
    border-radius: 50px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    max-width: 52px;
}
.translate-float-btn:hover {
    max-width: 280px;
    padding: 10px 18px 10px 12px;
    gap: 10px;
    border-color: #fbc24b;
    box-shadow: 0 6px 20px rgba(251, 194, 75, 0.25);
}
.translate-float-btn .translate-icon {
    font-size: 1.4rem;
    color: var(--color-text-muted, #5f5238);
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.translate-float-btn .translate-flag {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
}
.translate-float-btn .translate-text {
    white-space: nowrap;
    color: var(--color-text-muted, #5f5238);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    max-width: 0;
    transition: all 0.3s ease;
}
.translate-float-btn:hover .translate-text {
    opacity: 1;
    max-width: 200px;
}
.translate-float-btn .translate-check {
    display: none;
    color: #4CAF50;
    font-size: 1rem;
    margin-left: 5px;
}
.translate-float-btn.translated {
    border-color: #fbc24b;
    box-shadow: 0 0 0 3px rgba(251, 194, 75, 0.3), 0 4px 15px rgba(251, 194, 75, 0.2);
    animation: glowPulse 2s ease-in-out infinite;
}
.translate-float-btn.translated .translate-check {
    display: inline;
}
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(251, 194, 75, 0.3), 0 4px 15px rgba(251, 194, 75, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(251, 194, 75, 0.2), 0 4px 20px rgba(251, 194, 75, 0.3);
    }
}
@media (max-width: 768px) {
    .translate-float-btn {
        bottom: 16px;
        right: 16px;
        padding: 8px;
    }
    .translate-float-btn:hover {
        padding: 8px 14px 8px 10px;
    }
}

/* ---------- node page shell (replaces the PHP bootstrap .container) ---------- */

.podcast-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--nav-clearance, 74px) 16px 50px;
}

/* ---------- overview (/podcasts) ---------- */

.podcast-index {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--nav-clearance, 74px) 16px 60px;
}

.podcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Cards mirror the Lytte/Lese browse tiles: image on top, then title, a small
   meta row, and the lead. Same 16px radius, gold hover lift and 1px warm border
   as those grids, so the three browse surfaces read as one family. */

.podcast-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #f0ebe3;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.25s ease;
}

/* Filtering sets the `hidden` attribute. Without this the card stays visible:
   `display: flex` above is an author rule, and any author `display` beats the
   browser's own `[hidden] { display: none }` no matter how specific. */
.podcast-card[hidden] {
    display: none;
}

.podcast-card:hover {
    border-color: #fbc24b;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(251, 194, 75, 0.15);
}

.podcast-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #f7f2ea;
    overflow: hidden;
}

.podcast-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* An episode with no picture still gets a card the same height as its
   neighbours, rather than collapsing the row. */
.podcast-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fbc24b 0%, #eea94d 100%);
    color: white;
    font-size: 2rem;
}

.podcast-card-body {
    padding: 16px 18px 20px;
}

.podcast-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-default, #4a4540);
    margin: 0 0 8px;
}

.podcast-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.podcast-card-meta:empty {
    margin-bottom: 0;
}

.podcast-card-level {
    background: #fbc24b;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 6px;
}

.podcast-card-time {
    font-size: 0.85rem;
    color: var(--color-text-muted, #5f5238);
}

.podcast-card-time i {
    margin-right: 4px;
    opacity: 0.7;
}

.podcast-card-desc {
    font-size: 0.92rem;
    color: var(--color-text-muted, #5f5238);
    line-height: 1.55;
    margin: 0;
}

/* ---------- transcript segments (DB-rendered) ---------- */
/*
   Replaces the inline flex styles the hand-written transcript partials used
   (podcast_17mai.ejs). Placement is a column on podcast_segments now, so the
   layout lives here instead of in the content.
*/

.prat-segment {
    margin: 0 0 8px;
}

.prat-segment::after {
    content: "";
    display: block;
    clear: both;
}

.prat-figure {
    margin: 18px 0;
}

.prat-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.prat-figure--full {
    margin: 22px 0;
}

.prat-figure--left,
.prat-figure--right {
    max-width: 40%;
    margin-top: 6px;
}

.prat-figure--left {
    float: left;
    margin-right: 22px;
}

.prat-figure--right {
    float: right;
    margin-left: 22px;
}

/* Wrapping a paragraph around a 40%-wide image needs a column wide enough to
   still read as prose; below that the text becomes a ladder of two-word lines. */
@media (max-width: 640px) {
    .prat-figure--left,
    .prat-figure--right {
        float: none;
        max-width: 100%;
        margin: 18px 0;
    }
}

/* ---------- episode page head ---------- */
/*
   The back arrow lives in the nav bar (navBackUrl), like every other section
   page — not in the page body. The title sits above the player: the page is a
   thing you read as much as one you listen to, and leading with a bare control
   strip gave no clue which episode you had opened.
*/

/* The hero already provides the heading's breathing room below it. */
.podcast-page .audio-player-container {
    margin-top: 6px;
}

/* ---------- player: sticky, warm, with skip controls ---------- */
/*
   The player follows you down the page. On a read-along page the transcript is
   long, and having to scroll back up to pause or replay a sentence is the whole
   friction. 56px clears the fixed 50px nav.

   Scoped under .podcast-page so these win over the older player rules further up
   this file without having to untangle their nesting.
*/

.podcast-page .audio-player-container {
    position: sticky;
    top: 56px;
    z-index: 20;
    max-width: 100%;
    margin: 6px 0 28px;
    padding: 14px 18px;
    background: #fffdf9;
    border: 1px solid #f0ebe3;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(120, 95, 45, 0.10);
}

.podcast-page .audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.podcast-page .play-button {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbc24b 0%, #eea94d 100%);
    box-shadow: 0 4px 12px rgba(238, 169, 77, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.podcast-page .play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(238, 169, 77, 0.45);
}

/* Skip buttons read as secondary: outlined, warm brown, never gold — gold is
   the action colour and there is only one primary action here. */
.skip-button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #e6ded1;
    border-radius: 19px;
    background: #fff;
    color: #8a7559;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.skip-button i {
    font-size: 0.9rem;
}

.skip-button:hover {
    border-color: #fbc24b;
    color: #6b5942;
    background: #fffaf0;
}

.podcast-page .speed-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
}

.podcast-page .speed-button {
    width: 30px;
    height: 30px;
    border: 1px solid #e6ded1;
    border-radius: 50%;
    background: #fff;
    color: #8a7559;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.podcast-page .speed-button:hover {
    border-color: #fbc24b;
    background: #fffaf0;
}

.podcast-page .speed-display {
    min-width: 40px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8a7559;
}

.podcast-page .timeline {
    height: 6px;
    border-radius: 3px;
    background: #efe7da;
    cursor: pointer;
}

.podcast-page .timeline-progress {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #fbc24b 0%, #eea94d 100%);
}

.podcast-page .time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #a3937c;
}

/* On a phone the sticky player would eat a third of the screen, so it scrolls
   away with the page and the controls stack tighter. */
@media (max-width: 600px) {
    .podcast-page .audio-player-container {
        position: static;
        padding: 12px 14px;
    }
    .podcast-page .audio-controls {
        gap: 10px;
    }
    .skip-button {
        padding: 0 10px;
    }
}

/* ---------- transcript rhythm ---------- */
/*
   A section heading followed immediately by a full-width picture pushed the
   first line of text most of a screen away from its own heading. The heading
   now sits tight to the paragraph that follows it, and full-width figures get
   their air below instead.
*/

.prat-segment h2 {
    margin-bottom: 10px;
}

.prat-segment .prat-figure--full {
    margin: 10px 0 22px;
}

/* ---------- AI disclosure ---------- */
/*
   Sits directly under the player. Quiet but not hidden: a learner deciding
   whether to trust what they are about to hear should meet this before they
   press play, not after eight minutes of audio.
*/

.prat-ai-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 26px;
    padding: 10px 14px;
    background: #fdf6e7;
    border: 1px solid #f3e6c9;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #7d6b4f;
}

.prat-ai-notice i {
    margin-top: 2px;
    color: #d9a441;
}

/* ---------- catalogue filters ---------- */
/*
   Same shape as the Lytte browse controls — pill selects on a row, search at
   the end — so the two browse surfaces feel like one product. The bar is only
   rendered once there are enough episodes for filtering to earn its space.
*/

.prat-filters {
    margin: 4px 0 22px;
}

.prat-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.prat-select {
    appearance: none;
    padding: 11px 38px 11px 16px;
    min-width: 160px;
    border: 1px solid #e6ded1;
    border-radius: 12px;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238a7559' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: #4a4540;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}

.prat-select:hover,
.prat-search:focus-within {
    border-color: #fbc24b;
}

.prat-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 220px;
    max-width: 340px;
    padding: 0 14px;
    border: 1px solid #e6ded1;
    border-radius: 12px;
    background: #fff;
}

.prat-search i {
    color: #b9a888;
    font-size: 0.9rem;
}

.prat-search input {
    flex: 1;
    padding: 11px 10px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    color: #4a4540;
}

.prat-count {
    margin: 10px 2px 0;
    font-size: 0.85rem;
    color: #a3937c;
}

.prat-empty {
    margin: 30px 0;
    text-align: center;
    color: var(--color-text-muted, #5f5238);
}

/* Category chip on a card — quieter than the gold level badge, so the two
   never compete for the same glance. */
.podcast-card-cat {
    padding: 2px 9px;
    border-radius: 6px;
    background: #f4ece0;
    color: #8a7559;
    font-size: 0.78rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .prat-select {
        flex: 1 1 45%;
        min-width: 0;
    }
    .prat-search {
        max-width: none;
    }
}

/* ---------- level colours ---------- */
/*
   The shared CEFR palette from tokens.css (green A1 → red B2), same as the
   Arbeidsnorsk and Books badges. Defined once there so a learner reads the
   same colour as the same difficulty everywhere in Språki — worth more than
   any per-page styling.
*/

.podcast-card-level.A0 { background: var(--level-a0, #8BC34A); }
.podcast-card-level.A1 { background: var(--level-a1, #4CAF50); }
.podcast-card-level.A2 { background: var(--level-a2, #D4A017); }
.podcast-card-level.B1 { background: var(--level-b1, #FF9800); }
.podcast-card-level.B2 { background: var(--level-b2, #f44336); }

/* Level + tags under the episode hero. */
.prat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
}

.prat-tag {
    padding: 3px 11px;
    border-radius: 999px;
    background: #f4ece0;
    color: #8a7559;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ==========================================================================
   Tasks
   --------------------------------------------------------------------------
   Two places on the page: the warm-up sits between the player and the
   transcript, everything else below the glossary. Rows are collapsed by
   default and open one at a time, so the section costs a heading's worth of
   height until somebody wants it.

   Palette is the page's own — cream cards, warm brown text, gold reserved for
   the one primary action per row. No new colours, and nothing cold.
   ========================================================================== */

.prat-warmup,
.prat-tasks {
    max-width: 800px;
    margin: 40px auto;
    padding: 24px;
    background-color: #f7f4ee;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.prat-warmup { margin-bottom: 32px; }

.prat-tasks-heading {
    color: var(--color-text-muted, #5f5238);
    margin: 0 0 6px 0;
    font-size: 1.5rem;
}

.prat-tasks-summary {
    margin: 0 0 18px 0;
    color: #8a7559;
    font-size: 0.95rem;
}

/* --- One collapsed row --------------------------------------------------- */

.prat-task {
    border: 1px solid #e6ded1;
    border-radius: 12px;
    background: #fff;
    margin-top: 10px;
    overflow: hidden;
}

.prat-task.is-done { border-color: #d8cdb6; }

.prat-task-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    color: #4a4540;
}

.prat-task-header:hover { background: #fdfbf6; }

.prat-task-num {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0e9dc;
    color: #8a7559;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prat-task.is-done .prat-task-num {
    background: linear-gradient(135deg, #fbc24b 0%, #eea94d 100%);
    color: #fff;
}

.prat-task-title { flex: 1 1 auto; font-weight: 600; }

.prat-task-badge {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 700;
    color: #8a7559;
    background: #f4efe4;
    border-radius: 999px;
    padding: 3px 10px;
}

.prat-task-chevron {
    flex: 0 0 auto;
    color: #b3a58c;
    transition: transform 0.15s ease;
}

.prat-task-header[aria-expanded="true"] .prat-task-chevron { transform: rotate(180deg); }

.prat-task-panel {
    padding: 4px 16px 18px;
    border-top: 1px solid #f0e9dc;
}

/* --- "Hør fra her" — the one thing only a podcast task has ---------------- */

.prat-task-jump {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 4px;
    padding: 8px 16px;
    border: 1px solid #eea94d;
    border-radius: 999px;
    background: #fff8ec;
    color: #8a6320;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.prat-task-jump:hover { background: #fdeed3; }
.prat-jump-icon { font-size: 0.75rem; }

.prat-task-segment {
    margin: 4px 0 0;
    color: #8a7559;
    font-size: 0.85rem;
    font-style: italic;
}

/* --- Shared bits --------------------------------------------------------- */

.prat-task-question {
    margin: 14px 0 12px;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #4a4540;
}

.prat-task-hint {
    margin: 8px 0;
    color: #8a7559;
    font-size: 0.88rem;
}

.prat-blank {
    display: inline-block;
    min-width: 90px;
    border-bottom: 2px solid #eea94d;
    vertical-align: baseline;
}

/* --- Multiple choice ----------------------------------------------------- */

.prat-choice-list { display: flex; flex-direction: column; gap: 8px; }

.prat-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid #e6ded1;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.prat-choice:hover { border-color: #eea94d; background: #fffdf8; }
.prat-choice input { margin-top: 3px; accent-color: #eea94d; }
.prat-choice-text { flex: 1 1 auto; }

/* --- True / false -------------------------------------------------------- */

.prat-statement-list { display: flex; flex-direction: column; gap: 10px; }

.prat-statement {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 11px 14px;
    border: 1px solid #e6ded1;
    border-radius: 10px;
}

.prat-statement-text { flex: 1 1 240px; }
.prat-truefalse { display: flex; gap: 8px; }

.prat-tf-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e6ded1;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}

.prat-tf-option input { accent-color: #eea94d; }

/* Marks after grading. Warm green/red so they read as feedback, not alarm. */
.prat-statement.is-right,
.prat-match-row.is-right { border-color: #7fae52; background: #f6fbf0; }
.prat-statement.is-wrong,
.prat-match-row.is-wrong { border-color: #d98b7a; background: #fdf5f3; }

/* --- Word matching ------------------------------------------------------- */

.prat-match-list { display: flex; flex-direction: column; gap: 10px; }

.prat-match-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid #e6ded1;
    border-radius: 10px;
}

.prat-match-word {
    flex: 0 0 auto;
    font-weight: 700;
    color: #8a6320;
    min-width: 120px;
}

.prat-match-select {
    flex: 1 1 220px;
    padding: 8px 10px;
    border: 1px solid #e6ded1;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    color: #4a4540;
    max-width: 100%;
}

/* --- Ordering ------------------------------------------------------------ */

.prat-order-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: prat-order;
}

.prat-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid #e6ded1;
    border-radius: 10px;
    background: #fff;
    counter-increment: prat-order;
}

.prat-order-item::before {
    content: counter(prat-order);
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0e9dc;
    color: #8a7559;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prat-order-text { flex: 1 1 auto; }
.prat-order-controls { display: flex; flex-direction: column; gap: 2px; }

.prat-order-btn {
    border: 1px solid #e6ded1;
    background: #fff;
    color: #8a7559;
    border-radius: 6px;
    width: 28px;
    height: 20px;
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
}

.prat-order-btn:hover { border-color: #eea94d; color: #8a6320; }

/* --- Written answer ------------------------------------------------------ */

.prat-write {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e6ded1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a4540;
    resize: vertical;
}

.prat-write:focus { outline: 2px solid #eea94d; outline-offset: 1px; }

/* --- Actions and result -------------------------------------------------- */

.prat-task-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.prat-task-check {
    padding: 10px 22px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbc24b 0%, #eea94d 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(238, 169, 77, 0.3);
    transition: transform 0.15s ease;
}

.prat-task-check:hover:not(:disabled) { transform: translateY(-1px); }
.prat-task-check:disabled { opacity: 0.6; cursor: default; }

.prat-task-status { color: #8a7559; font-size: 0.88rem; }

.prat-result {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 4px solid #eea94d;
    background: #fdfbf6;
}

.prat-result.is-correct { border-left-color: #7fae52; background: #f6fbf0; }

.prat-result-score { margin: 0; font-weight: 700; color: #4a4540; }
.prat-result-answer { margin: 8px 0 0; color: #8a6320; }
.prat-result-feedback { margin: 8px 0 0; line-height: 1.6; color: #4a4540; }

.prat-result-order,
.prat-result-corrections { margin: 8px 0 0 18px; padding: 0; color: #5f5238; }

.prat-task-error { color: #a05a4a; }

/* --- Locked card, logged out --------------------------------------------- */
/* The episode stays public; the tasks do not. Says how many there are and
   nothing about what they ask, so the page still advertises itself. */

.prat-tasks-locked { text-align: center; padding: 12px 8px; }

.prat-tasks-locked i {
    font-size: 1.6rem;
    color: #c9b892;
    margin-bottom: 10px;
}

.prat-tasks-locked h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: var(--color-text-muted, #5f5238);
}

.prat-tasks-locked p {
    margin: 0 auto 18px;
    max-width: 460px;
    color: #8a7559;
    line-height: 1.6;
}

.prat-tasks-locked-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.prat-tasks-cta {
    padding: 11px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbc24b 0%, #eea94d 100%);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(238, 169, 77, 0.3);
}

.prat-tasks-login {
    padding: 11px 26px;
    border-radius: 999px;
    border: 1px solid #e6ded1;
    background: #fff;
    color: #8a7559;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 600px) {
    .prat-warmup,
    .prat-tasks { padding: 18px 14px; margin: 28px 12px; }
    .prat-match-word { min-width: 0; }
}
