/* ============================================================
   Verse Feed — Quran Verse Card Feed System
   ============================================================
   Brand: Quranic Insights | by eBlessings
   Design tokens:
     parchment-light   #fdf8f0
     card-bg           #ffffff
     card-border       rgba(180, 160, 120, 0.2)
     card-shadow       0 2px 12px rgba(0, 0, 0, 0.06)
     gold              #c9a84c
     emerald           #0d5c3a
     sepia-text        #5a4a3a
     sepia-muted       #8B7355
     purple            #8E44AD
     arabic-font       'Amiri Quran', 'Scheherazade New', 'Amiri', serif

   Cross-browser: vendor prefixes for Safari/WebKit, Firefox.
   iOS safe area: env(safe-area-inset-bottom) for notch devices.
   ============================================================ */

/* iOS safe-area viewport */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .verse-feed {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }
}

/* Vendor prefix fallbacks for content-visibility (Chrome 85+, no Firefox/Safari) */
@supports not (content-visibility: auto) {
    .feed-card {
        /* Fallback: no paint optimization, just render all */
        contain: layout style;
    }
}


/* ============================================================
   1. FEED CONTAINER
   ============================================================ */

.verse-feed {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 120px;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}


/* ============================================================
   2. FEED HEADER (sticky controls)
   ============================================================ */

.feed-header {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fdf8f0;
    padding: 4px 12px 4px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.12);
    margin-bottom: 12px;
    -webkit-backdrop-filter: blur(8px); /* Safari glassmorphism */
    backdrop-filter: blur(8px);
}

.feed-sura-title {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: #5a4a3a;
    margin: 0;
    padding: 10px 0 2px;
    line-height: 1.3;
}

.feed-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.feed-view-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(180, 160, 120, 0.3);
    flex-shrink: 0;
}

.feed-view-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    color: #8B7355;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    line-height: 1.4;
}

.feed-view-btn:hover {
    background: rgba(13, 92, 58, 0.06);
    color: #5a4a3a;
}

.feed-view-btn.active {
    background: #0d5c3a;
    color: #fff;
}

.feed-learning-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: #8B7355;
    flex-shrink: 0;
}

.feed-learning-toggle .form-check-input:checked {
    background-color: #0d5c3a;
    border-color: #0d5c3a;
}

.feed-progress {
    font-size: 0.72rem;
    color: #8B7355;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Play Surah button */
.feed-play-surah-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1.5px solid #0d5c3a;
    background: transparent;
    color: #0d5c3a;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.feed-play-surah-btn:hover {
    background: rgba(13, 92, 58, 0.08);
    border-color: #0b7a4a;
}

.feed-play-surah-btn:active {
    transform: scale(0.96);
}

/* Learning mode group */
.feed-learning-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.feed-learning-group .fas {
    color: #8B7355;
}

.feed-learning-switch {
    margin-bottom: 0;
}

.feed-learning-switch .form-check-input {
    width: 32px;
    height: 16px;
    cursor: pointer;
    border-color: rgba(180, 160, 120, 0.4);
}

.feed-learning-switch .form-check-input:checked {
    background-color: #8E44AD;
    border-color: #8E44AD;
}

.feed-learning-switch .form-check-label {
    font-size: 0.7rem;
    color: #8B7355;
    font-weight: 500;
    user-select: none;
}


/* ============================================================
   3. VERSE CARD (collapsed state)
   ============================================================ */

.feed-card {
    background: #fff;
    border: 1px solid rgba(180, 160, 120, 0.2);
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    content-visibility: auto;
    contain-intrinsic-size: 0 200px;
}

.feed-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(201, 168, 76, 0.4);
}

.feed-card.feed-card-active {
    border-left: 3px solid #c9a84c;
}

.feed-card.active-playing {
    border-left: 3px solid #0d5c3a;
    box-shadow: 0 4px 20px rgba(13, 92, 58, 0.15);
}


/* ============================================================
   4. CARD HEADER
   ============================================================ */

.feed-card-header {
    display: flex;
    align-items: center;
    padding: 10px 16px 0;
    gap: 8px;
}

.feed-card-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 26px;
    padding: 0 10px;
    border: 1.5px solid #c9a84c;
    border-radius: 13px;
    background: rgba(201, 168, 76, 0.08);
    font-family: 'Amiri', serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #5a4a3a;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.feed-card-maslow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feed-card-header-spacer {
    flex: 1;
}

