/* === 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 */
    --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;
}

/* === Box Model Normalization & Global Reset === */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
    font-size: 16px; /* Base size */
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 1.125rem; /* Standard body size moved to 18px */
    line-height: 1.6;
    font-weight: 400;
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    margin: 0;
}

/* Form Controls Typography Inheritance */
button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* === Accessibility Enhancements === */
.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);
}

.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;
}

/* === Typography Scale === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    color: var(--color-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    font-weight: 700;
    text-align: left;
}

h1 { font-size: 2.5rem; }     /* 40px */
h2 { font-size: 2.125rem; }   /* 34px */
h3 { font-size: 1.75rem; font-weight: 600; line-height: 1.25; }    /* 28px */
h4 { font-size: 1.375rem; font-weight: 600; line-height: 1.25; }   /* 22px */
h5 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }    /* 18px */
h6 { font-size: 1rem; line-height: 1.3; }                          /* 16px */

.display-name {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 2.25rem; /* 36px on mobile */
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    text-align: center; /* Default centered on mobile */
    color: var(--color-primary);
}

/* Role-based Typography Classes */
.text-lead {
    font-size: 1.25rem; /* 20px */
    line-height: 1.6;
}

.text-body {
    font-size: 1.125rem; /* 18px */
    line-height: 1.6;
}

.text-supporting {
    font-size: 1rem; /* 16px */
    line-height: 1.5;
}

.text-metadata {
    font-size: 0.875rem; /* 14px */
    line-height: 1.4;
}

blockquote {
    font-style: italic;
    color: var(--color-neutral-mid);
    border-left: 4px solid var(--color-secondary);
    padding-left: 1rem;
    margin-left: 0;
}

/* === Layout / Container System === */
/* Standard Container (Reading/Text-heavy) */
.container {
    width: 100%;
    max-width: 70ch;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Wide Container (Composed Sections/Layouts) */
.container-wide {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Component Styles === */

/* 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: #33684b; /* WCAG AA contrast compliant */
}

.cta-button-light {
    background-color: white;
    color: var(--color-primary);
    border: 2px solid white;
}

.cta-button-light:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
    border-color: var(--color-bg-light);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

/* Universal Focus States */
.cta-button:focus-visible,
.link-default:focus-visible,
.link-cta:focus-visible,
.video-button:focus-visible,
.dropdown-menu a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.bg-primary .link-social:focus-visible,
.bg-primary .cta-button:focus-visible {
    outline: 3px solid white;
    outline-offset: 3px;
}

button:focus {
    outline: none;
}

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

/* 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);
}

.link-social {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.link-social:hover {
    color: var(--color-bg-light);
}

/* Cards (Equal padding & border-box normalized) */
.content-card,
.testimonial-block,
.service-card,
.work-card,
.qualifications-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem; /* Reduced from 2rem to 1.5rem (24px) for visual balance */
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.h-full {
    height: 100%;
}

/* 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 */
.featured-talks-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.video-playlist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    width: 100%;
}

.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;
    width: 100%;
    font-size: 1rem; /* 16px */
}

.video-button:hover,
.video-button.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    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%;
    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;
}

/* Dropdown Menu */
.nav-item-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    z-index: 10;
    padding: 0.5rem 0;
    border: 1px solid #e5e5e5;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    text-align: left;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
    background-color: var(--color-bg-light);
    color: var(--color-accent);
}

.nav-item-dropdown:hover .dropdown-menu,
#training-menu-button[aria-expanded="true"] + .dropdown-menu {
    display: block;
}

#training-menu-button i {
    transition: transform 0.2s ease;
}

#training-menu-button[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Lists */
.standard-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.standard-list li {
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.standard-list li::marker {
    color: var(--color-accent);
    font-size: 1.15em;
}

/* Section Divider */
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(95, 143, 107, 0), rgba(95, 143, 107, 0.4) 20%, rgba(95, 143, 107, 0.4) 80%, rgba(95, 143, 107, 0));
    margin: 4rem auto;
    max-width: 48rem;
}

/* Modal */
.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);
}

/* Accordion */
.accordion-item {
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    margin: 0;
}

.accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: #f3f4f6;
    border: none;
    border-bottom: 1px solid #ccc;
    text-align: left;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.accordion-trigger[aria-expanded="false"] {
    border-bottom: none;
}

