/* ===============================
   ROOT VARIABLES: 60-30-10 Rule
   =============================== */
:root {
    --color-primary: #F8F9FA;
    /* 60% Dominant (backgrounds) */
    --color-secondary: #1B263B;
    /* 30% Structural/branding */
    --color-accent: #FF4D00;
    /* 10% Actions/CTAs */
    --color-accent-text: #C73D00;
    /* Darkened for WCAG AA text contrast on white (4.86:1) */

    --text-dark: #1A1A1A;
    --text-light: #FFFFFF;

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

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

body {
    background-color: var(--color-primary);
    color: var(--text-dark);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--color-secondary);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===============================
   HEADER / NAV
   =============================== */
header {
    background-color: var(--color-secondary);
    color: var(--text-light);
    padding: 1.5rem;
    text-align: center;
    border-bottom: 4px solid var(--color-accent);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

header .site-logo {
    height: 90px;
    width: 90px;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0 auto .5rem;
}

/* Desktop: single row, no wrap; narrow: scroll instead of wrap/overlap */
header nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    /* centered on large viewports */
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: nowrap;
    /* keep one line on wide screens */
    white-space: nowrap;
    /* keep each link on one line */
    overflow: visible;
    /* visible on wide screens */
}

header nav a {
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: .5rem 1rem;
    border-radius: 4px;
    border: 2px solid transparent;
    /* prevent jump on hover */
    transition: background-color .15s ease, border-color .15s ease;
    white-space: nowrap;
}

/* Current page (set via aria-current="page") */
nav a[aria-current="page"] {
    background-color: var(--color-accent);
    border: 2px solid var(--color-accent);
    border-radius: 4px;
}

/* Hover only where a real hover exists (prevents sticky hover on touch) */
@media (hover: hover) and (pointer: fine) {
    header nav a:hover {
        background-color: var(--color-accent);
        border: 2px solid var(--color-accent);
        border-radius: 4px;
    }
}

/* Tablet: allow nav wrapping */
@media (max-width: 900px) {
    header {
        min-height: unset;
        padding: 1rem;
    }

    header nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: .5rem;
        white-space: normal;
    }

    header nav a {
        padding: .4rem .75rem;
        font-size: .9rem;
    }
}

/* Mobile portrait: tighter and smaller logo */
@media (max-width: 480px) {
    header .site-logo {
        height: 60px;
        width: 60px;
    }

    header nav {
        gap: .35rem;
    }

    header nav a {
        padding: .35rem .6rem;
        font-size: .85rem;
    }
}

/* Focus outlines (keyboard a11y) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid #FFD4BF;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link (a11y) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: .5rem 1rem;
    background: #fff;
    color: #000;
    z-index: 1000;
    border-radius: 4px;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===============================
   FOOTER
   =============================== */
footer {
    background-color: var(--color-secondary);
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer,
footer p,
footer a {
    font-weight: 700;
}

footer a {
    color: var(--text-light);
    text-decoration: underline;
}

/* ===============================
   BUTTONS
   =============================== */
.btn-cta,
.btn-secondary,
.btn-explore {
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
}

.btn-cta {
    background-color: var(--color-accent);
    color: #fff;
    padding: .8rem 1.5rem;
}

.btn-cta:hover {
    background-color: #E63E00;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: #fff;
    padding: .8rem 1.5rem;
    margin-left: 1rem;
}

.btn-secondary:hover {
    background-color: #0D1929;
    transform: translateY(-2px);
}

.btn-explore {
    background-color: var(--color-accent);
    color: #fff;
    padding: .6rem 1.2rem;
    border-radius: 4px;
    font-size: .9rem;
    margin-top: 1rem;
}

.btn-explore:hover {
    background-color: #E63E00;
}

/* ===============================
   HERO SECTIONS (Unified)
   =============================== */
.hero-banner,
.community-hero,
.lean-hero,
.resources-hero {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #fff;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 2.5rem;
}

.hero-banner h2,
.resources-hero h1,
.community-hero h1,
.lean-hero h1 {
    color: #fff;
    margin: 0 0 .5rem 0;
}

.hero-banner p,
.resources-hero p,
.community-hero p,
.lean-hero p {
    color: #E0E0E0;
    margin: .25rem 0;
}

/* Individual backgrounds (relative to styles/main.css) */
.hero-banner {
    background-image:
        linear-gradient(rgba(27, 38, 59, .8), rgba(27, 38, 59, .8)),
        url('../images/lean-dev.webp');
}

.community-hero {
    background-image:
        linear-gradient(rgba(27, 38, 59, .8), rgba(27, 38, 59, .8)),
        url('../images/coding.webp');
    /* swap to a file you have if coding.webp is missing */
}

.lean-hero {
    background-image:
        linear-gradient(rgba(27, 38, 59, .8), rgba(27, 38, 59, .8)),
        url('../images/index.webp');
}

.resources-hero {
    background-image:
        linear-gradient(rgba(27, 38, 59, .8), rgba(27, 38, 59, .8)),
        url('../images/mozaic.webp');
}



.hero-subtext {
    color: #fff;
    font-size: 1rem !important;
    margin-top: 1rem !important;
}

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

.hero-buttons .btn-secondary {
    margin-left: 0;
}

/* ===============================
   FEATURES
   =============================== */
.features-section {
    margin-bottom: 3rem;
}

.features-section h2 {
    text-align: center;
    color: var(--color-secondary);
    margin-bottom: 2rem;
}

/* Base responsive grid (wraps as needed) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Force exactly 4 columns on wide screens */
@media (min-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    transition: transform .2s ease, box-shadow .2s ease;
    border-top: 4px solid var(--color-accent);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--color-secondary);
    margin: 1rem 0 .5rem 0;
}

