/*
Theme Name: AskaNews
Theme URI: https://yourdomain.com/askanews
Author: AskaNews Team
Author URI: https://yourdomain.com
Description: Tema Portal Berita WordPress Modern, Cepat, Responsif, SEO Friendly dengan Dark Mode, Sistem Lisensi, Multi-Widget, Mobile Drawer, Ticker, dan Fitur Pembaca Modern.
Version: 1.1.0
Tested up to: 6.7
Requires PHP: 7.4
License: Single Domain Commercial License
Text Domain: askanews
*/

:root {
  --primary-color: #c00000;
  --primary-dark: #990000;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --bg-color: #ffffff;
  --bg-secondary: #f8fafc;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
  --primary-color: #e63946;
  --primary-dark: #c00000;
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --bg-color: #0f172a;
  --bg-secondary: #1e293b;
  --border-color: #334155;
  --card-bg: #1e293b;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* TOP NETWORK BAR */
.top-bar {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  padding: 6px 0;
}
.top-bar-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-network, .top-social {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-network ul, .top-social ul {
  display: flex;
  list-style: none;
  gap: 12px;
}
.top-network ul li a, .top-social ul li a {
  color: var(--text-muted);
}
.top-network ul li a:hover, .top-social ul li a:hover {
  color: var(--primary-color);
}
@media (max-width: 768px) {
  .top-bar { display: none; }
}

/* MAIN HEADER */
.main-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}
.header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.site-logo {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--primary-color);
}
.site-logo:hover {
  color: var(--primary-color);
}

/* HAMBURGER MENU BUTTON (MOBILE) */
.mobile-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.mobile-toggle-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}
@media (max-width: 900px) {
  .mobile-toggle-btn { display: flex; }
}

/* SEARCH BAR */
.header-search {
  flex: 1;
  max-width: 450px;
}
.search-form {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.search-input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-secondary);
  color: var(--text-color);
  outline: none;
}
.search-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 0 14px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .header-search { display: none; }
}

/* THEME TOGGLE */
.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-color);
  transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
  background: var(--border-color);
}