.feed-card-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(180, 160, 120, 0.25);
    background: transparent;
    color: #8B7355;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    font-size: 0.7rem;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.feed-card-btn:hover {
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.08);
    color: #5a4a3a;
}

.feed-card-btn.feed-bookmarked {
    color: #c9a84c;
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.12);
}

.feed-card-btn.feed-play-btn {
    border-color: #0d5c3a;
    color: #0d5c3a;
}

.feed-card-btn.feed-play-btn:hover {
    background: rgba(13, 92, 58, 0.08);
}

.feed-expand-btn {
    transition: transform 0.3s;
}

.feed-card.expanded .feed-expand-btn {
    transform: rotate(180deg);
}


/* ============================================================
   5. CARD BODY
   ============================================================ */

.feed-card-body {
    padding: 12px 20px 8px;
}

.feed-card-bismillah {
    text-align: center;
    font-family: 'Amiri Quran', 'Amiri', serif;
    font-size: 1.3rem;
    color: #0d5c3a;
    padding: 8px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(13, 92, 58, 0.1);
}

.feed-card-arabic {
    text-align: center;
    font-family: 'Amiri Quran', 'Scheherazade New', 'Amiri', serif;
    font-size: 1.8rem;
    line-height: 2.2;
    color: #1a1a1a;
    direction: rtl;
    padding: 12px 0 8px;
    word-spacing: 6px;
}

.feed-card-ornament {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #c9a84c;
    color: #c9a84c;
    font-family: 'Amiri', serif;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 auto;
    background: rgba(201, 168, 76, 0.06);
}

.feed-card-translation {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #34495E;
    padding: 8px 0;
    font-style: italic;
    text-align: center;
    position: relative;
}

.feed-card-attribution {
    text-align: right;
    font-size: 0.75rem;
    color: #8B7355;
    padding: 0 0 4px;
    font-style: italic;
}


/* ============================================================
   6. CARD TAGS (footer strip)
   ============================================================ */

.feed-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 16px 10px;
    border-top: 1px solid rgba(180, 160, 120, 0.1);
}

.feed-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}

.feed-tag-maslow {
    border-color: currentColor;
}

.feed-tag-emotion {
    border-color: #c9a84c;
    color: #8B7355;
    background: rgba(201, 168, 76, 0.06);
}

.feed-tag-character {
    border-color: rgba(180, 160, 120, 0.3);
    color: #5a4a3a;
    background: rgba(180, 160, 120, 0.06);
    cursor: pointer;
}

.feed-tag-character:hover {
    border-color: #c9a84c;
}


/* ============================================================
   7. CARD DRAWER (expanded content)
   ============================================================ */

.feed-card-drawer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    -webkit-transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                        opacity 0.3s ease 0.05s,
                        padding 0.4s ease;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.05s,
                padding 0.4s ease;
    padding: 0 20px;
    border-top: 0 solid rgba(180, 160, 120, 0.1);
}

.feed-card.expanded .feed-card-drawer {
    max-height: 3000px;
    opacity: 1;
    padding: 12px 20px 16px;
    border-top-width: 1px;
}

.drawer-section {
    margin-bottom: 12px;
}

.drawer-section:last-child {
    margin-bottom: 0;
}

.drawer-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}


/* ============================================================
   8. DRAWER: TRANSLITERATION
   ============================================================ */

.drawer-transliteration {
    font-style: italic;
    color: #8E44AD;
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: center;
    padding: 8px 12px;
    background: rgba(142, 68, 173, 0.06);
    border-radius: 8px;
}


/* ============================================================
   9. DRAWER: WORD-BY-WORD TABLE
   ============================================================ */

.drawer-wbw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.drawer-wbw-table th {
    color: #8B7355;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.2);
}

.drawer-wbw-table td {
    padding: 6px;
    border-bottom: 1px solid rgba(180, 160, 120, 0.08);
}

.drawer-wbw-table .wbw-ar {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    direction: rtl;
    text-align: right;
    color: #1a1a1a;
}

.drawer-wbw-table .wbw-tr {
    font-style: italic;
    color: #8E44AD;
}

.drawer-wbw-table .wbw-en {
    color: #34495E;
}

