/* assets/site.css - one stylesheet for every public page */

:root {
    --aps-maroon: #8b0000;
    --aps-maroon-dark: #600000;
    --aps-navy: #002147;
    --aps-gold: #ffcc00;
    --light-bg: #f8f9fa;
    --card-line: #e5e9f0;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: var(--light-bg);
    color: #1f2937;
}
a { color: #0b4f9c; }
:focus-visible { outline: 3px solid rgba(255, 204, 0, .9); outline-offset: 2px; }

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 2000;
    background: var(--aps-gold); color: var(--aps-navy); font-weight: 700;
    padding: 8px 14px; border-radius: 6px; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ---------- Top bar and header ---------- */
.top-info-bar { background: var(--aps-navy); color: #fff; padding: 6px 0; font-size: .85rem; }
.top-info-bar a { color: #fff; text-decoration: none; }
.top-info-bar a:hover { text-decoration: underline; }

.header-main { background: #fff; padding: 15px 0; border-bottom: 4px solid var(--aps-gold); }
.school-logo { width: 85px; height: auto; }
.school-name { display: block; line-height: 1.15; }
.school-title { display: block; color: var(--aps-maroon); font-weight: 800; font-size: 2rem; }
.school-place { display: block; font-weight: 700; color: #6c757d; margin-top: 2px; }
@media (max-width: 991.98px) { .school-title { font-size: 1.45rem; } .school-logo { width: 64px; } }
@media (max-width: 420px)    { .school-title { font-size: 1.15rem; } .school-logo { width: 52px; } }

.clock-wrapper { border-left: 2px solid #eee; padding-left: 20px; }
@media (max-width: 575.98px) { .clock-wrapper { border-left: 0; padding-left: 0; } }
#analog-clock {
    width: 50px; height: 50px; border: 2px solid #333; border-radius: 50%;
    position: relative; margin-right: 15px;
}
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom; background: #333; }
.hour { width: 3px; height: 12px; }
.min  { width: 2px; height: 18px; }
.sec  { width: 1px; height: 20px; background: red; }

/* ---------- Menu ---------- */
.navbar { background: var(--aps-maroon) !important; padding: 0; }
.nav-link {
    color: #fff !important; font-weight: 600; text-transform: uppercase;
    padding: 12px 20px !important; font-size: .85rem;
}
.nav-link:hover, .nav-link.active { background: rgba(0, 0, 0, .2); color: var(--aps-gold) !important; }
.dropdown-menu { border-radius: 0 0 8px 8px; border-top: 3px solid var(--aps-gold); }
.dropdown-item.active, .dropdown-item:active { background: var(--aps-maroon); }
.dropdown-item:hover { background: #fdf1f1; }
@media (min-width: 992px) {
    .dropdown-menu {
        display: block; opacity: 0; visibility: hidden; transform: translateY(10px);
        transition: .25s; margin-top: 0;
    }
    .nav-item.dropdown:hover .dropdown-menu,
    .nav-item.dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
}
@media (max-width: 991.98px) {
    .navbar-collapse { padding-bottom: 8px; }
    .dropdown-menu { background: rgba(0, 0, 0, .18); border: 0; border-radius: 0; }
    .dropdown-item { color: #fff; }
    .dropdown-item:hover { background: rgba(0, 0, 0, .25); color: var(--aps-gold); }
}

/* ---------- Home: notice ticker ---------- */
.notice-container {
    background: #fff; border: 1px solid var(--card-line); border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column; height: 100%; min-height: 420px;
}
.notice-header { background: var(--aps-maroon); color: #fff; padding: 12px 14px; font-weight: 700; }
.notice-box { flex: 1 1 auto; overflow: hidden; position: relative; padding: 15px; min-height: 300px; }
@media (max-width: 991.98px) { .notice-box { min-height: 260px; max-height: 340px; } .notice-container { min-height: 0; } }
/* few notices: a plain list that scrolls by hand if it is long */
.notice-box:not(:has(.is-looping)) { overflow-y: auto; }
/* five or more: an endless upward loop with no empty gap (the list is repeated once) */
.notice-scroll.is-looping {
    /* out of the normal flow, so a long list can never stretch the box (or the row it sits in) */
    position: absolute; top: 15px; left: 15px; right: 15px;
    animation: tickerUp var(--ticker-seconds, 40s) linear infinite; will-change: transform;
}
.notice-scroll.is-looping:hover, .notice-scroll.is-looping:focus-within { animation-play-state: paused; }
@keyframes tickerUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) {
    .notice-box { overflow-y: auto !important; }
    .notice-scroll.is-looping { animation: none; position: static; }
    .notice-dup { display: none; }
}

/* ---------- Home: info cards ---------- */
.info-card {
    background: #fff; border: 1px solid var(--card-line); border-radius: 14px; overflow: hidden;
    height: 100%; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.info-card:hover { box-shadow: 0 10px 24px rgba(0, 33, 71, .1) !important; transform: translateY(-2px); }
.card-header-custom { padding: 12px; color: #fff; font-weight: 700; text-align: center; letter-spacing: .3px; }
.panel-body { flex-grow: 1; padding: 15px; min-height: 200px; }
.panel-item { border-bottom: 1px solid #eef1f5; padding-bottom: .6rem; margin-bottom: .8rem; }
.panel-item:last-child { border-bottom: 0; margin-bottom: 0; }
.panel-item a { color: #1f2937; text-decoration: none; font-weight: 700; font-size: .9rem; }
.panel-item a:hover { color: var(--aps-maroon); }
.panel-item small { display: block; color: #6c757d; }
.panel-empty { color: #6c757d; font-size: .9rem; }

/* ============================================================
   SLIDER - any picture size fits, nothing is cropped or stretched
   ============================================================ */
.hero-slider {
    background: #fff; border: 1px solid var(--card-line); border-radius: 14px; overflow: hidden;
    box-shadow: 0 6px 22px rgba(0, 33, 71, .12);
}
.slide-stage {
    position: relative; aspect-ratio: 16 / 9; background: #0b1424; overflow: hidden;
}
@media (max-width: 575.98px) { .slide-stage { aspect-ratio: 4 / 3; } }

/* soft, blurred copy of the same picture fills the empty space */
.slide-bg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: blur(22px) brightness(.62) saturate(1.15); transform: scale(1.15); pointer-events: none;
}
/* the real picture: shown whole, centred, never enlarged beyond its own size */
.slide-fg {
    position: absolute; inset: 0; margin: auto; z-index: 1;
    max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35));
}
.slide-open, .slide-link { position: absolute; inset: 0; z-index: 2; display: block; cursor: zoom-in; }
.slide-link { cursor: pointer; }

.slide-caption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none;
    padding: 2.6rem 1.1rem .9rem; color: #fff; font-weight: 600; font-size: 1.05rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.slide-zoom {
    position: absolute; top: 10px; right: 10px; z-index: 4; width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; background: rgba(0, 33, 71, .6); text-decoration: none; transition: background .2s;
}
.slide-zoom:hover { background: var(--aps-maroon); color: #fff; }
.slide-counter {
    position: absolute; right: 10px; bottom: 10px; z-index: 4; font-size: .78rem; font-weight: 600;
    color: #fff; background: rgba(0, 0, 0, .55); padding: 3px 10px; border-radius: 20px; pointer-events: none;
}

.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next { width: 64px; opacity: 1; z-index: 5; }
.slide-nav-btn {
    width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.15rem; background: rgba(0, 33, 71, .55); backdrop-filter: blur(4px); transition: background .2s, transform .2s;
}
.carousel-control-prev:hover .slide-nav-btn,
.carousel-control-next:hover .slide-nav-btn { background: var(--aps-maroon); transform: scale(1.08); }

.slider-thumbs {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px; background: #fff;
    border-top: 1px solid var(--card-line); scroll-snap-type: x proximity; scrollbar-width: thin;
}
.slider-thumbs button {
    flex: 0 0 auto; padding: 0; border: 2px solid transparent; border-radius: 9px; background: none;
    opacity: .68; scroll-snap-align: center; transition: opacity .2s, border-color .2s, transform .2s;
}
.slider-thumbs button:hover { opacity: 1; transform: translateY(-1px); }
.slider-thumbs button.active { border-color: var(--aps-maroon); opacity: 1; }
.slider-thumbs img { width: 96px; height: 60px; object-fit: cover; border-radius: 6px; display: block; background: #e2e8f0; }
@media (max-width: 575.98px) { .slider-thumbs img { width: 76px; height: 52px; } .hero-slider .carousel-control-prev, .hero-slider .carousel-control-next { width: 48px; } }

/* no slides yet: a tidy welcome card instead of an empty black box */
.slider-empty {
    aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: linear-gradient(135deg, var(--aps-navy), #0b3a73); color: #fff; padding: 1rem;
}
.slider-empty img { width: 84px; height: auto; margin-bottom: .8rem; }
.slider-empty .h4 { font-weight: 800; }

/* ---------- Inner pages ---------- */
.page-banner { background: #e9ecef; border-bottom: 1px solid #dee2e6; padding: 30px 0; margin-bottom: 30px; }
.page-banner .breadcrumb { margin: .5rem 0 0; font-size: .9rem; }
.page-banner .breadcrumb a { color: var(--aps-maroon); text-decoration: none; }

.content-card {
    background: #fff; border: 1px solid var(--card-line); border-radius: 16px;
    box-shadow: 0 6px 22px rgba(0, 33, 71, .06); padding: 2rem;
}
@media (max-width: 575.98px) { .content-card { padding: 1.2rem; border-radius: 12px; } }
.page-title { color: var(--aps-navy); font-weight: 800; letter-spacing: -.3px; }
.page-hero-img { width: 100%; max-height: 420px; object-fit: contain; background: #f1f5f9; border-radius: 12px; margin-bottom: 1.4rem; }

/* text written in the admin panel */
.page-content { line-height: 1.8; font-size: 1.04rem; overflow-wrap: anywhere; }
.page-content h1, .page-content h2, .page-content h3, .page-content h4 { color: var(--aps-navy); font-weight: 700; margin: 1.4rem 0 .7rem; }
.page-content h2 { font-size: 1.5rem; padding-bottom: .3rem; border-bottom: 2px solid var(--aps-gold); display: inline-block; }
.page-content img { max-width: 100%; height: auto; border-radius: 8px; }
.page-content a { text-decoration: underline; text-underline-offset: 2px; }
.page-content a:hover { color: var(--aps-maroon); }
.page-content blockquote { border-left: 4px solid var(--aps-gold); background: #fffbea; margin: 1rem 0; padding: .8rem 1rem; border-radius: 0 8px 8px 0; color: #475569; }
.page-content ul, .page-content ol { padding-left: 1.4rem; }
.page-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .96rem; }
.page-content th, .page-content td { border: 1px solid #dbe1ea; padding: .55rem .75rem; vertical-align: top; }
.page-content th { background: #f1f5f9; color: var(--aps-navy); }
.page-content .table-responsive { margin: 1rem 0; }

/* ---------- Notices ---------- */
.notice-item { border-left: 5px solid transparent; transition: .25s; margin-bottom: 8px; border-radius: 8px !important; }
.notice-item:hover { border-left-color: var(--aps-maroon); background-color: #fff; transform: translateX(4px); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
.sidebar-panel { background: #fff; border-radius: 12px; margin-bottom: 20px; border: 1px solid #eef2f6; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, .04); }
.panel-header { padding: 12px 15px; font-weight: 700; color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.bg-navy { background: var(--aps-navy); }
.btn-gold { background: var(--aps-gold); color: var(--aps-navy); }
.btn-gold:hover { background: #e6b800; color: var(--aps-navy); }
.badge-type { background: #fde8e8; color: #b42318; }

/* ---------- Useful links ---------- */
.link-card { border-radius: 14px; border: 1px solid var(--card-line); background: #fff; height: 100%; box-shadow: 0 3px 10px rgba(15, 23, 42, .05); transition: box-shadow .2s, transform .2s; }
.link-card:hover { box-shadow: 0 10px 22px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.link-card h2 { font-size: 1.15rem; font-weight: 700; color: var(--aps-navy); }
.link-item a { text-decoration: none; font-weight: 600; }
.link-item a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.footer-main { background: #111; color: #ccc; padding: 40px 0; border-top: 5px solid var(--aps-maroon); margin-top: 3rem; }

/* ---------- Print ---------- */
@media print {
    .top-info-bar, .navbar, .skip-link, .footer-main .small, .sidebar-col, .no-print { display: none !important; }
    body { background: #fff; }
    .content-card { box-shadow: none; border: 0; padding: 0; }
}
