/* ==========================================================================
   EPSO Test Design System
   Foundation styles: colors, typography, spacing, components
   ========================================================================== */

:root {
    /* Colors – Primary */
    --epso-blue-50:  #eff6ff;
    --epso-blue-100: #dbeafe;
    --epso-blue-200: #bfdbfe;
    --epso-blue-500: #3b82f6;
    --epso-blue-600: #2563eb;
    --epso-blue-700: #1d4ed8;
    --epso-blue-800: #1e40af;
    --epso-blue-900: #1e3a8a;

    /* Colors – Accent */
    --epso-amber-400: #fbbf24;
    --epso-amber-500: #f59e0b;
    --epso-amber-600: #d97706;

    /* Colors – Semantic */
    --epso-green-500: #22c55e;
    --epso-green-600: #16a34a;
    --epso-red-500:   #ef4444;
    --epso-red-600:   #dc2626;

    /* Colors – Neutral */
    --epso-gray-50:  #f8fafc;
    --epso-gray-100: #f1f5f9;
    --epso-gray-200: #e2e8f0;
    --epso-gray-300: #cbd5e1;
    --epso-gray-400: #94a3b8;
    --epso-gray-500: #64748b;
    --epso-gray-600: #475569;
    --epso-gray-700: #334155;
    --epso-gray-800: #1e293b;
    --epso-gray-900: #0f172a;

    --epso-white: #ffffff;

    /* Typography */
    --epso-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --epso-font-size-xs:   0.75rem;
    --epso-font-size-sm:   0.875rem;
    --epso-font-size-base: 1rem;
    --epso-font-size-lg:   1.125rem;
    --epso-font-size-xl:   1.25rem;
    --epso-font-size-2xl:  1.5rem;
    --epso-font-size-3xl:  1.875rem;
    --epso-font-size-4xl:  2.25rem;

    /* Spacing */
    --epso-space-1:  0.25rem;
    --epso-space-2:  0.5rem;
    --epso-space-3:  0.75rem;
    --epso-space-4:  1rem;
    --epso-space-5:  1.25rem;
    --epso-space-6:  1.5rem;
    --epso-space-8:  2rem;
    --epso-space-10: 2.5rem;
    --epso-space-12: 3rem;
    --epso-space-16: 4rem;

    /* Borders & Shadows */
    --epso-radius-sm:  0.375rem;
    --epso-radius-md:  0.5rem;
    --epso-radius-lg:  0.75rem;
    --epso-radius-xl:  1rem;
    --epso-shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
    --epso-shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --epso-shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Layout */
    --epso-container-max: 1200px;
    --epso-container-narrow: 800px;
}

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

