:root {
    --brand-red: #b71c1c;
    --brand-navy: #1a237e;
    --text-main: #2c3e50;
    --bg-gray: #f8f9fa;
    --white: #ffffff;
}

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

body {
    font-family: "Times New Roman", "YuMincho", "Hiragino Mincho ProN", serif;
    margin: 0; color: var(--text-main); background: var(--bg-gray);
    line-height: 1.8;
}

/* ===== HEADER / NAV ===== */
header {
    background: var(--white);
    border-top: 5px solid var(--brand-red);
    border-bottom: 1px solid #ddd;
    position: sticky; top: 0; z-index: 1000;
}
.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-size: clamp(13px, 3.2vw, 22px);
    font-weight: bold; color: var(--brand-red);
    text-decoration: none; white-space: nowrap;
}

.hamburger {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 36px; height: 36px; cursor: pointer;
    background: none; border: none; padding: 4px; flex-shrink: 0;
}
.hamburger span {
    display: block; height: 2px; background: var(--brand-navy);
    border-radius: 2px; transition: 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
    display: flex; gap: 20px; list-style: none; margin: 0; padding: 0;
    font-weight: bold; font-size: 14px; align-items: center;
}
.nav-links li a {
    text-decoration: none; color: var(--text-main);
    transition: 0.3s; white-space: nowrap;
}
.nav-links li a:hover { color: var(--brand-red); }
.nav-links li a.active { color: var(--brand-red); }
.btn-exam a {
    background: var(--brand-red); color: white !important;
    padding: 8px 16px; border-radius: 2px; display: block;
}

