/* =====================================================================
   site.css — tambahan gaya (aksesibilitas, navigasi, slider, tombol atas)
   Dimuat setelah CSS utama Vite. Tidak memerlukan rebuild Tailwind.
   ===================================================================== */

/* ---------- Aksesibilitas ---------- */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -4rem;
    z-index: 100;
    background: #b91c1c;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0.75rem;
    outline: 2px solid #fde047;
    outline-offset: 2px;
}

#main-content:focus { outline: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* ---------- Menu aktif ---------- */
.nav-active {
    color: #dc2626 !important;
    background-color: #fef2f2 !important;
    font-weight: 600;
}

/* ---------- Tombol kembali ke atas ---------- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(185, 28, 28, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    font-size: 1.25rem;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(185, 28, 28, 0.45);
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}
.back-to-top:active { transform: translateY(0) scale(0.95); }
.back-to-top .tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #ffffff;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}
.back-to-top:hover .tooltip { opacity: 1; visibility: visible; }
@media (max-width: 640px) {
    .back-to-top { bottom: 1.25rem; right: 1.25rem; width: 42px; height: 42px; font-size: 1rem; }
    .back-to-top .tooltip { display: none; }
}

/* ---------- Hero slider (beranda) ---------- */
.hero-slider { position: absolute; inset: 0; overflow: hidden; background: #7f1d1d; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    z-index: 0;
}
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-dot {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}
.hero-dot:hover { background: #fff; }
.hero-dot.active { width: 1.5rem; background: #fff; }

/* ---------- Konten editor (berita / kegiatan) ---------- */
.rich-content { overflow-wrap: anywhere; }
.rich-content img, .rich-content iframe { max-width: 100%; height: auto; }
.rich-content iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.rich-content table { display: block; overflow-x: auto; }

/* ---------- Honeypot formulir (disembunyikan dari manusia) ---------- */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Gerak dikurangi ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
