/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --saffron: #FF9933;
    --maroon: #800000;
    --cream: #FFF8E7;
    --sidebar-bg: #2c0b0b; /* Dark brownish-maroon */
    --text-dark: #333;
    --light-gold: #fffcf5;
    --border-color: #ddd;
}

body {
    font-family: 'Merriweather', serif;
    background-color: var(--cream);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    line-height: 1.6;
}

/* =========================================
   2. SIDEBAR & NAVIGATION
   ========================================= */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    position: fixed;
    height: 100%;
    border-right: 4px solid var(--saffron);
    z-index: 100;
    overflow-y: auto; /* Scroll if menu is long */
}

.sidebar-header {
    padding: 25px 15px;
    background-color: #1a0505;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    margin: 10px 0 0 0;
    font-size: 1.4rem;
    color: var(--saffron);
    font-family: 'Merriweather', serif;
}

/* Menu Links */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.menu a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.menu a:hover {
    background-color: var(--maroon);
    color: var(--saffron);
    padding-left: 25px; /* Slide effect */
}

/* Active Link Styling (Inline HTML style overrides this, but good default) */
.menu a.active {
    color: var(--saffron);
    background: rgba(255,255,255,0.05);
}

.menu-category {
    padding: 15px 20px 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #777;
    font-family: 'Lato', sans-serif;
    letter-spacing: 1px;
    font-weight: bold;
}

/* =========================================
   3. CSS LOGO (Sun & Question Mark)
   ========================================= */
.logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto; /* Centers horizontally */
}

.sun-body {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #ffaa4d 0%, #FF9933 100%);
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(255, 153, 51, 0.5);
}

.question-mark {
    font-family: 'Merriweather', serif;
    font-weight: bold;
    color: var(--maroon);
    font-size: 32px;
    margin-top: 2px;
}

/* Rays Common Style */
.ray {
    position: absolute;
    background-color: var(--saffron);
    width: 6px;
    height: 12px;
    border-radius: 4px;
    z-index: 1;
    left: 37px;
    top: 34px;
    transform-origin: center;
}

/* Ray Rotation */
.ray-1 { transform: rotate(0deg) translateY(-36px); }
.ray-2 { transform: rotate(45deg) translateY(-36px); }
.ray-3 { transform: rotate(90deg) translateY(-36px); }
.ray-4 { transform: rotate(135deg) translateY(-36px); }
.ray-5 { transform: rotate(180deg) translateY(-36px); }
.ray-6 { transform: rotate(225deg) translateY(-36px); }
.ray-7 { transform: rotate(270deg) translateY(-36px); }
.ray-8 { transform: rotate(315deg) translateY(-36px); }

/* =========================================
   4. MAIN CONTENT LAYOUT
   ========================================= */
.main-content {
    margin-left: 240px; /* Matches sidebar width */
    flex: 1;
    padding: 30px;
}

.page-title {
    color: var(--maroon);
    border-bottom: 2px solid var(--saffron);
    padding-bottom: 5px;
    margin-bottom: 20px;
    font-size: 1.6rem;
    font-weight: bold;
}

/* Product Description Box (Thin Rectangle) */
.product-desc-box {
    background-color: var(--light-gold);
    border: 1px solid #e0d0b0;
    border-left: 5px solid var(--maroon);
    color: #555;
    padding: 12px 20px;
    margin-bottom: 25px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    border-radius: 3px;
    max-width: 850px;
    display: flex;
    align-items: center;
}

.product-desc-box strong {
    color: var(--maroon);
    margin-right: 8px;
}

/* =========================================
   5. FORM STYLES (Compact)
   ========================================= */
.card, .content-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--saffron);
    padding: 25px 30px;
    max-width: 850px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* Compact Grid System */
.compact-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.compact-row.two-col {
    grid-template-columns: 1fr 1fr;
}

/* Section Dividers in Form */
.section-hdr {
    font-family: 'Lato', sans-serif;
    color: var(--maroon);
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 1px solid #eee;
    margin: 20px 0 10px 0;
    padding-bottom: 4px;
}

/* Inputs */
label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    color: #666;
    font-family: 'Lato', sans-serif;
    margin-bottom: 3px;
}

input, select, textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    background: #fdfdfd;
    box-sizing: border-box;
    transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--saffron);
    outline: none;
    background: #fff;
}

/* Buttons */
button {
    background-color: var(--saffron);
    color: var(--maroon);
    font-weight: bold;
    border: none;
    padding: 12px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 1rem;
    width: 100%;
    border-radius: 3px;
    transition: background 0.3s;
}

button:hover {
    background-color: #ffaa4d;
}

/* Terms Checkbox Area */
.terms {
    font-size: 0.8rem;
    margin-top: 15px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms a {
    color: var(--maroon);
    text-decoration: underline;
    cursor: pointer;
}

/* =========================================
   6. ARTICLE & GRID STYLES
   ========================================= */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.article-card {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 5px solid var(--maroon);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left-color: var(--saffron);
}

.article-title {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--maroon);
    margin: 0 0 10px 0;
}

.article-title a { text-decoration: none; color: inherit; }
.article-title a:hover { text-decoration: underline; }

.article-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    color: #fff;
    background-color: var(--sidebar-bg);
    padding: 6px 12px;
    border-radius: 3px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    align-self: flex-start;
}
.read-more:hover { background-color: var(--maroon); }

.tag-new {
    background-color: var(--saffron);
    color: white;
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: 2px;
    vertical-align: middle;
    margin-left: 5px;
    text-transform: uppercase;
}

/* Flush Right Image (For Articles) */
.flush-right-img {
    float: right;
    margin-left: 30px;
    margin-bottom: 20px;
    width: 300px;
    border: 4px solid var(--saffron);
    padding: 5px;
    background: white;
}

.astro-data {
    font-family: 'Roboto Mono', monospace;
    white-space: pre-wrap;
    font-size: 0.8rem;
    color: #222;
    background-color: #f9f9f9;
    padding: 15px;
    border-left: 3px solid #ccc;
    overflow-x: auto;
    margin-top: 20px;
}

.back-link {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    margin-bottom: 20px;
    display: inline-block;
}
.back-link:hover { color: var(--maroon); }

/* =========================================
   7. MODAL (POPUP) STYLES
   ========================================= */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Black overlay */
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-top: 6px solid var(--maroon);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover { color: #000; }

.modal-h2 {
    color: var(--maroon);
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-top: 0;
}

.modal-h3 {
    color: #333;
    margin-top: 25px;
    border-bottom: 1px dotted #ccc;
    font-size: 1.1rem;
}

/* =========================================
   8. PROFILE / ABOUT STYLES
   ========================================= */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
}

.profile-title {
    font-size: 0.95rem;
    color: #666;
    font-family: 'Lato', sans-serif;
}

.highlight {
    color: var(--maroon);
    font-weight: bold;
}

/* =========================================
   9. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 4px solid var(--saffron);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .compact-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .compact-row.two-col {
        grid-template-columns: 1fr;
    }

    .flush-right-img {
        float: none;
        width: 100%;
        margin-left: 0;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }
}