/* ==========================================================================
   1. CSS Variables & Typography Defaults
   ========================================================================== */
:root {
    --brand-blue: #154a7b; /* Primary Abdiel Blue */
    --text-dark: #000000;  /* Standard text color */
    --text-muted: #666666; /* Navigation and secondary text */
    --bg-overlay: rgba(255, 255, 255, 0.85); /* The subpage fade effect */
    
    --font-heading: 'Josefin Sans', Helvetica, Arial, sans-serif;
    --font-body: 'Open Sans', Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   2. Self-Hosted Fonts
   ========================================================================== */
/* Headings */
@font-face {
    font-family: 'Josefin Sans';
    src: url('../fonts/josefin-sans-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Body Text - Regular */
@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/open-sans-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Body Text - True Italic */
@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/open-sans-italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* ==========================================================================
   3. Global Resets & Basics
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Typography Rules */
h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading); 
    color: var(--brand-blue); 
    font-weight: 700; 
    letter-spacing: 1px;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a { 
    color: var(--brand-blue); 
    text-decoration: none; 
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover { 
    text-decoration: underline; 
}

/* ==========================================================================
   4. Backgrounds & Dynamic Fades
   ========================================================================== */
.bg-wrapper {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    /* Default to mobile crop */
    background-image: url('../images/skyline_mobile.webp'); 
    background-size: cover;
    background-position: center top;
    z-index: -1;
}

/* Tablet Background */
@media (min-width: 768px) {
    .bg-wrapper {
        background-image: url('../images/skyline_tablet.webp'); 
    }
}

/* Desktop Background (Full 2500px image) */
@media (min-width: 1200px) {
    .bg-wrapper {
        background-image: url('../images/skyline_desktop.webp'); 
    }
}

/* Apply the white wash overlay ONLY on sub-pages (any page without the .home class on body) */
body:not(.home) .bg-wrapper::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-overlay);
    z-index: 1;
}

/* ==========================================================================
   5. Structural Layout
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1080px;
    margin: 0 auto;
}

/* Header & Navigation */
.site-header {
    width: 100%;
    z-index: 10;
    position: relative;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
}

.logo img { 
    height: 50px; 
    width: auto; 
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-muted);
}

.nav-links a:hover, 
.nav-links a[aria-current="page"] { 
    color: var(--brand-blue); 
    text-decoration: none; 
}

/* Main Content Box (Used on subpages) */
.content-area {
    padding: 40px 0;
    position: relative;
    z-index: 2; /* Sits above the background */
}

/* ==========================================================================
   6. Specific Page Grids
   ========================================================================== */
/* About Page (Replaces old table layout) */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Team Page */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 600px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.team-member h3 { 
    font-size: 1.125rem; 
    margin-bottom: 2px;
}

.team-member h4 { 
    font-family: var(--font-heading);
    color: var(--text-dark); 
    font-size: 1rem; 
    margin-bottom: 10px;
}

/* Legal Pages (Privacy / Terms Markdown output) */
.legal-content h2, .legal-content h3 {
    margin-top: 2rem;
}
.legal-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}
.legal-content li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
.site-footer {
    text-align: center;
    padding: 40px 0 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
}

body.home .site-footer {
    color: #ffffff;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.8); /* Ensures readability over the vivid skyline */
}

.site-footer a { 
    color: inherit; 
    text-decoration: underline; 
}

/* ==========================================================================
   8. Mobile Specific Overrides
   ========================================================================== */
@media (max-width: 767px) {
    .header-flex { 
        flex-direction: column; 
        gap: 20px; 
    }
    
    .logo img {
        height: 40px;
    }

    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}
