/*
Theme Name: WorldPulse
Theme URI: https://worldpulse.com
Author: WorldPulse Team
Author URI: https://worldpulse.com
Description: A dark, editorial-style global news magazine theme featuring hero layouts, article card grids, breaking news tickers, and AdSense-ready ad zones.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: worldpulse
Tags: news, magazine, dark, blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =============================================================
   CSS VARIABLES
   ============================================================= */
:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface2: #1e1e24;
  --border: #2a2a35;
  --accent: #e8a020;
  --accent2: #c0392b;
  --text: #f0f0f5;
  --muted: #8888a0;
  --tag-bg: rgba(232,160,32,0.12);
}

/* =============================================================
   RESET & BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* =============================================================
   HEADER
   ============================================================= */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,13,15,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px;
}
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; letter-spacing: 3px;
  color: var(--accent);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.logo-globe { font-size: 1.4rem; }
nav { display: flex; gap: 4px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 4px;
  transition: all 0.2s;
}
nav a:hover,
nav a.current-menu-item,
nav a.active { color: var(--text); background: var(--surface2); }
.header-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 24px; padding: 6px 16px;
}
.header-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 0.875rem;
  width: 180px;
}
.header-search input::placeholder { color: var(--muted); }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  max-width: 1400px; margin: 32px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: auto auto;
  gap: 16px;
}
.hero-main {
  grid-row: 1 / 3;
  position: relative; border-radius: 12px; overflow: hidden;
  cursor: pointer;
}
.hero-main img {
  width: 100%; height: 520px; object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}
.hero-main:hover img { transform: scale(1.04); }
.hero-main-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  padding: 40px 32px 32px;
}
.hero-tag {
  display: inline-block;
  background: var(--accent); color: #000;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 3px; margin-bottom: 12px;
}
.hero-main-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem; font-weight: 900; line-height: 1.2;
  color: #fff; margin-bottom: 12px;
}
.hero-meta { color: rgba(255,255,255,0.6); font-size: 0.8rem; }

.hero-side {
  display: flex; flex-direction: column; gap: 16px;
}
.hero-side-card {
  position: relative; border-radius: 10px; overflow: hidden;
  cursor: pointer; flex: 1;
}
.hero-side-card img {
  width: 100%; height: 100%; min-height: 150px; object-fit: cover;
  display: block; transition: transform 0.5s;
}
.hero-side-card:hover img { transform: scale(1.05); }
.hero-side-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
  padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-side-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.3;
}

/* =============================================================
   BREAKING BAR
   ============================================================= */
