/**
 * Halaman dalam portal web utama — gaya seragam (identitas-sekolah & lainnya)
 */
:root {
    --portal-navy: #15477a;
    --portal-navy-dark: #0c365f;
    --portal-navy-deep: #082848;
    --portal-gold: #f2c808;
    --portal-gold-hover: #e0b800;
    --portal-surface: #ffffff;
    --portal-bg: #f4f6f9;
    --portal-bg-soft: #eef1f6;
    --portal-text: #1a202c;
    --portal-muted: #5a6578;
    --portal-border: #e2e8f0;
    --portal-radius: 10px;
    --portal-radius-lg: 12px;
    --portal-shadow: 0 4px 20px rgba(21, 71, 122, 0.07);
    --portal-shadow-lg: 0 10px 32px rgba(21, 71, 122, 0.1);
    --portal-header-gradient: linear-gradient(135deg, #0c365f 0%, #15477a 52%, #1e6aab 100%);
}

body .portal-page {
    padding: 1.5rem 0 3rem;
    background: linear-gradient(180deg, var(--portal-bg) 0%, var(--portal-surface) 12rem);
    overflow-x: clip;
}

body .portal-page-layout {
    align-items: flex-start;
}

body .portal-page-main {
    min-width: 0;
}

/* —— Hero —— */
body .portal-page-hero {
    margin-bottom: 1.5rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--portal-radius-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f0f4fa 100%);
    color: var(--portal-navy);
    box-shadow: var(--portal-shadow-lg);
    border: 1px solid rgba(21, 71, 122, 0.1);
    border-left: 4px solid var(--portal-gold);
}

body .portal-page-hero__text {
    margin-bottom: 0.85rem;
}

body .portal-page-hero__eyebrow {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b45309;
}

body .portal-page-hero__title {
    margin: 0;
    font-size: clamp(1rem, 2.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--portal-navy);
}

body .portal-page-hero__lead {
    margin: 0.4rem 0 0;
    font-size: clamp(0.8125rem, 2vw, 0.9375rem);
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0.02em;
    color: var(--portal-muted);
    text-wrap: balance;
}

body .portal-page-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body .portal-page-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(21, 71, 122, 0.08);
    border: 1px solid rgba(21, 71, 122, 0.14);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-navy);
}

body .portal-page-chip--gold {
    background: rgba(242, 200, 8, 0.22);
    border-color: rgba(242, 200, 8, 0.45);
    color: #92400e;
}

/* —— Panel konten —— */
body .portal-page-panel {
    margin-bottom: 1.25rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

body .portal-page-panel:last-child {
    margin-bottom: 0;
}

body .portal-page-panel__head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--portal-bg);
}

body .portal-page-panel__head--center {
    text-align: center;
}

body .portal-page-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--portal-navy);
}

body .portal-page-panel__lead {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--portal-muted);
    line-height: 1.5;
}

body .portal-page-panel__foot {
    margin-top: 1.15rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--portal-border);
    font-size: 0.75rem;
    color: var(--portal-muted);
    text-align: right;
}

/* —— Prose (HTML dari admin) —— */
body .portal-page-prose {
    color: var(--portal-muted);
    font-size: 0.9375rem;
    line-height: 1.75;
    word-break: break-word;
}

body .portal-page-prose :is(h1, h2, h3, h4, h5, h6) {
    color: var(--portal-navy);
    font-weight: 800;
    margin: 1.25rem 0 0.65rem;
    line-height: 1.35;
}

body .portal-page-prose h2 { font-size: 1.125rem; }
body .portal-page-prose h3 { font-size: 1rem; }
body .portal-page-prose h4 { font-size: 0.9375rem; }

body .portal-page-prose p,
body .portal-page-prose li {
    margin-bottom: 0.75rem;
}

body .portal-page-prose ul,
body .portal-page-prose ol {
    padding-left: 1.35rem;
    margin-bottom: 0.85rem;
}

body .portal-page-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--portal-radius);
    margin: 0.5rem 0;
}