/* MAIN NAVIGATION */
.main-nav {
  background: var(--primary-color);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.nav-box {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-box::-webkit-scrollbar { display: none; }
.nav-menu {
  display: flex;
  list-style: none;
}
.nav-menu li a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}
.nav-menu li a:hover, .nav-menu li.current-menu-item a {
  background: var(--primary-dark);
}
@media (max-width: 900px) {
  .main-nav { display: none; }
}

/* RUNNING TICKER / BREAKING NEWS */
.ticker-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 0;
  font-size: 13px;
}
.ticker-container {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.ticker-badge {
  background: var(--primary-color);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-marquee {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  flex: 1;
}
.ticker-track {
  display: inline-flex;
  gap: 20px;
  animation: ticker-scroll 35s linear infinite;
}
.ticker-track:hover {
  animation-play-state: paused;
}
.ticker-item {
  color: var(--text-color);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ticker-dot {
  color: var(--primary-color);
}
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* SECONDARY NAV (TRENDING) */
.secondary-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 0;
  font-size: 12px;
}
.secondary-box {
  display: flex;
  align-items: center;
  gap: 15px;
  overflow-x: auto;
  scrollbar-width: none;
}
.secondary-box::-webkit-scrollbar { display: none; }
.trending-badge {
  background: var(--primary-color);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}
.secondary-menu {
  display: flex;
  list-style: none;
  gap: 14px;
}
.secondary-menu li a {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.secondary-menu li a:hover {
  color: var(--primary-color);
}

/* ADS PLACEHOLDERS & SLOTS */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  margin: 15px auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 10px;
  border-radius: 4px;
}
.ad-billboard { min-height: 90px; max-width: 970px; }
.ad-leaderboard { min-height: 90px; max-width: 728px; }
.ad-rectangle { min-height: 250px; max-width: 300px; }
.ad-in-article { margin: 25px 0; }
.ad-widget-wrapper img { width: 100%; height: auto; }

/* MAIN CONTENT LAYOUT */
.main-wrapper {
  padding: 25px 0;
}
.layout-grid {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 25px;
}
@media (max-width: 900px) {
  .layout-grid { grid-template-columns: 1fr; }
}

/* SECTION TITLES */
.section-header {
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.section-title {
  background: var(--primary-color);
  color: #fff;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

/* HEADLINE SECTION (1 BIG + 3 SMALL) */
.headline-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
}
@media (max-width: 650px) {
  .headline-grid { grid-template-columns: 1fr; }
}

.headline-big {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 380px;
}
.headline-big img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.headline-big:hover img {
  transform: scale(1.03);
}
.headline-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #ffffff;
}
.cat-badge {
  background: var(--primary-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 3px;
  width: fit-content;
  margin-bottom: 8px;
}
.headline-big-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}
.headline-meta {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 6px;
}

.headline-small-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.headline-small-item {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.headline-small-item:last-child { border-bottom: none; }
.headline-small-thumb {
  width: 110px;
  height: 75px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.headline-small-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.headline-small-content h4 {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
}

/* LATEST NEWS FEED / INDEKS */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.news-card {
  display: flex;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}
.news-card-thumb {
  width: 200px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.news-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 500px) {
  .news-card { flex-direction: column; }
  .news-card-thumb { width: 100%; height: 180px; }
}
.news-card-body h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 8px;
}
.news-card-excerpt {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* SIDEBAR & WIDGETS */
.sidebar-widget {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 25px;
}
.widget-heading, .widgettitle {
  font-size: 16px;
  font-weight: 700;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-widget ul {
  list-style: none;
}
.sidebar-widget ul li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.sidebar-widget ul li:last-child {
  border-bottom: none;
}

.popular-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.popular-rank {
  font-size: 20px;
  font-weight: 900;
  color: #cbd5e1;
  width: 24px;
  text-align: center;
}
.popular-item:nth-child(1) .popular-rank { color: #ef4444; }
.popular-item:nth-child(2) .popular-rank { color: #f97316; }
.popular-item:nth-child(3) .popular-rank { color: #eab308; }
.popular-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

/* SINGLE ARTICLE */
.breadcrumbs {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 15px;
}
.article-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* ARTICLE TOOLBAR (FONT RESIZER & SHARE) */
.article-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.font-resizer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.toolbar-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--text-muted);
  margin-right: 4px;
}
.font-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}
.font-btn-active, .font-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.share-btn {
  padding: 6px 12px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}
.share-wa { background: #25D366; }
.share-fb { background: #1877F2; }
.share-x { background: #000000; }
.share-copy { background: #475569; }
.share-native { background: var(--primary-color); }

.article-featured-img {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}
.article-featured-img img { width: 100%; max-height: 480px; object-fit: cover; }
.img-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* ARTICLE BODY WITH FONT SIZES */
.article-body {
  font-size: 16px;
  line-height: 1.8;
}
.article-body.font-small { font-size: 14px; line-height: 1.7; }
.article-body.font-normal { font-size: 16px; line-height: 1.8; }
.article-body.font-large { font-size: 19px; line-height: 1.9; }

.article-body p { margin-bottom: 16px; }
.article-body img { margin: 15px auto; border-radius: 6px; }

.article-tags {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

/* FOOTER */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 40px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}
.footer-menu-list {
  list-style: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
}

/* MOBILE OFF-CANVAS DRAWER */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-color);
  box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer.active {
  left: 0;
}
.drawer-header {
  padding: 16px;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-title {
  font-size: 18px;
  font-weight: 800;
}
.drawer-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.drawer-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.drawer-body {
  padding: 16px;
}
.drawer-menu {
  list-style: none;
}
.drawer-menu li a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}
.drawer-backdrop.active {
  display: block;
}

/* BACK TO TOP BUTTON */
.back-to-top-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 42px;
  height: 42px;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top-btn.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

/* STICKY BOTTOM AD */
.sticky-bottom-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 80;
  text-align: center;
  padding: 6px 0;
}
.sticky-ad-inner {
  position: relative;
  display: inline-block;
  max-width: 728px;
  width: 100%;
}
.sticky-ad-close {
  position: absolute;
  top: -12px;
  right: 0;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

/* TOAST NOTIFICATION */
.askanews-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1001;
  pointer-events: none;
}
.askanews-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