.accordion-trigger:hover,
.accordion-trigger:focus {
    background-color: #e5e7eb;
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.accordion-icon {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.accordion-trigger[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.accordion-panel {
    padding: 1.5rem;
    background: white;
}

.accordion-panel[hidden] {
    display: none;
}

/* Tables */
.accessible-table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
}

.accessible-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ccc;
}

.accessible-table th,
.accessible-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    text-align: left;
}

.accessible-table th {
    background-color: #f3f4f6;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.accessible-table tr:nth-child(even) {
    background-color: #fafafa;
}

/* === Visual Landmark & Differentiation Classes === */

/* Testimonial Cards */
.testimonials-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.testimonial-card {
    background-color: white;
    border-left: 4px solid var(--color-secondary);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.testimonial-quote {
    font-style: italic;
    color: var(--color-text-dark);
    display: block;
    margin-bottom: 0.75rem;
}

.testimonial-author {
    font-weight: 700;
    color: var(--color-neutral-mid);
    font-size: 0.95rem;
    display: block;
}

/* Process Card Layout */
.process-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.process-step-num {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(95, 143, 107, 0.15); /* Faded accent green */
    line-height: 1;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    user-select: none;
}

.process-card p {
    margin: 0;
    z-index: 1;
}

/* Credentials Summary Panel */
.credentials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.credential-panel-card {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.credential-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-primary);
}

.credential-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
}

.credential-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.credential-text {
    font-size: 1rem;
    margin: 0;
    color: var(--color-text-dark);
}

/* Consistent Callout Box for Key Conclusions */
.callout-box {
    background-color: var(--color-success-bg);
    border-left: 4px solid var(--color-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin: 1.5rem 0;
}

.callout-box p {
    margin: 0;
}

/* === Base Unresponsive Utilities === */
.mx-auto { margin-left: auto; margin-right: auto; }
.m-0 { margin: 0; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-16 { margin-bottom: 4rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pl-5 { padding-left: 1.25rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.grow { flex-grow: 1; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.space-y-2>*+* { margin-top: 0.5rem; }
.space-y-4>*+* { margin-top: 1rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.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; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }

.text-neutral-mid { color: var(--color-neutral-mid); }
.text-white { color: white; }
.bg-primary { background-color: var(--color-primary); }
.bg-bg-light { background-color: var(--color-bg-light); }
.bg-accent { background-color: var(--color-accent) !important; }

.hidden { display: none !important; }
.inline-block { display: inline-block; }
.w-full { width: 100%; }

.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-6xl { max-width: 72rem; }
.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); }

.list-none { list-style-type: none !important; padding: 0 !important; margin: 0 !important; }
.list-disc { list-style-type: disc; }
.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; }

.h3-style { font-size: 1.75rem; font-weight: 600; line-height: 1.25; }
.hero-section { text-align: center; }
.hero-section h1 { text-align: center; }

/* ========================================== */
/* === RESPONSIVE STYLES (Cascade-Safe) === */
/* ========================================== */

/* Mobile Dropdown Overrides (max-width: 767px) */
@media (max-width: 767px) {
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        display: block; /* Always show on mobile */
        background-color: transparent;
    }
    
    .nav-item-dropdown {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Medium headings adjustment (max-width: 900px) */
@media (max-width: 900px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3, .h3-style { font-size: 1.5rem; } /* 24px */
    h4 { font-size: 1.25rem; } /* 20px */
}

/* Tablet & Desktop Layouts (min-width: 768px) */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        /* Define for backup, but primary layout shifts to lg (1024px) for focus cards */
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .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;
    }

    .md\:w-auto {
        width: auto;
    }

    /* Header/Name Alignment Override */
    .display-name {
        text-align: left;
        font-size: 3rem; /* 48px on desktop */
    }

    /* Playlist desktop size limit */
    .video-playlist {
        max-width: 300px;
    }
    
    /* Credentials grid on tablet */
    .credentials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop row layouts (min-width: 900px) */
@media (min-width: 900px) {
    .featured-talks-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Large Desktop - Reworked Column break (min-width: 1024px) */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    
    /* Credentials grid on large desktop */
    .credentials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}