/* Base typography and colors */
:root {
    /* Light Theme (Default) */
    --text-color: #1a1a1a;
    --heading-color: #0B1120;
    --accent-color: #F9A825;
    --link-color: #2563eb;
    --link-hover-color: var(--accent-color);
    --bg-color: #F8FAFC;
    --card-bg: #ffffff;
    --border-color: #eaeaea;
    --content-width: 900px;
    
    /* Fonts */
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --transition: all 0.3s ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-color: #e2e8f0;
    --heading-color: #ffffff;
    --link-color: #60a5fa;
    --link-hover-color: var(--accent-color);
    --bg-color: #0B1120;
    --card-bg: #111827;
    --border-color: #1e293b;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--heading-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }

a {
    color: var(--link-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--link-hover-color);
}

p {
    margin-bottom: 1.5rem;
    font-weight: 300;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    font-weight: 300;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 3rem 0;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
}

/* Layout Wrappers */
.wrapper {
    max-width: var(--content-width); /* 900px for reading content */
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header-wrapper {
    max-width: 1200px; /* Wider for laptop header */
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.site-header {
    background-color: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.5rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-header {
    background-color: rgba(11, 17, 32, 0.85);
}

/* Navigation (Left) */
.site-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-wrap: wrap;
    margin-right: auto; /* Pushes everything else to the right */
    padding-left: 1rem; /* Center-left positioning */
}

.site-nav a {
    color: var(--text-color);
    opacity: 0.6;
    transition: var(--transition);
    position: relative;
    padding-bottom: 0.25rem;
}

.site-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.site-nav a:hover {
    color: var(--heading-color);
    opacity: 1;
}

.site-nav a:hover::after {
    width: 100%;
}

/* Site Title */
.site-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--heading-color);
    letter-spacing: 0.02em;
    white-space: nowrap;
    margin-right: 1.5rem; /* Space between title and toggle */
}

.site-title:hover {
    color: var(--heading-color);
}

/* Actions */
.header-actions {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--border-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Main Content */
.page-content {
    padding: 4rem 0;
    min-height: calc(100vh - 180px);
}

/* Featured Cards */
.featured-card {
    background: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent-color);
}

.featured-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 0 20px rgba(249, 168, 37, 0.2);
    transform: translateY(-5px);
    border-color: var(--heading-color);
}

.featured-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--heading-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.featured-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Suave Cards */
.suave-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.suave-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 0 15px rgba(249, 168, 37, 0.15);
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.suave-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.suave-card p:last-child {
    margin-bottom: 0;
}

/* Suave List (for markdown lists) */
.suave-list {
    list-style-type: none;
    padding-left: 0;
}

.suave-list li {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    font-weight: 300;
}

.suave-list li:hover {
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 0 15px rgba(249, 168, 37, 0.15);
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.pagination-controls button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-controls button:hover:not(:disabled) {
    border-color: var(--heading-color);
    color: var(--heading-color);
}

.pagination-controls button.active {
    background-color: var(--heading-color);
    color: var(--bg-color);
    border-color: var(--heading-color);
}

.pagination-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-color);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--heading-color);
    margin: 6px 0;
    transition: 0.4s;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Homepage Layouts */
.hero-section {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 4rem;
}

.hero-image {
    flex: 0 0 35%;
}

.hero-image img {
    border-radius: 1.25rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    object-fit: cover;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    margin-top: 0;
    font-size: 3.5rem;
}

.hero-text p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.nav-grid-link {
    text-decoration: none !important;
}

.nav-grid .suave-card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.nav-grid .suave-card h3 {
    margin-bottom: 0.5rem;
    color: var(--heading-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-grid .suave-card p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Topic Tags */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.5rem 0 3rem 0;
}

.topic-tag {
    background-color: transparent;
    color: var(--heading-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.topic-tag:hover {
    background-color: var(--heading-color);
    color: var(--bg-color);
    border-color: var(--heading-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Media Queries */
@media (max-width: 1000px) {
    .header-wrapper {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    
    .menu-toggle {
        display: block;
        justify-self: start;
    }

    .site-title {
        justify-self: center;
        font-size: 1.8rem;
        margin-right: 0;
    }

    .header-actions {
        justify-self: end;
    }

    .site-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        flex-direction: column;
        gap: 1.5rem;
        padding-top: 1.5rem;
        padding-bottom: 1rem;
        text-align: center;
        margin-right: 0;
        padding-left: 0;
    }

    .site-nav.active {
        display: flex;
    }

    .hero-section {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .hero-image {
        max-width: 250px;
        margin: 0 auto;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }
}

/* Utilities */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }
