/*
Theme Name: Tukisaatio Modern
Theme URI: http://www.tukisaatio.fi/
Author: EE Turunen
Description: Sophisticated theme for Salaojituksen Tukisäätiö with earthy color palette and modern typography.
Version: 2.0.0
Text Domain: tukisaatio-modern
*/

/* ==========================================================================
   1. Reset & CSS Variables
   ========================================================================== */

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

:root {
    --color-primary: #1a3a5c;
    --color-primary-light: #2d5a87;
    --color-secondary: #8b7355;
    --color-accent: #c4a574;
    --color-bg: #faf9f7;
    --color-bg-alt: #f0efe9;
    --color-text: #1a1a1a;
    --color-text-light: #5a5a5a;
    --color-white: #ffffff;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

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

/* ==========================================================================
   2. Base Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--color-primary);
    transition: color 0.3s;
}

a:hover {
    color: var(--color-primary-light);
}

/* ==========================================================================
   3. Utility Classes
   ========================================================================== */

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

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--color-white);
    color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-accent);
    color: var(--color-white);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* ==========================================================================
   4. Navigation — Desktop
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 5%;
    transition: all 0.4s ease;
}

.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

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

/* Always white nav */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.08);
}

.site-header .logo a,
.site-header .logo span {
    color: var(--color-primary);
}

.site-header .nav-links > li > a {
    color: var(--color-text);
}

.site-header .nav-cta {
    background: var(--color-primary);
    color: var(--color-white) !important;
}

.site-header .mobile-toggle span {
    background: var(--color-text);
}

/* Logo */
.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.3s;
}

.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Logo swap: always blue (white bg) */
.logo .logo-white {
    display: none;
}

.logo span {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    transition: color 0.3s;
}

/* Main navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: all 0.3s;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-links > li > a:hover::after,
.nav-links > li.current-menu-item > a::after {
    width: 100%;
}

/* CTA nav button */
.nav-cta {
    padding: 0.75rem 1.5rem !important;
    background: var(--color-white);
    color: var(--color-primary) !important;
    border-radius: 2px;
    font-weight: 500 !important;
}

.nav-cta::after {
    display: none !important;
}

/* Desktop dropdown */
.nav-links > li > .dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--color-white);
    border-radius: 4px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
    padding: 0.75rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

.nav-links > li > .dropdown::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 0;
    right: 0;
    height: 0.75rem;
}

.nav-links > li:hover > .dropdown {
    opacity: 1;
    visibility: visible;
}

.nav-links > li > .dropdown li a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-links > li > .dropdown li a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

/* Language selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 1rem;
}

.language-selector a {
    text-decoration: none;
    transition: color 0.3s;
    padding: 0.15rem 0.3rem;
}

.language-selector a.active {
    font-weight: 600;
}

.language-selector .separator {
    opacity: 0.4;
    font-size: 0.75rem;
}

/* ==========================================================================
   5. Navigation — Mobile
   ========================================================================== */

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 0.5rem;
}

.mobile-toggle span {
    width: 25px;
    height: 2px;
    background: var(--color-text);
    transition: all 0.3s;
    display: block;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

body.menu-open .mobile-menu-overlay {
    display: block;
    opacity: 1;
}

/* Mobile menu panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: var(--color-white);
    z-index: 1002;
    transition: right 0.35s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.menu-open .mobile-menu {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-bg-alt);
}

.mobile-menu-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.mobile-menu-logo img {
    max-height: 40px;
    width: auto;
}

.mobile-menu-logo span {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    border-radius: 50%;
    transition: background 0.2s;
}

.mobile-menu-close:hover {
    background: var(--color-bg);
}

.mobile-menu-content {
    padding: 1rem 0;
}

.mobile-menu-list {
    list-style: none;
}

.mobile-menu-list > li {
    border-bottom: 1px solid var(--color-bg-alt);
}

.mobile-menu-list > li > a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: background 0.2s;
}

.mobile-menu-list > li > a:hover {
    background: var(--color-bg);
}

/* Mobile submenu toggle */
.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.submenu-toggle:hover {
    background: var(--color-bg);
}

.submenu-toggle .submenu-icon {
    transition: transform 0.3s;
    flex-shrink: 0;
}

.submenu-toggle[aria-expanded="true"] .submenu-icon {
    transform: rotate(180deg);
}

/* Mobile submenu */
.mobile-menu-list .submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--color-bg);
}