body .portal-page-prose a {
    color: var(--portal-navy);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

body .portal-page-prose a:hover {
    color: var(--portal-gold);
}

/* —— Data list (identitas) —— */
body .portal-page-dl {
    margin: 0;
}

body .portal-page-dl__row {
    display: grid;
    grid-template-columns: minmax(9rem, 38%) 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--portal-border);
}

body .portal-page-dl__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

body .portal-page-dl__row:first-child {
    padding-top: 0;
}

body .portal-page-dl__label {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--portal-muted);
}

body .portal-page-dl__label i {
    flex-shrink: 0;
    width: 1.25rem;
    margin-top: 0.1rem;
    color: var(--portal-navy);
    opacity: 0.75;
}

body .portal-page-dl__value {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--portal-navy);
    word-break: break-word;
    text-transform: none;
}

body .portal-page-dl__value--multiline {
    white-space: pre-line;
}

body .portal-page-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--portal-navy);
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1px solid #bfdbfe;
    text-transform: none;
}

/* —— Accordion (visi-misi) —— */
body .portal-page-accordion .card {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius) !important;
    margin-bottom: 0.65rem;
    overflow: hidden;
    box-shadow: none;
}

body .portal-page-accordion .card-header {
    padding: 0;
    background: var(--portal-bg);
    border-bottom: 0;
}

body .portal-page-accordion .btn-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--portal-navy) !important;
    text-decoration: none !important;
    background: transparent;
    border: 0;
}

body .portal-page-accordion .btn-link::after {
    content: "\F282";
    font-family: bootstrap-icons !important;
    font-size: 0.875rem;
    color: var(--portal-gold);
    transition: transform 0.2s ease;
}

body .portal-page-accordion .btn-link.collapsed::after {
    transform: rotate(-90deg);
}

body .portal-page-accordion .card-body {
    padding: 1rem 1.1rem;
    border-top: 1px solid var(--portal-border);
}

/* —— Tabel —— */
body .portal-page-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-border);
}

body .portal-page-table {
    width: 100%;
    margin: 0;
    font-size: 0.8125rem;
}

body .portal-page-table thead th {
    background: var(--portal-navy);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.6875rem;
    border: 0;
    white-space: nowrap;
    padding: 0.65rem 0.75rem;
}

body .portal-page-table tbody td,
body .portal-page-table tbody th {
    padding: 0.65rem 0.75rem;
    vertical-align: middle;
    border-color: var(--portal-border);
    color: var(--portal-text);
}

body .portal-page-table tbody tr:nth-child(even) {
    background: var(--portal-bg);
}

body .portal-page-table a {
    color: var(--portal-navy);
    font-weight: 600;
}

/* —— Form —— */
body .portal-page-form .form-control {
    border-radius: 0.5rem;
    border-color: var(--portal-border);
    min-height: 2.5rem;
    font-size: 0.875rem;
}

body .portal-page-form .form-control:focus {
    border-color: var(--portal-navy);
    box-shadow: 0 0 0 3px rgba(21, 71, 122, 0.12);
}

body .portal-page-form label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-navy);
    margin-bottom: 0.35rem;
}

body .portal-page-form .form-group {
    margin-bottom: 1rem;
}

body .portal-page-form__actions {
    padding-top: 0.5rem;
    border-top: 1px solid var(--portal-border);
    margin-top: 0.5rem;
}

body .portal-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.35rem;
    border-radius: 999px;
    border: none;
    background: var(--portal-navy);
    color: var(--portal-gold);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(21, 71, 122, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

body .portal-page-btn:hover {
    background: var(--portal-navy-dark);
    color: #fff;
    transform: translateY(-1px);
}

body .portal-page-alert {
    border-radius: var(--portal-radius);
    border: 0;
    margin-bottom: 1rem;
}

/* —— List kartu (pengumuman, artikel) —— */
body .portal-page-list-card {
    margin-bottom: 1rem;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body .portal-page-list-card:hover {
    box-shadow: var(--portal-shadow-lg);
    transform: translateY(-2px);
}

body .portal-page-list-card__head {
    padding: 0.65rem 1rem;
    background-color: var(--portal-navy, #15477a);
    background-image: var(--portal-header-gradient);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body .portal-page-list-card__body {
    padding: 1rem 1.1rem;
}

body .portal-page-list-card__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--portal-navy);
    line-height: 1.35;
}

body .portal-page-list-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--portal-border);
    background: var(--portal-bg);
    font-size: 0.75rem;
    color: var(--portal-muted);
}

