/*
 * Theme Name: Detik Hangat
 * Theme URI: https://faktahangat.com
 * Author: Fakta Hangat
 * Description: Tema berita Detik.com style untuk Kabupaten Ciamis
 * Version: 1.0.0
 * Requires at least: 5.0
 * Requires PHP: 7.2
 * License: GPL v2 or later
 * Text Domain: detik-hangat
 */

/* ===== VARIABLES ===== */
:root {
    --primary: #c41e3a;
    --primary-dark: #a01729;
    --primary-light: #e8546f;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg: #ffffff;
    --bg-light: #f5f5f5;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

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

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

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 10px;
    line-height: 1.3;
}

h1 { font-size: 32px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

/* ===== HEADER ===== */
.site-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.site-logo-part1 {
    color: var(--text);
}

.site-logo-part2 {
    color: var(--primary);
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
}

.search-form button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.search-form button:hover {
    background: var(--primary-dark);
}

.header-auth {
    display: flex;
    gap: 10px;
}

.btn-login, .btn-signup {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-login {
    background: transparent;
    color: var(--text);
}

.btn-signup {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-signup:hover {
    background: var(--primary-dark);
}

/* ===== NAVIGATION ===== */
.main-nav {
    background: var(--primary);
    border-bottom: 2px solid var(--primary-dark);
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.main-nav li {
    border-right: 1px solid rgba(255,255,255,0.2);
}

.main-nav li:last-child {
    border-right: none;
}

.main-nav a {
    display: block;
    padding: 12px 18px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.main-nav a:hover {
    background: var(--primary-dark);
    color: white;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 30px 0;
}

/* ===== HERO BANNER ===== */
.hero-section {
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-lg);
}

.hero-featured {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.hero-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 30px 30px;
    color: white;
}

.hero-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    border-radius: 3px;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: white;
    margin-bottom: 10px;
}

.hero-title a {
    color: white;
}

.hero-title a:hover {
    text-decoration: underline;
}

.hero-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    display: flex;
    gap: 15px;
}

/* ===== ARTICLE GRID ===== */
.articles-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.section-more {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.article-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.article-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.article-card:hover .article-thumb img {
    transform: scale(1.05);
}

.article-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-category-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
    border-radius: 2px;
    width: fit-content;
}

.article-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    flex: 1;
}

.article-title a {
    color: var(--text);
}

.article-title a:hover {
    color: var(--primary);
}

.article-excerpt {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}

.article-meta {
    font-size: 12px;
    color: var(--text-lighter);
    display: flex;
    gap: 10px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.popular-list {
    list-style: none;
}

.popular-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    counter-increment: item-counter;
}

.popular-list li:before {
    content: counter(item-counter);
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.popular-list a {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text);
    flex: 1;
}

.popular-list a:hover {
    color: var(--primary);
}

.popular-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ===== SINGLE POST ===== */
.single-post {
    background: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 30px;
    margin-bottom: 30px;
}

.single-featured {
    width: 100%;
    height: 400px;
    margin: 30px 0;
    border-radius: 4px;
    overflow: hidden;
}

.single-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
}

