/* Convention: rem for font sizes, px for borders, spacing, and radii. */

:root {
    /* JWIII theme */
    --bg: #ffffff;
    --text: #151515;
    --link: #0052a3;
    --text-nav: #151515;
    --accent: #0066cc;
    --border: #e0e0e0;
    --code-bg: #f6f6f6;
    /* FULL SPECTRUM (palette reference) */
    --blue: #007bff;
    --indigo: #6610f2;
    --purple: #6f42c1;
    --pink: #e83e8c;
    --red: #dc3545;
    --orange: #fd7e14;
    --yellow: #ffc107;
    --green: #28a745;
    --teal: #20c997;
    --cyan: #17a2b8;
    --white: #fff;
    --gray: #6c757d;
    --gray-dark: #343a40;
    --primary: #fff;
    --secondary: #ff6000;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f6f6f6;
    --dark: #151515;
}

[data-theme="dark"] {
    /* Draplin Theme */
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --link: #e0e0e0;
    --text-nav: #8a9298;
    --accent: #ff6000;
    --border: #6c757d;
    --code-bg: #26292d;
}

[data-theme="BLT"] {
    /* My theme */
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --link: #28a745;
    --text-nav: #8a9298;
    --accent: #28a745;
    --border: #6c757d;
    --code-bg: #26292d;
}

/* ==== Base ==== */

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

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    text-align: left;
    transition: background 0.3s ease, color 0.3s ease;
}

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

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 16px;
}

.container-flex {
    display: flex;
}

.box {
    flex: 1;
    padding: 16px;
    text-align: left;
}

.box a {
    color: var(--accent);
}

hr {
    border: 0;
    border-top: 2px solid var(--border);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==== Typography ==== */

h1 {
    color: var(--text);
    line-height: 100%;
    font-size: clamp(2.5rem, 10vw, 7rem);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 30px;
}

section {
    margin: 0 0 64px;
}

h2 {
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 600;
}

h3 {
    color: var(--link);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

h4 strong {
    color: var(--accent);
}

p {
    color: var(--text);
    margin-bottom: 16px;
}

em {
    color: var(--accent);
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Links inside running text need more than color to stand out */
p a,
li a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

/* ==== Components ==== */

.card {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.date {
    color: var(--link);
    font-size: 0.875rem;
    white-space: nowrap;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--link);
}

.link-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.link-list li {
    padding: 12px;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.link-list li:hover {
    background: var(--bg);
}

.link-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.link-list a::before {
    content: "→";
    color: var(--accent);
}

.bullet-list {
    list-style: none;
}

.bullet-list li {
    padding: 8px 0 8px 24px;
    position: relative;
}

.bullet-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--accent);
    font-size: 1.25rem;
}

.intro {
    max-width: 760px;
    font-size: 1.15rem;
}

footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--link);
    font-size: 0.875rem;
}

/* ==== Certifications page ==== */

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.cert-card {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.cert-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    background: var(--bg);
}

.cert-info {
    padding: 16px;
}

.cert-info h3 {
    margin-bottom: 8px;
    font-size: 1.125rem;
}

.cert-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.view-full {
    color: var(--accent);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.view-full:hover {
    text-decoration: underline;
}

/* Featured (vendor-issued) certification */
.cert-featured {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 16px;
}

.cert-badge {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.cert-featured .cert-meta {
    justify-content: flex-start;
    gap: 24px;
}

.cert-featured .cert-meta a {
    color: var(--accent);
    font-size: 0.875rem;
}

/* Modal for full-size image viewing */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #bbb;
}

/* ==== Draplin-style site header (partials/header.html) ==== */

.site-header-inner {
    max-width: 1300px;
    margin: 0 auto;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.site-title a {
    color: var(--text);
}

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

.site-nav-primary,
.site-nav-secondary .subnav {
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.site-nav-primary {
    display: flex;
}

.site-nav-primary a,
.site-nav-secondary .subnav a {
    display: inline-block;
    color: var(--text-nav);
    font-weight: 700;
    font-size: 1.1rem;
}

.site-nav-primary a:hover,
.site-nav-primary a.active,
.site-nav-secondary .subnav a:hover,
.site-nav-secondary .subnav a.active {
    color: var(--accent);
}

/* Secondary row stays hidden until nav.js marks a subnav active */
.site-nav-secondary,
.site-nav-secondary .subnav {
    display: none;
}

.site-nav-secondary:has(.subnav.active) {
    display: block;
}

.site-nav-secondary .subnav.active {
    display: flex;
}

/* ==== Small screens ==== */

@media (max-width: 600px) {
    .container {
        padding: 40px 16px;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
    }

    /* Room for the fixed theme toggle above the site title */
    .site-header {
        padding-top: 16px;
    }

    .container-flex,
    .cert-featured {
        flex-direction: column;
        align-items: flex-start;
    }

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

/* ==== Reduced motion ==== */

@media (prefers-reduced-motion: reduce) {
    /* !important is needed here to override every component's transition */
    *,
    *::before,
    *::after {
        transition: none !important;
    }

    .theme-toggle:hover,
    .cert-card:hover {
        transform: none;
    }
}