body .portal-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

body .portal-page-meta li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

body .portal-page-meta i {
    color: var(--portal-gold);
}

/* —— Direktori (guru, siswa, alumni) —— */
body .portal-page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

body .portal-page-toolbar .form-control,
body .portal-page-toolbar select.form-control {
    border-radius: 0.5rem;
    border-color: var(--portal-border);
    font-size: 0.875rem;
}

body .portal-profile-card {
    height: 100%;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body .portal-profile-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--portal-shadow-lg);
}

body .portal-profile-card__cover {
    height: 4.5rem;
    background: var(--portal-header-gradient);
    object-fit: cover;
}

body .portal-profile-card__avatar-wrap {
    margin-top: -3rem;
    text-align: center;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

body .portal-profile-card__avatar {
    width: 5.75rem;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    border: 3px solid var(--portal-gold);
    box-shadow: var(--portal-shadow);
    background: #fff;
}

body .portal-profile-card__modal-photo {
    width: 7.5rem;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    object-position: center;
    background: #fff;
    border: 2px solid var(--portal-gold);
}

body .portal-profile-card__body {
    padding: 0.75rem 1rem 1rem;
    text-align: center;
}

body .portal-profile-card__name {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--portal-navy);
    text-transform: none;
    line-height: 1.35;
    text-align: center;
    width: 100%;
}

body .portal-profile-card__name .portal-profile-card__title {
    display: inline;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--portal-muted);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Direktori guru — foto lingkaran, nama + gelar satu baris */
body .portal-profile-card--guru .portal-profile-card__avatar-frame {
    width: 5.5rem;
    height: 5.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--portal-gold);
    box-shadow: var(--portal-shadow);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .portal-profile-card--guru .portal-profile-card__avatar-frame--modal {
    width: 5.5rem;
    height: 5.5rem;
}

body .portal-profile-card--guru .portal-profile-card__avatar,
body .portal-profile-card--alumni .portal-profile-card__avatar {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: unset;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    object-fit: contain;
    object-position: center;
}

/* Direktori alumni — foto lingkaran (sama pola guru) */
body .portal-profile-card--alumni .portal-profile-card__avatar-frame {
    width: 5.5rem;
    height: 5.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--portal-gold);
    box-shadow: var(--portal-shadow);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .portal-profile-card--guru {
    container-type: inline-size;
}

body .portal-profile-card--guru .portal-profile-card__body--guru {
    padding: 0.55rem 0.35rem 0.75rem;
    background: linear-gradient(180deg, #15477a 0%, #0c365f 100%);
    overflow: visible;
}

body .portal-profile-card--guru .portal-profile-card__name {
    margin: 0;
    font-size: clamp(0.5rem, 4.9cqi, 0.625rem);
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    color: #fff;
    width: 100%;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

body .portal-profile-card--guru .portal-profile-card__name .portal-profile-card__title {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    letter-spacing: inherit;
}

body .portal-profile-card--guru .portal-profile-card__role {
    margin: 0.35rem 0 0;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(242, 200, 8, 0.35);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f2c808;
    text-align: center;
    text-transform: none;
    letter-spacing: 0.02em;
}

body .portal-profile-card__meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--portal-muted);
    font-weight: 600;
    text-transform: none;
}

body .portal-profile-card__foot {
    padding: 0.65rem 1rem 1rem;
}

body .portal-profile-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.45rem;
    border-radius: 0.5rem;
    background: var(--portal-navy);
    color: #fff;
    border: 0;
    font-size: 0.875rem;
}

body .portal-profile-card__btn:hover {
    background: var(--portal-navy-dark);
    color: var(--portal-gold);
}

/* —— Modal detail direktori (alumni, guru, siswa) —— */
body .portal-dir-modal__dialog {
    max-width: 22rem;
    margin: 0.75rem auto;
}

body .portal-dir-modal__content {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--portal-shadow-lg);
}