.single-meta {
    font-size: 13px;
    color: var(--text-light);
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.single-content {
    font-size: 16px;
    line-height: 1.8;
}

.single-content p {
    margin-bottom: 15px;
}

.single-content h2 {
    margin: 30px 0 15px;
}

/* ===== PAGINATION ===== */
.pagination {
    text-align: center;
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;  /* UBAH wrap → nowrap */
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-weight: 600;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== FOOTER ===== */
.site-footer {
    background: #333;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 60px;
    font-size: 13px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 14px;
}

.footer-widget a {
    color: #999;
    display: block;
    padding: 5px 0;
}

.footer-widget a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr 250px;
        gap: 20px;
    }
    
    .header-top {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header-search {
        display: none;
    }
    
    .header-auth {
        display: none;
    }
    
    .hero-featured {
        height: 250px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-overlay {
        padding: 20px 15px 15px;
    }
    
    .main-nav a {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .article-card {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 15px;
    }
    
    .article-thumb {
        height: 90px;
    }
    
    .article-content {
        padding: 10px;
    }
    
    .single-post {
        padding: 20px;
    }
    
    .single-featured {
        height: 250px;
    }
    
    .single-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .site-logo-text {
        font-size: 20px;
    }
    
    .search-form {
        order: 3;
        width: 100%;
        margin: 0 !important;
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav li {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .main-nav a {
        padding: 12px 15px;
    }
    
    .hero-featured {
        height: 200px;
    }
    
    .hero-title {
        font-size: 16px;
    }
    
    .articles-grid {
        gap: 12px;
    }
    
    .article-card {
        grid-template-columns: 100px 1fr;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .single-post {
        padding: 15px;
    }
    
    .single-featured {
        height: 180px;
    }
    
    .single-content {
        font-size: 15px;
    }
}

/* ===== HAMBURGER MENU ===== */
.hamburger-menu {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  gap: 6px;
  margin-right: 15px;
}

.hamburger-menu span {
  width: 25px;
  height: 3px;
  background: #c41e3a;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Menu */
@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column !important;
  }

  .main-nav a, .main-nav li {
    display: block !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid #f0f0f0;
  }
}

/* Hamburger Animation */
.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}
/* ===================================================== */
/* ===== TAMPILAN PORTAL (beranda gaya portal berita) ===== */
/* ===================================================== */
.fh-topbar{background:#1b1b1b;color:#bbb;font-size:12px}
.fh-topbar-in{display:flex;justify-content:space-between;gap:12px;padding-top:6px;padding-bottom:6px}
.fh-toplinks a{color:#ddd;margin-left:14px}.fh-toplinks a:hover{color:#fff}
.site-header.fh-header{position:relative;box-shadow:none}
.fh-header .site-logo{display:block;color:inherit}
.fh-tagline{display:block;font-size:11px;color:#777;margin-top:2px;font-weight:500}
.main-nav{position:sticky;top:0;z-index:100}
.fh-topik{background:#fff;border-bottom:1px solid var(--border);font-size:13px}
.fh-topik-in{display:flex;gap:10px;align-items:center;overflow-x:auto;white-space:nowrap;padding-top:8px;padding-bottom:8px}
.fh-topik b{color:var(--primary)}
.fh-topik a{background:#f7e8eb;color:var(--primary-dark);padding:3px 10px;border-radius:12px}
.fh-home{padding:14px 0 10px;max-width:1180px;margin:0 auto}
.fh-home a{color:#1b1b1b}.fh-home a:hover,.fh-home a:hover h3{color:var(--primary)}
.fh-home h1,.fh-home h2,.fh-home h3{margin:0}
.fh-ticker{background:#fff;border:1px solid var(--border);display:flex;align-items:center;overflow:hidden;font-size:14px}
.fh-ticker b{background:var(--primary);color:#fff;padding:9px 14px;flex:none;z-index:1}
.fh-ticker-track{overflow:hidden;flex:1}
.fh-ticker-in{display:inline-block;white-space:nowrap;padding-left:100%;animation:fhTick 70s linear infinite}
.fh-ticker-in span{color:#bbb;margin:0 12px}
.fh-ticker:hover .fh-ticker-in{animation-play-state:paused}
@keyframes fhTick{to{transform:translateX(-100%)}}
.fh-hl{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-top:16px}
.fh-hero{position:relative;display:block;border-radius:6px;overflow:hidden;background:#000}
.fh-hero img{width:100%;height:420px;object-fit:cover;opacity:.92}
.fh-ov{position:absolute;left:0;right:0;bottom:0;padding:70px 22px 20px;background:linear-gradient(transparent,rgba(0,0,0,.88));color:#fff}
.fh-home .fh-hero h1{font-size:28px;line-height:1.25;margin:8px 0;color:#fff}
.fh-hero:hover h1{text-decoration:underline}
.fh-ov time{font-size:13px;opacity:.85}
.fh-kat{display:inline-block;color:var(--primary);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.4px}
.fh-kat-box{background:var(--primary);color:#fff;padding:3px 8px;border-radius:3px}
.fh-subs{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}
.fh-subs a{background:#fff;border:1px solid var(--border);border-radius:6px;overflow:hidden}
.fh-subs img{width:100%;height:130px;object-fit:cover}
.fh-subs div{padding:10px 12px 14px}
.fh-subs h3{font-size:15px;line-height:1.35;margin-top:4px}
.fh-box{background:#fff;border:1px solid var(--border);border-radius:6px;padding:14px 16px}
.fh-sh{font-size:17px!important;margin:0 0 12px!important;border-bottom:2px solid var(--border)}
.fh-sh span{display:inline-block;border-bottom:3px solid var(--primary);padding-bottom:6px;margin-bottom:-2px}
.fh-pop ol{list-style:none;margin:0;padding:0;counter-reset:fhc}
.fh-pop li{counter-increment:fhc;display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.fh-pop li:last-child{border:0}
.fh-pop li:before{content:counter(fhc);font-size:28px;font-weight:800;color:var(--primary);line-height:1;min-width:24px}
.fh-pop a{font-weight:700;font-size:14.5px;line-height:1.35}
.fh-main{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-top:16px;align-items:start}
.fh-li{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid var(--border)}
.fh-li:last-of-type{border-bottom:0}
.fh-li img{width:180px;height:112px;object-fit:cover;border-radius:4px;flex:none}
.fh-li h3{font-size:17px;line-height:1.35;margin:4px 0 6px!important}
.fh-li time{font-size:12px;color:#777}
.fh-more{display:block;text-align:center;border:1px solid var(--primary);color:var(--primary)!important;font-weight:700;padding:10px;border-radius:4px;margin-top:10px}
.fh-more:hover{background:var(--primary);color:#fff!important}
.fh-side{display:flex;flex-direction:column;gap:16px;position:sticky;top:60px}
.fh-fokus{margin:0;padding-left:18px;line-height:2;font-size:14px}
.fh-fokus small{color:#999}
.fh-cats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}
.fh-cbf img{width:100%;height:150px;object-fit:cover;border-radius:4px}
.fh-cbf h3{font-size:15.5px;line-height:1.35;margin:8px 0!important}
.fh-cb ul{margin:0;padding:0;list-style:none}
.fh-cb li{border-top:1px solid var(--border);padding:8px 0;font-size:14px;line-height:1.4}
@media (max-width:900px){
  .fh-hl,.fh-main,.fh-cats{grid-template-columns:1fr}
  .fh-hero img{height:260px}
  .fh-home .fh-hero h1{font-size:21px}
  .fh-subs{grid-template-columns:1fr 1fr}
  .fh-subs a:nth-child(3){display:none}
  .fh-li img{width:120px;height:80px}
  .fh-li h3{font-size:15px}
  .fh-side{position:static}
}
@media (max-width:768px){
  .fh-toplinks{display:none}
  .hamburger-menu{display:none!important}
  .main-nav{display:block!important;position:sticky!important;top:0!important;background:var(--primary)!important;box-shadow:none!important}
  .main-nav ul{flex-direction:row!important;flex-wrap:nowrap!important;overflow-x:auto}
  .main-nav li{border:0!important;display:block!important;padding:0!important}
  .main-nav a{display:block!important;padding:11px 14px!important;color:#fff!important;border-bottom:0!important}
}

/* Sembunyikan scrollbar menu & topik di HP */
.main-nav ul,.fh-topik-in{scrollbar-width:none}
.main-nav ul::-webkit-scrollbar,.fh-topik-in::-webkit-scrollbar{display:none}

/* Perbaikan lebar di HP: cegah halaman melebar melebihi layar */
.fh-hl>*,.fh-main>*,.fh-cats>*,.fh-subs>*{min-width:0}
.fh-li>div{flex:1;min-width:0}
.fh-li h3,.fh-subs h3,.fh-cbf h3,.fh-pop a{white-space:normal;overflow-wrap:anywhere}
.fh-home{overflow-x:hidden}
html,body{overflow-x:hidden}