@media (max-width: 700px) {
    .hamburger { display: flex; }
    .nav-links {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; gap: 0;
        background: var(--white);
        border-bottom: 2px solid var(--brand-red);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .nav-links.open { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links li a {
        display: block; padding: 14px 20px;
        border-bottom: 1px solid #eee;
        font-size: 15px;
    }
    .btn-exam a { border-radius: 0; }
}

/* ===== HERO ===== */
.hero {
    height: clamp(240px, 50vw, 500px);
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
        url('https://images.unsplash.com/photo-1541339907198-e08756ebafe3?auto=format&fit=crop&w=1200&q=80');
    background-size: cover; background-position: center;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    color: white; text-align: center; padding: 0 20px;
}
.hero h2 {
    font-size: clamp(20px, 5.5vw, 52px);
    margin: 0; letter-spacing: 0.15em;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.hero p {
    font-size: clamp(12px, 2.8vw, 20px);
    margin-top: 14px; letter-spacing: 0.1em;
}

/* ===== LAYOUT ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 40px 16px; }
.section-box {
    background: var(--white);
    padding: clamp(20px, 5vw, 50px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    margin-top: -40px; position: relative;
}
.section-title {
    font-size: clamp(20px, 4.5vw, 32px);
    text-align: center; margin-bottom: 36px; color: var(--brand-navy);
}
.section-title::after {
    content: ""; display: block; width: 60px; height: 3px;
    background: var(--brand-red); margin: 14px auto 0;
}

/* ===== LONG TEXT ===== */
.long-text p {
    margin-bottom: 1.8em; text-indent: 1em; text-align: justify;
    font-size: clamp(14px, 2.4vw, 16px);
}

/* ===== NEWS ===== */
.news-item {
    padding: 13px 0; border-bottom: 1px solid #eee;
    font-size: clamp(13px, 2.4vw, 15px);
}
.news-item:last-child { border-bottom: none; }

/* ===== PRINCIPAL ===== */
.principal-inner {
    display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap;
}
.principal-profile {
    flex-shrink: 0; text-align: center; width: 150px; margin: 0 auto;
}
.principal-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    border: 4px solid var(--brand-red);
    object-fit: cover; background: #ddd;
    display: block; margin: 0 auto 10px;
}
.principal-name {
    font-weight: bold; color: var(--brand-navy);
    font-size: clamp(14px, 2.8vw, 18px);
}
.principal-title { font-size: 13px; color: #999; }

@media (max-width: 600px) {
    .principal-inner { flex-direction: column; align-items: center; gap: 20px; }
    .principal-profile { width: 100%; }
}

/* ===== ALUMNI ===== */
.alumni-period {
    margin-bottom: 48px;
    border-left: 4px solid var(--brand-red);
    padding-left: 18px;
}
.alumni-period-title {
    font-size: clamp(15px, 2.8vw, 20px);
    font-weight: bold; color: var(--brand-navy);
    margin-bottom: 6px;
}
.alumni-period-note {
    font-size: 13px; color: #888; margin-bottom: 18px;
}
.alumni-cards {
    display: flex; gap: 14px; flex-wrap: wrap;
}
.alumni-card {
    background: var(--bg-gray); border: 1px solid #e0e0e0;
    padding: 18px; display: flex; align-items: center; gap: 14px;
    flex: 1; min-width: 200px;
}
.alumni-avatar {
    width: 68px; height: 68px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--brand-red);
    flex-shrink: 0; background: #ddd;
}
.alumni-name {
    font-size: clamp(14px, 2.8vw, 18px);
    font-weight: bold; color: var(--brand-navy); margin-bottom: 3px;
}
.alumni-handle { font-size: 13px; color: #999; }

@media (max-width: 480px) {
    .alumni-cards { flex-direction: column; }
    .alumni-card { min-width: 0; }
}

/* ===== EXAM ===== */
.status-bar {
    display: flex; gap: 5px; margin-bottom: 28px;
}
.grade-badge {
    padding: 8px 2px; background: #eee; border-radius: 4px;
    font-weight: bold; color: #999;
    flex: 1; text-align: center;
    font-size: clamp(11px, 2.5vw, 15px);
}
.grade-badge.active { background: var(--brand-red); color: white; }
.grade-badge.passed { background: var(--brand-navy); color: white; }

.quiz-container {
    border: 1px solid #eee;
    padding: clamp(18px, 5vw, 40px);
    text-align: center; background: #fff;
}
.quiz-container h3 { font-size: clamp(15px, 3.2vw, 20px); }
.quiz-container p { font-size: clamp(14px, 2.6vw, 16px); }

.choice-btn {
    display: block; width: 100%; padding: 14px 10px; margin: 10px 0;
    border: 1px solid #ddd; background: white; cursor: pointer;
    font-size: clamp(14px, 2.8vw, 16px); font-weight: bold;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.choice-btn:hover, .choice-btn:active {
    background: #fdf2f2; border-color: var(--brand-red);
}
.write-input {
    width: 100%; padding: 14px;
    font-size: clamp(16px, 4vw, 20px);
    border: 2px solid var(--brand-navy); margin-bottom: 14px;
    text-align: center; font-family: inherit;
}

/* ===== OVERLAY ===== */
#submit-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.98); display: none; flex-direction: column;
    justify-content: center; align-items: center; z-index: 5000; padding: 20px;
}
#submit-overlay h3 { text-align: center; font-size: clamp(16px, 3.5vw, 22px); }
.spinner {
    width: 60px; height: 60px; border: 6px solid #f3f3f3;
    border-top: 6px solid var(--brand-red); border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FOOTER ===== */
footer {
    background: #1a1a1a; color: #888;
    padding: 36px 20px; text-align: center; font-size: 12px;
}

/* ===== PAGE FADE ===== */
main { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===== AUDIO PLAYER ===== */
.custom-audio-player {
    background: linear-gradient(135deg, var(--brand-red), var(--brand-navy));
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(183, 28, 28, 0.25);
}
.custom-audio-player audio {
    width: 100%;
    height: 50px;
    accent-color: var(--white);
    filter: brightness(1.1);
}
.custom-audio-player audio::-webkit-media-controls-panel {
    background-color: transparent;
}
.custom-audio-player audio::-webkit-media-controls-timeline {
    background-color: rgba(255,255,255,0.3);
}
