/* =========================================================
   REDESIGN TEMPLATE4 - KONTEN BERANDA
   Sumber desain: template_1/portal-blitar.html
   ========================================================= */

.tpl4-section { padding: 64px 24px; }
.tpl4-container { max-width: 1200px; margin: 0 auto; }
.tpl4-section-label {
    font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
    color: var(--tpl1-red); font-weight: 600; margin-bottom: 10px;
}
.tpl4-section-title {
    font-size: clamp(24px, 4vw, 34px); font-weight: 700; color: var(--tpl1-gray-800);
    margin-bottom: 10px; line-height: 1.25;
}
.tpl4-section-sub { color: var(--tpl1-gray-600); font-size: 15px; max-width: 600px; line-height: 1.7; }
.tpl4-section-header { margin-bottom: 40px; }
.tpl4-btn-primary {
    display: inline-flex; align-items: center; gap: 6px; background: var(--tpl1-red);
    color: #fff !important; padding: 12px 24px; border-radius: 8px; text-decoration: none;
    font-size: 14px; font-weight: 500; transition: background .2s; border: none;
}
.tpl4-btn-primary:hover { background: var(--tpl1-red-dark); color: #fff; }

/* ===== HERO ===== */
#tpl4-hero {
    position: relative; min-height: 520px; display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden; background: linear-gradient(135deg, var(--tpl1-red-dark), #2c1a1a);
}
#tpl4-hero video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
#tpl4-hero .tpl4-hero-content { position: relative; z-index: 1; max-width: 760px; padding: 24px; color: #fff; }
#tpl4-hero .tpl4-hero-eyebrow { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; opacity: .8; margin-bottom: 14px; }
#tpl4-hero .tpl4-hero-title { font-size: clamp(28px, 5vw, 46px); font-weight: 700; line-height: 1.2; margin-bottom: 16px; }
#tpl4-hero .tpl4-hero-title span { color: #f0c040; }
#tpl4-hero .tpl4-hero-sub { font-size: 15px; opacity: .85; margin-bottom: 28px; line-height: 1.7; }
#tpl4-hero .tpl4-hero-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
#tpl4-hero .tpl4-hero-badge {
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    padding: 6px 14px; border-radius: 20px; font-size: 12px; backdrop-filter: blur(4px);
}

/* ===== PROFIL KOTA ===== */
#tpl4-profil { background: var(--tpl1-gray-50); }
.tpl4-profil-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tpl4-profil-img {
    position: relative; border-radius: 16px; overflow: hidden; min-height: 360px;
    background: linear-gradient(135deg, var(--tpl1-red-dark), #8a0809);
    display: flex; align-items: flex-end;
}
.tpl4-profil-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.tpl4-profil-img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 65%); }
.tpl4-profil-img-body { position: relative; z-index: 1; padding: 24px; color: #fff; }
.tpl4-profil-img-body h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.tpl4-profil-img-body p { font-size: 13px; opacity: .8; }
.tpl4-profil-quote {
    font-size: 17px; color: var(--tpl1-gray-800); line-height: 1.7; margin-bottom: 20px;
    font-style: italic; border-left: 3px solid var(--tpl1-red); padding-left: 18px;
}
.tpl4-profil-desc { color: var(--tpl1-gray-600); font-size: 15px; line-height: 1.8; margin-bottom: 24px; }
.tpl4-profil-tabs { display: flex; border-bottom: 2px solid var(--tpl1-gray-200); margin-bottom: 20px; }
.tpl4-profil-tab {
    padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--tpl1-gray-400);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
}
.tpl4-profil-tab.active { color: var(--tpl1-red); border-bottom-color: var(--tpl1-red); }
.tpl4-profil-pane { display: none; }
.tpl4-profil-pane.active { display: block; }
.tpl4-pimpinan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.tpl4-pimpinan-card {
    background: #fff; border-radius: 12px; padding: 16px; text-align: center; border: 1px solid var(--tpl1-gray-200);
}
.tpl4-pimpinan-card img {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block;
}
.tpl4-pimpinan-card h4 { font-size: 13px; font-weight: 600; color: var(--tpl1-gray-800); }
.tpl4-pimpinan-card p { font-size: 11px; color: var(--tpl1-red); margin-top: 3px; }

