@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

/* --- LAYOUT RESTRUCTURE --- */
.homepage-layout {
    display: grid;
    /* Left: Navigation | Center: The Feed | Right: Utility */
    grid-template-columns: 1fr 3fr 1fr;
    gap: 2rem;
    padding: 0 2rem 2rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 70px); 
    box-sizing: border-box;
}

/* Hero Section Styles */
.hero-header {
    text-align: center;
    padding: 4rem 1rem;
    background: 
        radial-gradient(circle at top left, var(--color-1) 0%, transparent 30%), 
        radial-gradient(circle at top right, var(--color-1) 0%, transparent 30%), 
        radial-gradient(ellipse 90% 90% at bottom center, var(--color-2) 0%, transparent 50%),
        var(--bg-color);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.hero-header h1 {
    font-size: 3.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Feed & Comment Cards */
.full-width-panel {
    grid-column: unset; /* Remove the old 2-column span */
}

.comment-card-home {
    display: flex;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
    box-shadow: 0 10px 25px var(--box-shadow); 
}

.comment-card-home:hover {
    border-color: var(--color-1);
}

/* Upvote Styles (Synced with reader page) */
.vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 40px;
}

.vote-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 0;
}

.vote-btn:hover { color: var(--color-1); }

/* Scripture Context Block */
.scripture-context {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-style: italic;
    background: var(--bg-color);
    border-left: 3px solid var(--color-2);
    padding: 12px 16px;
    margin: 10px 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5;
}

.comment-body { flex: 1; }
.meta-row { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.citation-link { font-weight: bold; color: var(--color-1); text-decoration: none; }

/* Sidebars */
.sidebar-panel {
    position: sticky;
    top: 20px;
}

.sidebar-panel h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-1);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* hide header elements that are repeated in the body */

.header-search{
    display: none !important;
}

.header-link {
    display: none !important;
}

.header-right {
    justify-self: end !important;
}

.index-html-search { justify-self: center; width: 100%; display: flex; gap: 5px; }
.index-html-search input { width: 100%; padding: 10px 15px; border: 1px solid var(--border); border-radius: 20px; outline: none; background: var(--card-bg); font-size: 0.95rem; color: var(--text-color)}
.index-html-search input:focus { border-color: var(--color-1); background: var(--card-bg); }

.mobile-saved-toggle-container {
    display: none !important;
}

.hero-header-title {
    font-family: "Noto Sans", sans-serif;
    font-weight: 700;
}

/* General styling for all custom select dropdowns */
select#new-comment-tag,
select#home-tag-filter,
select#sort-dropdown,
select#mobile-sort-dropdown {
    appearance: none; /* Removes default ugly browser styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--card-bg, #ffffff);
    color: var(--text-color, #333333);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    padding: 8px 32px 8px 12px; /* Extra padding on the right for the arrow */
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    
    /* Custom SVG Dropdown Arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23718096%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
}

/* Hover and Focus interaction states */
select#new-comment-tag:hover,
select#home-tag-filter:hover,
select#sort-dropdown:hover,
select#mobile-sort-dropdown:hover {
    border-color: #a0aec0;
}

select#new-comment-tag:focus,
select#home-tag-filter:focus,
select#sort-dropdown:focus,
select#mobile-sort-dropdown:focus {
    border-color: var(--primary, #2b6cb0);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
}

/* Specific sizing for the post comment form dropdown */
select#new-comment-tag {
    width: 100%;
    margin-bottom: 15px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1rem;
}

/* =========================================
   COMMENT TAG BADGES
   ========================================= */

/* Base styling for the little ellipse */
.comment-tag-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 20px;
    background-color: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-muted, #718096);
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Center the loader in your empty state div */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    width: 100%;
}

/* The SVG and Animation Styles */
.eb-garamond-tau {
    font-family: "EB Garamond", serif;
    font-size: 450px;
    fill: #1e5085;
}

.mask-stroke {
    fill: none;
    stroke: white;
    stroke-width: 180;
    stroke-linecap: round;
    stroke-dasharray: 600; 
    stroke-dashoffset: 600;
}