.breaking-bar {
  max-width: 1400px; margin: 16px auto;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.breaking-label {
  background: var(--accent2); color: #fff;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 3px 10px; border-radius: 3px;
  white-space: nowrap;
}
.breaking-ticker {
  font-size: 0.875rem; color: var(--muted);
  overflow: hidden; white-space: nowrap;
  animation: ticker 30s linear infinite;
}
@keyframes ticker {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* =============================================================
   AD ZONES
   ============================================================= */
.ad-zone {
  max-width: 1400px; margin: 24px auto;
  padding: 0 24px;
  display: flex; justify-content: center; align-items: center;
}
.ad-zone-inner {
  width: 100%; max-width: 728px;
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-zone-leaderboard { max-width: 728px; }
.ad-zone-inline {
  max-width: 100%;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: 8px; padding: 8px;
}
.ad-placeholder {
  /* Only shown when no ad code is placed — remove in production */
  background: var(--surface2); border: 1px dashed var(--border);
  border-radius: 6px; padding: 20px; text-align: center;
  color: var(--muted); font-size: 0.75rem; letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =============================================================
   SECTION LAYOUT
   ============================================================= */
.section {
  max-width: 1400px; margin: 40px auto;
  padding: 0 24px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem; letter-spacing: 2px;
  color: var(--text);
  display: flex; align-items: center; gap: 12px;
}
.section-title span { color: var(--accent); }
.see-all {
  color: var(--accent); font-size: 0.8rem; font-weight: 600;
  text-decoration: none; letter-spacing: 0.08em; text-transform: uppercase;
}

/* =============================================================
   GRIDS
   ============================================================= */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* =============================================================
   ARTICLE CARD
   ============================================================= */
.card {
  background: var(--surface);
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer; transition: transform 0.3s, box-shadow 0.3s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.card-img { position: relative; overflow: hidden; height: 200px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.card:hover .card-img img { transform: scale(1.06); }
.card-img-tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: #000;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 9px; border-radius: 3px;
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-source {
  font-size: 0.72rem; color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700; line-height: 1.35;
  color: var(--text); margin-bottom: 10px; flex: 1;
}
.card-excerpt { font-size: 0.82rem; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--muted);
}
.card-footer-left { display: flex; align-items: center; gap: 8px; }
.likes { display: flex; align-items: center; gap: 4px; }

/* =============================================================
   FEATURED HORIZONTAL CARD
   ============================================================= */
.card-h {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  display: flex; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card-h:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.card-h-img { width: 160px; flex-shrink: 0; overflow: hidden; }
.card-h-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.card-h:hover .card-h-img img { transform: scale(1.08); }
.card-h-body { padding: 16px; flex: 1; }
.card-h-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; font-weight: 700; line-height: 1.35;
  color: var(--text); margin-bottom: 6px;
}
.card-h-meta { font-size: 0.75rem; color: var(--muted); }

/* =============================================================
   SIDEBAR LIST
   ============================================================= */
.sidebar-list { display: flex; flex-direction: column; gap: 0; }
.sidebar-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity 0.2s;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { opacity: 0.8; }
.sidebar-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; color: var(--border);
  line-height: 1; flex-shrink: 0; width: 28px; text-align: right;
}
.sidebar-item-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem; font-weight: 700; line-height: 1.35; color: var(--text);
}
.sidebar-item-meta { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

/* =============================================================
   WIDE FEATURE
   ============================================================= */
.feature-wide {
  position: relative; border-radius: 12px; overflow: hidden;
  cursor: pointer; margin-bottom: 20px;
}
.feature-wide img { width: 100%; height: 400px; object-fit: cover; display: block; transition: transform 0.6s; }
.feature-wide:hover img { transform: scale(1.03); }
.feature-wide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  display: flex; align-items: center; padding: 48px;
}
.feature-wide-content { max-width: 520px; }
.feature-wide-tag {
  display: inline-block; background: var(--accent); color: #000;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 10px; border-radius: 3px; margin-bottom: 16px;
}
.feature-wide-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem; font-weight: 900; line-height: 1.15; color: #fff; margin-bottom: 16px;
}
.feature-wide-excerpt { font-size: 1rem; color: rgba(255,255,255,0.7); line-height: 1.6; }

/* =============================================================
   TAGS ROW
   ============================================================= */
.tags-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.tag-pill {
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 6px 16px; border-radius: 20px;
  cursor: pointer; transition: all 0.2s;
}
.tag-pill:hover, .tag-pill.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* =============================================================
   NEWSLETTER
   ============================================================= */
.newsletter {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 40px; text-align: center;
  max-width: 1400px; margin: 40px auto;
}
.newsletter h3 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 900; margin-bottom: 8px;
}
.newsletter p { color: var(--muted); margin-bottom: 24px; }
.newsletter-form { display: flex; gap: 12px; max-width: 460px; margin: 0 auto; }
.newsletter-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 0.9rem;
  padding: 12px 18px; border-radius: 8px; outline: none;
}
.newsletter-form input:focus { border-color: var(--accent); }
.btn-accent {
  background: var(--accent); color: #000;
  font-family: inherit; font-size: 0.9rem; font-weight: 700;
  padding: 12px 24px; border: none; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: opacity 0.2s;
}
.btn-accent:hover { opacity: 0.85; }

/* =============================================================
   RIBBON
   ============================================================= */
.ribbon {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  color: #fff; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 3px;
}

/* =============================================================
   FOOTER
   ============================================================= */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 60px; padding: 40px 24px;
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .logo { font-size: 1.6rem; margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: 0.875rem; line-height: 1.6; }
.footer-col h4 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 2px; color: var(--accent); margin-bottom: 16px;
}
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 0.85rem; padding: 4px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  max-width: 1400px; margin: 32px auto 0;
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.8rem;
}

/* =============================================================
   SCROLL ANIMATIONS
   ============================================================= */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* =============================================================
   WORDPRESS SPECIFIC
   ============================================================= */
.wp-caption { max-width: 100%; }
.wp-caption-text { color: var(--muted); font-size: 0.8rem; padding: 6px 0; }
.alignleft { float: left; margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr 300px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; }
  .hero-side { flex-direction: row; }
  .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  nav { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .feature-wide-title { font-size: 1.6rem; }
  .feature-wide-overlay { padding: 24px; }
  .newsletter-form { flex-direction: column; }
  .ad-zone-leaderboard { max-width: 320px; }
}
