/**
 * Main Stylesheet
 * Based on "Better Minute" design
 */

:root {
    --primary-gold: #D4AF37;
    --primary-gold-dark: #B8941F;
    --primary-gold-light: #F4E4BC;
    --text-dark: #2C2C2C;
    --text-light: #666666;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --border-color: #E5E5E5;
    --accent-red: #DC3545;
    --accent-green: #28A745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: #F8F6F3; /* Light beige/off-white background */
    line-height: 1.6;
}

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo */
.logo-section {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    color: var(--text-dark);
}

.logo-box {
    border: 1px solid var(--text-dark);
    padding: 8px 15px;
    display: inline-block;
}

.logo-main {
    display: block;
    font-family: 'Georgia', serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.logo-sub {
    display: block;
    font-family: 'Georgia', serif;
    font-size: 12px;
    font-style: italic;
    margin-top: -2px;
}

/* Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 0;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-gold);
}

.nav-item.active .nav-link {
    color: var(--primary-gold);
    border-bottom: 2px solid var(--primary-gold);
}

.nav-icon {
    font-size: 14px;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 3px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    list-style: none;
    min-width: 200px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    text-transform: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.btn-subscribe,
.btn-exclusive {
    background: var(--primary-gold);
    color: var(--bg-white);
    border: none;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 3px;
}

.btn-subscribe:hover,
.btn-exclusive:hover {
    background: var(--primary-gold-dark);
}

.btn-search,
.btn-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

.btn-menu {
    flex-direction: column;
    gap: 4px;
}

.btn-menu span {
    width: 20px;
    height: 2px;
    background: var(--text-dark);
    display: block;
}

/* Homepage Main */
.homepage-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 50px;
    border-left: 4px solid var(--primary-gold);
}

.welcome-message h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.last-visit {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 20px;
}

.continue-series-box,
.start-series-box {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--primary-gold-light);
    margin-top: 15px;
}

.continue-series-box h3,
.start-series-box h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.btn-continue,
.btn-start {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    background: var(--primary-gold);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-continue:hover,
.btn-start:hover {
    background: var(--primary-gold-dark);
}

/* Section Headers */
.section-header {
    margin-bottom: 30px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    font-size: 28px;
}

/* Articles Grid - 3 Columns */
.articles-grid.three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* Article Card */
.article-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 3:5 aspect ratio */
    overflow: hidden;
    background: var(--bg-light);
}

.article-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid var(--primary-gold);
    border-radius: 4px;
}

.article-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.article-card:hover .article-image-overlay {
    opacity: 1;
}

.article-content {
    padding: 20px;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    font-family: 'Georgia', serif;
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.article-category {
    text-transform: uppercase;
    font-weight: 600;
}

/* Quizzes Grid */
.quizzes-section {
    margin-bottom: 60px;
}

.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Series Grid */
.series-section {
    margin-bottom: 60px;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.series-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.series-card:hover {
    transform: translateY(-5px);
}

.series-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
}

.series-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
}

.series-progress-fill {
    height: 100%;
    background: var(--primary-gold);
    transition: width 0.3s;
}

.series-content {
    padding: 20px;
}

.series-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.series-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.series-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
}

/* Article Page */
.article-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #f9f4ed; /* Light beige/off-white background */
}