.drawer-wbw-table .wbw-root {
    color: #8B7355;
    font-family: monospace;
    font-size: 0.72rem;
}

.drawer-wbw-table .wbw-pos {
    color: #8B7355;
    font-size: 0.68rem;
}

/* Learning mode: click-through highlighting */
.drawer-wbw-table td.wbw-active {
    background: rgba(201, 168, 76, 0.15);
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.3);
    border-radius: 4px;
}


/* ============================================================
   10. DRAWER: MASLOW MINI-BARS
   ============================================================ */

.drawer-needs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.drawer-need-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.drawer-need-label {
    width: 56px;
    font-size: 0.68rem;
    color: #8B7355;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.drawer-need-bar {
    flex: 1;
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.drawer-need-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.drawer-need-val {
    width: 16px;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: right;
}


/* ============================================================
   11. DRAWER: PSYCHE BADGES
   ============================================================ */

.drawer-psyche-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.drawer-psyche-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.drawer-psyche-badge .badge-label {
    font-size: 0.6rem;
    color: #8B7355;
    font-weight: 400;
}


/* ============================================================
   12. DRAWER: SCENE
   ============================================================ */

.drawer-scene {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.drawer-scene-chip {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
    background: rgba(180, 160, 120, 0.08);
    color: #5a4a3a;
    border: 1px solid rgba(180, 160, 120, 0.15);
}

.drawer-scene-chip i {
    font-size: 0.6rem;
    margin-right: 3px;
    color: #8B7355;
}

.drawer-sounds {
    font-style: italic;
    font-size: 0.75rem;
    color: #8B7355;
    margin-top: 4px;
}


/* ============================================================
   13. DRAWER: ENRICHMENT (collapsible sections)
   ============================================================ */

.drawer-enrichment-item {
    margin-bottom: 8px;
}

.drawer-enrichment-item:last-child {
    margin-bottom: 0;
}

.drawer-enrichment-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a4a3a;
    padding: 4px 0;
    user-select: none;
}

.drawer-enrichment-toggle i {
    font-size: 0.65rem;
    color: #c9a84c;
    transition: transform 0.2s;
}

.drawer-enrichment-item.open .drawer-enrichment-toggle i {
    transform: rotate(90deg);
}

.drawer-enrichment-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #34495E;
    padding-left: 18px;
}

.drawer-enrichment-item.open .drawer-enrichment-content {
    max-height: 500px;
    padding-top: 4px;
}


/* ============================================================
   14. DRAWER: AUDIO BUTTONS
   ============================================================ */

.drawer-audio {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.drawer-audio .audio-trigger-btn {
    height: 30px;
    padding: 0 14px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}


/* ============================================================
   15. DRAWER: ACTIONS ROW
   ============================================================ */

.drawer-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(180, 160, 120, 0.1);
}

.drawer-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    color: #8B7355;
    border: 1px solid rgba(180, 160, 120, 0.25);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.drawer-action-btn:hover {
    border-color: #c9a84c;
    color: #5a4a3a;
}

.drawer-action-btn i {
    font-size: 0.65rem;
}


/* ============================================================
   16. LEARNING MODE
   ============================================================ */

.verse-feed.learning-mode .feed-card-translation {
    -webkit-filter: blur(8px);
    filter: blur(8px);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-transition: -webkit-filter 0.3s ease;
    transition: filter 0.3s ease;
    position: relative; /* for ::after positioning */
}

.verse-feed.learning-mode .feed-card-translation.revealed {
    -webkit-filter: none;
    filter: none;
    cursor: default;
}

.verse-feed.learning-mode .feed-card-translation::after {
    content: 'Tap to reveal';
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    font-size: 0.72rem;
    color: #8B7355;
    font-style: normal;
    opacity: 1;
    pointer-events: none;
}

.verse-feed.learning-mode .feed-card-translation.revealed::after {
    opacity: 0;
}

/* Auto-show transliteration in learning mode */
.verse-feed.learning-mode .drawer-transliteration-peek {
    display: block;
}

.feed-repeat-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(180, 160, 120, 0.3);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
}

