:root {
    --bg: #FFFFFF;
    --text: #000080; /* Navy Blue */
    --text-light: #FFFFFF;
    --accent: #C5B358; /* Muted Gold */
    --secondary: #708090; /* Slate Grey */
    --primary: #000080; /* Navy Blue */
    
    /* Typography */
    --font-display: 'Montserrat', sans-serif;
    --font-body: 'Merriweather', serif;
    
    /* Spacing */
    --spacing-section: 120px;
    --spacing-element: 40px;
}

html {
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Skip to Content (Accessibility) */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 12px 24px;
    background-color: var(--accent);
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skip-to-content:focus {
    left: 0;
}

/* Focus Styles (Accessibility) */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Links Global */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* HERO SECTION */
header {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--primary);
    color: var(--text-light);
    padding: 20px;
    position: relative;
}

.header-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
    opacity: 0;
    animation: heroFadeIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-label {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 600;
}

.name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.02em;
    overflow-wrap: break-word; /* Prevent overflow of long words */
}

.title {
    font-family: var(--font-body);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0;
}

.hero-divider {
    width: 2px;
    height: 60px;
    background-color: var(--accent);
    margin: 30px auto;
}

.hero-nav .links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero-nav .links a {
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 2px;
    position: relative;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.hero-nav .links a:hover {
    border-color: var(--accent);
    background-color: rgba(197, 179, 88, 0.1);
    color: var(--accent);
}

.hero-nav .links a.nav-active {
    border-color: var(--accent);
    color: var(--accent);
}

/* Blog Header Variant */
.header-blog {
    min-height: 50vh;
    height: auto;
    padding: 120px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--primary);
    color: var(--text-light);
    position: relative;
}

.name--post {
    font-size: clamp(1.8rem, 5vw, 4rem);
    line-height: 1.2;
    margin-bottom: 20px;
}

/* Blog Tag Variants */
.tag-list--inline {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
}

.tag-meta {
    font-weight: 600;
    color: var(--accent);
}

/* MAIN LAYOUT */
.scroll-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    background-color: var(--bg);
}

section {
    padding: var(--spacing-section) 0;
    border-top: 1px solid rgba(112, 128, 144, 0.15);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
}

/* Section Labels (Left Column) */
.section-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: sticky;
    top: 40px;
    height: fit-content;
    text-align: right;
}

/* Section Content (Right Column) */
.section-content {
    min-width: 0; /* Essential for grid items to shrink below content size */
}

.section-content h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin: 0 0 40px 0;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.text-block p {
    font-size: 1.25rem;
    max-width: 800px;
    color: var(--text);
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.skill-category-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--secondary);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(112, 128, 144, 0.2);
    padding-bottom: 10px;
}

.tag-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    font-family: var(--font-display);
    font-size: 0.9rem;
    padding: 8px 16px;
    background-color: rgba(112, 128, 144, 0.05);
    color: var(--primary);
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tag:hover {
    background-color: var(--primary);
    color: var(--text-light);
    transform: translateY(-2px);
}

