/* ==========================================================================
   E-ARSIP PRL PUBLIC PORTAL — INSTITUTIONAL DESIGN SYSTEM
   Fase 8A: Clean, accessible, restrained institutional styling for KKP PRL
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette: Oceanic Institutional (KKP Identity) */
    --portal-bg: #f8fafc;
    --portal-surface: #ffffff;
    --portal-surface-subtle: #f1f5f9;
    --portal-surface-card: #ffffff;
    --portal-text: #0f172a;
    --portal-text-secondary: #334155;
    --portal-muted: #64748b;
    --portal-border: #e2e8f0;
    --portal-border-strong: #cbd5e1;

    /* Brand Accent Blues */
    --portal-primary: #0284c7;
    --portal-primary-dark: #0369a1;
    --portal-primary-deep: #0c4a6e;
    --portal-primary-subtle: #e0f2fe;
    --portal-navy: #092c4c;
    --portal-navy-dark: #061c31;
    --portal-navy-light: #0d3b66;

    /* Status Colors */
    --portal-info: #0284c7;
    --portal-info-bg: #f0f9ff;
    --portal-info-border: #bae6fd;
    --portal-warning: #b45309;
    --portal-warning-bg: #fffbeb;
    --portal-warning-border: #fde68a;

    /* Typography */
    --portal-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --portal-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    /* Layout & Geometry */
    --portal-container-max: 1200px;
    --portal-radius-sm: 4px;
    --portal-radius-md: 8px;
    --portal-radius-lg: 12px;

    /* Focus & Shadows */
    --portal-focus-ring: 0 0 0 3px rgba(2, 132, 199, 0.35);
    --portal-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --portal-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --portal-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE ELEMENTS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--portal-font-sans);
    background-color: var(--portal-bg);
    color: var(--portal-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--portal-primary-dark);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--portal-primary-deep);
}

a:focus-visible, button:focus-visible, input:not(.search-input):focus-visible {
    outline: none;
    box-shadow: var(--portal-focus-ring);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   3. LAYOUT CONTAINERS & UTILITIES
   -------------------------------------------------------------------------- */
.portal-container {
    width: 100%;
    max-width: var(--portal-container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.portal-main {
    flex: 1 0 auto;
}

/* --------------------------------------------------------------------------
   4. GOVERNMENT TOP BAR & PUBLIC HEADER
   -------------------------------------------------------------------------- */
.gov-bar {
    background-color: var(--portal-navy-dark);
    color: #e2e8f0;
    font-size: 0.8125rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gov-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gov-bar-flag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #cbd5e1;
}

.gov-bar-links {
    display: flex;
    gap: 1rem;
}

.gov-bar-links a {
    color: #94a3b8;
    font-size: 0.8125rem;
}

.gov-bar-links a:hover {
    color: #ffffff;
}

.public-header {
    background-color: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--portal-shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    color: inherit;
}

.header-brand:hover {
    color: inherit;
}

.header-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-org {
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--portal-primary-dark);
    line-height: 1.2;
}

.header-app-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--portal-navy);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Navigation */
.public-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-link {
    color: var(--portal-text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--portal-primary-dark);
}

.nav-link.active {
    color: var(--portal-primary-deep);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--portal-primary);
    border-radius: 1px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions-mobile {
    display: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--portal-radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid transparent;
    line-height: 1.4;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--portal-border-strong);
    color: var(--portal-text-secondary);
}

.btn-secondary:hover {
    background-color: var(--portal-surface-subtle);
    color: var(--portal-text);
    border-color: #94a3b8;
}

.btn-primary {
    background-color: var(--portal-primary);
    border-color: var(--portal-primary-dark);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--portal-primary-dark);
    color: #ffffff;
}

.btn-internal {
    background-color: var(--portal-navy);
    border-color: var(--portal-navy-dark);
    color: #ffffff;
}

.btn-internal:hover {
    background-color: var(--portal-navy-light);
    color: #ffffff;
}

/* Public Portal User Badge & Identity (Fase 8C) */
.portal-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.6rem 0.25rem 0.35rem;
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border-strong);
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: var(--portal-text);
}

.portal-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--portal-primary);
    flex-shrink: 0;
}

