/* Shared public inner pages (Gallery, Notices) — matches homepage chrome */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.public-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    background: #f6f7fb;
    line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 12px 0;
    transition: all 0.4s ease;
    background: transparent;
}
.navbar.scrolled {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 30px rgba(0,0,0,0.08);
    padding: 8px 0;
}
.navbar .container {
    display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand img {
    height: 50px; width: 50px; border-radius: 12px; object-fit: cover;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.navbar.scrolled .nav-brand img { height: 42px; width: 42px; }
.nav-brand-text {
    font-weight: 700; font-size: 1.1rem; color: #fff;
    max-width: 200px; line-height: 1.3;
}
.navbar.scrolled .nav-brand-text { color: var(--school-primary); }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-links a {
    display: inline-block; padding: 8px 16px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}
.navbar.scrolled .nav-links a { color: #444; }
.nav-links a:hover,
.nav-links a.is-active {
    background: rgba(255,255,255,0.15); color: #fff;
}
.navbar.scrolled .nav-links a:hover,
.navbar.scrolled .nav-links a.is-active {
    background: var(--school-primary); color: #fff;
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    position: absolute; top: 100%; right: 0; min-width: 160px;
    background: #fff; border-radius: 12px; padding: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: all 0.3s ease;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block; padding: 10px 16px; border-radius: 8px;
    font-size: 0.88rem; color: #333 !important; font-weight: 500;
}
.nav-dropdown-menu a:hover { background: var(--school-primary) !important; color: #fff !important; }
.login-btn {
    background: rgba(255,255,255,0.2) !important; border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px !important;
}
.navbar.scrolled .login-btn {
    background: var(--school-primary) !important; color: #fff !important;
    border-color: var(--school-primary);
}
.mobile-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 30px; height: 24px; position: relative; z-index: 1001;
}
.mobile-toggle span {
    display: block; width: 100%; height: 2px; background: #fff;
    border-radius: 2px; position: absolute; left: 0;
    transition: all 0.3s ease;
}
.navbar.scrolled .mobile-toggle span { background: #333; }
.mobile-toggle span:nth-child(1) { top: 0; }
.mobile-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.mobile-toggle span:nth-child(3) { bottom: 0; }

.page-hero {
    position: relative;
    min-height: 46vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 140px 0 56px;
}
.page-hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}
.page-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.38) 55%, rgba(0,0,0,0.55) 100%);
}
.page-hero-content { position: relative; z-index: 2; color: #fff; max-width: 720px; }
.page-kicker {
    display: inline-block; padding: 6px 16px; margin-bottom: 14px;
    background: rgba(255,255,255,0.14); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2); border-radius: 50px;
    font-size: 0.82rem; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
}
.page-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 800; line-height: 1.15; margin-bottom: 12px;
}
.page-hero p {
    font-size: 1.05rem; color: rgba(255,255,255,0.86); max-width: 540px;
}

.public-section { padding: 56px 0 80px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.gallery-grid:has(.public-empty),
.notices-grid:has(.public-empty) {
    display: block;
}
.gallery-grid a {
    display: block;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #e8edf3;
    box-shadow: 0 10px 30px rgba(15, 25, 35, 0.08);
}
.gallery-grid img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.45s ease;
}
.gallery-grid a::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.35) 100%);
    opacity: 0; transition: opacity 0.3s ease;
}
.gallery-grid a:hover img { transform: scale(1.06); }
.gallery-grid a:hover::after { opacity: 1; }

.notices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.notice-card {
    background: #fff;
    border-radius: 18px;
    padding: 24px 22px 18px;
    box-shadow: 0 10px 32px rgba(15, 25, 35, 0.06);
    border: 1px solid #eef1f6;
    border-left: 4px solid var(--school-primary);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.notice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 25, 35, 0.1);
}
.notice-badge {
    position: absolute; top: 16px; right: 16px;
    background: var(--school-primary); color: #fff;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.notice-card h3 {
    margin: 0 70px 12px 0;
    font-size: 1.08rem; font-weight: 700; color: #1a1a2e; line-height: 1.4;
}
.notice-card p {
    margin: 0 0 16px;
    color: #555; font-size: 0.95rem; line-height: 1.7;
}
.notice-meta {
    display: flex; align-items: center; gap: 10px;
    padding-top: 12px; border-top: 1px solid #eef1f6;
    color: #7a8290; font-size: 0.82rem;
}
.notice-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--school-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
}

