/* css/global.css */

/* ------------------------- */
/* --- 0. Global Resets & Variables --- */
/* ------------------------- */

:root {
    --primary-color: #0A2463; /* 深蓝 */
    --secondary-color: #3E92CC; /* 中蓝 */
    --accent-color: #FF9F1C; /* 橙色/金色强调 */
    --accent-color-rgb: 255, 159, 28; /* --accent-color 的 RGB 值 */
    --light-accent-color: #F5D491;
    --text-color-dark: #212529; /* 深灰文本 */
    --text-color-light: #f8f9fa; /* 浅色文本 (用于深色背景) */
    --background-light: #f8f9fa;
    --background-medium: #e9ecef;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;

    --font-family-headings: 'Montserrat', sans-serif;
    --font-family-body: 'Open Sans', sans-serif;

    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 5px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s ease;
}

/* Basic Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--font-family-body);
    color: var(--text-color-dark);
    line-height: 1.6;
    background-color: #fff;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* ------------------------- */
/* --- 1. Utility Classes --- */
/* ------------------------- */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.section-padding {
    padding-top: 80px;
    padding-bottom: 80px;
}

.bg-light {
    background-color: var(--background-light);
}

.bg-medium {
    background-color: var(--background-medium);
}

.bg-primary-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.text-light {
    color: var(--text-color-light);
}

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

.section-title { /* Global section title styling */
    font-family: var(--font-family-headings);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-align: center;
    font-weight: 700;
}

.section-title.light { /* For dark backgrounds */
    color: var(--text-color-light);
}


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

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

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

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: var(--font-family-headings);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), transform var(--transition-speed);
    border: 2px solid transparent;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: hsl(from var(--primary-color) h s calc(l - 10%));
    border-color: hsl(from var(--primary-color) h s calc(l - 10%));
    color: var(--text-color-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    border-color: var(--secondary-color);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: hsl(from var(--secondary-color) h s calc(l - 10%));
    border-color: hsl(from var(--secondary-color) h s calc(l - 10%));
    color: var(--text-color-light);
    transform: translateY(-2px);
}

.btn-outline-light {
    background-color: transparent;
    color: var(--text-color-light);
    border-color: var(--text-color-light);
}

