/* ================================================================
   ULT UPI - Main Stylesheet v3.0
   PREMIUM LIGHT THEME — Merah UPI Edition
   ================================================================ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
    /* Brand Colors */
    --red-50: #fff0f0;
    --red-100: #ffd6d6;
    --red-200: #ffadad;
    --red-300: #ff8585;
    --red-400: #eb3434;
    --red-500: #cc0000;
    /* primary */
    --red-600: #a30000;
    --red-700: #850000;
    --red-800: #660000;
    --red-900: #470000;

    --crimson: #a30000;
    --crimson-dark: #850000;
    --crimson-glow: rgba(163, 0, 0, 0.15);

    /* Neutral / Surface */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Accent */
    --gold: #D4AF37;
    --gold-light: #F0D060;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .10), 0 4px 6px rgba(0, 0, 0, .05);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, .12);
    --shadow-red: 0 8px 30px rgba(163, 0, 0, .25);
    --shadow-red-lg: 0 16px 48px rgba(163, 0, 0, .30);

    /* Typography — satu font konsisten */
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Layout */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ── Base Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--gray-800);
    background: var(--white);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Override font-serif → Inter, konsisten seluruh site ── */
.font-serif,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', system-ui, sans-serif !important;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: var(--red-50);
    border: 1.5px solid rgba(163, 0, 0, .2);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--crimson);
    margin-bottom: 12px;
    line-height: 1;
}

.section-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--crimson);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(163, 0, 0, .2);
    animation: gentle-pulse 2.5s ease-in-out infinite;
}

@keyframes gentle-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(163, 0, 0, .2);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(163, 0, 0, .0);
    }
}

.section-badge-gold {
    background: rgba(212, 175, 55, .08);
    border-color: rgba(212, 175, 55, .3);
    color: #8B6914;
}

.section-badge-gold::before {
    background: var(--gold);
    box-shadow: none;
    animation: none;
}

/* ── Hero Section Fallback ── */
#hero {
    background-color: #a30000;
    /* fallback if no bg image */
}

#hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    clip-path: ellipse(55% 100% at 50% 100%);
    z-index: 15;
}

.section-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(1.875rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    letter-spacing: -.02em;
}



/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: var(--crimson);
    color: var(--white);
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-red);
    position: relative;
    overflow: hidden;
    letter-spacing: .01em;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15), transparent);
    transition: left .4s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--crimson-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-red-lg);
    color: var(--white);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    color: var(--crimson);
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius);
    text-decoration: none;
    border: 2px solid var(--crimson);
    transition: all .25s ease;
    cursor: pointer;
}

.btn-outline:hover {
    background: var(--crimson);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius);
    text-decoration: none;
    border: 1.5px solid var(--gray-200);
    transition: all .2s ease;
}

.btn-ghost:hover {
    background: white;
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ── Gradient Text ── */
.gradient-text {
    color: var(--crimson);
}

/* ── Card Base ── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
    border-color: var(--gray-200);
}

/* ── Ornamental Card Left Border ── */
.ornament-card {
    position: relative;
    padding-left: 20px !important;
}

.ornament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--crimson);
    border-radius: 4px 0 0 4px;
}

/* ── Hover Lift ── */
.hover-lift {
    transition: transform .3s cubic-bezier(.25, .46, .45, .94), box-shadow .3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* ── Badge utility ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.badge-red {
    background: var(--red-50);
    color: var(--crimson);
    border: 1px solid var(--red-200);
}

.badge-gold {
    background: rgba(212, 175, 55, .1);
    color: #7A5F00;
    border: 1px solid rgba(212, 175, 55, .25);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

/* ── Page Content (CMS rich text) ── */
.page-content {
    line-height: 1.9;
    color: var(--gray-700);
    font-size: 15.5px;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
    font-family: var(--font-heading);
    color: var(--gray-900);
    font-weight: 400;
    margin: 2em 0 .75em;
    line-height: 1.3;
}

.page-content h1 {
    font-size: 2.2rem;
    border-bottom: 3px solid var(--crimson);
    padding-bottom: .5em;
}

.page-content h2 {
    font-size: 1.7rem;
}

.page-content h3 {
    font-size: 1.3rem;
}

.page-content p {
    margin-bottom: 1.25em;
}

.page-content a {
    color: var(--crimson);
    text-decoration: underline;
}

.page-content ul,
.page-content ol {
    margin: 1em 0 1em 1.5em;
}

.page-content li {
    margin-bottom: .5em;
}

.page-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5em 0;
}

.page-content blockquote {
    border-left: 4px solid var(--crimson);
    background: var(--red-50);
    padding: 1.2em 1.5em;
    margin: 1.5em 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--gray-600);
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.page-content th {
    background: var(--crimson);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-heading);
}