.public-empty {
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 64px 24px;
    box-shadow: 0 10px 32px rgba(15, 25, 35, 0.05);
    color: #667085;
}
.public-empty i {
    font-size: 2.4rem; color: var(--school-primary); margin-bottom: 12px;
}
.public-empty h3 { color: #1a1a2e; margin-bottom: 6px; font-size: 1.2rem; }

.footer {
    background: #0f1923; padding: 70px 0 0; color: #ccc;
}
.footer-grid {
    display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 40px; padding-bottom: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-grid > div { min-width: 0; }
.footer-brand img {
    height: 56px; width: 56px; border-radius: 14px; margin-bottom: 16px; object-fit: cover;
}
.footer-brand p { font-size: 0.9rem; color: #999; line-height: 1.7; margin-bottom: 20px; }
.footer h5 { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 20px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a, .footer-links li {
    font-size: 0.9rem; color: #999; overflow-wrap: break-word;
}
.footer-links a:hover { color: var(--school-primary); }
.social-icons { display: flex; gap: 10px; }
.social-icons a {
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255,255,255,0.06); display: flex;
    align-items: center; justify-content: center;
    color: #999; transition: all 0.3s ease;
}
.social-icons a:hover { background: var(--school-primary); color: #fff; }
.footer-bottom {
    padding: 24px 0; text-align: center;
    font-size: 0.82rem; color: #666;
}

body.menu-open-body { overflow: hidden !important; }
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-toggle { display: block; z-index: 1002; }
    .navbar.menu-open { background: #0f1923 !important; box-shadow: none !important; }
    .navbar.menu-open .mobile-toggle span { background: #fff !important; }
    .navbar.menu-open .nav-brand-text { color: #fff !important; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: fixed; top: 0; right: 0; left: auto;
        width: min(300px, 86vw);
        height: 100vh; height: 100dvh; max-height: 100dvh;
        background: #0f1923;
        justify-content: flex-start; align-items: flex-end;
        gap: 6px; z-index: 1001;
        overflow-y: auto; padding: 80px 20px calc(72px + env(safe-area-inset-bottom, 0px));
        text-align: right;
        box-shadow: -10px 0 32px rgba(0,0,0,0.35);
    }
    .nav-links.open > li { width: 100%; }
    .nav-links.open a {
        color: #fff !important; font-size: 1.05rem;
        padding: 12px 8px; display: block; width: 100%; text-align: right;
    }
    .nav-links.open .nav-dropdown-menu {
        position: static; opacity: 1; visibility: visible;
        transform: none; background: rgba(255,255,255,0.08);
        box-shadow: none; width: 100%;
    }
    .nav-links.open .nav-dropdown-menu a {
        color: rgba(255,255,255,0.85) !important; font-size: 0.95rem;
    }
    .footer-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 120px 0 40px; min-height: 38vh; }
}

html[data-theme="dark"] body.public-page { background: #0f1923; color: #e8eef5; }
html[data-theme="dark"] .navbar.scrolled { background: rgba(15,25,35,0.96); }
html[data-theme="dark"] .navbar.scrolled .nav-brand-text,
html[data-theme="dark"] .navbar.scrolled .nav-links a { color: #e8eef5; }
html[data-theme="dark"] .navbar.scrolled .mobile-toggle span { background: #e8eef5; }
html[data-theme="dark"] .notice-card,
html[data-theme="dark"] .public-empty { background: #16202b; border-color: #243140; }
html[data-theme="dark"] .notice-card h3,
html[data-theme="dark"] .public-empty h3 { color: #f3f6fb; }
html[data-theme="dark"] .notice-card p { color: #c5ced8; }
html[data-theme="dark"] .notice-meta { border-top-color: #243140; }
