/* ============================================================
   Drew Jackson Portfolio — Shared Stylesheet
   Used by: index.html, creator.html, engineer.html, educator.html
   (contact.html shares only the theme variables and reset)
   ============================================================ */

/* --- THEME VARIABLES -----------------------------------------
   Palette: Midnight & brass
     primary  #1B2845  deep navy
     brass    #C9A961  warm brass (replaces the old bright blue accent)
     accent   #4A5680  muted indigo (used sparingly for hover/dividers)
     surface  #E8E2D3  warm cream (raised surfaces, sidebar fills)
     bg       #F5F2EC  off-white page background
   The old --primary-blue / --accent-blue variable names are kept for
   backward compatibility with the page-specific CSS, but their values
   now refer to navy and brass respectively.
   -------------------------------------------------------------- */
:root {
    /* Light Mode (default) */
    --bg-color: #F5F2EC;
    --bg-secondary: #E8E2D3;
    --sidebar-bg: #E8E2D3;
    --text-main: #2B2F3A;
    --text-muted: #5A5E68;
    --text-secondary: #5A5E68;
    --card-bg: #FFFFFF;
    --skill-bg: #FFFFFF;
    --primary-blue: #1B2845; /* navy (legacy variable name) */
    --accent-blue: #C9A961;  /* brass (legacy variable name) */
    --nav-bg: rgba(27, 40, 69, 0.9);
    --nav-bg-scrolled: rgba(27, 40, 69, 0.95);
    --nav-text: #E8E2D3;
    --input-bg: #FFFFFF;
    --input-border: #C9C2AA;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-color: #0A0F1C;
    --bg-secondary: #14213D;
    --sidebar-bg: #14213D;
    --text-main: #E8E2D3;
    --text-muted: #A0A8B8;
    --text-secondary: #A0A8B8;
    --card-bg: #14213D;
    --skill-bg: #1F2A4A;
    --primary-blue: #D4B570; /* lifted brass for headings on dark bg */
    --accent-blue: #C9A961;
    --nav-bg: rgba(10, 15, 28, 0.95);
    --nav-bg-scrolled: rgba(10, 15, 28, 0.95);
    --nav-text: #E8E2D3;
    --input-bg: #14213D;
    --input-border: #2A3550;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* --- BASE RESET ---------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Smooth scrolling for anchor links + window.scrollTo() — disabled
   for users who prefer reduced motion. */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}

/* --- ACCESSIBILITY UTILITIES --------------------------------- */

/* Visually hidden but available to screen readers (e.g., the
   index.html h1 that gives the home page a proper heading). */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-main link — hidden until focused via keyboard tab. */
.skip-link {
    position: absolute;
    top: -50px;
    left: 12px;
    background: #1B2845;
    color: #E8E2D3;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 200;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 12px;
    outline: 2px solid #C9A961;
    outline-offset: 2px;
}

/* Visible keyboard focus ring on all interactive elements.
   :focus-visible avoids showing the ring on mouse clicks. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #C9A961;
    outline-offset: 3px;
    border-radius: 3px;
}

/* Active navbar link (set by JS via aria-current="page") */
.nav-links a[aria-current="page"] {
    color: #C9A961;
}
.nav-links a[aria-current="page"]::after {
    width: 100%;
}

body {
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-feature-settings: 'cv11', 'ss01'; /* Inter stylistic sets — crisper figures */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- TYPOGRAPHY: Fraunces for headings, Inter for body ------ */
h1, h2, h3, h4, h5, h6,
.logo {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-optical-sizing: auto;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* --- NAVIGATION BAR ------------------------------------------ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.4s ease;
}

/* Modifier: transparent navbar (used on index.html over hero). */
.navbar.navbar--transparent {
    background: transparent;
    box-shadow: none;
}

/* Modifier: scrolled state (applied via JS once scrollY > 50). */
.navbar.scrolled {
    background: var(--nav-bg-scrolled);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    color: var(--nav-text);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- THEME TOGGLE BUTTON ------------------------------------- */
.theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.2rem;
    cursor: pointer;
    /* 44x44 minimum tap target (WCAG 2.5.5) */
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent-blue);
}

