/* === Color Variables === */
:root {
    --color-primary: #3B7A57;
    --color-secondary: #5F8F6B;
    --color-accent: #946300;
    --color-bg-light: #F9F9F7;
    --color-text-dark: #1F1F1F;
    --color-neutral-mid: #595959;

    /* Semantic Colors from Simulator (keeping consistent) */
    --color-success-bg: #f0fdf4;
    --color-success-border: #16a34a;
    --color-success-text: #166534;

    --color-warning-bg: #fefce8;
    --color-warning-border: #ca8a04;
    --color-warning-text: #854d0e;

    --color-critical-bg: #fef2f2;
    --color-critical-border: #dc2626;
    --color-critical-text: #991b1b;
}

/* === Base Styles (Typography & Reset) === */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Global 16px Base */
}

body {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    line-height: 1.6;
    font-weight: 400;
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    /* Explicitly force font */
    color: var(--color-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    font-weight: 700;
}

/* Typography Scale (Exact Matches) */
h1 {
    font-size: 40px;
}

h2 {
    font-size: 34px;
}

h3 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
}

h4 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

h5 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

h6 {
    font-size: 16px;
    line-height: 1.3;
}

@media (max-width: 900px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }
}

.display-name {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    text-align: center;
    color: var(--color-primary);
}

blockquote {
    font-style: italic;
    color: var(--color-neutral-mid);
    border-left: 4px solid var(--color-secondary);
    padding-left: 1rem;
    margin-left: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === Layout / Container System === */
/* Standard Container (Text-heavy) */
.container {
    width: 100%;
    max-width: 70ch;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Wide Container (Media/Multi-column) */
.container-wide {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Legacy Overrides for compatibility during migration */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* === Components === */

/* Buttons */
.cta-button {
    background-color: var(--color-primary);
    color: white;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    background-color: var(--color-secondary);
}

/* Links */
.link-default,
.link-cta {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s;
}

.link-cta:hover {
    color: var(--color-accent);
}

/* Cards (Generic) */
.content-card,
.testimonial-block,
.service-card,
.work-card,
.qualifications-card {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    /* consistently 0.5rem vs 0.75rem? User asked for alignment. */
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Profile Image */
.profile-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--color-secondary);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Featured Talks Layout */
.featured-talks-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .featured-talks-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Playlist */
.video-playlist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    max-width: 300px;
}

.video-button {
    background-color: var(--color-bg-light);
    border: 2px solid var(--color-neutral-mid);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.video-button:hover,
.video-button.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Video Player */
.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    background-color: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Contact Form */
.contact-form input,
.contact-form textarea {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    border: 2px solid var(--color-neutral-mid);
    border-radius: 0.5rem;
    padding: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Footer Links */
.footer-nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-link {
    color: white;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Grid specific */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.gap-4 {
    gap: 1rem;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Missing Responsive Utils */
    .md\:flex-row {
        flex-direction: row;
    }

    .md\:text-left {
        text-align: left;
    }

    .md\:justify-start {
        justify-content: flex-start;
    }

    .md\:py-16 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .md\:text-xl {
        font-size: 1.25rem;
    }
}

/* Missing Sizing & Shaping Utils */
.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Missing Color Utils */
.bg-primary {
    background-color: var(--color-primary);
}

.bg-bg-light {
    background-color: var(--color-bg-light);
}

/* Accessible Skip Link */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
}

.skip-link:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 1rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    top: 1rem;
    left: 1rem;
    background-color: var(--color-primary);
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    z-index: 50;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* === RESTORED UTILITIES (Essential for existing HTML layout) === */

.list-none {
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-social-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.footer-social-list li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gap-2 {
    gap: 0.5rem;
}

/* Spacing */
.m-0 {
    margin: 0;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Flexbox & Alignment */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

.gap-8 {
    gap: 2rem;
}

.space-y-2>*+* {
    margin-top: 0.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

/* Text Sizing & Alignment */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-5xl {
    font-size: 3rem;
}

/* For Icons */

.font-bold {
    font-weight: 700;
}

.text-neutral-mid {
    color: var(--color-neutral-mid);
}

.text-white {
    color: white;
}

/* === NEW UTILITIES (Added for Portfolio Updates) === */

.grow {
    flex-grow: 1;
}

.mt-auto {
    margin-top: auto;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.025em;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.list-disc {
    list-style-type: disc;
}

.pl-5 {
    padding-left: 1.25rem;
}

.w-full {
    width: 100%;
}

.inline-block {
    display: inline-block;
}

.bg-accent {
    background-color: var(--color-accent) !important;
}

.h3-style {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.25;
}

/* === Modal Styles (Contact Form) === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2rem 1rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--color-bg-light);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-neutral-mid);
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: var(--color-text-dark);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}