.feature-card p {
    color: #333;
    line-height: 1.6;
}

/* ===============================
   SPOTLIGHT
   =============================== */
.spotlight-section {
    margin-bottom: 3rem;
}

.spotlight-section h2 {
    text-align: center;
    color: var(--color-secondary);
    margin-bottom: 2rem;
}

.spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.spotlight-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    transition: transform .2s ease, box-shadow .2s ease;
}

.spotlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .15);
}

.spotlight-header {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.spotlight-header img {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.spotlight-card h3 {
    padding: 1.5rem 1.5rem 0 1.5rem;
    margin: 0;
    color: var(--color-secondary);
    font-size: 1.2rem;
}

.institution {
    color: var(--color-accent-text);
    font-weight: bold;
    font-size: .9rem;
    padding: 0 1.5rem;
    margin: .3rem 0 !important;
}

.spotlight-card p {
    padding: 0 1.5rem;
    font-size: .95rem;
    line-height: 1.5;
    color: #333;
}

.spotlight-card .tags {
    padding: 1rem 1.5rem 0 1.5rem;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: .3rem .8rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: bold;
}

.tag-cs {
    background-color: #E3F2FD;
    color: #1565C0;
}

.tag-devops {
    background-color: #FFF3E0;
    color: #E65100;
}

.tag-ai {
    background-color: #F3E5F5;
    color: #6A1B9A;
}

.tag-intermediate,
.tag-advanced {
    background-color: #FCE4EC;
    color: #C2185B;
}

.spotlight-card .btn-explore {
    margin: 1rem 1.5rem;
}

/* ===============================
   PRINCIPLES PREVIEW
   =============================== */
.principles-preview {
    background: linear-gradient(135deg, #F5F5F5, #FFFBF0);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.principles-preview h2 {
    text-align: center;
    color: var(--color-secondary);
    margin: 0 0 2rem;
}

.principles-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.principle-preview {
    background: #fff;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--color-accent);
}

.principle-preview h3 {
    color: var(--color-secondary);
    margin: 0 0 .5rem 0;
}

.principle-preview p {
    color: #333;
    font-size: .95rem;
    line-height: 1.5;
    margin: 0;
}

/* ===============================
   CTA
   =============================== */
.cta-section {
    background: linear-gradient(135deg, var(--color-secondary), #2D3E50);
    color: #fff;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.cta-section h2 {
    color: #fff;
    margin: 0 0 1rem 0;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #E0E0E0;
}

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

.cta-buttons .btn-secondary {
    background-color: rgba(255, 255, 255, .2);
    border: 2px solid #fff;
    margin-left: 0;
}

.cta-buttons .btn-secondary:hover {
    background-color: rgba(255, 255, 255, .3);
}

/* ===============================
   RESPONSIVE
   =============================== */
@media (max-width: 768px) {

    .hero-banner,
    .community-hero,
    .lean-hero,
    .resources-hero {
        padding: 2rem 1rem;
    }

    .hero-banner h2 {
        font-size: 1.8rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn-secondary,
    .btn-secondary {
        margin-left: 0;
        width: 100%;
    }

    .btn-large {
        width: 100%;
    }

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

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons a {
        width: 100%;
    }
}

@media (max-width: 600px) {
    header .site-logo {
        height: 70px;
        width: 70px;
    }

    header {
        min-height: 140px;
    }
}

/* ===============================
   REDUCED MOTION
   =============================== */
@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }

    .btn-cta:hover,
    .btn-secondary:hover,
    .btn-explore:hover,
    .feature-card:hover,
    .spotlight-card:hover {
        transform: none !important;
    }

    header nav a {
        transition: none !important;
    }
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.center-content {
    text-align: center;
}

.top-margin-2 {
    margin-top: 2rem;
}

/* ===============================
   ABOUT PAGE
   =============================== */
.about-hero {
    max-width: 800px;
    margin: 0 auto;
}

.about-hero h1 {
    color: var(--color-secondary);
}

.about-hero h2 {
    color: var(--color-accent-text);
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
}

.map-container {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-map {
    width: 100%;
    height: 400px;
    border: 0;
    display: block;
}

/* ===============================
   REFERENCES PAGE
   =============================== */
.references-content h1 {
    color: var(--color-secondary);
}

.references-content h2,
.notes h2 {
    color: var(--color-accent-text);
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.reference-list {
    list-style-type: none;
    padding-left: 0;
}

.reference-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.reference-list li:last-child {
    border-bottom: none;
}

.notes {
    background: #FFF3E0;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--color-accent);
    margin-top: 2rem;
}