.page-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.page-content tr:nth-child(even) td {
    background: var(--gray-50);
}

/* ── Hero Breadcrumb ── */
.hero-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    margin-bottom: 20px;
}

.hero-breadcrumb a {
    color: rgba(255, 255, 255, .8);
    text-decoration: none;
}

.hero-breadcrumb a:hover {
    color: var(--gold-light);
}

.hero-breadcrumb .sep {
    color: var(--gold);
}

/* ── Page Hero Banner ── */
.page-hero {
    background: #a30000;
    padding: 124px 0 64px;
    /* 104px (dua sticky bar) + 20px gap breathing room */
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 48px;
    background: white;
    clip-path: ellipse(55% 100% at 50% 100%);
}

/* ── FAQ ── */
.faq-item {
    border-bottom: 1px solid var(--gray-100);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 20px 0;
    font-weight: 600;
    color: var(--gray-800);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
    font-family: var(--font-body);
    transition: color .2s;
}

.faq-question:hover {
    color: var(--crimson);
}

.faq-question.active {
    color: var(--crimson);
}

.faq-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .3s;
    color: var(--gray-500);
    font-size: 12px;
}

.faq-question.active .faq-icon {
    background: var(--crimson);
    border-color: var(--crimson);
    color: white;
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.4, 0, .2, 1), padding .3s;
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 14.5px;
}

.faq-answer.open {
    max-height: 800px;
    padding-bottom: 20px;
}

/* ── News Card ── */
.news-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gray-100);
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-sm);
    display: block;
}

.news-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
    border-color: rgba(163, 0, 0, .15);
}

.news-card:hover .news-img {
    transform: scale(1.06);
}

.news-img {
    transition: transform .55s ease;
}

.news-cat-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--crimson);
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 4px;
}

/* ── Stat Number ── */
.stat-number {
    font-family: var(--font-heading);
    font-weight: 400;
}

/* ── Service Item ── */
.service-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--gray-100);
}

.service-item:last-child {
    border-bottom: none;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--red-50);
    border: 1px solid var(--red-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crimson);
    flex-shrink: 0;
    font-size: 18px;
}

/* ── Search Input ── */
.search-input:focus {
    border-color: var(--crimson) !important;
    box-shadow: 0 0 0 3px rgba(163, 0, 0, .10);
}

/* ── Accessibility ── */
html.high-contrast {
    filter: contrast(160%) saturate(120%) !important;
}

html.grayscale {
    filter: grayscale(100%) !important;
}

html.underline-links a {
    text-decoration: underline !important;
}

html.readable-font,
html.readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.font-sm {
    font-size: 14px !important;
}

html.font-md {
    font-size: 16px !important;
}

html.font-lg {
    font-size: 18px !important;
}

html.font-xl {
    font-size: 20px !important;
}

#reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(163, 0, 0, .07);
    border-top: 2px solid rgba(163, 0, 0, .3);
    border-bottom: 2px solid rgba(163, 0, 0, .3);
    pointer-events: none;
    z-index: 9005;
    display: none;
}

/* ── Timeline ── */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--crimson);
}

.timeline-item {
    position: relative;
    padding: 0 0 32px 52px;
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crimson);
    font-size: 14px;
    font-weight: 700;
    z-index: 1;
}