.article-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.article-content-wrapper {
    background: #F8F6F3; /* Match main background */
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Article Hero Section */
.article-hero {
    position: relative;
    padding: 40px;
    margin-left: 50px;
    margin-right: 50px;
    margin-bottom: 50px;
    background: linear-gradient(-21deg, #efd9c775 30%, white 30%, #efd9c7);
    border-color: #b19811;
    outline: 10px solid #896b10;
    outline-offset: -18px;
    outline-style: inset;
    background-color: white;
    outline: 3px solid #ffffff;
    outline-offset: -10px;
    border: 18px solid #916411 !important;
    border-image: url(/assets/images/border-texture.jpg) 30 !important;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Fallback for browsers that don't support border-image */
@supports not (border-image: url()) {
    .article-hero {
        border: 18px solid #916411 !important;
        background-image: 
            url(/assets/images/border-texture.jpg),
            linear-gradient(-21deg, #efd9c775 30%, white 30%, #efd9c7);
        background-size: 100% 100%, 100% 100%;
        background-position: center, center;
        background-repeat: no-repeat, no-repeat;
    }
}

.article-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #FFFFFF;
    pointer-events: none;
    z-index: -1;
}

.article-hero-content {
    position: relative;
    z-index: 1;
}

.article-hero-category {
    font-family: 'Sacramento', cursive;
    font-size: 1.3em;
    color: #2C2C2C;
    text-align: right;
    margin-bottom: 20px;
    font-weight: 400;
}

.article-hero-title {
    font-family: 'Marcellus+SC', serif;
    font-size: 3.5em;
    font-weight: 700;
    color: #2C2C2C;
    line-height: 1.2;
    margin-bottom: 15px;
    text-align: center;
}

.article-hero-subtitle {
    font-family: 'Marcellus+SC', serif;
    font-size: 1.8em;
    color: #D4AF37;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    width: 100%;
}

.article-hero-subtitle::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    opacity: 0.5;
}

.article-hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 0.9em;
    color: #666666;
}

.article-hero-author {
    font-weight: 600;
    color: #2C2C2C;
}

.article-hero-read-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-hero-read-time::before {
    content: '🕐';
    font-size: 1.1em;
}

/* Article Content Spacing */
.article-content-wrapper article,
.article-content-wrapper,
.article-body {
    background: #f9f4ed;
    padding: 0 60px 40px;
}

.article-content-wrapper p,
.article-body p {
    margin-bottom: 1.5em;
    line-height: 1.5;
    font-size: 1.05em;
}

.article-content-wrapper h1,
.article-content-wrapper h2,
.article-content-wrapper h3,
.article-content-wrapper h4,
.article-content-wrapper h5,
.article-content-wrapper h6,
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.article-content-wrapper h1,
.article-body h1 {
    font-size: 2.5em;
    margin-top: 0;
}

.article-content-wrapper h2,
.article-body h2 {
    font-size: 2em;
}

.article-content-wrapper h3,
.article-body h3 {
    font-size: 1.6em;
}

.article-content-wrapper h4,
.article-body h4 {
    font-size: 1.3em;
}

.article-content-wrapper ul,
.article-content-wrapper ol,
.article-body ul,
.article-body ol {
    margin-bottom: 1.5em;
    padding-left: 2em;
    line-height: 1.8;
}

.article-content-wrapper li,
.article-body li {
    /* margin-bottom: 0.8em; */
}

.article-content-wrapper img,
.article-body img {
    margin: 2em 0;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-content-wrapper blockquote,
.article-body blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    border-left: 4px solid #D4AF37;
    background: rgba(212, 175, 55, 0.05);
    font-style: italic;
}

.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Related Articles */
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-article-item {
    padding: 15px;
    background: var(--bg-light);
    border-radius: 5px;
    border-left: 3px solid var(--primary-gold);
    transition: transform 0.2s;
}

.related-article-item:hover {
    transform: translateX(5px);
}

.related-article-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
}

.related-article-item a:hover {
    color: var(--primary-gold);
}

/* Error Page */
.error-main {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.error-container {
    text-align: center;
    max-width: 600px;
}

.error-container h1 {
    font-size: 72px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.error-container p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.btn-home {
    display: inline-block;
    padding: 15px 30px;
    background: var(--primary-gold);
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-home:hover {
    background: var(--primary-gold-dark);
}

/* Footer */
.main-footer {
    background: var(--text-dark);
    color: var(--bg-white);
    padding: 40px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--bg-white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1200px) {
    .articles-grid.three-columns,
    .quizzes-grid,
    .series-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-container {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        order: -1;
    }
}

/* Responsive Hero Section */
@media (max-width: 768px) {
    .article-hero {
        padding: 30px 20px;
    }
    
    .article-hero-title {
        font-size: 2em;
    }
    
    .article-hero-subtitle {
        font-size: 1.3em;
    }
    
    .article-body {
        padding: 0 20px 40px;
        margin-top: 150px; /* Reduced for mobile */
    }
    
    .article-hero {
        margin-left: 20px;
        margin-right: 20px;
        margin-bottom: -150px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .articles-grid.three-columns,
    .quizzes-grid,
    .series-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

