/* CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette */
    --primary-color: #2c3e50;
    --secondary-color: #c0392b;
    --accent-color: #e67e22;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --background-light: #ffffff;
    --background-section: #f8f9fa;
    --border-color: #ecf0f1;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.15);
    
    /* Dark mode colors */
    --bg-dark: #1a1a1a;
    --text-dark: #e8e8e8;
    --text-secondary-dark: #b0b0b0;
    --border-dark: #333;
    --section-dark: #242424;
    
    /* Typography */
    --font-heading: 'Crimson Text', serif;
    --font-body: 'Inter', sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Breakpoints */
    --bp-sm: 576px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
}

[data-theme="dark"] {
    --background-light: var(--bg-dark);
    --background-section: var(--section-dark);
    --text-primary: var(--text-dark);
    --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-dark);
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--background-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Header & Navigation */
header {
    background: var(--background-light);
    box-shadow: var(--shadow-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link:focus {
    background: var(--background-section);
    color: var(--secondary-color);
    outline: 2px solid transparent;
}

.nav-link.active {
    color: var(--secondary-color);
    background: var(--background-section);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover, .theme-toggle:focus {
    border-color: var(--secondary-color);
    outline: 2px solid transparent;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Main Content */
main {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xxl) 0;
}

.section:nth-child(even) {
    background: var(--background-section);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
    background: linear-gradient(135deg, var(--background-light) 0%, var(--background-section) 100%);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.cta-button:hover, .cta-button:focus {
    background: #a93226;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    outline: 2px solid transparent;
}

/* Poetry Grid */
.poetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.poem-card {
    background: var(--background-light);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.poem-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.poem-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.poem-excerpt {
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover, .read-more:focus {
    color: #a93226;
    text-decoration: underline;
}

/* Search Bar */
.search-container {
    margin-bottom: var(--spacing-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--background-light);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.search-bar:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.search-bar::placeholder {
    color: var(--text-secondary);
}

/* Biography Section */
.bio-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.bio-image {
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    width: 100%;
    height: auto;
}

.bio-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.bio-text p {
    margin-bottom: var(--spacing-md);
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.news-item {
    background: var(--background-light);
    border-radius: 8px;
    padding: var(--spacing-lg);
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateX(4px);
}

.news-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

.news-title {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
    font-family: var(--font-heading);
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    list-style: none;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover, .footer-links a:focus {
    color: white;
}

.copyright {
    border-top: 1px solid #34495e;
    padding-top: var(--spacing-md);
    color: #bdc3c7;
}
.copyright>p>a{
    color: #c3c7ca;
    text-decoration: none;
    transition: color 0.3s ease;
    list-style: none;
}

.copyright>p>a:hover{
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--background-light);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-medium);
    }

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

    .mobile-menu-toggle {
        display: block;
    }

    .bio-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

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

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .poetry-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #333333;
        --background-light: #ffffff;
        --border-color: #666666;
    }
}

/* Hidden class for JavaScript */
.hidden {
    display: none !important;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}