/* CSS Variables - Color Palette & Typography */
:root {
    /* Colors - Inspired by Apple & Material Design */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F5F5F7;

    /* Text Colors */
    --color-text-primary: #1D1D1F;
    --color-text-secondary: #86868B;

    /* Accents */
    --color-accent: #0071E3;
    --color-accent-hover: #0077ED;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 96px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 18px;
    --line-height-base: 1.6;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
}

/* Link Styles */
a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Site Wrapper */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--color-text-primary);
}

/* Header & Navigation - Bootstrap Navbar Overrides */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1030;
}

.navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* Allow flex children to wrap so intro-section can drop to second row on mobile */
.navbar > .container,
.navbar > .container-fluid {
    flex-wrap: wrap;
    align-items: center;
}

.site-logo img {
    height: 100px;
    display: block;
}

/* Mobile: smaller logo, centered */
@media (max-width: 991.98px) {
    .site-logo img {
        height: 70px;
    }
    /* Center the logo: spacer takes same space as toggler on the left */
    .navbar-brand.site-logo {
        margin-left: auto;
        margin-right: auto;
    }
    /* Spacer mirrors toggler width to push logo to center */
    .navbar-mobile-spacer {
        width: 44px; /* approx toggler width */
        flex-shrink: 0;
    }
}

/* Navbar Links */
.navbar-nav .nav-link {
    font-size: 14px;
    color: var(--color-text-primary);
    font-weight: 500;
    opacity: 0.8;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: var(--color-accent);
    opacity: 1;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: var(--spacing-xs);
}

.dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

/* Intro Section (inside header navbar) */
.intro-section {
    /* Desktop: grow to fill space between logo and nav */
    flex: 1 1 auto;
    padding: 0 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-section-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.intro-title {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.intro-subtitle {
    display: block;
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Mobile: intro-section is full-width row below logo+hamburger, centered */
@media (max-width: 991.98px) {
    .intro-section {
        flex: 0 0 100%;
        width: 100%;
        padding: 0.6rem 1rem 0.5rem;
        order: 10; /* force below logo and toggler */
    }

    .intro-title {
        font-size: 1.8rem;
    }

    .intro-subtitle {
        font-size: 1.2rem;
        max-width: 100%;
    }
}

/* Hero Section */
.hero-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Footer */
.site-footer {
    background-color: var(--color-bg-secondary);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.site-footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Article Image Wrapper & Reading Time Badge */
.article-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.article-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-image-wrapper:hover .article-img {
    transform: scale(1.05);
}

/* Featured article (first/most recent) */
.article-img-featured {
    height: 300px;
}

@media (min-width: 992px) {
    .article-img-featured {
        height: 350px;
    }
}

.reading-time-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Article Cards */
.article-card,
.article-item {
    display: flex;
    flex-direction: column;
}

/* Utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Mobile Padding Adjustments */
@media (max-width: 575.98px) {
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Hamburger Menu Icon Color */
.navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2829, 29, 31, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
