/* ============================================================
   ABC TVET Polytechnic College - Main Stylesheet
   ISO 9001:2015 & ISO 21001:2018 Compliant
   WCAG 2.1 AA Accessibility Compliant
   Mobile-First Responsive Design
   ============================================================ */

/* === CSS Variables === */
:root {
    --primary: #003366;
    --primary-dark: #002244;
    --primary-light: #004488;
    --gold: #FFB81C;
    --gold-dark: #D4A000;
    --gold-light: #FFD700;
    --text-dark: #212529;
    --text-light: #f8f9fa;
    --bg-light: #f0f4f8;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s ease;
}

/* === Reset & Base === */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* === Colors === */
.bg-primary { background-color: var(--primary) !important; }
.bg-gold { background-color: var(--gold) !important; }
.text-gold { color: var(--gold) !important; }
.btn-gold {
    background-color: var(--gold);
    border-color: var(--gold);
    color: var(--primary-dark);
    font-weight: 600;
    transition: var(--transition);
}
.btn-gold:hover, .btn-gold:focus {
    background-color: var(--gold-dark);
    border-color: var(--gold-dark);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 184, 28, 0.4);
}

/* === Navigation === */
.navbar {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}
.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
    border-radius: 0.25rem;
}
.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.navbar .nav-link.btn-gold {
    color: var(--primary-dark) !important;
}
.navbar .nav-link.btn-gold:hover {
    background-color: var(--gold-dark);
    color: var(--primary-dark) !important;
}

/* === Hero Section === */
.hero-section .carousel-item {
    min-height: 70vh;
    display: flex;
    align-items: center;
}
@media (max-width: 768px) {
    .hero-section .carousel-item {
        min-height: 50vh;
    }
    .hero-section .display-4 {
        font-size: 2rem;
    }
}

/* === Counter Section === */
.counter-item {
    padding: 1rem;
}
.counter {
    transition: var(--transition);
}

/* === Cards === */
.card {
    border-radius: 0.5rem;
    transition: var(--transition);
}
.program-card,
.news-card,
.event-card,
.album-card {
    transition: transform 0.3s, box-shadow 0.3s;
}
.program-card:hover,
.news-card:hover,
.event-card:hover,
.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 51, 102, 0.15) !important;
}

/* === Event Date Badge === */
.event-date {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* === Gallery Overlay === */
.gallery-thumb {
    position: relative;
    overflow: hidden;
}
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 51, 102, 0.7);
    opacity: 0;
    transition: var(--transition);
}
.gallery-thumb:hover .gallery-overlay {
    opacity: 1;
}

/* === Breadcrumbs === */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
}

/* === Forms === */
.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(255, 184, 28, 0.25);
}

/* === Emergency Banner === */
.emergency-banner {
    z-index: 1050;
}

/* === Scroll to Top === */
#scrollTop {
    z-index: 1050;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: var(--transition);
}
#scrollTop:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* === Footer === */
footer a:hover {
    color: var(--gold) !important;
    text-decoration: underline !important;
}

/* === Admin Sidebar === */
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-sidebar .nav-link {
    padding: 0.6rem 1rem;
    margin-bottom: 0.2rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}
.admin-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
@media (max-width: 768px) {
    .admin-sidebar {
        position: relative;
        height: auto;
        min-height: auto;
    }
    .admin-wrapper {
        flex-direction: column;
    }
}

/* === Tables === */
.table > :not(caption) > * > * {
    vertical-align: middle;
}

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

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Skip to main content */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--gold);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    z-index: 9999;
    font-weight: bold;
}
.skip-link:focus {
    top: 0;
}

/* === Grayscale for partner logos === */
.grayscale {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}
.grayscale:hover {
    filter: grayscale(0);
    opacity: 1;
}

/* === News Content Body === */
.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}
.content-body h2,
.content-body h3 {
    margin-top: 1.5rem;
    color: var(--primary);
}

/* === Accordion === */
.accordion-button:not(.collapsed) {
    background-color: rgba(0, 51, 102, 0.05);
    color: var(--primary);
    font-weight: 600;
}
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 184, 28, 0.25);
}

/* === Countdown Timer === */
.countdown .bg-dark {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* === Responsive Breakpoints === */
@media (max-width: 320px) {
    .hero-section .display-4 { font-size: 1.5rem; }
    .hero-section .lead { font-size: 0.9rem; }
    .navbar-brand div { display: none; }
}

@media (min-width: 768px) {
    .news-card-horizontal .card-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
}

/* === Print Styles === */
@media print {
    .navbar, footer, #scrollTop, .breadcrumb { display: none; }
    .card { border: 1px solid #ddd; box-shadow: none; }
}