.portal-user-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--portal-primary-subtle);
    color: var(--portal-primary-deep);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-user-name {
    font-weight: 600;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-portal-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-portal-logout:hover {
    background-color: #fecaca;
    color: #7f1d1d;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--portal-navy);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* --------------------------------------------------------------------------
   5. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
    background: linear-gradient(180deg, #f0f7fc 0%, var(--portal-bg) 100%);
    border-bottom: 1px solid var(--portal-border);
    padding: 3.5rem 0 3.5rem;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background-color: var(--portal-primary-subtle);
    color: var(--portal-primary-deep);
    border: 1px solid #bae6fd;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    line-height: 1.25;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--portal-muted);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.25rem;
    line-height: 1.5;
}

/* Hero Search Form */
.hero-search-wrapper {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search-form {
    display: flex;
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border-strong);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow-md);
    padding: 0.35rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-search-form:hover:not(:focus-within) {
    border-color: #94a3b8;
}

.hero-search-form:focus-within {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2), var(--portal-shadow-md);
}

.hero-search-form:focus-within .search-icon {
    color: var(--portal-primary);
}

.search-input-group {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 0.875rem;
    gap: 0.75rem;
    border: none;
    outline: none;
    box-shadow: none;
}

.search-icon {
    color: var(--portal-muted);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--portal-text);
    padding: 0.65rem 0;
    font-family: inherit;
    box-shadow: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-input:focus,
.search-input:focus-visible,
.search-input:active,
.hero-search-form .search-input:focus,
.hero-search-form .search-input:focus-visible,
.hero-search-form .search-input:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-button {
    flex-shrink: 0;
    padding: 0.75rem 1.75rem;
    font-size: 0.9375rem;
}

.hero-search-meta {
    margin-top: 0.85rem;
    font-size: 0.8125rem;
    color: var(--portal-muted);
}

/* --------------------------------------------------------------------------
   6. PORTAL CONTENT SECTIONS
   -------------------------------------------------------------------------- */
.portal-section {
    padding: 3.5rem 0;
}

.portal-section-alt {
    background-color: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
    border-bottom: 1px solid var(--portal-border);
}

.section-header {
    margin-bottom: 2.25rem;
}

.section-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--portal-primary-dark);
    margin-bottom: 0.35rem;
}

.section-heading {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.section-description {
    font-size: 0.975rem;
    color: var(--portal-muted);
    margin-top: 0.35rem;
    max-width: 680px;
}

/* ==========================================================================
   PETA KOLEKSI PUBLIK (DATA-DRIVEN PUBLIC COLLECTION MAP)
   ========================================================================== */
.collection-map-section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

.collection-overview-strip {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
    margin-bottom: 2.25rem;
    flex-wrap: wrap;
}

.collection-stat-pill {
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: 9999px;
    padding: 0.65rem 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--portal-shadow-sm);
}

.collection-stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    line-height: 1;
}

.collection-stat-lbl {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.collection-panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
}

@media (max-width: 860px) {
    .collection-panels-grid {
        grid-template-columns: 1fr;
    }
}

