/* ================================================================
   MJUE MUNGU — Posts Page
================================================================ */

/* ── Theme palette for cards ─────────────────────────────── */
:root {
    --d-navy:       linear-gradient(145deg, #1a2e42 0%, #243d5c 100%);
    --d-gold:       linear-gradient(145deg, #7a4a00 0%, #c8830a 100%);
    --d-sunrise:    linear-gradient(145deg, #7d1a2e 0%, #c0392b 60%, #e67e22 100%);
    --d-forest:     linear-gradient(145deg, #1a3a2a 0%, #1e6b45 100%);
    --d-purple:     linear-gradient(145deg, #2d1b4e 0%, #6c3483 100%);
    --d-midnight:   linear-gradient(145deg, #0d0d1a 0%, #1a1a3e 100%);
    --d-teal:       linear-gradient(145deg, #0a3d3d 0%, #117a65 100%);
    --d-rose:       linear-gradient(145deg, #4a0e2a 0%, #922b52 100%);
}

/* ── Hero ────────────────────────────────────────────────── */
.devot-hero {
    position: relative;
    padding: 7rem 0 3.5rem;
    background: linear-gradient(135deg, rgba(26,35,50,0.97) 0%, rgba(24,48,79,0.94) 100%);
    color: #fff;
    overflow: hidden;
}

.devot-hero-orb {
    position: absolute;
    top: -6rem;
    right: -6rem;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,160,76,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.devot-hero-copy h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1.1;
    margin: 0.6rem 0 1rem;
}

.devot-hero-copy p {
    max-width: 56ch;
    color: rgba(255,255,255,0.78);
    line-height: 1.85;
    font-size: 1.05rem;
}

/* ── Filter bar ──────────────────────────────────────────── */
.devot-filter-bar {
    background: #fff;
    border-bottom: 1px solid rgba(26,35,50,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(26,35,50,0.07);
}

.devot-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    flex-wrap: wrap;
}

.devot-filter-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.devot-tab {
    background: none;
    border: 1.5px solid rgba(26,35,50,0.15);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-dark);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.devot-tab:hover {
    border-color: var(--navy-dark);
    color: var(--navy-dark);
}

.devot-tab.active {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: #fff;
}

.devot-count {
    font-size: 0.85rem;
    color: var(--gray-medium);
    white-space: nowrap;
    font-weight: 500;
}

/* ── Feed section ────────────────────────────────────────── */
.devot-feed-section {
    padding: 3rem 0 5rem;
    background: #f4f6f9;
    min-height: 40vh;
}

/* ── Grid ────────────────────────────────────────────────── */
.devot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
    gap: 1rem;
}

/* ── Skeleton loaders ────────────────────────────────────── */
.devot-skeleton {
    border-radius: 20px;
    height: 14rem;
    background: linear-gradient(90deg, #e0e4ea 25%, #edf0f4 50%, #e0e4ea 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Card base ───────────────────────────────────────────── */
.devot-card {
    border-radius: 20px;
    padding: 1.4rem 1.5rem 1rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: hidden;
    min-height: 13rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.devot-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

/* Decorative orb inside card */
.devot-card::before {
    content: '';
    position: absolute;
    top: -3rem;
    right: -3rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}

.devot-card::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: -2rem;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

/* ── Grid cards: uniform fixed height, content clipped ───
   The modal (in .devot-modal-inner) is never inside .devot-grid,
   so these rules only apply to the feed.                    */
.devot-grid .devot-card:not(.devot-card-img-only) {
    height: 22rem;
    min-height: 0;
    overflow: hidden;
}

/* Replace the bottom decorative orb with a gradient fade
   that signals there may be more content below.            */
.devot-grid .devot-card:not(.devot-card-img-only)::after {
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    height: 5.5rem;
    border-radius: 0 0 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, transparent 100%);
}

/* Light-background styles: use a matching light fade */
.devot-grid .devot-card[data-style="verse"]::after,
.devot-grid .devot-card[data-style="parchment"]::after {
    background: linear-gradient(to top, rgba(250,248,242,0.92) 0%, transparent 100%);
}
.devot-grid .devot-card[data-style="banner"]::after {
    background: linear-gradient(to top, rgba(244,246,249,0.95) 0%, transparent 100%);
}

/* "Tap to read" hint overlaid on the gradient */
.devot-card-expand-hint {
    position: absolute;
    bottom: 0.55rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.85);
    z-index: 2;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Dark hint text on light-background card styles */
.devot-card[data-style="verse"] .devot-card-expand-hint,
.devot-card[data-style="parchment"] .devot-card-expand-hint,
.devot-card[data-style="banner"] .devot-card-expand-hint {
    color: rgba(0,0,0,0.5);
    text-shadow: none;
}

/* ── Theme variants (background + CSS custom props) ─────────── */
.devot-card[data-theme="navy"]     { background: var(--d-navy);     --d-card-bg: var(--d-navy);     --d-card-accent: #3b82f6; }
.devot-card[data-theme="gold"]     { background: var(--d-gold);     --d-card-bg: var(--d-gold);     --d-card-accent: #e0930d; }
.devot-card[data-theme="sunrise"]  { background: var(--d-sunrise);  --d-card-bg: var(--d-sunrise);  --d-card-accent: #e05030; }
.devot-card[data-theme="forest"]   { background: var(--d-forest);   --d-card-bg: var(--d-forest);   --d-card-accent: #22c55e; }
.devot-card[data-theme="purple"]   { background: var(--d-purple);   --d-card-bg: var(--d-purple);   --d-card-accent: #a855f7; }
.devot-card[data-theme="midnight"] { background: var(--d-midnight); --d-card-bg: var(--d-midnight); --d-card-accent: #818cf8; }
.devot-card[data-theme="teal"]     { background: var(--d-teal);     --d-card-bg: var(--d-teal);     --d-card-accent: #14b8a6; }
.devot-card[data-theme="rose"]     { background: var(--d-rose);     --d-card-bg: var(--d-rose);     --d-card-accent: #f472b6; }

/* ── Card parts ──────────────────────────────────────────── */
.devot-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.devot-card-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    backdrop-filter: blur(4px);
}

.devot-card-date {
    font-size: 0.75rem;
    opacity: 0.6;
    font-weight: 500;
}

.devot-card-message {
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    font-style: italic;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 0.8rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* When line-breaks have been injected, disable the clamp so all lines show */
.devot-card-message.devot-msg-wrapped {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* ── Rich-text size spans (set by RTE toolbar) ─────────────
   Relative to the card's base message font size               */
.devot-card-message .ts-sm  { font-size: 0.68em; }
.devot-card-message .ts-lg  { font-size: 1.35em; line-height: 1.3; }
.devot-card-message .ts-xl  { font-size: 1.75em; line-height: 1.2; }
/* Bold and italic pass through naturally from <b>/<strong>/<em>/<i> */
.devot-card-message strong,
.devot-card-message b  { font-weight: 800; font-style: normal; }
.devot-card-message em,
.devot-card-message i  { font-style: italic; }

/* Opening quotation mark */
.devot-card-message::before {
    content: '\201C';
    font-size: 3.5rem;
    line-height: 0;
    vertical-align: -0.8rem;
    margin-right: 0.15rem;
    opacity: 0.45;
    font-style: normal;
}

.devot-card-scripture {
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.75;
    margin-bottom: 0.4rem;
    font-style: normal;
    letter-spacing: 0.02em;
}

.devot-card-scripture-text {
    font-size: 0.88rem;
    opacity: 0.68;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
    border-left: 2px solid rgba(255,255,255,0.3);
    padding-left: 0.75rem;
}

.devot-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

/* ── Brand strip (always visible, including in downloads) ── */
.devot-card-brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0.55rem;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.devot-brand-logo {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.85;
}

.devot-brand-name {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    opacity: 0.8;
}

.devot-brand-url {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.55;
    margin-left: auto;
    letter-spacing: 0.02em;
}

/* Adjust brand strip border/colour on light-background card styles */
.devot-card[data-style="verse"] .devot-card-brand,
.devot-card[data-style="parchment"] .devot-card-brand,
.devot-card[data-style="banner"] .devot-card-brand {
    border-top-color: rgba(0,0,0,0.12);
}

.devot-card[data-style="verse"] .devot-brand-name,
.devot-card[data-style="verse"] .devot-brand-url,
.devot-card[data-style="parchment"] .devot-brand-name,
.devot-card[data-style="parchment"] .devot-brand-url,
.devot-card[data-style="banner"] .devot-brand-name,
.devot-card[data-style="banner"] .devot-brand-url {
    color: #374151;
}



.devot-card-author {
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.devot-card-actions {
    display: flex;
    gap: 0.5rem;
}

.devot-share-btn,
.devot-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 0.38rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    backdrop-filter: blur(4px);
    transition: background 0.18s;
    white-space: nowrap;
}

.devot-share-btn:hover,
.devot-download-btn:hover {
    background: rgba(255,255,255,0.28);
}

/* ═══════════════════════════════════════════════════════════
   CARD STYLE VARIANTS
   6 distinct visual layouts — pick any theme × style combo.
═══════════════════════════════════════════════════════════ */

/* ── Style: verse — white card, color left bar ───────────── */
.devot-card[data-style="verse"] {
    background: #fff !important;
    color: #1a2332;
    border-left: 5px solid var(--d-card-accent, #3b82f6);
    border-radius: 0 20px 20px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.devot-card[data-style="verse"]::before,
.devot-card[data-style="verse"]::after { display: none; }
.devot-card[data-style="verse"] .devot-card-tag {
    background: var(--d-card-accent, #3b82f6);
    color: #fff;
    border-color: transparent;
}
.devot-card[data-style="verse"] .devot-card-date { color: #6b7280; opacity: 1; }
.devot-card[data-style="verse"] .devot-card-message {
    color: #1a2332;
    text-shadow: none;
    font-size: clamp(1.1rem, 2vw, 1.42rem);
}
.devot-card[data-style="verse"] .devot-card-message::before {
    color: var(--d-card-accent, #3b82f6);
    opacity: 0.85;
}
.devot-card[data-style="verse"] .devot-card-scripture { color: var(--d-card-accent, #3b82f6); opacity: 1; }
.devot-card[data-style="verse"] .devot-card-scripture-text { color: #4a5568; opacity: 1; border-left-color: var(--d-card-accent, #3b82f6); }
.devot-card[data-style="verse"] .devot-card-footer { border-top-color: #e5e7eb; }
.devot-card[data-style="verse"] .devot-card-author { color: #6b7280; opacity: 1; }
.devot-card[data-style="verse"] .devot-share-btn,
.devot-card[data-style="verse"] .devot-download-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.14);
    color: #374151;
    backdrop-filter: none;
}
.devot-card[data-style="verse"] .devot-share-btn:hover,
.devot-card[data-style="verse"] .devot-download-btn:hover {
    background: var(--d-card-accent, #3b82f6);
    border-color: transparent;
    color: #fff;
}

/* ── Style: parchment — warm cream, aged look ───────────── */
.devot-card[data-style="parchment"] {
    background: #f5eed6 !important;
    color: #3d2b1f;
    border: 2px solid #d4b87a;
    box-shadow: 0 4px 24px rgba(80,50,10,0.18);
}
.devot-card[data-style="parchment"]::before { background: rgba(180,140,60,0.12); }
.devot-card[data-style="parchment"]::after  { background: rgba(180,140,60,0.08); }
.devot-card[data-style="parchment"] .devot-card-tag {
    background: rgba(140,100,30,0.14);
    border-color: #d4b87a;
    color: #7a5520;
}
.devot-card[data-style="parchment"] .devot-card-date { color: #8a7050; opacity: 1; }
.devot-card[data-style="parchment"] .devot-card-message {
    color: #3d2b1f;
    text-shadow: none;
    font-size: clamp(1.1rem, 2vw, 1.42rem);
}
.devot-card[data-style="parchment"] .devot-card-message::before { color: #c9ad7a; opacity: 0.75; }
.devot-card[data-style="parchment"] .devot-card-scripture { color: #8a6030; opacity: 1; font-style: italic; }
.devot-card[data-style="parchment"] .devot-card-scripture-text { color: #6b5040; opacity: 1; border-left-color: #d4b87a; }
.devot-card[data-style="parchment"] .devot-card-footer { border-top-color: #d4b87a; }
.devot-card[data-style="parchment"] .devot-card-author { color: #8a7050; opacity: 1; }
.devot-card[data-style="parchment"] .devot-card-top::after {
    content: '\2055  \2055  \2055';
    display: block;
    font-size: 0.65rem;
    color: #d4b87a;
    letter-spacing: 0.4rem;
    margin-top: 0.9rem;
    text-align: center;
    width: 100%;
}
.devot-card[data-style="parchment"] .devot-card-message { padding-top: 0.6rem; }
.devot-card[data-style="parchment"] .devot-share-btn,
.devot-card[data-style="parchment"] .devot-download-btn {
    background: rgba(140,100,30,0.1);
    border-color: #d4b87a;
    color: #7a5520;
    backdrop-filter: none;
}
.devot-card[data-style="parchment"] .devot-share-btn:hover,
.devot-card[data-style="parchment"] .devot-download-btn:hover {
    background: #8a6030;
    border-color: transparent;
    color: #fff;
}

/* ── Style: banner — dark header band + white body ───────── */
.devot-card[data-style="banner"] {
    padding: 0;
    gap: 0;
    min-height: 22rem;
    background: transparent !important;
}
.devot-card[data-style="banner"]::before,
.devot-card[data-style="banner"]::after { display: none; }
.devot-banner-head {
    background: var(--d-card-bg, linear-gradient(145deg, #1a2e42, #243d5c));
    padding: 1.35rem 2rem 1.2rem;
    flex-shrink: 0;
}
.devot-banner-body {
    background: #fff;
    color: #1a2332;
    padding: 1.45rem 2rem 1.35rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.devot-card[data-style="banner"] .devot-card-message {
    color: #1a2332;
    text-shadow: none;
    font-size: clamp(1.05rem, 2vw, 1.38rem);
}
.devot-card[data-style="banner"] .devot-card-message::before {
    color: var(--d-card-accent, #3b82f6);
    opacity: 0.7;
}
.devot-card[data-style="banner"] .devot-card-scripture { color: var(--d-card-accent, #3b82f6); opacity: 1; }
.devot-card[data-style="banner"] .devot-card-scripture-text { color: #4a5568; opacity: 1; border-left-color: var(--d-card-accent, #3b82f6); }
.devot-card[data-style="banner"] .devot-card-footer { border-top-color: #e5e7eb; }
.devot-card[data-style="banner"] .devot-card-author { color: #6b7280; opacity: 1; }
.devot-card[data-style="banner"] .devot-share-btn,
.devot-card[data-style="banner"] .devot-download-btn {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.14);
    color: #374151;
    backdrop-filter: none;
}
.devot-card[data-style="banner"] .devot-share-btn:hover,
.devot-card[data-style="banner"] .devot-download-btn:hover {
    background: var(--d-card-accent, #3b82f6);
    border-color: transparent;
    color: #fff;
}

/* ── Style: frame — centered, ornamental inner border ───── */
.devot-card[data-style="frame"] {
    text-align: center;
    padding: 2.4rem 2.4rem 1.6rem;
    box-shadow:
        0 8px 40px rgba(0,0,0,0.3),
        inset 0 0 0 2px rgba(255,255,255,0.22),
        inset 0 0 0 5px rgba(255,255,255,0.06);
}
.devot-card[data-style="frame"] .devot-card-top { justify-content: center; gap: 0.75rem; }
.devot-card[data-style="frame"] .devot-card-message { font-size: clamp(1.2rem, 2.5vw, 1.65rem); }
.devot-card[data-style="frame"] .devot-card-message::before {
    content: '\2736';
    font-size: 1.5rem;
    line-height: 1.5;
    vertical-align: 0;
    margin-right: 0;
    display: block;
    text-align: center;
    margin-bottom: 0.7rem;
    font-style: normal;
}
.devot-card[data-style="frame"] .devot-card-scripture,
.devot-card[data-style="frame"] .devot-card-scripture-text {
    text-align: center;
    border-left: none;
    padding-left: 0;
}
.devot-card[data-style="frame"] .devot-card-footer { justify-content: center; }

/* ── Style: bold — oversized centered statement ─────────── */
.devot-card[data-style="bold"] {
    text-align: center;
    padding: 2.8rem 2.2rem 1.6rem;
}
.devot-card[data-style="bold"] .devot-card-top { justify-content: center; margin-bottom: 2rem; }
.devot-card[data-style="bold"] .devot-card-message {
    font-size: clamp(1.45rem, 3.5vw, 2.1rem);
    font-style: normal;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}
.devot-card[data-style="bold"] .devot-card-message::before {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: rgba(255,255,255,0.45);
    margin: 0 auto 1.2rem;
    font-size: inherit;
    line-height: 0;
    vertical-align: 0;
}
.devot-card[data-style="bold"] .devot-card-scripture {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    opacity: 0.75;
}
.devot-card[data-style="bold"] .devot-card-footer { justify-content: center; }

/* ── Empty state ─────────────────────────────────────────── */
.devot-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--gray-medium);
}

.devot-empty h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ── Toast ───────────────────────────────────────────────── */
.devot-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(2rem);
    background: var(--navy-dark);
    color: #fff;
    border-radius: 999px;
    padding: 0.7rem 1.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    white-space: nowrap;
}

.devot-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Uploaded-image card variant ────────────────────────── */
.devot-card-img-only {
    background: #111827;
    padding: 0;
    overflow: hidden;
    position: relative;   /* needed for absolute .devot-card-top */
    display: flex;
    flex-direction: column;
}

.devot-card-img-only .devot-card-top {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
}

.devot-uploaded-img {
    width: 100%;
    display: block;
    object-fit: cover;
    max-height: 150px;
    flex: 1 1 auto;
}

.devot-card-caption {
    padding: 0.65rem 1.1rem 0.4rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    font-style: italic;
    margin: 0;
    background: rgba(0,0,0,0.35);
    line-height: 1.5;
}

.devot-img-footer {
    background: rgba(0,0,0,0.4);
    padding: 0.6rem 1rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .devot-hero {
        padding: 6rem 0 2.5rem;
    }

    .devot-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    /* Designed cards — let height be driven by content on mobile */
    .devot-card:not(.devot-card-img-only) {
        min-height: 0;
    }

    /* Grid cards: keep overflow hidden but let height go auto on 768px */
    .devot-grid .devot-card:not(.devot-card-img-only) {
        height: 18rem;
    }

    /* Filter tabs — scroll horizontally instead of wrapping */
    .devot-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .devot-filter-tabs::-webkit-scrollbar { display: none; }
    .devot-tab { flex-shrink: 0; }

    .devot-filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
}

/* ── Phone — designed cards only (≤ 480 px) ───────────────── */
@media (max-width: 480px) {

    /* ── Portrait shape for designed cards ─────────────────
       aspect-ratio 3/4 makes every card taller than wide so
       it fills a phone screen in portrait and looks right on
       WhatsApp / Instagram status without cropping.          */
    .devot-card:not(.devot-card-img-only) {
        aspect-ratio: 3 / 4;
        padding: 1.3rem 1.2rem 1rem;
        border-radius: 16px;
        min-height: 0; /* let aspect-ratio drive height */
    }

    /* On very small phones the aspect-ratio controls height —
       revert the fixed height so they don't conflict           */
    .devot-grid .devot-card:not(.devot-card-img-only) {
        height: auto;
        overflow: hidden;
    }

    /* Shrink the oversized decorative opening quote */
    .devot-card:not(.devot-card-img-only) .devot-card-message::before {
        font-size: 2.4rem;
        vertical-align: -0.55rem;
    }

    /* Show all text — the portrait card has enough room */
    .devot-card:not(.devot-card-img-only) .devot-card-message {
        font-size: 1.1rem;
        line-height: 1.7;
        -webkit-line-clamp: unset;
        overflow: visible;
        display: block;
        margin-bottom: 0.75rem;
    }

    /* Scripture reference */
    .devot-card:not(.devot-card-img-only) .devot-card-scripture {
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .devot-card:not(.devot-card-img-only) .devot-card-scripture-text {
        font-size: 0.86rem;
        margin-bottom: 0.8rem;
    }

    /* Footer — stack author above buttons, pinned to card bottom */
    .devot-card:not(.devot-card-img-only) .devot-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding-top: 0.75rem;
        margin-top: auto;
    }

    /* Buttons — compact but tappable */
    .devot-card:not(.devot-card-img-only) .devot-share-btn,
    .devot-card:not(.devot-card-img-only) .devot-download-btn {
        padding: 0.38rem 0.85rem;
        font-size: 0.76rem;
    }

    /* Banner — portrait card with colour header + white body */
    .devot-card[data-style="banner"] {
        min-height: 0;
    }
    .devot-banner-head {
        padding: 1.1rem 1.2rem 1rem;
        flex-shrink: 0;
    }
    .devot-banner-body {
        padding: 1.1rem 1.2rem 1rem;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Frame — centred quote card, generous vertical space */
    .devot-card[data-style="frame"] {
        padding: 1.8rem 1.2rem 1.2rem;
    }
    .devot-card[data-style="frame"] .devot-card-message {
        font-size: clamp(1.1rem, 4.8vw, 1.45rem);
    }

    /* Bold — big statement with vertical breathing room */
    .devot-card[data-style="bold"] {
        padding: 2rem 1.2rem 1.2rem;
    }
    .devot-card[data-style="bold"] .devot-card-top {
        margin-bottom: 1.5rem;
    }
    .devot-card[data-style="bold"] .devot-card-message {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
        line-height: 1.4;
        margin-bottom: 1.5rem;
    }

    /* Verse card left accent bar */
    .devot-card[data-style="verse"] {
        border-left-width: 4px;
    }

    /* Hero copy */
    .devot-hero-copy h1 {
        font-size: clamp(1.7rem, 7.5vw, 2.4rem);
    }
    .devot-hero-copy p {
        font-size: 0.95rem;
    }

    /* Feed section padding */
    .devot-feed-section {
        padding: 1.8rem 0 3.5rem;
    }
}

/* ── Modal / Lightbox ────────────────────────────────────── */
.devot-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: devotModalFadeIn 0.2s ease;
}

@keyframes devotModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.devot-modal-inner {
    position: relative;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 22px;
    animation: devotModalSlideUp 0.22s ease;
    scrollbar-width: thin;
}

@keyframes devotModalSlideUp {
    from { transform: translateY(1.5rem); opacity: 0; }
    to   { transform: translateY(0);      opacity: 1; }
}

.devot-modal-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    z-index: 10;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    color: #1a2332;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
    transition: background 0.15s, transform 0.15s;
}

.devot-modal-close:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

/* Full-size card overrides inside modal */
.devot-modal-inner .devot-card {
    cursor: default;
    height: auto;
    min-height: unset;
    border-radius: 20px;
    padding: 2.2rem 2rem 1.6rem;
}

.devot-modal-inner .devot-card-message {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    line-height: 1.6;
    margin-bottom: 1.4rem;
}

.devot-modal-inner .devot-uploaded-img {
    max-height: unset;
}

.devot-modal-inner .devot-card-top {
    margin-bottom: 1.4rem;
}

.devot-modal-inner .devot-card[data-style="banner"] {
    padding: 0;
}

.devot-modal-inner .devot-banner-body {
    padding: 1.45rem 2rem 1.35rem;
}

@media (max-width: 540px) {
    .devot-modal-inner {
        max-width: 100%;
    }

    .devot-modal-inner .devot-card:not(.devot-card-img-only) {
        padding: 1.5rem 1.3rem 1.2rem;
    }

    .devot-modal-inner .devot-card-message {
        font-size: clamp(1.1rem, 4.5vw, 1.4rem);
        line-height: 1.65;
    }

    .devot-modal-inner .devot-banner-head {
        padding: 1rem 1.3rem 0.9rem;
    }

    .devot-modal-inner .devot-banner-body {
        padding: 1rem 1.3rem 1rem;
    }

    .devot-modal-inner .devot-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* End-of-feed message */
.devot-end-msg {
    text-align: center;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    padding: 1.5rem 0 2rem;
    letter-spacing: 0.03em;
}