.btn-outline-light:hover, .btn-outline-light:focus {
    background-color: var(--text-color-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-light {
    background-color: var(--text-color-light);
    color: var(--primary-color);
    border-color: var(--text-color-light);
}

.btn-light:hover, .btn-light:focus {
    background-color: var(--background-medium);
    color: var(--primary-color);
    border-color: var(--background-medium);
    transform: translateY(-2px);
}

/* ------------------------- */
/* --- 2. Header Styles    --- */
/* ------------------------- */
.site-header {
    background-color: #fff;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--box-shadow);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.logo a {
    font-family: var(--font-family-headings);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.logo a:hover {
    color: var(--secondary-color);
}

html[lang="ru"] .logo a {
    font-size: 1.2rem;
}

.main-navigation {
    flex-grow: 0;
    flex-shrink: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    align-items: center;
}

.main-navigation .nav-link {
    font-family: var(--font-family-headings);
    color: var(--text-color-dark);
    text-decoration: none;
    padding: 10px 12px;
    margin-left: 3px;
    font-weight: 500;
    position: relative;
    transition: color var(--transition-speed);
    white-space: nowrap;
    font-size: 0.95rem;
}

html[lang="ru"] .main-navigation .nav-link {
    font-size: 0.8rem;
    padding: 10px 6px;
    margin-left: 2px;
}

.main-navigation .nav-link:hover,
.main-navigation .nav-link.active {
    color: var(--primary-color);
}

.main-navigation .nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.main-navigation .nav-link:hover::after,
.main-navigation .nav-link.active::after {
    width: 70%;
}

.language-switcher {
    flex-shrink: 1;
    white-space: nowrap;
    margin-left: 10px;
}

.language-switcher .lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color-dark);
    padding: 6px 10px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

html[lang="ru"] .language-switcher .lang-btn {
    font-size: 0.7rem;
    padding: 4px 6px;
    margin-left: 2px;
}

.language-switcher .lang-btn:hover,
.language-switcher .lang-btn.active {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    margin-left: 10px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all var(--transition-speed);
}

/* ------------------------- */
/* --- 3. Hero Section (Homepage specific, could be in index-page.css) --- */
/* ------------------------- */
.hero-section { /* This is for index.html hero */
    background: linear-gradient(rgba(10, 36, 99, 0.8), rgba(10, 36, 99, 0.7)), url('https://placehold.co/1920x1080/0A2463/333?text=Welcome+to+MoeDove') no-repeat center center/cover;
    color: var(--text-color-light);
    height: calc(100vh - var(--header-height));
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
}

.hero-section .container { /* Max width for hero content */
    max-width: 800px;
}

.hero-section h1 {
    font-family: var(--font-family-headings);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    line-height: 1.7;
    opacity: 0.9;
}
/* In global.css (moved from programs-page.css or similar) */
.page-hero-section {
    background-color: var(--background-medium);
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 60px;
    text-align: center;
}

.hero-page-subtitle {
    font-size: 1.1rem;
    color: var(--text-color-dark);
    opacity: 0.8;
    max-width: 800px;
    margin: 0 auto 30px auto;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .page-hero-section {
        padding-top: calc(var(--header-height) + 30px);
        padding-bottom: 40px;
    }
    .hero-page-subtitle {
        font-size: 1rem;
    }
}

/* ------------------------- */
/* --- 4. Featured Programs (Homepage specific, could be in index-page.css) --- */
/* ------------------------- */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.program-card { /* Styling for homepage program cards */
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.program-image { /* For homepage cards */
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.program-card h3 {
    font-family: var(--font-family-headings);
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 20px 20px 10px;
}

.program-card p {
    font-size: 0.95rem;
    padding: 0 20px 20px;
    flex-grow: 1;
    color: #555;
}

.program-card .btn {
    margin: 0 20px 20px;
    align-self: flex-start;
}

/* ------------------------- */
/* --- 5. About Preview (Homepage specific, could be in index-page.css) --- */
/* ------------------------- */
.about-preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-preview-content .about-text h2.section-title { /* This title might need to be more generic or moved */
    text-align: left;
    margin-bottom: 20px;
}

.about-preview-content .about-text p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    color: #444;
}

.about-image-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.about-image { /* For homepage about preview */
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ------------------------- */
/* --- 6. Why Choose Us (Homepage specific, could be in index-page.css) --- */
/* ------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-item {
    background-color: #fff;
    padding: 30px;
    text-align: center;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.feature-icon {
    margin-bottom: 20px;
}

.feature-icon img {
    height: 60px;
    width: auto;
    margin: 0 auto;
}

.feature-item h3 {
    font-family: var(--font-family-headings);
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.feature-item p {
    font-size: 0.9rem;
    color: #555;
}

/* ------------------------- */
/* --- 7. Call to Action (Homepage specific, could be in index-page.css) --- */
/* ------------------------- */
.cta-section {
    color: var(--text-color-light);
}

/* .cta-section .section-title is covered by .section-title.light */

.cta-section p {
    font-size: 1.15rem;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.cta-buttons .btn {
    margin: 0 10px;
}

/* ------------------------- */
/* --- 8. Footer Styles    --- */
/* ------------------------- */
.site-footer {
    background-color: var(--text-color-dark);
    color: var(--background-light);
    padding-top: 60px;
    padding-bottom: 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h4 {
    font-family: var(--font-family-headings);
    font-size: 1.3rem;
    color: var(--text-color-light);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-column p, .footer-column li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.footer-column a {
    color: var(--background-light);
    text-decoration: none;
}

.footer-column a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.social-links a {
    display: inline-block;
    margin-right: 15px;
}

.social-links img {
    height: 24px;
    width: 24px;
    transition: transform var(--transition-speed);
}

.social-links a:hover img {
    transform: scale(1.1);
}

.newsletter-form {
    display: flex;
    margin-top: 10px;
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 0.9rem;
    background-color: #fff;
    color: var(--text-color-dark);
}
.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--accent-color-rgb), 0.25);
}

.newsletter-form button {
    padding: 10px 15px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    white-space: nowrap;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ------------------------- */
/* --- 9. Responsive Design (Global parts) --- */
/* ------------------------- */

/* Basic Grid setup for row/col if not using a framework like Bootstrap */
/* This should be global if used across pages */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px; /* Gutter emulation */
    margin-left: -15px;  /* Gutter emulation */
}
.col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-sm-6 { /* Add other col sizes as needed */
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 576px) { /* sm breakpoint */
    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 768px) { /* md breakpoint */
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
}


@media (max-width: 992px) { /* Tablet */
    .section-title { font-size: 2rem; }

    /* Homepage hero adjustments */
    .hero-section h1 { font-size: 2.8rem; }
    .hero-section p { font-size: 1.1rem; }

    /* Homepage about preview adjustments */
    .about-preview-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .about-preview-content .about-text h2.section-title {
        text-align: center;
    }
    .about-image-container {
        margin-top: 30px;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Header nav link adjustments */
    .main-navigation .nav-link {
        font-size: 0.9rem;
        padding: 10px 10px;
    }
    html[lang="ru"] .main-navigation .nav-link {
        font-size: 0.8rem;
        padding: 10px 7px;
    }
    .logo a { font-size: 1.5rem; }
    html[lang="ru"] .logo a { font-size: 1.1rem; }
    html[lang="ru"] .language-switcher .lang-btn {
        font-size: 0.65rem;
        padding: 3px 5px;
    }
}

@media (max-width: 768px) { /* Mobile Landscape / Large Phones */
    :root { --header-height: 70px; }
    .site-header { height: var(--header-height); }

    /* Homepage hero adjustments */
    .hero-section {
        height: auto;
        min-height: 500px;
        padding-top: calc(var(--header-height) + 30px);
        padding-bottom: 30px;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 10px 0;
    }
    .main-navigation.active {
        display: flex;
        flex-direction: column;
    }
    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }
    .main-navigation .nav-link {
        padding: 12px 20px;
        margin-left: 0;
        text-align: center;
        border-bottom: 1px solid var(--background-medium);
        white-space: normal;
        font-size: 1rem;
    }
    html[lang="ru"] .main-navigation .nav-link {
        font-size: 0.95rem;
    }
    .main-navigation .nav-link:last-child { border-bottom: none; }
    .main-navigation .nav-link::after { display: none; }

    .menu-toggle { display: block; }
    .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

    .language-switcher {
        margin-left: auto;
        padding-right: 0;
    }
    html[lang="ru"] .language-switcher .lang-btn {
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    /* Homepage sections stacking */
    .programs-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .social-links { text-align: center; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form input[type="email"] {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        margin-bottom: 10px;
    }
    .newsletter-form button {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
}

@media (max-width: 576px) { /* Mobile Portrait / Small Phones */
    .section-title { font-size: 1.8rem; }
    .hero-section h1 { font-size: 2.2rem; } /* Homepage hero */
    .hero-section p { font-size: 1rem; }  /* Homepage hero */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .program-card h3 { font-size: 1.3rem; } /* Homepage program card */
    .logo a { font-size: 1.3rem; }
    html[lang="ru"] .logo a { font-size: 1.0rem; white-space: normal; line-height:1.1; }
    .language-switcher .lang-btn {
        padding: 5px 6px;
        font-size: 0.7rem;
    }
    html[lang="ru"] .language-switcher .lang-btn {
        font-size: 0.65rem;
        padding: 3px 4px;
        margin-left: 1px;
    }
}