/*
Theme Name: Bestpublichealth2.0
Description: Clean, modern WordPress theme for public health education and career resources with comprehensive assessment tools, SEO optimization, and mobile-first design.
Author: BestPublicHealth Team
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bestpublichealth
Tags: education, health, responsive, accessibility, seo, assessment-tools
*/

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Legacy Variables (Preserved - Synced with New System) */
    --primary-color: #002147;
    /* Oxford Blue */
    --primary-dark: #00152e;
    --primary-light: #e6f0fa;
    --secondary-color: #008080;
    /* Teal */
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background: #ffffff;
    --background-light: #f9fafb;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
    --transition: all 0.2s ease-in-out;

    /* New Professional Academic Design System 2.0 */
    --color-primary: #002147;
    /* Oxford Blue - Deep, Trustworthy */
    --color-primary-light: #003366;
    /* Lighter Navy */
    --color-secondary: #008080;
    /* Teal - Growth, Health */
    --color-accent: #C0392B;
    /* Deep Red - Alert/Important (sparingly) */
    --color-bg-main: #F4F6F7;
    /* Very Light Gray/Blue tint */
    --color-surface: #FFFFFF;
    --color-text-main: #1C2833;
    /* Almost Black */
    --color-text-muted: #566573;
    /* Muted Blue-Gray */

    --font-heading: 'Merriweather', 'Georgia', serif;
    /* Academic/Formal */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Clean/Readable */

    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    /* Reduced from 1.5rem for more professional look */
    --white: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background-light);
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
    border: 3px solid var(--background-light);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--secondary-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip Link for Accessibility */
.skip-link {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 100000;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0.5rem;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    color: white;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* WordPress Core Classes */
.alignleft {
    float: left;
    margin: 0 1rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1rem;
}

.aligncenter {
    display: block;
    margin: 1rem auto;
}

.alignwide {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 1rem;
}

.wp-caption img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.wp-caption-text {
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

/* Loading state fixes for browser navigation */
body.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

body.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 9999;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ensure loading state is cleared on page show */
body:not(.loading) .loading::after {
    display: none !important;
}

/* Mobile responsiveness fixes */
@media (max-width: 768px) {

    /* Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Typography adjustments */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
        word-break: break-word;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.3;
        word-break: break-word;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.4;
        word-break: break-word;
    }

    /* Container improvements */
    .container {
        padding: 0 0.75rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Fix potential overflow elements */
    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    /* Fix long text */
    p,
    div,
    span {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Fix links and buttons */
    a,
    button {
        word-break: break-word;
    }

    /* Footer specific mobile fixes */
    .site-footer {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Additional footer mobile compacting */
    .footer-main {
        padding: 1.5rem 0.75rem 1rem !important;
    }

    .footer-bottom {
        padding: 1rem 0.75rem !important;
    }

    .footer-grid {
        gap: 1.25rem !important;
    }

    .footer-section {
        margin-bottom: 0 !important;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .footer-widgets-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
    }

    .social-links {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .footer-navigation {
        width: 100%;
    }

    .footer-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Fix admission and statistics sections at bottom */
    .admission-contact,
    .contact-info,
    .university-statistics,
    .program-statistics {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        word-break: break-word;
    }
}