/* Experience / Timeline */
.timeline {
    border-left: 1px solid rgba(112, 128, 144, 0.2);
    padding-left: 40px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 80px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -45px; /* aligns with border */
    top: 8px;
    width: 9px;
    height: 9px;
    background-color: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.duration {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.company {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.timeline-right h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    color: var(--text);
    font-weight: 500;
}

.timeline-right ul {
    padding-left: 20px;
    color: var(--secondary);
}

.timeline-right li {
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* Grid 2 Col */
.grid-2-col {
    display: block; /* Sections stack inside, layout handled by section grid */
}

/* Minimal Lists (Languages, Certs) */
.minimal-list {
    list-style: none;
    padding: 0;
}

.minimal-list li {
    font-family: var(--font-display);
    font-size: 1.2rem;
    padding: 20px 0;
    border-bottom: 1px solid rgba(112, 128, 144, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.minimal-list li::before {
    content: '→';
    margin-right: 20px;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.minimal-list li:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Education */
.education-list {
    list-style: none;
    padding: 0;
}

.education-list li {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 40px;
    padding: 30px 0;
    border-bottom: 1px solid rgba(112, 128, 144, 0.15);
}

.year {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
}

.edu-details strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.edu-details span {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--secondary);
}

/* BLOG STYLES */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.blog-post-preview {
    display: block;
    text-decoration: none;
    padding-bottom: 60px;
    border-bottom: 1px solid rgba(112, 128, 144, 0.15);
}

.blog-post-preview:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-post-preview h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 10px 0 20px 0;
    transition: color 0.2s;
}

.blog-post-preview:hover h3 {
    color: var(--accent);
}

.post-meta {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-meta__byline {
    display: flex;
    align-items: center;
    gap: 20px;
    white-space: nowrap;
}

.tag-list--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.tag-chip {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 10px;
    border: 1px solid rgba(197, 179, 88, 0.4);
    white-space: nowrap;
}

.reading-time {
    font-weight: 500;
}

.post-excerpt {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.read-more {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
    transition: all 0.2s;
}

.read-more:hover {
    color: var(--accent);
}

/* Post Single */
.post-content {
    max-width: 800px; /* Enforce measure for readability */
    min-width: 0; /* Prevent flex/grid item overflow */
    width: 100%; /* Ensure it fills available space but no more */
}

.post-header {
    margin-bottom: 60px;
    border-bottom: 1px solid rgba(112, 128, 144, 0.2);
    padding-bottom: 40px;
}

.post-title {
    font-size: 3rem;
    line-height: 1.2;
}

.post-body {
    font-family: var(--font-body);
    font-size: 1.2rem;
    line-height: 1.9;
    color: #2c3e50; /* Darker for body text reading */
    overflow-wrap: break-word; /* Essential for long URLs/words */
    word-break: break-word;
}

.post-body h2 {
    margin-top: 60px;
    color: var(--primary);
}

.post-body p {
    margin-bottom: 25px;
}

.post-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--secondary);
    background: rgba(197, 179, 88, 0.1); /* Muted Gold transparent */
    padding: 20px;
    border-radius: 0 4px 4px 0;
}

/* Subtle "aside" callouts for footnote-like context */
.post-body blockquote.aside {
    border-left-color: rgba(112, 128, 144, 0.45);
    background: transparent;
    font-style: normal;
    font-size: 0.95em;
    padding: 12px 16px;
    margin: 16px 0 24px 0;
}

.post-body blockquote.aside p {
    margin: 0 0 10px 0;
}

.post-body blockquote.aside p:last-child {
    margin-bottom: 0;
}

.post-body code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f4f6f8;
    padding: 3px 6px;
    border-radius: 3px;
    color: var(--primary);
    font-size: 0.9em;
    overflow-wrap: break-word;
}

.post-body pre {
    background-color: #1a1a1a;
    color: #f0f0f0;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
    white-space: pre; /* Keep pre formatting but allow scroll */
    word-break: normal;
}

/* Tables */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 1rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.post-body th,
.post-body td {
    padding: 12px 15px;
    border: 1px solid rgba(112, 128, 144, 0.2);
    text-align: left;
}

.post-body th {
    background-color: rgba(112, 128, 144, 0.05);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--primary);
}

.post-body tr:nth-child(even) {
    background-color: rgba(112, 128, 144, 0.02);
}

/* Custom Table Helpers */
.no-wrap-col-1 td:nth-child(1),
.no-wrap-col-1 th:nth-child(1) {
    white-space: nowrap;
}

.no-wrap-col-2 td:nth-child(2),
.no-wrap-col-2 th:nth-child(2) {
    white-space: nowrap;
}

/* RELATED ARTICLES */
.related-articles {
    padding: var(--spacing-section) 0;
    border-top: 1px solid rgba(112, 128, 144, 0.15);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
}

.related-articles .section-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 40px 0;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.related-article-card {
    display: flex;
    flex-direction: column;
    padding: 30px;
    background-color: rgba(112, 128, 144, 0.03);
    border: 1px solid rgba(112, 128, 144, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
}

.related-article-card:hover {
    background-color: rgba(112, 128, 144, 0.06);
    border-color: var(--accent);
    transform: translateY(-4px);
    color: inherit;
}

.related-article-date {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.related-article-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 15px 0;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.related-article-card:hover .related-article-title {
    color: var(--accent);
}

.related-article-description {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--secondary);
    line-height: 1.6;
    margin: 0 0 20px 0;
    flex-grow: 1;
}

.related-article-card .read-more {
    align-self: flex-start;
}

/* SITE FOOTER */
.site-footer {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 60px 40px;
    margin-top: var(--spacing-section);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-nav {
    display: flex;
    gap: 30px;
}

.footer-nav a {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--accent);
}

.footer-copyright {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    letter-spacing: 1px;
}

/* ANIMATIONS */
@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    section {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 80px 0;
    }
    
    .section-label {
        position: static;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--accent);
        display: inline-block;
        padding-bottom: 5px;
        text-align: left;
    }
    
    .section-content h2 {
        font-size: 2rem;
    }

    .timeline {
        border-left: none;
        padding-left: 0;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-top: 20px;
        border-top: 2px solid var(--accent);
    }

    .timeline-item::before {
        display: none;
    }
    
    .education-list li {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .related-articles {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 80px 0;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .name {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .scroll-container {
        padding: 0 20px;
    }
    
    .hero-nav .links {
        flex-direction: column;
        gap: 20px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .post-title {
        font-size: 2rem;
    }

    .posts-container {
        gap: 40px;
    }

    .blog-post-preview {
        padding-bottom: 30px;
    }

    .minimal-list li {
        font-size: 1rem;
    }
    
    .related-articles {
        padding: 60px 0;
    }
    
    .related-article-card {
        padding: 20px;
    }
    
    .related-article-title {
        font-size: 1.1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    header {
        min-height: auto;
        padding: 40px 20px;
        background-color: #fff;
        color: var(--primary);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .hero-divider,
    .hero-nav,
    .skip-to-content,
    .site-footer {
        display: none;
    }

    .name {
        font-size: 2.5rem;
        color: var(--primary);
    }

    .title {
        color: var(--secondary);
    }

    .scroll-container {
        padding: 0;
    }

    section {
        padding: 30px 0;
        page-break-inside: avoid;
    }

    .tag:hover {
        background-color: rgba(112, 128, 144, 0.05);
        color: var(--primary);
        transform: none;
    }

    a::after {
        content: none !important;
    }
}
