/* ==========================================
   Site header
   ========================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-container-lowest);
    box-shadow: var(--shadow-sm);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    height: var(--nav-height);
}

.site-header__brand-text {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--primary);
}

/* the_custom_logo()'s <img> has no height cap by default and renders at
   its uploaded file's natural size — this school's logo is 310px tall,
   far beyond the 72px --nav-height header row. Without this, the image
   overflows the fixed-height sticky header and overlaps the section
   below it. Must be an explicit height, not a percentage: the image's
   containing link has no definite height of its own for a percentage
   to resolve against. */
.custom-logo {
    height: 2.75rem;
    width: auto;
}

.site-header__nav { flex: 1; }

.site-header__nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-header__nav-list a {
    font-size: var(--text-md);
    font-weight: var(--font-weight-medium);
    color: var(--text);
    white-space: nowrap;
}

.site-header__nav-list a:hover { color: var(--primary); }

.site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.site-header__actions .btn { white-space: nowrap; }

.site-header__menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 2.75rem;
    height: 2.75rem;
    cursor: pointer;
}

.site-header__menu-icon,
.site-header__menu-icon::before,
.site-header__menu-icon::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition);
}
.site-header__menu-icon::before { content: ""; position: absolute; top: -7px; }
.site-header__menu-icon::after { content: ""; position: absolute; top: 7px; }

.site-header__mobile-nav {
    display: none;
    border-top: 1px solid var(--outline-variant);
    background: var(--surface-container-lowest);
}
.site-header__mobile-nav[hidden] { display: none; }
.site-header__mobile-nav:not([hidden]) { display: block; }

.site-header__mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: var(--space-4) var(--page-padding);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

@media (max-width: 860px) {
    .site-header__nav,
    .site-header__actions { display: none; }
    .site-header__menu-toggle { display: block; }
}

/* ==========================================
   Site footer
   ========================================== */

.site-footer {
    background: var(--on-surface);
    color: var(--inverse-on-surface, #F3F1EB);
    margin-top: var(--space-16);
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
    padding-block: var(--space-12);
}

.site-footer__brand {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: #FFFFFF;
}

.site-footer__desc { color: rgba(255, 255, 255, 0.72); margin-top: var(--space-3); }

.site-footer h4 { color: #FFFFFF; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-4); }

.site-footer__nav-list, .site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.site-footer__nav-list a, .site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer__nav-list a:hover, .site-footer a:hover { color: #FFFFFF; }

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-block: var(--space-5);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

@media (max-width: 640px) {
    .site-footer__inner { grid-template-columns: 1fr; }
}

/* ==========================================
   Shared loading / empty / error states
   Used by every REST-wired page (home, dashboard, students, results,
   admission, exam-dates). Every rule here that sets `display` on a
   state container is paired with an explicit [hidden] guard — see the
   comment in style.css on why that pairing is non-negotiable.
   ========================================== */

.rabta-state {
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--text-light);
}
.rabta-state[hidden] { display: none; }

.rabta-state--loading { text-align: initial; }

.skeleton-row {
    height: 3.5rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    background: linear-gradient(90deg, var(--surface-container) 25%, var(--surface-container-high) 37%, var(--surface-container) 63%);
    background-size: 400% 100%;
    animation: rabta-skeleton 1.4s ease infinite;
}

@keyframes rabta-skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.rabta-state--error i,
.rabta-state p { margin-bottom: var(--space-4); }

/* ==========================================
   Toast (helpers.js's toast())
   ========================================== */

.rabta-toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    left: var(--space-6);
    z-index: 200;
    max-width: 420px;
    margin-inline-start: auto;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    background: var(--on-surface);
    color: #FFFFFF;
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: var(--transition);
}
.rabta-toast.is-visible { opacity: 1; transform: translateY(0); }
.rabta-toast--success { background: var(--md-success); }
.rabta-toast--error { background: var(--md-error); }
.rabta-toast--warning { background: var(--md-warning); }

@media (max-width: 640px) {
    .rabta-toast { right: var(--space-4); left: var(--space-4); max-width: none; }
}