body .portal-dir-modal__header {
    padding: 0.7rem 1rem;
    background: linear-gradient(145deg, var(--portal-navy) 0%, var(--portal-navy-dark) 100%);
    color: #fff;
    border: 0;
    border-bottom: 3px solid var(--portal-gold);
}

body .portal-dir-modal__header .modal-title {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

body .portal-dir-modal__header .close {
    opacity: 0.85;
    text-shadow: none;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

body .portal-dir-modal__body {
    padding: 1rem 1rem 1.1rem;
    background: var(--portal-surface);
}

body .portal-dir-modal__photo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem;
    overflow: hidden;
    border: 2px solid var(--portal-gold);
    background: #fff;
    box-shadow: 0 4px 14px rgba(21, 71, 122, 0.12);
}

body .portal-dir-modal__photo-wrap--circle {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
}

body .portal-dir-modal__photo-wrap--portrait {
    width: 4.75rem;
    aspect-ratio: 3 / 4;
    border-radius: 0.5rem;
}

body .portal-dir-modal__photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

body .portal-dir-modal__dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

body .portal-dir-modal__row {
    display: grid;
    grid-template-columns: 5.75rem 1fr;
    gap: 0.25rem 0.65rem;
    align-items: start;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--portal-border);
}

body .portal-dir-modal__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

body .portal-dir-modal__row dt {
    margin: 0;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--portal-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

body .portal-dir-modal__row dd {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--portal-navy);
    word-break: break-word;
}

@media (max-width: 575.98px) {
    body .portal-dir-modal__dialog {
        max-width: calc(100% - 1.5rem);
    }

    body .portal-dir-modal__row {
        grid-template-columns: 5.25rem 1fr;
    }
}

/* —— Galeri —— */
body .portal-page-gallery-filter {
    margin-bottom: 1.25rem;
}

body .portal-page-gallery-filter select {
    max-width: 280px;
    margin: 0 auto;
    border-radius: 999px;
    border-color: var(--portal-border);
}

body .portal-gallery-grid .portal-gallery-item {
    margin-bottom: 1rem;
}

body .portal-gallery-item__frame {
    border-radius: var(--portal-radius);
    overflow: hidden;
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    transition: transform 0.2s ease;
}

body .portal-gallery-item__frame:hover {
    transform: scale(1.02);
}

body .portal-gallery-item__frame img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

body .portal-video-grid .embed-responsive {
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    box-shadow: var(--portal-shadow);
    border: 1px solid var(--portal-border);
    margin-bottom: 1rem;
}

/* —— Kepala sekolah (identitas) —— */
body .portal-page-kepsek__profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--portal-border);
}

body .portal-page-kepsek__photo {
    flex-shrink: 0;
    width: 6.75rem;
    aspect-ratio: 3 / 4;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 3px solid var(--portal-gold);
    box-shadow: 0 6px 18px rgba(21, 71, 122, 0.12);
    background: #fff;
}

body .portal-page-kepsek__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

body .portal-page-kepsek__name {
    margin: 0 0 0.2rem;
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--portal-navy);
    text-transform: none;
}

body .portal-page-kepsek__role {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--portal-gold);
}

body .portal-page-kepsek__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

body .portal-page-kepsek__item {
    padding: 0.75rem 0.85rem;
    border-radius: var(--portal-radius);
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
}

body .portal-page-kepsek__item-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--portal-muted);
}

body .portal-page-kepsek__item-value {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--portal-navy);
    word-break: break-word;
    text-transform: none;
}

/* —— Kartu kepala sekolah (sidebar) —— */
body .portal-kepsek-card {
    text-align: center;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
}

body .portal-kepsek-card__cover {
    height: 4.25rem;
    background: var(--portal-header-gradient);
    border-bottom: 3px solid var(--portal-gold);
}

body .portal-kepsek-card__avatar-wrap {
    margin-top: -3rem;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

body .portal-kepsek-card__avatar {
    width: 5.75rem;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    border: 3px solid var(--portal-gold);
    box-shadow: 0 6px 18px rgba(21, 71, 122, 0.15);
    background: #fff;
}

body .portal-kepsek-card__body {
    padding: 0.85rem 1.1rem 0.5rem;
}

body .portal-kepsek-card__name {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--portal-navy);
    text-transform: none;
    word-break: break-word;
}