.top-bar {
    animation: drawTop 3s ease-in-out infinite;
}

.stem {
    animation: drawStem 3s ease-in-out infinite;
}

@keyframes drawTop {
    0%, 10%   { stroke-dashoffset: 600; }
    35%, 70%  { stroke-dashoffset: 0; }
    90%, 100% { stroke-dashoffset: 600; }
}

@keyframes drawStem {
    0%, 25%   { stroke-dashoffset: 600; }
    50%, 70%  { stroke-dashoffset: 0; }
    90%, 100% { stroke-dashoffset: 600; }
}

.about-link-top {
    display: none;
}

@media (max-width: 800px) {
    .homepage-layout { grid-template-columns: 220px 1fr; padding-left: 1rem; padding-right: 1rem;}
    .right-sidebar { display: none; }

    .comment-card-home {
        gap: 0.7rem;
    }

    /* Show the text container cleanly right under the search bar */
    .mobile-saved-toggle-container {
        display: block !important;
        text-align: center;
        margin-top: 20px; 
        width: 100%;
    }

    /* Style the clickable text */
    #mobile-sidebar-toggle {
        color: var(--primary, #007bff); 
        font-weight: bold;
        font-size: 1rem;
        cursor: pointer;
        user-select: none; 
    }

    /* Make the main layout a vertical flexbox */
    .homepage-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Completely collapse BOTH sidebars by default on mobile */
    .left-sidebar, .right-sidebar {
        display: none !important; 
    }

    /* The Active State: Show them and stack them at the top! */
    .left-sidebar.mobile-show, .right-sidebar.mobile-show {
        display: flex !important; 
        flex-direction: column !important;
        width: 100% !important; /* Ensures they stretch nicely on mobile */
        
        /* THE FIX: Disable desktop sticky behavior so they scroll naturally! */
        position: static !important; 
        height: auto !important; 
        overflow: visible !important; 
    }

    /* THE MAGIC: Force them to jump above the comments feed in a specific order! */
    .right-sidebar.mobile-show {
        order: -2 !important; /* Puts Saved Documents at the absolute top */
        margin-bottom: 20px !important;
    }
    
    .left-sidebar.mobile-show {
        order: -1 !important; /* Puts the Menu and Trending Documents underneath Saved */
        margin-bottom: 0 !important; 
    }

    /* other styles    */

    .hero-header h1 {
        font-size: 3rem;
        color: var(--text-color);
        margin-bottom: 2rem;
    }

    .hero-header {
        text-align: center;
        padding: 2rem 1rem;
        background: 
            radial-gradient(ellipse at top left, var(--color-1) 0%, transparent 40%), 
            radial-gradient(ellipse at top right, var(--color-1) 0%, transparent 40%), 
            radial-gradient(ellipse 150% 90% at bottom center, var(--color-2) 0%, transparent 50%),
            var(--bg-color);
        border-bottom: 1px solid var(--border);
        
    }

    .vote-col {
        min-width: 0px;
    }

    .about-link-sidebar {
        display: none !important;
    }

    .about-link-top {
        display: block !important;
    }
}

/* Dynamic Colors based on the tag! */
.tag-historical-cultural {
    background-color: #fff5f5;
    color: #c53030;
    border-color: #fed7d7;
}

.tag-theological {
    background-color: #ebf4ff;
    color: #2b6cb0;
    border-color: #bee3f8;
}

.tag-literary {
    background-color: #f0fff4;
    color: #2f855a;
    border-color: #c6f6d5;
}

.tag-practical-devotional {
    background-color: #faf5ff;
    color: #6b46c1;
    border-color: #e9d8fd;
}

.tag-legal-ethical {
    background-color: #fffff0; /* soft yellow */
    color: #b7791f;
    border-color: #fef08a;
}

.tag-mystical-allegorical {
    background-color: #fdf2f8; /* soft pink/purple */
    color: #9d174d;
    border-color: #fbcfe8;
}

.tag-linguistic {
    background-color: #fcf6a6;
    color: #53520a;
    border-color: #ca7944;
}