.feed-repeat-control button {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #8B7355;
    cursor: pointer;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.feed-repeat-control button:hover {
    background: rgba(201, 168, 76, 0.1);
}

.feed-repeat-count {
    min-width: 14px;
    text-align: center;
    font-weight: 700;
    color: #5a4a3a;
}


/* ============================================================
   17. FEED SENTINEL (infinite scroll trigger)
   ============================================================ */

.feed-sentinel {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-sentinel-loading {
    font-size: 0.78rem;
    color: #8B7355;
}

.feed-sentinel-loading i {
    animation: feed-spin 1s linear infinite;
    margin-right: 6px;
}

@keyframes feed-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   17b. CARD FLASH ANIMATION (scroll-to-verse highlight)
   ============================================================ */

.feed-card-flash {
    animation: feed-flash 1.5s ease;
}

@keyframes feed-flash {
    0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.6); }
    25% { box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.4); border-color: #c9a84c; }
    100% { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
}


/* ============================================================
   17c. CONTINUE READING BANNER
   ============================================================ */

.feed-continue-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08) 0%, rgba(13, 92, 58, 0.06) 100%);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.feed-continue-banner:hover {
    border-color: #c9a84c;
    background: rgba(201, 168, 76, 0.12);
}

.feed-continue-banner i {
    color: #c9a84c;
    font-size: 1rem;
}

.feed-continue-text {
    flex: 1;
    font-size: 0.82rem;
    color: #5a4a3a;
}

.feed-continue-text strong {
    color: #0d5c3a;
}

.feed-continue-dismiss {
    border: none;
    background: transparent;
    color: #8B7355;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.feed-continue-dismiss:hover {
    background: rgba(180, 160, 120, 0.15);
}


/* ============================================================
   17d. END OF SURA MARKER
   ============================================================ */

.feed-end-marker {
    text-align: center;
    padding: 24px 16px;
    color: #8B7355;
    font-size: 0.82rem;
    font-style: italic;
    border-top: 1px solid rgba(180, 160, 120, 0.15);
    margin-top: 8px;
}


/* ============================================================
   17e. VERSE NOTES (in drawer)
   ============================================================ */

.drawer-notes-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 200px;
    padding: 8px 10px;
    border: 1px solid rgba(180, 160, 120, 0.25);
    border-radius: 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #5a4a3a;
    background: #fdf8f0;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.drawer-notes-textarea:focus {
    border-color: #c9a84c;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15);
}

.drawer-notes-textarea::placeholder {
    color: #b4a080;
    font-style: italic;
}


/* ============================================================
   17f. RESPONSIVE: below 1024px (tablets)
   ============================================================ */

@media (max-width: 1024px) {
    .verse-feed {
        max-width: 640px;
    }

    .feed-card-arabic {
        font-size: 1.65rem;
    }

    /* Controls: hide lang/translator on tablets in feed mode too */
    .feed-controls-row .feed-globe-icon,
    .feed-controls-row .feed-lang-wrap,
    .feed-controls-row .feed-translator-wrap,
    .feed-controls-row .feed-lang-divider {
        display: none !important;
    }
}


/* ============================================================
   18. RESPONSIVE: below 768px
   ============================================================ */

