/*
Theme Name: NewsPress Pro
Theme URI: https://yoursite.com
Author: NewsPress
Description: Lightweight News Theme with Advanced SEO, IndexNow, GSC, Ad Manager & WhatsApp Button
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: newspress-pro
*/

/* =====================
   CSS RESET & BASE
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange:     #E8652A;
  --orange-dk:  #c9521e;
  --dark:       #111111;
  --dark2:      #1e1e1e;
  --mid:        #2d2d2d;
  --light:      #f5f5f5;
  --border:     #e0e0e0;
  --text:       #222222;
  --muted:      #666666;
  --white:      #ffffff;
  --wa-green:   #25D366;
  --wa-dark:    #075e54;
  --font:       'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--dark);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* =====================
   HEADER / NAV
   ===================== */
#site-header {
  background: var(--orange);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.site-logo { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.site-logo span { opacity: 0.85; font-weight: 400; }

.nav-toggle { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.nav-toggle span { font-size: 14px; font-weight: 600; letter-spacing: 1px; }

.header-search { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; font-size: 14px; letter-spacing: 1px; cursor: pointer; }

/* NAV MENU */
#main-nav {
  background: var(--dark2);
  display: none;
  border-top: 2px solid var(--orange);
}
#main-nav.open { display: block; }
#main-nav ul { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; }
#main-nav ul li a {
  display: block;
  padding: 14px 18px;
  color: #ddd;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
#main-nav ul li a:hover { color: var(--orange); background: rgba(255,255,255,0.04); }

/* =====================
   LAYOUT
   ===================== */
.site-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

@media (max-width: 900px) {
  .site-wrapper { grid-template-columns: 1fr; }
  .site-sidebar { display: none; }
}

/* =====================
   ARTICLE CARD
   ===================== */
.articles-list { display: flex; flex-direction: column; gap: 0; }

.article-card {
  background: var(--dark2, #1e1e1e);
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 0;
  border-bottom: none;
  transition: background 0.2s;
  outline: none;
}
.article-card:hover { background: var(--card-hover, #252525); }

.article-card .thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
}
.article-card .thumb-placeholder {
  width: 120px;
  height: 90px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 28px;
}

.article-card .info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border-right: none;
}

.article-card .info h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #eee);
  line-height: 1.35;
}
.article-card .info h2 a:hover { color: var(--orange); }

.article-card .meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted, #888);
}
.article-card .meta span { display: flex; align-items: center; gap: 4px; }

.cat-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ad row between articles */
.ad-row-inline {
  background: #1a1a1a;
  padding: 12px;
  text-align: center;
  border: none;
}
.ad-row-inline ins, .ad-row-inline > * { max-width: 100%; }

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