.submenu-toggle[aria-expanded="true"] + .submenu {
    max-height: 500px;
}

.mobile-menu-list .submenu li a {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem;
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.mobile-menu-list .submenu li a:hover {
    color: var(--color-primary);
}

/* Mobile language selector */
.mobile-language-selector {
    padding: 1.5rem;
    border-top: 1px solid var(--color-bg-alt);
    margin-top: 1rem;
}

.mobile-language-selector .language-selector {
    margin-left: 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   6. Hero Section (Front Page)
   ========================================================================== */

.hero {
    height: 70vh;
    min-height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 58, 92, 0.85) 0%, rgba(26, 58, 92, 0.6) 50%, rgba(139, 115, 85, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
}

.hero-tagline {
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 500;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.hero-content > p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-white);
    opacity: 0.7;
    animation: bounce 2s infinite;
    z-index: 2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ==========================================================================
   7. Section Shared Styles
   ========================================================================== */

.front-page section {
    padding: 8rem 5%;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 5rem;
}

.section-label {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.section-desc {
    color: var(--color-text-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ==========================================================================
   8. About Section
   ========================================================================== */

.about {
    background: var(--color-white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    border-radius: 4px;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 2rem;
    left: -2rem;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    z-index: -1;
}

.about-content h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.about-content p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--color-bg-alt);
}

.stat h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-primary);
    font-weight: 500;
}

.stat p {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* ==========================================================================
   9. Research Areas Section
   ========================================================================== */

.research {
    background: var(--color-bg);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.research-card {
    background: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.research-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.research-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.research-card:hover img {
    transform: scale(1.05);
}

.research-card-content {
    padding: 2rem;
}

.research-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.research-card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ==========================================================================
   10. Impact Section
   ========================================================================== */

.impact {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    text-align: center;
}

.impact .section-label {
    color: var(--color-accent);
}

.impact .section-title {
    color: var(--color-white);
}

.impact .section-desc {
    color: rgba(255, 255, 255, 0.85);
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.impact-item h3 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.impact-item p {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 300;
}

/* ==========================================================================
   11. Projects Section
   ========================================================================== */

.projects {
    background: var(--color-white);
}

.projects-showcase {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-main {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    height: 500px;
}

.project-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-main:hover img {
    transform: scale(1.03);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--color-white);
}

.project-overlay h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.project-overlay p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.project-side {
    display: grid;
    gap: 2rem;
}

.project-small {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    height: calc(250px - 1rem);
}

.project-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-small:hover img {
    transform: scale(1.05);
}

.project-small .project-overlay {
    padding: 1.5rem;
}

.project-small h3 {
    font-size: 1.2rem;
}

.project-main a,
.project-small a {
    display: block;
    height: 100%;
    position: relative;
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   12. Blog Grid Section
   ========================================================================== */

.blog-section {
    background: var(--color-bg);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.blog-article-grid {
    background: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.blog-article-grid:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.blog-article-thumb {
    display: block;
    overflow: hidden;
}

.blog-thumb-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.blog-article-grid:hover .blog-thumb-img {
    transform: scale(1.05);
}

.blog-article-info {
    padding: 1.5rem;
}

.blog-article-info h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.blog-article-info h3 a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s;
}

.blog-article-info h3 a:hover {
    color: var(--color-primary);
}

.blog-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.meta-item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.show-more-btn {
    display: block;
    margin: 3rem auto 0;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.show-more-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================================================
   13. History Section
   ========================================================================== */

.history {
    background: var(--color-bg-alt);
}

.history-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.history-content > p {
    color: var(--color-text-light);
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 1.5rem;
}

.history-timeline {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.timeline-item {
    text-align: center;
}

.timeline-item h3 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-primary);
    font-weight: 500;
}

.timeline-item p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* ==========================================================================
   14. Partners Section
   ========================================================================== */

.partners {
    background: var(--color-white);
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: center;
}

.partner-item {
    text-align: center;
    padding: 2rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.partner-item:hover {
    opacity: 1;
}

.partner-item a {
    text-decoration: none;
    color: inherit;
}

.partner-item img {
    max-width: 150px;
    height: auto;
    filter: grayscale(100%);
    transition: filter 0.3s;
    margin: 0 auto;
}

.partner-item:hover img {
    filter: grayscale(0%);
}

.partner-item p {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-weight: 500;
}

/* ==========================================================================
   15. CTA Section
   ========================================================================== */

.cta {
    position: relative;
    padding: 10rem 5%;
    text-align: center;
    overflow: hidden;
}

.cta-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(26, 58, 92, 0.9), rgba(26, 58, 92, 0.85));
    background-size: cover;
    background-position: center;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-white);
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.cta .btn-primary {
    background: var(--color-accent);
    color: var(--color-white);
    padding: 1.25rem 3rem;
    font-size: 1rem;
}

.cta .btn-primary:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

/* ==========================================================================
   16. Page Header (Inner Pages)
   ========================================================================== */

.page-header {
    padding: 10rem 5% 5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: var(--color-white);
    text-align: center;
}

.page-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: var(--color-white);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--color-white);
}

.page-header p:not(.breadcrumb) {
    font-size: 1.15rem;
    opacity: 0.9;
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

.page-header .article-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Featured image below header */
.page-featured-image,
.article-featured-image {
    max-width: 1000px;
    margin: -3rem auto 0;
    padding: 0 5%;
    position: relative;
    z-index: 1;
}

.page-featured-image img,
.article-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   17. Content Styling
   ========================================================================== */

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 5%;
}

.main-content-1000 {
    max-width: 1000px;
}

.entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-text-light);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    color: var(--color-text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content h2 { font-size: 2rem; }
.entry-content h3 { font-size: 1.5rem; }
.entry-content h4 { font-size: 1.2rem; }

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-underline-offset: 3px;
}

.entry-content a:hover {
    color: var(--color-primary-light);
}

.entry-content img {
    border-radius: 4px;
    margin: 2rem 0;
}

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

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: var(--color-bg);
    border-radius: 0 4px 4px 0;
    font-style: italic;
    color: var(--color-text);
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content pre,
.entry-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
}

.entry-content pre {
    background: var(--color-text);
    color: var(--color-bg);
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 2rem 0;
}

.entry-content code {
    background: var(--color-bg-alt);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

/* Tables */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.entry-content th {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.entry-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-bg-alt);
}

.entry-content tr:hover td {
    background: var(--color-bg);
}

/* WordPress blocks */
.entry-content .wp-block-image {
    margin: 2rem 0;
}

.entry-content .wp-block-image img {
    margin: 0;
}

.entry-content .wp-block-gallery {
    margin: 2rem 0;
}

.entry-content .wp-block-button .wp-block-button__link {
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: 2px;
    background-color: var(--color-primary);
    color: var(--color-white);
}

.entry-content .wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.entry-content .alignwide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% + 10%);
    margin-left: -5%;
}

.entry-content .alignfull {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* ==========================================================================
   18. Archive & Index Styles
   ========================================================================== */

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 5%;
}

/* ==========================================================================
   19. 404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 6rem 5%;
}

.error-404 h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ==========================================================================
   20. Footer
   ========================================================================== */

.site-footer {
    background: var(--color-text);
    color: var(--color-white);
    padding: 5rem 5% 2rem;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto 4rem;
}

.footer-brand {
    flex: 2 1 250px;
}

.footer-col {
    flex: 1 1 150px;
}

.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.footer-col h4 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: var(--color-white);
}

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

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1400px;
    margin: 0 auto;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* ==========================================================================
   21. Responsive — 1024px (Tablet)
   ========================================================================== */

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        order: -1;
    }

    .about-image::before {
        display: none;
    }

    .about-image img {
        height: 400px;
    }

    .research-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .impact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand {
        flex-basis: 100%;
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   22. Responsive — 768px (Mobile)
   ========================================================================== */

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
    }

    .front-page section {
        padding: 5rem 5%;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .hero {
        min-height: 600px;
    }

    .research-grid,
    .projects-showcase {
        grid-template-columns: 1fr;
    }

    .project-main,
    .project-small {
        height: 300px;
    }

    .impact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

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

    .partners-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-grid {
        flex-direction: column;
        gap: 2rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .history-timeline {
        gap: 2rem;
    }

    .page-header {
        padding: 8rem 5% 4rem;
    }

    .page-featured-image,
    .article-featured-image {
        margin-top: -2rem;
    }

    .main-content {
        padding: 3rem 5%;
    }

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

/* ==========================================================================
   23. Responsive — 480px (Small Mobile)
   ========================================================================== */

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-content > p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

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

    .impact-item h3 {
        font-size: 2.5rem;
    }

    .about-content h2 {
        font-size: 2rem;
    }

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

    .cta {
        padding: 6rem 5%;
    }

    .page-header {
        padding: 7rem 5% 3rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}