/* --- SHARED SECTION HEADINGS --------------------------------- */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--primary-blue);
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-blue);
}

/* --- SHARED FORM CONTROLS ------------------------------------ */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-main);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    background: #1B2845; /* Navy primary — kept consistent across light/dark for contrast */
    color: #E8E2D3;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.submit-btn:hover {
    background: #0E1730;
}

/* --- UTILITY CLASSES ----------------------------------------- */
.bg-secondary {
    background-color: var(--bg-secondary) !important;
}

/* --- SHARED CTA SECTION (used at the end of index/creator) --- */
.cta-section {
    padding: 80px 5%;
    text-align: center;
    background: var(--bg-secondary);
}

.cta-section h2 {
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 14px;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-main);
    max-width: 600px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.cta-btn {
    display: inline-block;
    background: #C9A961; /* brass — distinguishes "go to contact" from form submits */
    color: #1B2845;
    padding: 14px 32px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

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

/* --- LIGHTBOX GALLERY ---------------------------------------- */
.lightbox-gallery img {
    cursor: zoom-in;
}

.lightbox {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    color: #E8E2D3;
}

.lightbox::backdrop {
    background: rgba(10, 15, 28, 0.92);
    backdrop-filter: blur(4px);
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: rgba(232, 226, 211, 0.12);
    border: 1px solid rgba(232, 226, 211, 0.25);
    color: #E8E2D3;
    font-size: 1.4rem;
    font-family: 'Inter', system-ui, sans-serif;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(201, 169, 97, 0.3); /* brass tint */
    border-color: #C9A961;
}

.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }

.lightbox-prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.05); }

.lightbox-counter {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(232, 226, 211, 0.75);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin: 0;
}

@media (max-width: 600px) {
    .lightbox-close { top: 14px; right: 14px; }
    .lightbox-prev  { left: 12px; }
    .lightbox-next  { right: 12px; }
    .lightbox-img   { max-width: 96vw; max-height: 78vh; }
}

/* --- BACK-TO-TOP FLOATING BUTTON ----------------------------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #C9A961; /* brass */
    color: #1B2845;       /* navy */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #B8985A;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .back-to-top { bottom: 18px; right: 18px; width: 44px; height: 44px; }
}

/* --- FADE-IN ON SCROLL --------------------------------------- */
/* Applied via JS to selected elements. Element starts invisible
   and slides up slightly; IntersectionObserver toggles .visible
   when the element scrolls into view. */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
}

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

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .back-to-top { transition: none; }
}

/* --- SITE FOOTER (used on every page except vcard.html) ------ */
.site-footer {
    background: #1B2845;
    color: #E8E2D3;
    padding: 60px 5% 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.4fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto 36px;
}

.footer-brand .footer-logo {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    color: #E8E2D3;
}

.footer-brand .footer-tagline {
    color: rgba(232, 226, 211, 0.7);
    font-size: 0.88rem;
    letter-spacing: 0.4px;
    margin-bottom: 14px;
}

.footer-brand .footer-loc {
    font-size: 0.85rem;
    color: rgba(232, 226, 211, 0.7); /* bumped from 0.55 for WCAG AA */
}

.footer-heading {
    color: #C9A961;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

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

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: rgba(232, 226, 211, 0.85);
    text-decoration: none;
    font-size: 0.92rem;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0; /* tap target padding without disrupting layout */
}

.footer-col a:hover {
    color: #C9A961;
}

.footer-col a i {
    width: 14px;
    color: #C9A961;
    font-size: 0.85rem;
}

.footer-bottom {
    border-top: 1px solid rgba(232, 226, 211, 0.15);
    padding-top: 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    color: rgba(232, 226, 211, 0.7); /* bumped from 0.5 for WCAG AA */
    font-size: 0.8rem;
}

.footer-bottom p {
    margin: 0;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 48px 6% 24px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

/* --- RESPONSIVE BASELINE ------------------------------------- */
@media (max-width: 480px) {
    .navbar {
        height: auto;
        flex-direction: column;
        padding: 15px;
        background: var(--nav-bg-scrolled);
    }

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