.sidebar-widget {
  background: var(--dark2, #1e1e1e);
  border-radius: 6px;
  overflow: hidden;
}
.widget-title {
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.widget-body { padding: 14px; }

/* Sidebar ad */
.sidebar-ad { text-align: center; }
.sidebar-ad ins, .sidebar-ad > * { max-width: 100%; }

/* =====================
   HOMEPAGE CATEGORY SECTIONS
   ===================== */
.cat-section { margin-bottom: 4px; }
.cat-section-title {
  background: transparent;
  color: var(--orange, #E8652A);
  padding: 10px 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid var(--orange, #E8652A);
  margin-bottom: 0;
}

/* =====================
   SINGLE POST
   ===================== */
.single-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}
@media (max-width: 900px) { .single-wrapper { grid-template-columns: 1fr; } }

.post-header { margin-bottom: 20px; }
.post-title { font-size: 26px; font-weight: 700; color: #eee; line-height: 1.3; margin-bottom: 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted, #888); margin-bottom: 16px; }
.post-meta span { display: flex; align-items: center; gap: 5px; }
.post-thumbnail { width: 100%; height: auto; border-radius: 6px; margin-bottom: 20px; }

.post-content { color: var(--muted, #ccc); line-height: 1.8; font-size: 16px; }
.post-content h2, .post-content h3 { color: var(--text, #eee); margin: 24px 0 12px; }
.post-content p { margin-bottom: 16px; }
.post-content a { color: var(--orange); }

/* Ad inside post content */
.post-ad { margin: 24px 0; text-align: center; }

/* =====================
   HEADER AD BAR
   ===================== */
.header-ad-bar { background: #1a1a1a; text-align: center; padding: 8px; }
.header-ad-bar ins, .header-ad-bar > * { max-width: 100%; }

/* =====================
   BEFORE FOOTER AD
   ===================== */
.before-footer-ad { background: #1a1a1a; text-align: center; padding: 12px; }

/* =====================
   FOOTER
   ===================== */
#site-footer {
  background: var(--footer-bg, #1a1a1a);
  border-top: 1px solid var(--border, #2a2a2a);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #888;
}
#site-footer a { color: var(--orange); }

/* =====================
   WHATSAPP FIXED BUTTON - BOTTOM CENTER
   ===================== */
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes wa-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes wa-pop-in {
  0%   { transform: translateY(40px) scale(0.7); opacity: 0; }
  70%  { transform: translateY(-4px) scale(1.04); opacity: 1; }
  100% { transform: translateY(0)   scale(1);    opacity: 1; }
}@keyframes wa-shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.78; }
}
@keyframes wa-tooltip {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* WHATSAPP CENTERING — uses flex on body-level, no translateX */
#wa-float-wrap {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: wa-pop-in 0.65s cubic-bezier(0.34,1.56,0.64,1) 1s both;
}

#wa-tooltip {
  pointer-events: auto;
  background: #fff;
  color: var(--wa-dark);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  animation: wa-tooltip 0.4s ease 2s both;
}

/* btn-row: button + close side by side, centered via flex parent */
#wa-btn-row {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

/* pulse ring lives INSIDE the button only */
#wa-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: var(--wa-green);
  animation: wa-pulse 2.2s ease-out 2.5s infinite;
  pointer-events: none;
  z-index: 0;
}

#wa-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--wa-green);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 22px 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  animation: wa-bounce 3s ease-in-out 3s infinite;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
  white-space: nowrap;
  transition: background 0.2s;
  overflow: visible;
}
#wa-btn:hover { background: #20c45a; }
#wa-btn svg { width: 26px; height: 26px; flex-shrink: 0; }

.wa-text { display: flex; flex-direction: column; line-height: 1.2; }
.wa-sub  { font-size: 11px; font-weight: 400; opacity: 0.88; }
.wa-main { font-size: 15px; font-weight: 600; animation: wa-shimmer 2.8s ease-in-out 3s infinite; }

.wa-members {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  font-size: 10px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
}

/* close: sits right next to button, NOT overlapping */
#wa-close {
  pointer-events: auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  background: #444;
  border-radius: 50%;
  border: 2px solid #555;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  line-height: 1;
  z-index: 2;
  position: static;
}
#wa-close:hover { background: #e74c3c; border-color: #e74c3c; }

/* Mobile adjustments */
@media (max-width: 600px) {
  #wa-btn { font-size: 14px; padding: 11px 18px 11px 14px; }
  .wa-main { font-size: 14px; }
}

/* =====================
   SEARCH BAR
   ===================== */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9998;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-box {
  background: #1e1e1e;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 600px;
  margin: 0 16px;
}
.search-box input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #eee;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 6px;
  outline: none;
}
.search-box input:focus { border-color: var(--orange); }

/* =====================
   PAGINATION
   ===================== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 24px 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  background: #1e1e1e;
  color: #ccc;
  border: 1px solid #333;
}
.pagination .current { background: var(--orange); color: #fff; border-color: var(--orange); }
.pagination a:hover { border-color: var(--orange); color: var(--orange); }

/* =====================
   ADMIN NOTICE
   ===================== */
.newspress-notice {
  background: #fff3cd;
  border-left: 4px solid var(--orange);
  padding: 10px 14px;
  font-size: 13px;
}

/* =====================
   SIDEBAR LINK FIX
   ===================== */
.widget-body a {
  color: var(--text, #eeeeee);
  font-size: 13px;
  line-height: 1.35;
  display: block;
}
.widget-body a:hover { color: var(--orange, #E8652A); }
.widget-body .sidebar-post-time { font-size: 11px; color: var(--muted, #888); }

/* =====================
   POPULAR TODAY SECTION
   ===================== */
.popular-today-section { margin-bottom: 4px; }
.popular-today-section .cat-section-title {
  color: #c0392b;
  border-bottom: none;
}

/* List layout */
.popular-list { background: var(--dark2); }
.popular-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a2a;
  transition: background 0.15s;
}
.popular-list-item:hover { background: #252525; }
.popular-list-item:last-child { border-bottom: none; }

.popular-rank {
  font-size: 22px;
  font-weight: 800;
  color: #c0392b;
  min-width: 32px;
  text-align: center;
  line-height: 1;
}
.popular-list-item:nth-child(1) .popular-rank { color: #f1c40f; font-size: 26px; }
.popular-list-item:nth-child(2) .popular-rank { color: #bdc3c7; font-size: 24px; }
.popular-list-item:nth-child(3) .popular-rank { color: #cd7f32; font-size: 23px; }

.popular-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.popular-title {
  font-size: 14px;
  font-weight: 600;
  color: #eee;
  line-height: 1.35;
  display: block;
}
.popular-title:hover { color: #c0392b; }
.popular-views { font-size: 12px; color: #888; }

/* Horizontal scroll layout */
.popular-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 14px;
  background: var(--dark2);
  scrollbar-width: thin;
  scrollbar-color: #444 #1e1e1e;
}
.popular-scroll::-webkit-scrollbar { height: 4px; }
.popular-scroll::-webkit-scrollbar-track { background: #1e1e1e; }
.popular-scroll::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.popular-card {
  flex-shrink: 0;
  width: 180px;
  background: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s;
}
.popular-card:hover { transform: translateY(-2px); }
.popular-card-info { padding: 8px 10px; }
.popular-card .popular-title { font-size: 13px; margin-bottom: 4px; }
.popular-card .popular-views { font-size: 11px; }

/* Grid layout — reuses .article-card styles, just has red badge */
.popular-grid { background: var(--dark2); }