body .portal-kepsek-card__role {
    margin: 0 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--portal-gold);
}

body .portal-kepsek-card__welcome {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--portal-muted);
}

body .portal-kepsek-card__school {
    display: inline-block;
    margin-top: 0.2rem;
    font-weight: 600;
    color: var(--portal-navy);
}

body .portal-kepsek-card__foot {
    padding: 0.85rem 1.1rem 1.15rem;
}

body .portal-kepsek-card__btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
    text-decoration: none !important;
}

body .portal-kepsek-card__btn:hover {
    color: #fff;
}

/* —— Sidebar —— */
body .portal-sidebar .card {
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    overflow: hidden;
    box-shadow: var(--portal-shadow);
    margin-bottom: 1rem;
}

body .portal-sidebar .card-header {
    background-color: var(--portal-navy, #15477a) !important;
    background-image: var(--portal-header-gradient) !important;
    color: #fff !important;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 0;
}

body .portal-sidebar .card-img-top {
    max-height: 220px;
    object-fit: cover;
}

body .portal-sidebar .btn-utama {
    border-radius: 999px;
}

body .portal-sidebar .media {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}

body .portal-sidebar .media:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

body .portal-sidebar .media img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    object-position: center;
    border-radius: 0.5rem;
    background: #eef3f9;
    border: 1px solid var(--portal-border);
}

body .portal-sidebar .recent h5 {
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
}

body .portal-sidebar .recent h5 a {
    color: var(--portal-navy);
    font-weight: 700;
}

body .portal-sidebar .recent h6 {
    font-size: 0.75rem;
    color: var(--portal-muted);
    margin: 0;
}

body .portal-sidebar-search form {
    display: flex;
    gap: 0.35rem;
}

body .portal-sidebar-search input {
    flex: 1;
    border: 1px solid var(--portal-border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
}

body .portal-sidebar-search button {
    border: 0;
    border-radius: 0.5rem;
    background: var(--portal-navy);
    color: #fff;
    padding: 0 0.75rem;
}

body .portal-sidebar-cats .btn-outline-primary {
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border-color: var(--portal-navy);
    color: var(--portal-navy);
}

body .portal-sidebar-cats .btn-outline-primary:hover {
    background: var(--portal-navy);
    color: #fff;
}

/* —— Pagination —— */
body .portal-page .page-link {
    color: var(--portal-navy);
    border-color: var(--portal-border);
    border-radius: 0.35rem;
    margin: 0 0.1rem;
}

body .portal-page .page-item.active .page-link {
    background: var(--portal-navy);
    border-color: var(--portal-navy);
    color: #fff;
}

/* —— Peta / gambar —— */
body .portal-page-media img {
    width: 100%;
    height: auto;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    margin-top: 1rem;
}

/* —— Artikel unggulan —— */
body .portal-page-featured {
    padding: 0;
    overflow: hidden;
}

body .portal-page-featured__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    max-height: none;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
    border-bottom: 1px solid var(--portal-border);
    overflow: hidden;
    padding: 0.65rem;
}

body .portal-page-featured__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
}

body .portal-page-list-card__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 0.65rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
    border-right: 0;
    border-bottom: 1px solid var(--portal-border);
    overflow: hidden;
}

body .portal-page-list-card__thumb img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain !important;
    object-position: center;
    display: block;
}

/* —— Kalender agenda —— */
body .portal-page-calendar {
    padding: 1rem;
    border-radius: var(--portal-radius-lg);
    border: 1px solid var(--portal-border);
    background: var(--portal-surface);
    box-shadow: var(--portal-shadow);
}

body .portal-page-calendar .fc-toolbar-title {
    font-size: 1rem !important;
    font-weight: 800;
    color: var(--portal-navy);
}

body .portal-page-calendar .fc-button-primary {
    background: var(--portal-navy) !important;
    border-color: var(--portal-navy) !important;
}

/* —— Sidebar (scroll normal, tidak sticky) —— */
@media screen and (min-width: 992px) {
    body .portal-page .col-md-4.sid,
    body .portal-sidebar {
        position: static;
        top: auto;
    }

    body .portal-profile-card--guru .portal-profile-card__body--guru {
        padding: 0.55rem 0.4rem 0.8rem;
    }
}