/* ===== STATISTIKA ===== */
#tpl4-statistik { background: #fff; }
.tpl4-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.tpl4-stat-card {
    background: var(--tpl1-gray-50); border: 1px solid var(--tpl1-gray-200); border-radius: 14px;
    padding: 24px 16px; text-align: center; transition: all .2s;
}
.tpl4-stat-card:hover { border-color: var(--tpl1-red); transform: translateY(-3px); }
.tpl4-stat-icon {
    width: 52px; height: 52px; border-radius: 50%; background: var(--tpl1-red-light); color: var(--tpl1-red);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 22px;
}
.tpl4-stat-num { font-size: 26px; font-weight: 700; color: var(--tpl1-red); }
.tpl4-stat-lbl { font-size: 12px; color: var(--tpl1-gray-600); margin-top: 4px; }

/* ===== GALERI (reskin, class fungsional JS TIDAK diubah) ===== */
#tpl4-galeri { background: var(--tpl1-gray-50); }
#tpl4-galeri .galeri-kegiatan-render .card,
#tpl4-galeri .galeri-kegiatan-render .item {
    border-radius: 14px !important; overflow: hidden; border: none !important;
    box-shadow: var(--tpl1-shadow-md);
}
.btn-galeri-filter { border-radius: 20px !important; border: 1px solid var(--tpl1-gray-200) !important; color: var(--tpl1-gray-600) !important; background: #fff !important; }
.btn-galeri-filter.active { background: var(--tpl1-red) !important; border-color: var(--tpl1-red) !important; color: #fff !important; }
.btn-nav-galeri { background: #fff !important; border: 1px solid var(--tpl1-gray-200) !important; color: var(--tpl1-red) !important; }

/* ===== BERITA header wrapper (isi tetap fungsi lama) ===== */
.color-red-theme { color: var(--tpl1-red) !important; }
.btn-portal-berita { background: var(--tpl1-red) !important; border-color: var(--tpl1-red) !important; color: #fff !important; }
.btn-kategori-berita.active,
.btn-rubrik-masyarakat.active { background: var(--tpl1-red) !important; border-color: var(--tpl1-red) !important; color: #fff !important; }
.btn-nav-kategori, .btn-nav-video-kegiatan { background: #fff !important; border: 1px solid var(--tpl1-gray-200) !important; color: var(--tpl1-red) !important; }

/* ===== Recolor global elemen lama supaya seragam dengan tema baru ===== */
.marquee-info { background: var(--tpl1-red) !important; }
.bg-card-merah-muda { background: var(--tpl1-red-light) !important; }
.text-old-red, .text-danger { color: var(--tpl1-red) !important; }
.btn-informasi.active, .nav-pills .btn-informasi.active { background: var(--tpl1-red) !important; border-color: var(--tpl1-red) !important; }
.bg-info-layanan { background: linear-gradient(135deg, var(--tpl1-red-dark), #2c1a1a) !important; }
.bg-prestasi-penghargaan { background: linear-gradient(135deg, var(--tpl1-red-dark), #5a0607) !important; }

/* ===== BERITA (redesign section, sesuai portal-blitar.html) ===== */
#tpl4-berita { background: #fff; }
.tpl4-berita-hero-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin-bottom: 40px; }
.tpl4-berita-hero-main {
    position: relative; border-radius: 16px; overflow: hidden; min-height: 320px;
    background-color: var(--tpl1-red-dark); background-size: cover; background-position: center;
    display: flex; align-items: flex-end; text-decoration: none;
}
.tpl4-berita-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 60%); }
.tpl4-berita-hero-content { position: relative; z-index: 1; padding: 28px; color: #fff; }
.tpl4-berita-badge {
    display: inline-block; background: var(--tpl1-red); color: #fff; font-size: 11px;
    padding: 3px 8px; border-radius: 4px; margin-bottom: 10px; font-weight: 600;
}
.tpl4-berita-hero-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; color: #fff; }
.tpl4-berita-hero-meta { font-size: 12px; color: rgba(255,255,255,.7); }
.tpl4-berita-aside { display: flex; flex-direction: column; gap: 12px; }
.tpl4-berita-aside-item {
    display: flex; gap: 12px; text-decoration: none; border: 1px solid var(--tpl1-gray-200);
    border-radius: 12px; overflow: hidden; transition: border-color .2s;
}
.tpl4-berita-aside-item:hover { border-color: var(--tpl1-red); }
.tpl4-berita-aside-thumb {
    width: 80px; flex-shrink: 0; background-color: var(--tpl1-gray-100);
    background-size: cover; background-position: center;
}
.tpl4-berita-aside-info { padding: 12px 12px 12px 0; flex: 1; }
.tpl4-berita-aside-cat { font-size: 10px; color: var(--tpl1-red); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; }
.tpl4-berita-aside-title { font-size: 13px; font-weight: 500; color: var(--tpl1-gray-800); line-height: 1.4; margin-bottom: 4px; }
.tpl4-berita-aside-date { font-size: 11px; color: var(--tpl1-gray-400); }

.tpl4-berita-tabs { display: flex; align-items: center; gap: 0; border-bottom: 2px solid var(--tpl1-gray-200); margin-bottom: 24px; }
.tpl4-berita-tab {
    padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--tpl1-gray-400);
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s;
}
.tpl4-berita-tab.active { color: var(--tpl1-red); border-bottom-color: var(--tpl1-red); }
.tpl4-berita-tab-link { margin-left: auto; text-decoration: none; color: var(--tpl1-gray-400) !important; }
.tpl4-berita-tab-link:hover { color: var(--tpl1-red) !important; }
.tpl4-berita-tab-content { display: none; }
.tpl4-berita-tab-content.active { display: block; }
.tpl4-berita-card {
    border: 1px solid var(--tpl1-gray-200); border-radius: 12px; overflow: hidden;
    text-decoration: none; transition: all .2s; display: block;
}
.tpl4-berita-card:hover { border-color: var(--tpl1-red); transform: translateY(-2px); box-shadow: var(--tpl1-shadow); }
.tpl4-berita-card-thumb { height: 140px; background-color: var(--tpl1-gray-100); background-size: cover; background-position: center; }
.tpl4-berita-card-body { padding: 16px; }
.tpl4-berita-card-cat { font-size: 10px; color: var(--tpl1-red); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.tpl4-berita-card-title { font-size: 14px; font-weight: 600; color: var(--tpl1-gray-800); line-height: 1.4; margin-bottom: 6px; }
.tpl4-berita-card-meta { font-size: 11px; color: var(--tpl1-gray-400); }

.tpl4-berita-kategori-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tpl4-berita-kategori-filter .btn-kategori-berita {
    border-radius: 20px !important; border: 1px solid var(--tpl1-gray-200) !important;
    color: var(--tpl1-gray-600) !important; background: #fff !important; font-size: 12px !important;
}
.tpl4-berita-kategori-filter .btn-kategori-berita.active { background: var(--tpl1-red) !important; border-color: var(--tpl1-red) !important; color: #fff !important; }
.tpl4-berita-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tpl4-berita-grid .berita-not-found { grid-column: 1 / -1; text-align: center; color: var(--tpl1-gray-400); padding: 30px 0; }

@media (max-width: 900px) {
    .tpl4-profil-grid { grid-template-columns: 1fr; }
    .tpl4-berita-hero-grid { grid-template-columns: 1fr; }
    .tpl4-berita-tab-content.active { grid-template-columns: 1fr 1fr; }
    .tpl4-berita-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .tpl4-berita-tab-content.active { grid-template-columns: 1fr; }
    .tpl4-berita-grid { grid-template-columns: 1fr; }
}