/* ── Glassmorphism cards ── */
.glass-card {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .06);
}

/* ── Red Gradient Band ── */
.red-band {
    background: #a30000;
    color: white;
}

/* ── Counter Item ── */
.counter-item {
    text-align: center;
    padding: 20px;
}

.counter-value {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.25rem);
    color: var(--gray-900);
    line-height: 1;
}

.counter-value span.accent {
    color: var(--crimson);
}

/* ── Decorative Dot Pattern ── */
.dot-pattern {
    background-image: radial-gradient(circle, rgba(163, 0, 0, .08) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

/* ── Print ── */
@media print {

    header,
    footer,
    #back-to-top,
    #acc-panel {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    .page-content a::after {
        content: " (" attr(href) ")";
        font-size: .8em;
    }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .page-hero {
        padding: 60px 0 48px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .page-content h1 {
        font-size: 1.5rem;
    }
}

/* ── Ring Decorative ── */
.ring-decor {
    border-radius: 50%;
    border: 1.5px solid rgba(163, 0, 0, .12);
    position: absolute;
    pointer-events: none;
}

/* ── Active Nav ── */
.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--crimson) !important;
}

/* ── Animated underline link ── */
.anim-link {
    position: relative;
    text-decoration: none;
    color: var(--crimson);
    font-weight: 700;
}

.anim-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--crimson);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s ease;
}

.anim-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hide scrollbar for slider */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE FIX — Cegah horizontal scroll
   ══════════════════════════════════════════════════ */

/* 1. Kunci overflow horizontal di level paling atas */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* 2. Cegah overflow HORIZONTAL saja — overflow-x: clip tidak membuat scroll context */
/* Jangan pakai overflow: clip (2 arah) pada #hero karena video card sengaja menjulur ke bawah */
section.overflow-hidden {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

/* Hero: hanya horizontal, biarkan video card menjulur ke bawah (translate-y[30%]) */
#hero {
    overflow-x: clip;
}

/* 5. Accessibility Panel di sisi kanan — pastikan tidak tambah lebar */
#acc-panel {
    right: 0;
    overflow: visible;
}

/* 6. Floating buttons (WA + Chatbot) di mobile — perkecil & sesuaikan posisi */
@media (max-width: 640px) {
    /* WA button */
    #wa-float-wrapper {
        bottom: 1.25rem;
        left: 1rem;
    }

    #wa-float-wrapper button {
        width: 48px;
        height: 48px;
    }

    /* Chatbot button */
    #chatbot-wrapper {
        bottom: 1.25rem;
        left: 4.5rem; /* 72px — tepat di kanan tombol WA */
    }

    #chatbot-btn {
        width: 48px;
        height: 48px;
    }

    /* Chatbot popup — full width minus margin di mobile */
    #chatbot-popup {
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: calc(100vw - 2rem);
    }

    /* WA modal — full width */
    #wa-modal-box {
        margin: 0.75rem;
        max-height: 85vh;
    }

    /* Announcement modal */
    #announcement-modal-box {
        margin: 0.75rem;
        max-height: 88vh;
    }
}

/* 7. Hero section — text lebih kecil di mobile */
@media (max-width: 640px) {
    #hero {
        padding-bottom: 240px !important;
    }

    #hero .relative.z-10 {
        padding-top: 5rem !important;
        padding-bottom: 14rem !important;
    }
}

/* 8. Gambar dan iframe — jangan melebihi container */
img,
iframe,
video {
    max-width: 100%;
}

/* 9. Tabel — horizontal scroll di dalam container, bukan overflow ke luar */
.page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 10. Footer columns — stack di mobile */
@media (max-width: 640px) {
    footer .grid {
        gap: 2rem;
    }
}

/* 11. Perbaiki dekoratif circle di section alur layanan */
.py-24.bg-gray-50 > .absolute {
    overflow: hidden;
}

/* 12. Topbar — sembunyikan teks panjang di mobile kecil */
@media (max-width: 380px) {
    .topbar-gradient .hidden.md\\:flex {
        display: none !important;
    }
}