@media (max-width: 768px) {

    /* --- Feed header: compact 2-row layout --- */
    .feed-header {
        padding: 4px 10px 4px;
        margin-bottom: 6px;
    }

    .feed-sura-title {
        font-size: 1.15rem;
        padding: 6px 0 0;
    }

    /* Hide globe icon + language/translator dropdowns in feed mode on mobile.
       These controls exist on the main page and within card drawers.
       Uses explicit classes added to the wrapper elements. */
    .feed-controls-row .feed-globe-icon,
    .feed-controls-row .feed-lang-wrap,
    .feed-controls-row .feed-translator-wrap,
    .feed-controls-row .feed-lang-divider {
        display: none !important;
    }

    /* Controls row: tight single line with remaining items */
    .feed-controls-row {
        gap: 6px;
        padding: 4px 0;
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    /* Sura info strip compact */
    .sura-info-strip {
        font-size: 0.72rem;
        padding: 3px 0;
    }

    /* Cards */
    .feed-card {
        margin-bottom: 8px;
    }

    .feed-card-arabic {
        font-size: 1.5rem;
    }

    .feed-card-body {
        padding: 10px 14px 6px;
    }

    .feed-card-header {
        padding: 8px 12px 0;
    }

    .feed-card-tags {
        padding: 4px 12px 8px;
    }

    .feed-tag {
        font-size: 0.6rem;
    }

    /* Hide WBW columns on tablet */
    .drawer-wbw-table .wbw-root,
    .drawer-wbw-table .wbw-pos {
        display: none;
    }

    /* Play Surah button: compact */
    .feed-play-surah-btn {
        height: 26px;
        padding: 0 10px;
        font-size: 0.68rem;
    }

    /* Learning group: compact */
    .feed-learning-group {
        gap: 3px;
    }

    .feed-learning-switch .form-check-label {
        font-size: 0.65rem;
    }

    /* Bottom padding: audio player bar only (56px) since vc bar is hidden in feed */
    .verse-feed {
        padding-bottom: 72px; /* 56px player + 16px breathing room */
    }
}


/* ============================================================
   19. RESPONSIVE: below 480px (small phones: 360-412px)
   ============================================================ */

@media (max-width: 480px) {
    .verse-feed {
        padding: 0 6px 68px; /* tighter horizontal, audio player + margin */
    }

    .feed-header {
        padding: 3px 6px 3px;
        margin-bottom: 4px;
    }

    .feed-sura-title {
        font-size: 1.05rem;
        padding: 4px 0 0;
    }

    /* Controls row: super compact */
    .feed-controls-row {
        gap: 4px;
        padding: 3px 0;
    }

    /* Hide remaining dividers on small phones */
    .feed-controls-row .vc-action-divider {
        display: none !important;
    }

    /* View toggle: smaller */
    .feed-view-btn {
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    /* Play Surah: icon-only on very small screens */
    .feed-play-surah-btn .btn-label-text {
        display: none;
    }

    .feed-play-surah-btn {
        height: 24px;
        padding: 0 8px;
        font-size: 0.65rem;
        min-width: 0;
    }

    /* Learning toggle: hide label, icon + switch only */
    .feed-learning-switch .form-check-label {
        display: none;
    }

    /* Card sizing */
    .feed-card {
        border-radius: 12px;
        margin-bottom: 8px;
    }

    .feed-card-body {
        padding: 8px 10px 6px;
    }

    .feed-card-arabic {
        font-size: 1.3rem;
        line-height: 2;
        padding: 8px 0 6px;
    }

    .feed-card-translation {
        font-size: 0.88rem;
        padding: 6px 0;
    }

    .feed-card-attribution {
        font-size: 0.7rem;
    }

    /* Card header: compact */
    .feed-card-header {
        padding: 6px 10px 0;
        gap: 6px;
    }

    .feed-card-btn {
        width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }

    .feed-card-ref {
        height: 24px;
        font-size: 0.75rem;
        min-width: 46px;
        padding: 0 8px;
    }

    /* Tags: smaller */
    .feed-card-tags {
        padding: 3px 10px 6px;
        gap: 3px;
    }

    .feed-tag {
        font-size: 0.58rem;
        padding: 1px 6px;
    }

    /* Sura info strip */
    .sura-info-strip {
        font-size: 0.68rem;
    }

    /* Drawer: tighter on mobile */
    .feed-card.expanded .feed-card-drawer {
        padding: 10px 12px 12px;
    }

    .drawer-section-label {
        font-size: 0.65rem;
    }

    /* Continue reading banner: compact */
    .feed-continue-banner {
        padding: 8px 12px;
        margin-bottom: 8px;
        gap: 8px;
    }

    .feed-continue-text {
        font-size: 0.78rem;
    }

    /* iOS safe area for bottom-bar devices */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .verse-feed {
            padding-bottom: calc(68px + env(safe-area-inset-bottom));
        }
    }
}


/* ============================================================
   19b. RESPONSIVE: landscape phones (short viewport)
   ============================================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .feed-header {
        position: relative; /* un-sticky on landscape phones — too little vertical space */
    }

    .feed-card-arabic {
        font-size: 1.2rem;
        line-height: 1.8;
        padding: 6px 0 4px;
    }

    .feed-card-translation {
        font-size: 0.82rem;
    }
}


/* ============================================================
   20. PRINT
   ============================================================ */

@media print {
    .feed-header,
    .feed-card-header .feed-card-btn,
    .feed-card-drawer,
    .feed-card-tags,
    .feed-sentinel {
        display: none !important;
    }

    .feed-card {
        break-inside: avoid;
        border: none;
        box-shadow: none;
        margin-bottom: 20px;
    }
}