body {
    font-family: var(--epso-font-family);
    color: var(--epso-gray-800);
    background-color: var(--epso-gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.epsotest-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--epso-space-2);
    padding: var(--epso-space-3) var(--epso-space-6);
    font-family: var(--epso-font-family);
    font-size: var(--epso-font-size-sm);
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--epso-radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.epsotest-btn-primary {
    background-color: var(--epso-blue-600);
    color: var(--epso-white);
}
.epsotest-btn-primary:hover {
    background-color: var(--epso-blue-700);
    color: var(--epso-white);
    transform: translateY(-1px);
    box-shadow: var(--epso-shadow-md);
}

.epsotest-btn-secondary {
    background-color: var(--epso-white);
    color: var(--epso-blue-600);
    border: 1px solid var(--epso-blue-200);
}
.epsotest-btn-secondary:hover {
    background-color: var(--epso-blue-50);
    color: var(--epso-blue-700);
}

.epsotest-btn-accent {
    background-color: var(--epso-amber-500);
    color: var(--epso-gray-900);
}
.epsotest-btn-accent:hover {
    background-color: var(--epso-amber-600);
    transform: translateY(-1px);
    box-shadow: var(--epso-shadow-md);
}

.epsotest-btn-lg {
    padding: var(--epso-space-4) var(--epso-space-8);
    font-size: var(--epso-font-size-base);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.epsotest-card {
    background: var(--epso-white);
    border-radius: var(--epso-radius-xl);
    box-shadow: var(--epso-shadow-sm);
    padding: var(--epso-space-6);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.epsotest-card:hover {
    box-shadow: var(--epso-shadow-md);
}

.epsotest-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--epso-shadow-lg);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.epsotest-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--epso-space-1) var(--epso-space-3);
    font-size: var(--epso-font-size-xs);
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.epsotest-badge-blue {
    background-color: var(--epso-blue-100);
    color: var(--epso-blue-800);
}

.epsotest-badge-green {
    background-color: #dcfce7;
    color: var(--epso-green-600);
}

.epsotest-badge-amber {
    background-color: #fef3c7;
    color: var(--epso-amber-600);
}

.epsotest-badge-red {
    background-color: #fee2e2;
    color: var(--epso-red-600);
}

.epsotest-badge-gray {
    background-color: var(--epso-gray-100);
    color: var(--epso-gray-600);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.epsotest-progress {
    width: 100%;
    height: 8px;
    background-color: var(--epso-gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.epsotest-progress-fill {
    height: 100%;
    background-color: var(--epso-blue-600);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.epsotest-progress-fill--green {
    background-color: var(--epso-green-500);
}

.epsotest-progress-fill--amber {
    background-color: var(--epso-amber-500);
}

.epsotest-progress-fill--red {
    background-color: var(--epso-red-500);
}

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.epsotest-container {
    width: 100%;
    max-width: var(--epso-container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--epso-space-4);
    padding-right: var(--epso-space-4);
}

.epsotest-container-narrow {
    max-width: var(--epso-container-narrow);
}

.epsotest-grid {
    display: grid;
    gap: var(--epso-space-6);
}

.epsotest-grid-2 { grid-template-columns: repeat(1, 1fr); }
.epsotest-grid-3 { grid-template-columns: repeat(1, 1fr); }

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

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

.epsotest-section {
    padding-top: var(--epso-space-16);
    padding-bottom: var(--epso-space-16);
}

/* ==========================================================================
   Product shell layout rail (GeneratePress + epsotest-container)
   Full-width outer .site; header/footer/main share the same max-width as
   .epsotest-container so app pages are not “double boxed” or blog-narrow.
   body.epsotest-product-shell is set in functions.php (with GP fluid layout).
   ========================================================================== */

body.epsotest-product-shell:not(.epsotest-quiz-mode) .site.grid-container {
    max-width: none;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

body.epsotest-product-shell {
    overflow-x: hidden;
}

body.epsotest-product-shell .epsotest-product-main {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

body.epsotest-product-shell .epsotest-product-main > * {
    max-width: 100%;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .site-header .inside-header {
    max-width: var(--epso-container-max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--epso-space-4);
    padding-right: var(--epso-space-4);
    box-sizing: border-box;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .site-content,
body.epsotest-product-shell:not(.epsotest-quiz-mode) #content {
    display: block !important;
    width: 100%;
    max-width: none;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) #page > #content.site-content {
    display: block !important;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .content-area {
    width: 100% !important;
    max-width: none !important;
    float: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) #main,
body.epsotest-product-shell:not(.epsotest-quiz-mode) .site-main {
    width: 100%;
    max-width: none;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .inside-article {
    padding-left: 0;
    padding-right: 0;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .entry-header {
    max-width: var(--epso-container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--epso-space-4);
    padding-right: var(--epso-space-4);
    box-sizing: border-box;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .page-header-image {
    margin-left: 0;
    margin-right: 0;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .entry-content {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) .site-footer .inside-site-info {
    max-width: var(--epso-container-max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--epso-space-4);
    padding-right: var(--epso-space-4);
    box-sizing: border-box;
}

body.epsotest-product-shell:not(.epsotest-quiz-mode) #footer-widgets .footer-widgets-container {
    max-width: var(--epso-container-max);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--epso-space-4);
    padding-right: var(--epso-space-4);
    box-sizing: border-box;
}

/* ==========================================================================
   Register page (PMS + product shell)
   ========================================================================== */

.epsotest-register-lead {
    max-width: 36rem;
    margin: 0 auto 1.5rem;
    padding: 0 var(--epso-space-4);
    font-size: var(--epso-font-size-base);
    line-height: 1.6;
    color: var(--epso-gray-600);
    text-align: center;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .epsotest-register-lead {
        font-size: var(--epso-font-size-lg);
        margin-bottom: 2rem;
    }
}

/* ==========================================================================
   Navigation CTA Override
   ========================================================================== */

.epsotest-nav-cta a.epsotest-btn {
    margin-left: var(--epso-space-4);
    padding: var(--epso-space-2) var(--epso-space-5);
    font-size: var(--epso-font-size-sm);
    white-space: nowrap;
}

/* ==========================================================================
   GeneratePress header — desktop nav (769px+ matches GP mobile breakpoint)
   Single visible menu row; hide mobile toggle; avoid overlap with CTA item.
   Scoped to #site-navigation so slide-out / off-canvas clones are untouched.
   ========================================================================== */

@media (min-width: 769px) {
    #site-navigation.main-navigation .menu-toggle {
        display: none !important;
    }

    #site-navigation.main-navigation:not(.toggled) .main-nav > ul {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 0.125rem;
        row-gap: 0.25rem;
        justify-content: flex-end;
    }

    #site-navigation.main-navigation .inside-navigation {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        justify-content: flex-end;
        column-gap: var(--epso-space-3);
        width: 100%;
    }

    #site-navigation.main-navigation .main-nav {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ==========================================================================
   Quiz Mode – hide header/footer for immersive experience
   ========================================================================== */

body.epsotest-quiz-mode .site-header,
body.epsotest-quiz-mode .site-footer,
body.epsotest-quiz-mode #generate-breadcrumbs {
    display: none;
}

/* ==========================================================================
   Skip link (accessibility)
   ========================================================================== */

.epsotest-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100100;
    padding: var(--epso-space-3) var(--epso-space-5);
    background: var(--epso-blue-600);
    color: var(--epso-white);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--epso-radius-md);
}
.epsotest-skip-link:focus {
    left: var(--epso-space-4);
    top: var(--epso-space-4);
    outline: 2px solid var(--epso-white);
    outline-offset: 2px;
}

/* ==========================================================================
   Cookie notice (site-wide; script from EPSO Quiz plugin)
   ========================================================================== */

.epso-cookie-banner {
    position: fixed;
    z-index: 100050;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--epso-space-4);
    padding: var(--epso-space-4) var(--epso-space-5);
    background: var(--epso-gray-900);
    color: var(--epso-gray-100);
    box-shadow: 0 -4px 24px rgb(0 0 0 / 0.15);
}
.epso-cookie-banner__text {
    flex: 1 1 16rem;
    margin: 0;
    font-size: var(--epso-font-size-sm);
    line-height: 1.5;
}
.epso-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--epso-space-3);
}
.epso-cookie-banner__link {
    color: var(--epso-blue-200);
    text-decoration: underline;
    font-size: var(--epso-font-size-sm);
}
.epso-cookie-banner__link:hover {
    color: var(--epso-white);
}
.epso-cookie-banner__accept {
    cursor: pointer;
    border: none;
    border-radius: var(--epso-radius-md);
    padding: var(--epso-space-2) var(--epso-space-5);
    font-size: var(--epso-font-size-sm);
    font-weight: 600;
    background: var(--epso-blue-600);
    color: var(--epso-white);
}
.epso-cookie-banner__accept:hover {
    background: var(--epso-blue-500);
}
.epso-cookie-banner__accept:focus-visible {
    outline: 2px solid var(--epso-white);
    outline-offset: 2px;
}