.collection-panel {
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg, 12px);
    box-shadow: var(--portal-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.collection-panel-header {
    padding: 1.25rem 1.5rem;
    background: var(--portal-surface-subtle);
    border-bottom: 1px solid var(--portal-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.collection-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collection-panel-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.collection-panel-badge.fasilitatif {
    background: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.collection-panel-badge.substantif {
    background: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.collection-panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    margin: 0;
    letter-spacing: 0.02em;
}

.collection-panel-totals {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--portal-muted);
    background: #ffffff;
    border: 1px solid var(--portal-border);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
}

.collection-division-list {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.collection-division-item {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.collection-division-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.collection-division-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--portal-navy-dark);
    line-height: 1.4;
}

.collection-division-counts {
    font-size: 0.825rem;
    color: var(--portal-muted);
    white-space: nowrap;
}

.count-bold {
    font-weight: 700;
    color: var(--portal-text);
}

.count-dot {
    color: var(--portal-border);
    margin: 0 0.25rem;
}

.collection-progress-track {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.collection-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.collection-panel.fasilitatif .collection-progress-fill {
    background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.collection-panel.substantif .collection-progress-fill {
    background: linear-gradient(90deg, #0d9488, #2dd4bf);
}

.collection-panel-footer {
    padding: 0.9rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid var(--portal-border-subtle, #f1f5f9);
    display: flex;
    justify-content: flex-end;
}

.collection-panel-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-primary-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: color 0.15s ease, gap 0.15s ease;
}

.collection-panel-link:hover {
    color: var(--portal-primary-deep, #075985);
    gap: 0.55rem;
}

.collection-empty-msg {
    font-size: 0.875rem;
    color: var(--portal-muted);
    font-style: italic;
    padding: 1.5rem 0;
    text-align: center;
}



/* Institutional / About Section */
.institutional-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.institutional-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    margin-bottom: 0.75rem;
}

.institutional-text p {
    font-size: 0.95rem;
    color: var(--portal-text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.info-box {
    background-color: var(--portal-surface-subtle);
    border: 1px solid var(--portal-border);
    border-left: 4px solid var(--portal-primary);
    border-radius: var(--portal-radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.info-box-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box-text {
    font-size: 0.875rem;
    color: var(--portal-muted);
    line-height: 1.6;
}

/* Notice Card */
.notice-card {
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    padding: 1.5rem;
    box-shadow: var(--portal-shadow-sm);
}

.notice-list {
    list-style: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notice-list li {
    font-size: 0.875rem;
    color: var(--portal-text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    line-height: 1.5;
}

.notice-list li svg {
    width: 18px;
    height: 18px;
    color: var(--portal-primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* --------------------------------------------------------------------------
   7. PUBLIC SEARCH / DETAIL / FILE PAGE STYLING
   -------------------------------------------------------------------------- */
.page-container {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--portal-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--portal-muted);
}

.breadcrumb a:hover {
    color: var(--portal-primary-dark);
}

.breadcrumb-separator {
    color: var(--portal-border-strong);
}

.breadcrumb-current {
    color: var(--portal-text);
    font-weight: 600;
}

.page-title-group {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--portal-muted);
    margin-top: 0.25rem;
}

/* Search Bar on Search Page */
.search-page-bar {
    margin-bottom: 2rem;
}

/* Empty States & Alert Boxes */
.portal-empty-state {
    background-color: var(--portal-surface);
    border: 1px dashed var(--portal-border-strong);
    border-radius: var(--portal-radius-md);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 640px;
    margin: 2rem auto;
}

.portal-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--portal-surface-subtle);
    color: var(--portal-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.portal-empty-icon svg {
    width: 26px;
    height: 26px;
}

.portal-empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    margin-bottom: 0.5rem;
}

.portal-empty-desc {
    font-size: 0.9125rem;
    color: var(--portal-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.portal-notice-box {
    background-color: var(--portal-info-bg);
    border: 1px solid var(--portal-info-border);
    border-radius: var(--portal-radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.portal-notice-icon {
    color: var(--portal-info);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.portal-notice-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    margin-bottom: 0.25rem;
}

.portal-notice-text {
    font-size: 0.875rem;
    color: var(--portal-text-secondary);
    line-height: 1.6;
}

.portal-denied-box {
    background-color: var(--portal-warning-bg);
    border: 1px solid var(--portal-warning-border);
    border-radius: var(--portal-radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 3rem auto;
}

.portal-denied-icon {
    color: var(--portal-warning);
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   8. PUBLIC FOOTER
   -------------------------------------------------------------------------- */
.public-footer {
    background-color: var(--portal-navy-dark);
    color: #e2e8f0;
    padding-top: 3.5rem;
    border-top: 3px solid var(--portal-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.footer-subtitle {
    font-size: 0.775rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-desc {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-top: 0.75rem;
}

.footer-col-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: #38bdf8;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #38bdf8;
    margin-top: 0.15rem;
}

.footer-bottom {
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.footer-bottom a {
    color: #94a3b8;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   8B. SEARCH RESULTS & PAGINATION COMPONENTS
   -------------------------------------------------------------------------- */
.search-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--portal-border);
}

.search-filter-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--portal-radius-md);
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border);
    color: var(--portal-text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.filter-tab-btn:hover {
    background-color: var(--portal-surface-subtle);
    border-color: var(--portal-border-strong);
    color: var(--portal-text);
}

.filter-tab-btn.active {
    background-color: var(--portal-navy);
    border-color: var(--portal-navy-dark);
    color: #ffffff;
}

.search-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--portal-muted);
    margin-bottom: 1.25rem;
}

.search-count-highlight {
    font-weight: 700;
    color: var(--portal-navy-dark);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.search-result-card {
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--portal-shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result-card:hover {
    border-color: var(--portal-primary);
    box-shadow: var(--portal-shadow-md);
    transform: translateY(-1px);
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-badge-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--portal-radius-sm);
    line-height: 1.3;
}

.badge-category-substantif {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-category-fasilitatif {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-code {
    background-color: #f8fafc;
    color: var(--portal-navy-dark);
    border: 1px solid var(--portal-border-strong);
    font-family: var(--portal-font-mono);
}

.badge-public {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.search-result-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    line-height: 1.4;
    margin: 0;
}

.search-result-item-name {
    font-size: 0.875rem;
    color: var(--portal-primary-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.search-result-desc {
    font-size: 0.9125rem;
    color: var(--portal-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.search-result-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: var(--portal-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--portal-surface-subtle);
}

.search-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.search-meta-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #94a3b8;
}

.result-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--portal-muted);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--portal-radius-md);
    background-color: var(--portal-surface);
    border: 1px solid var(--portal-border);
    color: var(--portal-text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination-btn:hover:not(.disabled) {
    background-color: var(--portal-surface-subtle);
    border-color: var(--portal-border-strong);
    color: var(--portal-text);
}

.pagination-btn.active {
    background-color: var(--portal-primary);
    border-color: var(--portal-primary-dark);
    color: #ffffff;
}

.pagination-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: var(--portal-surface-subtle);
    border-color: var(--portal-border);
    color: var(--portal-muted);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 900px) {
    .header-container {
        height: 4rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .public-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--portal-surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid var(--portal-border);
        box-shadow: var(--portal-shadow-lg);
        gap: 0.75rem;
        max-height: calc(100vh - 4.5rem);
        overflow-y: auto;
    }

    .public-nav.is-open {
        display: flex;
    }

    .nav-link {
        width: 100%;
        padding: 0.5rem 0;
    }

    .header-actions {
        display: none;
    }

    .public-nav.is-open .header-actions-mobile {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--portal-border);
    }

    .public-nav.is-open .header-actions-mobile .btn {
        width: 100%;
        justify-content: center;
        min-height: 42px;
    }

    .public-nav.is-open .header-actions-mobile .portal-user-badge {
        width: 100%;
        justify-content: space-between;
        padding: 0.45rem 0.75rem;
        border-radius: var(--portal-radius-md);
    }

    .public-nav.is-open .header-actions-mobile .portal-user-name {
        max-width: none;
        flex: 1;
    }

    .hero-section {
        padding: 2.5rem 0;
    }

    .hero-title {
        font-size: 1.65rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.75rem;
    }

    .hero-search-form {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .search-input-group {
        padding: 0.25rem 0.5rem;
    }

    .search-button {
        width: 100%;
    }

    .institutional-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gov-bar {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   10. PUBLIC ARCHIVE DETAIL PAGE STYLING (PRE-STAGE-9)
   -------------------------------------------------------------------------- */
.archive-detail-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
    margin-top: 1rem;
}

.detail-main-col {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.detail-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-hero-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 88% 18%,
            rgba(56, 189, 248, 0.22) 0,
            rgba(56, 189, 248, 0) 34%
        ),
        linear-gradient(
            135deg,
            #062c4f 0%,
            #0a477b 58%,
            #0284c7 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--portal-radius-lg);
    box-shadow: 0 12px 30px rgba(6, 44, 79, 0.16);
    padding: 2rem;
    color: #ffffff;
}

.detail-hero-card .detail-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.detail-hero-card .detail-meta-item {
    padding: 1rem 1.15rem;
    gap: 0.35rem;
    min-width: 0;
}

/* Subtle separators */
.detail-hero-card .detail-meta-item:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.detail-hero-card .detail-meta-item:nth-child(n+3) {
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.detail-hero-card .detail-meta-label {
    color: #bae6fd;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.detail-hero-card .detail-meta-value {
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
}


/* --------------------------------------------------------------------------
   Public Detail Hero — Badge Refinement
   Scoped only inside .detail-hero-card
   -------------------------------------------------------------------------- */

.detail-hero-card .result-card-header {
    margin-bottom: 0.65rem;
}

.detail-hero-card .result-badge-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-hero-card .badge-tag {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: none;
}

/* Substantif */
.detail-hero-card .badge-category-substantif {
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #075985;
}

/* Fasilitatif */
.detail-hero-card .badge-category-fasilitatif {
    background-color: #dbeafe;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Classification code */
.detail-hero-card .badge-code {
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-family: var(--portal-font-mono);
    backdrop-filter: blur(3px);
}

/* Public access status */
.detail-hero-card .badge-public {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

/* Hero typography */
.detail-hero-card .detail-title {
    margin-top: 0;
    margin-bottom: 0.35rem;
    max-width: 920px;

    font-size: clamp(1.65rem, 2.1vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;

    color: #ffffff;
}

.detail-hero-card .detail-subtitle {
    max-width: 920px;
    margin-top: 0;
    margin-bottom: 1.35rem;

    font-size: 0.9375rem;
    line-height: 1.55;
    color: #dbeafe;
}

.detail-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--portal-border);
}

.detail-hero-card .detail-summary-box,
.detail-hero-card .detail-meta-grid {
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Tambahan khusus summary box */
.detail-hero-card .detail-summary-box {
    padding: 1rem 1.15rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.detail-hero-card .detail-summary-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #bae6fd;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.055em;
}

.detail-hero-card .detail-summary-text {
    color: #ffffff;
    font-size: 0.9375rem;
    line-height: 1.6;
    font-weight: 400;
}

.detail-hero-card .detail-title {
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1.3;
}

.detail-hero-card .detail-subtitle {
    color: #dbeafe;
}

.detail-hero-card .detail-subtitle .text-gray-700 {
    color: #ffffff !important;
}

.detail-hero-card .detail-subtitle .text-gray-500 {
    color: #cbd5e1 !important;
}

.detail-hero-card .detail-summary-box {
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--portal-radius-md);
}

.detail-hero-card .detail-summary-label {
    color: #bae6fd;
}

.detail-hero-card .detail-summary-text {
    color: #ffffff;
}

.detail-hero-card .detail-meta-grid {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.detail-hero-card .detail-meta-label {
    color: #bae6fd;
}

.detail-hero-card .detail-meta-value {
    color: #ffffff;
}

.detail-hero-card .badge-code {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.detail-header-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.detail-classification-box {
    background-color: var(--portal-surface-subtle);
    border: 1px solid var(--portal-border);
    border-left: 3px solid var(--portal-primary);
    border-radius: var(--portal-radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--portal-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-classification-code {
    font-family: var(--portal-font-mono);
    font-weight: 700;
    color: var(--portal-navy-dark);
}

.detail-subtitle {
    font-size: 0.9375rem;
    color: var(--portal-text-secondary);
    line-height: 1.5;
    margin-top: 0.35rem;
    margin-bottom: 1.25rem;
}

.detail-summary-box,
.detail-description-box {
    margin-top: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-summary-label,
.detail-description-label {
    font-size: 0.8125rem; /* ~13px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569; /* slate-600 / dark-muted */
    margin-bottom: 0.5rem;
    display: block;
}

.detail-summary-text,
.detail-description-text {
    font-size: 0.9375rem; /* 15px readable body */
    line-height: 1.6;
    color: var(--portal-navy-dark);
    word-break: break-word;
}

/* Metadata Grid inside Card */
.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    background-color: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    padding: 1.25rem;
}

.detail-meta-item,
.detail-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Section Header (File Dokumen Digital & Badge) */
.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem; /* Clear breathing room to first attachment card */
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--portal-border);
}

.detail-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.detail-meta-cell.full-width {
    grid-column: 1 / -1;
}

.detail-meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-muted);
}

.detail-meta-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--portal-navy-dark);
}

/* Attachments Section */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--portal-surface-subtle);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    padding: 1rem 1.25rem;
    gap: 1rem;
    transition: all 0.15s ease;
}

.attachment-card:hover {
    border-color: var(--portal-primary);
    background-color: #ffffff;
    box-shadow: var(--portal-shadow-sm);
}

.attachment-lead {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.attachment-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--portal-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-icon-badge.pdf {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.attachment-icon-badge.image {
    background-color: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.attachment-icon-badge.generic {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.attachment-details {
    min-width: 0;
    flex: 1;
}

.attachment-filename {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    word-break: break-word;
    line-height: 1.35;
}

.attachment-specs {
    font-size: 0.8125rem;
    color: var(--portal-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-action-view {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--portal-radius-md);
    background-color: #ffffff;
    color: var(--portal-primary-dark);
    border: 1px solid var(--portal-primary);
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-action-view:hover {
    background-color: var(--portal-primary);
    color: #ffffff;
}

.btn-action-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: var(--portal-radius-md);
    background-color: var(--portal-navy);
    color: #ffffff;
    border: 1px solid var(--portal-navy-dark);
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-action-download:hover {
    background-color: var(--portal-navy-light);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Document Preview Card (Pratinjau Dokumen)
   -------------------------------------------------------------------------- */
.detail-card {
    background-color: #ffffff;
    border: 1px solid #dbe3ec;
    border-radius: var(--portal-radius-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    padding: 1.5rem;
}

.detail-card .badge-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

.detail-card .badge-public {
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.pdf-preview-box {
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
}

.pdf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pdf-preview-title {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.pdf-preview-title > svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.document-preview-filename {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-navy-dark);
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.document-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.preview-action-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--portal-radius-md);
    color: #0f2740;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.preview-action-btn svg {
    flex-shrink: 0;
}

.preview-action-btn:hover {
    background-color: #eff6ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.preview-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.document-file-tabs {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.document-file-tab {
    flex: 0 0 220px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    background-color: #ffffff;
    border: 1px solid #dbe3ec;
    border-radius: var(--portal-radius-md);
    color: var(--portal-text-secondary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease,
                background-color 0.15s ease,
                box-shadow 0.15s ease,
                color 0.15s ease;
}

.document-file-tab:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

.document-file-tab.active {
    border-color: #0284c7;
    background-color: #f0f9ff;
    box-shadow: 0 0 0 1px #0284c7;
}

.document-file-tab-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.625rem;
    font-weight: 800;
}

.document-file-tab-icon.pdf {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.document-file-tab-icon.image {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.document-file-tab-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.document-file-tab-name {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-navy-dark);
    line-height: 1.35;
}

.document-file-tab.active .document-file-tab-name {
    color: #0369a1;
    font-weight: 700;
}

.document-file-tab-meta {
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    color: var(--portal-muted);
}

.document-files-subheading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--portal-border);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
}

.document-files-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--portal-muted);
}

.pdf-frame-wrapper {
    width: 100%;
    height: 720px;
    border-radius: var(--portal-radius-md);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background-color: #525659;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.pdf-preview-notice {
    font-size: 0.775rem;
    color: var(--portal-muted);
    margin-top: 0.75rem;
    line-height: 1.5;
    padding: 0.65rem 0.85rem;
    background-color: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Sidebar Information Cards (Tindakan Cepat, Informasi Tambahan, Kata Kunci)
   Clean institutional government style: white cards, subtle gray-blue borders,
   soft shadow, navy headings, compact readable info table, restrained keyword chips.
   -------------------------------------------------------------------------- */
.sidebar-card {
    background-color: #ffffff;
    border: 1px solid #dbe3ec;
    border-radius: var(--portal-radius-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    padding: 1.35rem 1.5rem;
}

.sidebar-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-navy-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.3;
}

/* 1. Tindakan Cepat */
.sidebar-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sidebar-action-buttons > * + * {
    margin-top: 0.65rem;
}

@supports (gap: 0.65rem) {
    .sidebar-action-buttons > * + * {
        margin-top: 0;
    }
}

.sidebar-btn-back {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--portal-radius-md);
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f2740;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
    cursor: pointer;
}

.sidebar-btn-back:hover {
    background-color: #eff6ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.sidebar-btn-back.btn-copy-link {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f2740;
}

.sidebar-btn-back.btn-copy-link:hover {
    background-color: #eff6ff;
    border-color: #7dd3fc;
    color: #0369a1;
}

.sidebar-btn-back:focus,
.sidebar-btn-back.btn-copy-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

/* 2. Informasi Tambahan */
.sidebar-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.sidebar-info-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-info-table tr:last-child {
    border-bottom: none;
}

.sidebar-info-table td {
    padding: 0.6rem 0;
    vertical-align: middle;
}

.sidebar-info-table td.label-col {
    width: 44%;
    padding-right: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
}

.sidebar-info-table td.val-col {
    width: 56%;
    color: #0f2740;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: right;
    line-height: 1.4;
    word-break: break-word;
}

.sidebar-card .badge-public {
    display: inline-flex;
    align-items: center;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-weight: 600;
    border-radius: 4px;
}

/* 3. Kata Kunci */
.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.keyword-chip svg {
    flex-shrink: 0;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.keyword-chip:hover {
    background-color: #eff6ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.keyword-chip:hover svg {
    color: #0284c7;
}

.keyword-chip:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

/* Responsive Overrides for Detail Page */
@media (max-width: 900px) {
    .archive-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .detail-main-col {
        min-width: 0;
        width: 100%;
    }

    .detail-sidebar-col {
        position: static;
        min-width: 0;
        width: 100%;
    }

    .detail-card {
        padding: 1.25rem;
    }

    .sidebar-card {
        padding: 1.25rem;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .attachment-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .attachment-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pdf-frame-wrapper {
        height: 520px;
    }

    .document-file-tab {
        flex-basis: 70vw;
        max-width: 260px;
    }

    .detail-hero-card {
        padding: 1.35rem;
    }

    .detail-hero-card .detail-title {
        font-size: 1.375rem;
        word-break: break-word;
    }

    .detail-hero-card .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .detail-hero-card .detail-meta-item:nth-child(odd) {
        border-right: none;
    }

    .detail-hero-card .detail-meta-item:nth-child(n+2) {
        border-top: 1px solid rgba(255, 255, 255, 0.11);
    }
}

@media (max-width: 640px) {
    .detail-card,
    .sidebar-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .pdf-preview-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .document-preview-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .preview-action-btn {
        flex: 1;
        min-height: 40px;
    }

    .pdf-frame-wrapper {
        height: 420px;
    }

    .document-file-tab {
        flex-basis: 78vw;
        max-width: 250px;
    }

    .detail-hero-card {
        padding: 1.15rem;
        border-radius: 10px;
    }

    .detail-hero-card .detail-title {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   HOMEPAGE PORTAL REDESIGN: FEATURED ARCHIVE & LATEST PUBLIC ARCHIVES
   ========================================================================== */

/* Hero Search Chips */
.hero-search-chips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.15rem;
}

.hero-chips-label {
    font-size: 0.8125rem;
    color: var(--portal-muted);
    font-weight: 600;
}

.hero-chip {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #334155;
    background: #ffffff;
    border: 1px solid var(--portal-border-strong);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-chip:hover {
    color: var(--portal-primary-dark);
    border-color: var(--portal-primary);
    background: var(--portal-primary-subtle);
    transform: translateY(-1px);
}

/* Featured Archive Block (60/40 Split) */
.featured-section {
    padding: 3rem 0;
    background-color: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.featured-layout {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

.featured-preview-col {
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.featured-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
    gap: 0.75rem;
}

.featured-preview-file-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex: 1;
}

.featured-preview-filename {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.featured-viewport {
    height: 440px;
    background: #091a2b;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.featured-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
    height: 100%;
    background-color: #091a2b;
}

.featured-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.featured-fallback-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.featured-fallback-box svg {
    color: #64748b;
    margin-bottom: 1rem;
}

.featured-fallback-box h4 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.featured-file-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--portal-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.featured-file-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
    max-width: 250px;
}

.featured-file-tab:hover {
    border-color: var(--portal-primary);
    background: #f0f9ff;
}

.featured-file-tab.active {
    border-color: var(--portal-primary);
    background: #e0f2fe;
    box-shadow: 0 0 0 1px var(--portal-primary);
}

.featured-file-tab:focus-visible {
    outline: none;
    box-shadow: var(--portal-focus-ring);
}

.featured-tab-badge {
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.featured-tab-badge.pdf {
    background-color: #fee2e2;
    color: #b91c1c;
}

.featured-tab-badge.image {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.featured-tab-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.featured-tab-filename {
    font-weight: 600;
    color: var(--portal-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
}

.featured-tab-meta {
    font-size: 0.6875rem;
    color: var(--portal-muted);
}

.featured-info-col {
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-lg);
    box-shadow: var(--portal-shadow-sm);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.badge-featured-label {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 700;
}

.featured-doc-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--portal-navy-dark);
    line-height: 1.35;
    margin: 1rem 0 0.75rem;
    letter-spacing: -0.01em;
}

.featured-doc-desc {
    font-size: 0.9375rem;
    color: var(--portal-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    padding: 1.15rem 0;
    border-top: 1px solid var(--portal-border);
    border-bottom: 1px solid var(--portal-border);
    margin-bottom: 1.5rem;
}

.featured-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.featured-meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-muted);
}

.featured-meta-val {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--portal-text);
    word-break: break-word;
}

.featured-cta-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--portal-radius-md);
    justify-content: center;
}

/* Latest Public Archives Grid */
.latest-section {
    padding: 3.5rem 0;
    background-color: var(--portal-bg);
}

.latest-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.latest-header-left {
    flex: 1 1 300px;
}

.latest-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.carousel-counter {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--portal-navy);
    font-variant-numeric: tabular-nums;
    background: #ffffff;
    border: 1px solid var(--portal-border);
    padding: 0.35rem 0.85rem;
    border-radius: var(--portal-radius-sm);
    letter-spacing: 0.05em;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-separator {
    margin: 0 0.35rem;
    color: var(--portal-muted);
    font-weight: 500;
}

.carousel-nav-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--portal-radius-sm);
    border: 1px solid var(--portal-border);
    background: #ffffff;
    color: var(--portal-navy-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 0;
}

.carousel-nav-btn:hover:not(:disabled) {
    background: var(--portal-primary-dark);
    border-color: var(--portal-primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(11, 48, 86, 0.15);
}

.carousel-nav-btn:focus-visible {
    outline: 2px solid var(--portal-primary);
    outline-offset: 2px;
}

.carousel-nav-btn:disabled,
.carousel-nav-btn[aria-disabled="true"] {
    opacity: 0.35;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: var(--portal-border);
    color: var(--portal-muted);
    box-shadow: none;
    transform: none;
}

/* Carousel Viewport & Track */
.latest-carousel-wrapper {
    position: relative;
    width: 100%;
}

.latest-carousel-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0.25rem 1rem;
    margin: -0.5rem -0.25rem -1rem;
}

.latest-carousel-viewport:focus-visible {
    outline: 2px solid var(--portal-primary);
    outline-offset: 2px;
}

.latest-carousel-viewport::-webkit-scrollbar {
    display: none;
}

.latest-carousel-track {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

/* Cards within Carousel (Desktop >= 1024px: 3 visible per page) */
.latest-carousel-track .latest-archive-card {
    flex: 0 0 calc((100% - (2 * 1.5rem)) / 3);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.latest-see-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--portal-primary-dark);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.latest-see-all-link:hover {
    color: var(--portal-primary-deep);
    transform: translateX(3px);
}

.latest-footer-action {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.latest-archive-card {
    background: #ffffff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.latest-archive-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--portal-shadow-md);
    border-color: #cbd5e1;
}

.latest-card-media {
    height: 180px;
    position: relative;
    background: #0f172a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.latest-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
}

.latest-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.latest-archive-card:hover .latest-card-img {
    transform: scale(1.04);
}

.latest-card-doc-cover {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: #ffffff;
    position: relative;
}

.latest-card-doc-cover.pdf-cover {
    background: linear-gradient(135deg, #092c4c 0%, #0369a1 100%);
}

.latest-card-doc-cover.generic-cover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.doc-cover-icon {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.doc-cover-type {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    backdrop-filter: blur(4px);
}

.latest-card-body {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.latest-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--portal-navy-dark);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-card-title a {
    color: inherit;
    text-decoration: none;
}

.latest-card-title a:hover {
    color: var(--portal-primary-dark);
}

.latest-card-excerpt {
    font-size: 0.875rem;
    color: var(--portal-muted);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.latest-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--portal-border);
    font-size: 0.8125rem;
    color: var(--portal-muted);
}

.latest-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.latest-card-link {
    font-weight: 700;
    color: var(--portal-primary-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.latest-card-link:hover {
    color: var(--portal-primary-deep);
    transform: translateX(2px);
}

/* Responsive Homepage Rules */
@media (max-width: 1024px) {
    .featured-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .featured-viewport {
        height: 380px;
    }

    /* Tablet (768px–1023px): 2 cards visible per page */
    .latest-carousel-track {
        gap: 1.25rem;
    }

    .latest-carousel-track .latest-archive-card {
        flex: 0 0 calc((100% - 1.25rem) / 2);
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 1.625rem;
    }

    .hero-search-form {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
        margin-top: 0.35rem;
    }

    .hero-search-chips {
        justify-content: flex-start;
    }

    .featured-info-col {
        padding: 1.25rem;
    }

    .featured-meta-grid {
        grid-template-columns: 1fr;
    }

    .featured-viewport {
        height: 280px;
    }

    .latest-card-media {
        height: 160px;
    }
}

/* Mobile (< 768px): 1 card visible per page */
@media (max-width: 767px) {
    .latest-section-header {
        align-items: flex-start;
    }

    .latest-header-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }

    .latest-carousel-track {
        gap: 1rem;
    }

    .latest-carousel-track .latest-archive-card {
        flex: 0 0 100%;
    }
}