@media screen and (max-width: 991.98px) {
    body .portal-page {
        padding: 1.25rem 0 2rem;
    }

    body .portal-page-hero {
        padding: 1.15rem 1rem;
        text-align: center;
    }

    body .portal-page-hero__text {
        margin-bottom: 0.75rem;
    }

    body .portal-page-hero__chips {
        justify-content: center;
    }

    body .portal-page-layout > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body .portal-sidebar {
        margin-top: 1.5rem;
        position: static !important;
        top: auto !important;
    }

    body .portal-page-panel {
        padding: 1rem 0.9rem;
    }

    body .portal-page-dl__row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    body .portal-page-dl__value {
        padding-left: 1.65rem;
    }

    body .portal-page-kepsek__profile {
        flex-direction: column;
        text-align: center;
    }

    body .portal-page-kepsek__photo {
        margin: 0 auto;
    }

    body .portal-page-kepsek__grid {
        grid-template-columns: 1fr;
    }

    body .portal-page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    body .portal-page-form .form-group.row > [class*="col-sm"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body .portal-page-list-card .row.no-gutters > [class*="col-md"],
    body .portal-page-list-card .row > [class*="col-md"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body .portal-page-list-card__thumb {
        min-height: 0;
        max-height: none;
        border-right: 0;
        border-bottom: 1px solid var(--portal-border);
    }

    body .portal-page-list-card__thumb img {
        max-height: none;
    }

    body .portal-page-featured__thumb {
        max-height: none;
    }

    body .portal-page-featured__img {
        max-height: none;
    }

    body .portal-page-gallery-filter select {
        max-width: 100%;
    }

    body .portal-page-calendar {
        padding: 0.65rem;
    }

    body .portal-page-calendar .fc-header-toolbar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    body .portal-page-calendar .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    body .portal-page-calendar .fc-toolbar-title {
        font-size: 0.875rem !important;
    }

    body .portal-page-prose img,
    body .portal-page-prose table,
    body .portal-page-prose iframe,
    body .portal-page-prose video {
        max-width: 100%;
        height: auto;
    }

    body .portal-page-prose table {
        display: block;
        overflow-x: auto;
    }

    body .entry.entry-single .entry-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body .portal-page-meta {
        font-size: 0.75rem;
    }
}

@media screen and (min-width: 576px) and (max-width: 991.98px) {
    body .portal-page-kepsek__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body .portal-page-kepsek__item:last-child {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 575.98px) {
    body .portal-page {
        padding: 1rem 0 1.75rem;
    }

    body .portal-page > .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    body .portal-page-hero {
        padding: 0.95rem 0.85rem;
        margin-bottom: 1.1rem;
        border-radius: var(--portal-radius);
    }

    body .portal-page-hero__title {
        font-size: 1.05rem;
        line-height: 1.35;
        word-break: break-word;
    }

    body .portal-page-hero__lead {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    body .portal-page-hero__eyebrow {
        font-size: 0.6875rem;
    }

    body .portal-page-chip {
        font-size: 0.6875rem;
        padding: 0.3rem 0.65rem;
    }

    body .portal-page-panel {
        padding: 0.9rem 0.8rem;
        border-radius: var(--portal-radius);
    }

    body .portal-page-panel__title {
        font-size: 0.875rem;
    }

    body .portal-page-list-card__body {
        padding: 0.85rem;
    }

    body .portal-page-list-card__title {
        font-size: 0.875rem;
    }

    body .portal-page-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    body .portal-page-toolbar {
        padding: 0.85rem;
    }

    body .portal-page-toolbar .form-control,
    body .portal-page-toolbar select.form-control {
        width: 100%;
        max-width: 100% !important;
    }

    body .portal-page-toolbar .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
    }

    body .portal-page .col-6.col-md-4,
    body .portal-page .col-6.col-md-4.col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body .portal-profile-card__avatar {
        width: 4.75rem;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    body .portal-profile-card--guru .portal-profile-card__avatar-frame,
    body .portal-profile-card--guru .portal-profile-card__avatar-frame--modal,
    body .portal-profile-card--alumni .portal-profile-card__avatar-frame,
    body .portal-profile-card--alumni .portal-profile-card__avatar-frame--modal {
        width: 4.75rem;
        height: 4.75rem;
    }

    body .portal-profile-card--guru .portal-profile-card__name {
        font-size: clamp(0.5rem, 4.9cqi, 0.625rem);
    }

    body .portal-profile-card--guru .portal-profile-card__role {
        font-size: 0.625rem;
    }

    body .portal-profile-card__name {
        font-size: 0.875rem;
    }

    body .portal-sidebar .card-header {
        font-size: 0.75rem;
        padding: 0.65rem 0.85rem;
    }

    body .portal-sidebar .media {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    body .portal-sidebar .media img {
        margin-bottom: 0.5rem;
        max-width: 100% !important;
        width: 100%;
        height: auto;
        border-radius: var(--portal-radius);
    }

    body .blog-pagination .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }

    body .blog-pagination .page-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    body .portal-page-dl__value {
        padding-left: 0;
        font-size: 0.875rem;
    }

    body .portal-page-dl__label {
        font-size: 0.6875rem;
    }

    body .portal-page-kepsek__name {
        font-size: 0.9375rem;
    }

    body .portal-page-media img {
        margin-top: 0;
    }

    body .portal-kepsek-card__name {
        font-size: 0.875rem;
    }

    body .portal-kepsek-card__welcome {
        font-size: 0.75rem;
    }

    body .portal-kepsek-card__avatar {
        width: 4.75rem;
        height: auto;
        aspect-ratio: 3 / 4;
    }
}

/* —— Halaman Ekstrakurikuler (Kategori) —— */
body .portal-eskul-page__banner {
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--portal-radius-lg);
    background: linear-gradient(180deg, #fff 0%, #f0f4fa 100%);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
}

body .portal-eskul-page__banner-img {
    display: inline-block;
    max-width: 100%;
    width: auto;
    max-height: 280px;
    object-fit: contain;
    border-radius: var(--portal-radius);
}

body .portal-eskul-page__intro .portal-page-prose {
    font-size: 0.9375rem;
}

body .portal-eskul-grid {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

body .portal-eskul-grid__col {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}

body .portal-eskul-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--portal-radius-lg);
    overflow: hidden;
    background: var(--portal-surface);
    border: 1px solid rgba(21, 71, 122, 0.1);
    box-shadow: var(--portal-shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body .portal-eskul-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(21, 71, 122, 0.14);
}

body .portal-eskul-card__img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 10.5rem;
    padding: 0.85rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
    border-bottom: 3px solid var(--portal-gold);
}

body .portal-eskul-card__img {
    width: 100%;
    height: auto;
    max-height: 9rem;
    object-fit: contain;
    object-position: center;
    display: block;
}

body .portal-eskul-card--page .portal-eskul-card__img-wrap {
    min-height: 11rem;
}

body .portal-eskul-card--page .portal-eskul-card__img {
    max-height: 9.5rem;
}

body .portal-eskul-card__title {
    margin: 0;
    padding: 0.85rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--portal-navy);
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
}

body .portal-eskul-card--page .portal-eskul-card__title {
    font-size: 0.875rem;
}

@media screen and (max-width: 767.98px) {
    body .portal-eskul-page__banner-img {
        max-height: 200px;
    }

    body .portal-eskul-card__img-wrap,
    body .portal-eskul-card--page .portal-eskul-card__img-wrap {
        min-height: 5rem;
        padding: 0.4rem 0.45rem;
        border-bottom-width: 2px;
    }

    body .portal-eskul-card__img,
    body .portal-eskul-card--page .portal-eskul-card__img {
        max-height: 4rem;
    }

    body .portal-eskul-card__title,
    body .portal-eskul-card--page .portal-eskul-card__title {
        font-size: 0.6875rem;
        min-height: 1.85rem;
        padding: 0.35rem 0.3rem;
        line-height: 1.25;
    }
}

@media screen and (max-width: 575.98px) {
    body .portal-eskul-grid {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
    }

    body .portal-eskul-grid__col {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        margin-bottom: 0.65rem;
    }
}
