/* ============================================
   POLRES KETAPANG - Main Stylesheet
   Theme: Merah + Abu | Bootstrap 5
   ============================================ */

:root {
    --color-primary:   #c0392b;
    --color-secondary: #7f8c8d;
    --color-accent:    #2c3e50;
    --color-text:      #2d3436;
    --color-bg:        #f5f6fa;
    --radius:          10px;
    --shadow:          0 3px 15px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    font-size: .95rem;
}

/* ============ PAGE LOADING BAR ============ */
#page-loader-bar {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), #ff6b6b, var(--color-primary));
    background-size: 200% 100%;
    z-index: 99999;
    transition: width .3s ease, opacity .4s ease;
    opacity: 0;
    animation: loaderShimmer 1.2s linear infinite;
}
#page-loader-bar.loading {
    opacity: 1;
    animation: loaderShimmer 1.2s linear infinite;
}
@keyframes loaderShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ PAGE TRANSITION FADE ============ */
.page-transition {
    animation: pageFadeIn .35s ease forwards;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ LOADING OVERLAY ============ */
#page-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
#page-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.loader-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(0,0,0,.08);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spinLoader .7s linear infinite;
}
@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

/* ============ SKELETON LOADING ============ */
.skeleton {
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ TOP BAR ============ */
.top-bar {
    background: var(--color-accent);
    color: rgba(255,255,255,.8);
    font-size: .78rem;
}
.top-social {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    margin: 0 5px;
    font-size: 1rem;
    transition: color .2s;
}
.top-social:hover { color: #fff; }

/* ============ SITE HEADER (fixed) ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    width: 100%;
}
/* padding-top body diset otomatis oleh JS sesuai tinggi header */

/* ============ NAVBAR ============ */
.main-navbar {
    background: var(--color-accent) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    padding: .6rem 0;
}
.brand-icon {
    width: 46px; height: 46px; border-radius: 10px;
    background: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff; flex-shrink: 0;
}
.brand-name { font-size: .92rem; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-tagline { font-size: .68rem; color: rgba(255,255,255,.65); }

.main-navbar .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; font-size: .88rem; border-radius: 6px; padding: .4rem .7rem !important; transition: all .2s; }
.main-navbar .nav-link:hover, .main-navbar .nav-link.active { color: #fff !important; background: rgba(255,255,255,.12); }
.main-navbar .dropdown-menu { border: none; box-shadow: var(--shadow); border-radius: var(--radius); }
.main-navbar .dropdown-item:hover { background: var(--color-primary); color: #fff; }
.main-navbar .form-control { border-radius: 20px 0 0 20px; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.15); color: #fff; font-size: .82rem; }
.main-navbar .form-control::placeholder { color: rgba(255,255,255,.6); }
.main-navbar .form-control:focus { background: rgba(255,255,255,.25); box-shadow: none; border-color: rgba(255,255,255,.5); color: #fff; }

/* ============ PAGE HEADER BAR ============ */
.page-header-bar { background: #fff; border-bottom: 1px solid #e9ecef; }
.breadcrumb-item a { color: var(--color-primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--color-secondary); }

/* ============ HERO DEFAULT ============ */
.hero-default { background: linear-gradient(135deg, var(--color-accent), var(--color-primary)); min-height: 300px; display: flex; align-items: center; }

/* ============ BANNER ============ */
#mainBanner { margin: 0; padding: 0; line-height: 0; }
.banner-img {
    display: block;
    width: 100%;
    height: 380px;
    object-fit: fill;   /* paksa gambar penuh mengisi area, tidak terpotong */
}

@media (max-width: 992px) { .banner-img { height: 280px; } }
@media (max-width: 768px) { .banner-img { height: 200px; } }
@media (max-width: 576px) { .banner-img { height: 150px; } }
/* indikator dots lebih kecil & rapi */
#mainBanner .carousel-indicators [data-bs-target] {
    width: 8px; height: 8px; border-radius: 50%;
    border: none; opacity: .5;
    background-color: #fff;
    margin: 0 4px;
}
#mainBanner .carousel-indicators .active { opacity: 1; }

/* ============ SECTION TITLE ============ */
.section-title-bar { display: flex; align-items: center; border-bottom: 2px solid var(--color-primary); padding-bottom: .5rem; }
.section-title-bar h5 { margin: 0; font-weight: 700; color: var(--color-accent); font-size: 1rem; }

/* ============ BADGE ============ */
.badge-primary { background: var(--color-primary); color: #fff; }
.badge-outline {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
    font-size: .72rem; font-weight: 600;
    border-radius: 4px; padding: 3px 8px;
}

/* ============ FEATURED NEWS ============ */
.featured-card { border-radius: var(--radius); overflow: hidden; }
.featured-img { height: 100%; min-height: 260px; object-fit: cover; }
.no-thumb-lg { height: 260px; background: linear-gradient(135deg, #e0e0e0, #f5f5f5); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: #bbb; }

/* ============ NEWS CARDS ============ */
.news-card { border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.news-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,.12) !important; }
.news-thumb-wrap { position: relative; overflow: hidden; }
.news-thumb { height: 200px; object-fit: cover; transition: transform .3s; display: block; width: 100%; }
.news-card:hover .news-thumb { transform: scale(1.05); }
.no-thumb-md { height: 200px; background: linear-gradient(135deg, #e9ecef, #f8f9fa); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #ced4da; }
.news-cat-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--color-primary); color: #fff;
    font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 4px;
}
.news-title-link { transition: color .2s; }
.news-title-link:hover { color: var(--color-primary) !important; }

/* ============ SIDEBAR ============ */
.sidebar-widget { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sidebar-title {
    background: var(--color-accent); color: #fff;
    padding: .75rem 1rem; font-size: .88rem; font-weight: 700; display: flex; align-items: center;
}
.sidebar-content { padding: .5rem; }
.sidebar-article { display: flex; gap: .6rem; padding: .5rem; border-bottom: 1px solid #f0f0f0; align-items: flex-start; }
.sidebar-article:last-child { border-bottom: none; }
.sidebar-article-thumb { width: 70px; height: 52px; flex-shrink: 0; border-radius: 6px; overflow: hidden; }
.sidebar-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-thumb-xs { width: 70px; height: 52px; background: #e9ecef; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #ced4da; }
.no-thumb-sm { width: 50px; height: 40px; background: #e9ecef; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #ced4da; }
.sidebar-article-body { flex: 1; min-width: 0; }
.sidebar-article-title { font-size: .82rem; font-weight: 600; color: var(--color-text); text-decoration: none; display: block; line-height: 1.35; }
.sidebar-article-title:hover { color: var(--color-primary); }
.sidebar-popular-item { display: flex; gap: .75rem; padding: .6rem .5rem; border-bottom: 1px solid #f0f0f0; align-items: flex-start; }
.popular-number { width: 26px; height: 26px; background: var(--color-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.popular-body { flex: 1; }
.sidebar-cat-badge { display: inline-block; background: #f0f2f5; color: var(--color-text); border-radius: 20px; padding: 4px 12px; margin: 3px; font-size: .78rem; text-decoration: none; transition: all .2s; }
.sidebar-cat-badge:hover { background: var(--color-primary); color: #fff; }

/* ============ ARTICLE DETAIL ============ */
.article-title { font-family: 'Merriweather', serif; font-size: 1.6rem; line-height: 1.4; color: var(--color-accent); margin-bottom: .75rem; }
.article-meta { color: var(--color-secondary); font-size: .83rem; }
.article-thumb-wrap { border-radius: var(--radius); overflow: hidden; }
.article-thumb { width: 100%; max-height: 500px; object-fit: cover; }
.article-content { font-size: 1rem; line-height: 1.85; color: var(--color-text); }
.article-content img { max-width: 100%; border-radius: 8px; margin: 1rem auto; display: block; }
.article-content h2,.article-content h3,.article-content h4 { color: var(--color-accent); margin: 1.5rem 0 .75rem; }
.article-content blockquote { border-left: 4px solid var(--color-primary); padding: 1rem 1.5rem; background: #fdf5f5; color: var(--color-secondary); font-style: italic; border-radius: 0 8px 8px 0; margin: 1.5rem 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-content table th { background: var(--color-accent); color: #fff; padding: .6rem 1rem; }
.article-content table td { border: 1px solid #e0e0e0; padding: .6rem 1rem; }

/* ============ COMMENTS ============ */
.comment-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #f0f0f0; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 42px; height: 42px; background: var(--color-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-text { color: var(--color-text); font-size: .9rem; margin-top: .25rem; margin-bottom: 0; }

/* ============ GALLERY ============ */
.gallery-card { border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; aspect-ratio: 1; }
.gallery-img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-card:hover .gallery-img { transform: scale(1.1); }
.gallery-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; opacity: 0; transition: opacity .3s; }
.gallery-card:hover .gallery-overlay { opacity: 1; }
.gallery-overlay i { font-size: 2rem; margin-bottom: .5rem; }
.gallery-overlay p { font-size: .8rem; margin: 0; text-align: center; padding: 0 .5rem; }

/* ============ PROFIL ============ */
.profil-nav .profil-nav-active { background: var(--color-primary); color: #fff !important; }
.profil-section-img { max-height: 350px; object-fit: cover; }
.profil-content img { max-width: 100%; border-radius: 8px; }

/* ============ PAGINATION ============ */
.pagination .page-link { color: var(--color-primary); border-color: #dee2e6; }
.pagination .page-item.active .page-link { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination .page-link:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ============ BUTTONS ============ */
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-accent); border-color: var(--color-accent); }
.btn-outline-primary { color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline-primary:hover { background: var(--color-primary); border-color: var(--color-primary); }

/* ============ FOOTER ============ */
.site-footer { background: var(--color-accent); color: rgba(255,255,255,.85); }
.footer-main { border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-widget h5 { font-size: .92rem; }
.footer-title { font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; color: #fff; margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.footer-text { font-size: .83rem; color: rgba(255,255,255,.75); line-height: 1.7; }
.footer-text a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer-photo { width: 100%; max-width: 180px; height: 120px; object-fit: cover; border-radius: 8px; display: block; }
.footer-logo-box { width: 80px; height: 80px; background: var(--color-primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #fff; }
.footer-menu { list-style: none; padding: 0; margin: 0; }
.footer-menu li { margin-bottom: 5px; }
.footer-menu a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .83rem; transition: color .2s; }
.footer-menu a:hover { color: #fff; }
.footer-social a { color: rgba(255,255,255,.7); font-size: 1.3rem; margin-right: .75rem; text-decoration: none; transition: color .2s; }
.footer-social a:hover { color: #fff; }
.footer-articles { padding: .25rem; }
.footer-article-item { display: flex; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid rgba(255,255,255,.08); align-items: flex-start; }
.footer-article-item:last-child { border-bottom: none; }
.footer-article-thumb { width: 55px; height: 42px; flex-shrink: 0; border-radius: 5px; overflow: hidden; }
.footer-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.footer-article-info a { font-size: .78rem; color: rgba(255,255,255,.85); text-decoration: none; display: block; line-height: 1.3; }
.footer-article-info a:hover { color: #fff; }
.footer-article-info small { color: rgba(255,255,255,.5); font-size: .7rem; }
.footer-bottom { background: rgba(0,0,0,.2); color: rgba(255,255,255,.6); font-size: .8rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
    .article-title { font-size: 1.3rem; }
}
@media (max-width: 576px) {
    .article-title { font-size: 1.15rem; }
    .brand-tagline { display: none; }
    .footer-photo { max-width: 100%; }
}

/* ============ UTILITIES ============ */
.text-primary { color: var(--color-primary) !important; }
.bg-primary { background: var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }
img { max-width: 100%; }
.overflow-hidden { overflow: hidden; }
.object-fit-cover { object-fit: cover; }
