/* ===============================
RESET & GLOBALS
=============================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    overflow: hidden; /* Lock page scroll for the app-like layout */
}

/* ===============================
HEADER & TICKER
=============================== */
.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #002868;
    color: white;
}

.logo {
    display: flex;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

/* Slim Edge-to-Edge Search Bar */
.search-bar-slim {
    width: 100%;
    background: #eef3fb;
    color: #002868;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px solid #dbe2ef;
    transition: background 0.2s ease;
}

.search-bar-slim:hover {
    background: #dbe2ef;
}

.breaking-ticker {
    background: #bf0a30;
    color: white;
    height: 34px;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-weight: 600;
    font-size: 14px;
}

.ticker-track {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: ticker 120s linear infinite;
    padding-left: 100%;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===============================
CONTROL PANEL (Slide-Out Menu)
=============================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 300px;
    max-width: 85%;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0; /* Slide in */
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #002868;
    color: white;
}

.modal-close-small {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
}

.menu-zone {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-zone h4 {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.menu-zone a {
    text-decoration: none;
    font-weight: 700;
    color: #333;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
}

.menu-zone a:hover {
    background: #eef3fb;
    transform: translateX(4px);
}

.btn-tip {
    background: #bf0a30 !important;
    color: white !important;
    text-align: center;
    border: 1px solid #990826;
}

hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin: 0 20px;
}

/* ===============================
LOCKED LAYOUT GRID
=============================== */
.layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    /* THE FIX: A hard stop height so the grid physically ends before the footer starts */
    height: calc(100vh - 180px); 
    max-width: 1400px;
    /* THE FIX: '0 auto' stops the page from pushing itself downward */
    margin: 0 auto; 
    padding: 16px;
}

.left-column {
    position: sticky;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    gap: 20px;
}

.center-column {
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 10px; /* Just a little breathing room */
}

.center-column::-webkit-scrollbar { width: 6px; }
.center-column::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* ===============================
VIDEO WING (Left)
=============================== */
.video-wrapper {
    width: 100%;
    max-height: calc(45vh - 40px); /* Prevents them from being taller than half the screen */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.video-label {
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    color: white;
    letter-spacing: 0.5px;
}

.video-label.tag-investigation { background: #bf0a30; }
.video-label.tag-pulse { background: #002868; }

.video-slot {
    width: 100%;
    height: 100%; 
    min-height: 0; /* Flexbox trick allowing aspect ratio to shrink properly */
    aspect-ratio: 16/9;
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-slot iframe, .video-slot video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===============================
SPONSOR WING (Right)
=============================== */
.right-column {
    position: sticky;
    top: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* THIS IS THE FIX: Changed from flex-start to center! */
    justify-content: center; 
    gap: 20px;
}

/* The main container */
.ad-slot {
    position: relative;
    width: 100%;
    min-height: 250px;
    background: #e6e6e6;
    border-radius: 8px;
    overflow: hidden;
    display: flex; 
    margin-bottom: 25px; 
}

.ad-sponsor-label {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
}

/* The clickable link container */
.ad-content { 
    display: flex; 
    flex-direction: column; /* Forces the image and caption to stack */
    flex: 1; 
    text-decoration: none;
}

/* The image */
.ad-content img { 
    width: 100%; 
    flex: 1; /* Pushes the caption perfectly to the bottom */
    min-height: 0;
    object-fit: contain; 
}

/* The new caption bar */
.ad-caption {
    background: #002868;
    color: white;
    text-align: center;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
}

.ad-content:hover .ad-caption {
    background: #bf0a30; /* Turns red on hover to encourage clicks */
}

/* ===============================
THE ZEN FEED (Center Cards)
=============================== */
.card-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeUp 0.4s ease;
    display: flex;
    flex-direction: column;
    border-left: 5px solid #ccc; /* Default left accent */
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Typography Focused Cards */
.card h3 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
    color: #111;
}

.card p {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Category Pill Tags inside Cards */
.tag-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
}

/* Tag Specific Styling */
.tag-pulse { border-left-color: #002868; }
.tag-pulse .tag-pill { background: #002868; color: white; }

.tag-investigation { border-left-color: #bf0a30; }
.tag-investigation .tag-pill { background: #bf0a30; color: white; }

.tag-heritage { border-left-color: #555; }
.tag-heritage .tag-pill { background: #555; color: white; }

/* Special Cards */
.poll-card { border-left: none; background: linear-gradient(135deg, #ffffff, #eef3fb); cursor: default; }
.poll-card h3 { margin-bottom: 15px; }

.scripture-card { 
    border-left: none; 
    background: linear-gradient(135deg, #002868, #001f4d); 
    color: white; 
    text-align: center; 
    padding: 25px;
}
.scripture-card p { color: white; font-size: 18px; font-style: italic; margin-bottom: 10px; }
.scripture-card .scripture-ref { font-weight: 700; font-size: 13px; opacity: 0.8; }

.meme-card { padding: 0; border: none; overflow: hidden; background: none; box-shadow: none; cursor: default; }
.meme-card img { width: 100%; border-radius: 10px; display: block; }

/* ===============================
MODAL ECOSYSTEM
=============================== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 10001; /* Above the menu */
    padding: 15px;
}

.modal-inner {
    position: relative;
    background: white;
    padding: 25px 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* ===============================
MODAL TYPOGRAPHY (Auto-Spacing)
=============================== */
.modal-inner p {
    font-size: 16px;
    line-height: 1.7; /* Gives great breathing room between lines of text */
    margin-bottom: 18px; /* Pushes the next paragraph down */
    color: #222;
}

.modal-inner h2 {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 15px;
    color: #111;
}

.modal-inner h3 {
    font-size: 20px;
    margin-top: 25px; /* Creates space above subheadings */
    margin-bottom: 10px;
    color: #002868;
}

.modal-inner ul, 
.modal-inner ol {
    margin-bottom: 18px;
    margin-left: 24px;
    font-size: 16px;
    line-height: 1.7;
}

.modal-inner li {
    margin-bottom: 8px;
}

.modal-dark {
    background: rgba(0, 40, 104, 0.95); /* Deep navy search overlay */
}

.modal-dark .modal-inner {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.modal-dark input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border-radius: 8px;
    border: none;
    margin-top: 10px;
    outline: none;
}

/* Universal Close Buttons */
.modal-close-top {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #777;
    cursor: pointer;
    z-index: 10;
}

.modal-close-top:hover { color: #bf0a30; }

.modal-close-bottom {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 25px;
    background: #f1f1f1;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close-bottom:hover { background: #e2e2e2; }

/* Forms inside Modals */
.modal form input, .modal form textarea {
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* ===============================
FOOTER
=============================== */
footer {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background: #bf0a30;
    color: white;
    padding: 10px 16px;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.footer-weather { flex: 1; text-align: center; font-size: 13px; font-weight: 700; }
.social { display: flex; justify-content: flex-end; gap: 16px; flex: 1; }
.social a { text-decoration: none; font-size: 18px; line-height: 1; }

/* ===============================
ANIMATIONS
=============================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===============================
MOBILE RESPONSIVE (SUPER STACK)
=============================== */
@media (max-width: 900px) {
    body { overflow: auto; }
    
    .layout {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 0;
        gap: 0;
        /* THE FIX: Forces a massive invisible bumper below the last card on mobile */
        padding-bottom: 80px; 
    }

    .left-column, .right-column {
        position: relative;
        padding: 12px;
        gap: 12px;
        height: auto;
    }

    .center-column {
        padding: 12px;
        overflow-y: visible;
    }

    .video-wrapper, .ad-slot, .card {
        border-radius: 8px; /* Slightly tighter curves on mobile */
    }

    footer {
        flex-direction: column;
        gap: 6px;
        padding: 8px;
    }
    
    footer p, .footer-weather, .social {
        flex: auto;
        justify-content: center;
    }
    
    /* ===============================
INTERACTIVE POLL CARDS
=============================== */
.poll-btn {
    display: block;
    width: 100%;
    background: #f4f6f9;
    border: 2px solid #eef3fb;
    color: #002868;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}
/* (Plus the other .poll-bar rules we generated earlier) */

.poll-btn:hover {
    background: #002868;
    color: white;
    border-color: #002868;
}

.poll-result-row {
    margin-bottom: 15px;
}

.poll-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 800;
    color: #222;
    margin-bottom: 5px;
}

.poll-percent {
    color: #bf0a30; /* Alamo Red for the numbers */
}

.poll-bar-bg {
    width: 100%;
    height: 12px;
    background: #e6e6e6;
    border-radius: 6px;
    overflow: hidden;
}

.poll-bar-fill {
    height: 100%;
    background: #002868; /* Alamo Navy for the fill */
    border-radius: 6px;
    width: 0%; /* Starts at 0 for the animation */
    transition: width 1.2s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth snap animation */
}
}