/*
Theme Name: IndiaESecure
Theme URI: https://indiaesecure.com
Description: India-focused cybersecurity news aggregator theme
Version: 1.0
Author: IndiaESecure
*/

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f8f9fc;
  --surface:   #ffffff;
  --header-bg: #0a0f1a;
  --teal:      #00d4aa;
  --teal-dark: #00b891;
  --orange:    #FF9933;
  --text:      #1a1a2e;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --radius:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,.08);
}

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

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ───────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

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

.site-logo a {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-india  { color: #FF9933; }
.logo-e      { color: #ffffff; }
.logo-secure { color: var(--teal); }
.logo-tagline {
  color: #8899aa;
  font-size: 11px;
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: 0;
  align-self: center;
}

.header-search {
  flex: 1;
  max-width: 380px;
}
.header-search form {
  display: flex;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  overflow: hidden;
}
.header-search input {
  flex: 1;
  background: none;
  border: none;
  padding: 7px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.header-search input::placeholder { color: #667788; }
.header-search button {
  background: none;
  border: none;
  color: #8899aa;
  padding: 0 12px;
  cursor: pointer;
  font-size: 14px;
}

.header-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.header-nav a {
  color: #99aabb;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.header-nav a:hover  { color: #fff; background: rgba(255,255,255,.08); }
.header-nav a.active { color: var(--teal); }

/* ── Sector nav bar ───────────────────────────────────────────────────────── */
#sector-bar {
  background: #111827;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sector-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sector-bar-inner::-webkit-scrollbar { display: none; }
.sector-bar-inner a {
  color: #8899aa;
  font-size: 12px;
  font-weight: 500;
  padding: 9px 12px;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.sector-bar-inner a:hover { color: #ddeeff; border-bottom-color: var(--teal); }
.sector-bar-inner a.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ── Layout ───────────────────────────────────────────────────────────────── */
#site-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  #site-wrap { grid-template-columns: 1fr; }
  #sidebar { display: none; }
}

/* ── Post cards ───────────────────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.post-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); }

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-sector   { background: #e8f4fd; color: #1565c0; }
.badge-critical { background: #fde8e8; color: #b71c1c; }
.badge-high     { background: #fff3e0; color: #e65100; }
.badge-medium   { background: #fffde7; color: #827717; }
.badge-low      { background: #e8f5e9; color: #2e7d32; }

.post-card-source {
  font-size: 11px;
  color: var(--muted);
}
.post-card-time {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.post-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}
.post-card-title a {
  color: var(--text);
  text-decoration: none;
}
.post-card-title a:hover { color: var(--teal-dark); }

.post-card-excerpt {
  font-size: 13px;
  color: #444;
  line-height: 1.55;
  margin-bottom: 8px;
}

.post-card-sowhat {
  font-size: 13px;
  color: #1565c0;
  background: #e8f4fd;
  border-left: 3px solid #1976d2;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  margin-top: 8px;
}
.post-card-sowhat strong { font-weight: 600; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
#sidebar { position: sticky; top: 78px; }

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.widget-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #ffffff;
  background: var(--header-bg);
  padding: 10px 14px;
}

/* Sector heat index */
.heat-index { padding: 12px 14px; }
.heat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.heat-row:last-child { margin-bottom: 0; }
.heat-sector { font-size: 12px; color: var(--text); width: 80px; flex-shrink: 0; }
.heat-bar-wrap { flex: 1; background: var(--border); border-radius: 3px; height: 8px; overflow: hidden; }
.heat-bar { height: 100%; border-radius: 3px; background: var(--teal); transition: width .3s; }
.heat-bar.warn  { background: #FF9933; }
.heat-bar.alert { background: #e53935; }
.heat-count { font-size: 11px; color: var(--muted); width: 20px; text-align: right; flex-shrink: 0; }

/* Recent posts widget */
.recent-list { padding: 4px 0; }
.recent-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item a { color: var(--text); font-weight: 500; }
.recent-item a:hover { color: var(--teal-dark); }
.recent-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Single post ──────────────────────────────────────────────────────────── */
.single-header { margin-bottom: 24px; }
.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.single-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}
.single-sowhat {
  font-size: 14px;
  color: #1565c0;
  background: #e8f4fd;
  border-left: 3px solid #1976d2;
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 20px;
}
.single-content {
  font-size: 15px;
  line-height: 1.75;
  color: #333;
}
.single-content p { margin-bottom: 1em; }
.single-content a { color: var(--teal-dark); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--header-bg);
  color: #8899aa;
  text-align: center;
  padding: 20px;
  font-size: 12px;
  margin-top: 40px;
}
#site-footer a { color: var(--teal); }

/* ── Static pages (page.php) ──────────────────────────────────────────────── */
.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.page-body {
  font-size: 15px;
  line-height: 1.8;
  color: #2d3142;
}

.page-body > * + * { margin-top: 1em; }
.page-body p       { margin-bottom: 0; }

.page-body .page-lead {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.65;
  border-left: 3px solid var(--teal);
  padding-left: 14px;
  margin-bottom: 1.2em;
}

.page-body h3,
.page-body h3.wp-block-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--teal-dark);
  margin-top: 28px;
  margin-bottom: 8px;
}

.page-body ul,
.page-body ul.wp-block-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.page-body ul li {
  padding: 10px 14px 10px 34px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}
.page-body ul li:last-child { border-bottom: none; }
.page-body ul li::before {
  content: '›';
  position: absolute;
  left: 14px;
  color: var(--teal);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
}

.page-body hr,
.page-body .wp-block-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.page-body a           { color: var(--teal-dark); }
.page-body a:hover     { color: var(--teal); }

/* Contact email highlight */
.page-body .contact-email,
.page-body p.contact-email {
  font-size: 20px;
  font-weight: 700;
  margin: 16px 0;
  background: #f0faf8;
  border: 1px solid #b2ede3;
  border-radius: var(--radius);
  padding: 14px 18px;
}
.page-body .contact-email a { font-size: inherit; }

/* Responsive page card */
@media (max-width: 600px) {
  .page-card { padding: 20px 18px; }
  .page-title { font-size: 22px; }
  .page-body .page-lead { font-size: 15px; }
}

/* ── Today's Snapshot ────────────────────────────────────────────────────── */
.snap-card {
  background: #0d1421;
  border: 1px solid #1e2d42;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.snap-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #1a2a3a;
}

.snap-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.snap-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  animation: snap-pulse 2s ease-in-out infinite;
}

@keyframes snap-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  50%       { opacity: .7; box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

.snap-date {
  font-size: 12px;
  color: #4a6175;
}

.snap-head-label {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00d4aa;
}

.snap-grid {
  display: grid;
  grid-template-columns: 90px 90px 1fr 120px;
  gap: 0;
}

.snap-metric {
  padding: 14px 16px;
  border-right: 1px solid #1a2a3a;
}
.snap-metric:last-child { border-right: none; }

.snap-metric-label {
  font-size: 10px;
  font-weight: 600;
  color: #6b8099;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.snap-metric-value {
  font-size: 26px;
  font-weight: 800;
  color: #00d4aa;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.snap-metric-muted { color: #3a5068; font-size: 20px; }

.snap-metric-updated {
  font-size: 16px;
  font-weight: 700;
  color: #c8dff0;
}

/* Sector metric */
.snap-metric-sector .snap-metric-label { margin-bottom: 4px; }

.snap-sector-name {
  font-size: 15px;
  font-weight: 700;
  color: #c8dff0;
  margin-bottom: 8px;
  line-height: 1.2;
}

.snap-bar-wrap {
  height: 5px;
  background: #1a2a3a;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.snap-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4aa, #00b891);
  border-radius: 3px;
  transition: width .4s ease;
}

.snap-sector-count {
  font-size: 10px;
  color: #6b8099;
}

@media (max-width: 700px) {
  .snap-grid {
    grid-template-columns: 1fr 1fr;
  }
  .snap-metric {
    border-right: none;
    border-bottom: 1px solid #1a2a3a;
  }
  .snap-metric:nth-child(odd)  { border-right: 1px solid #1a2a3a; }
  .snap-metric:last-child,
  .snap-metric:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

@media (max-width: 400px) {
  .snap-grid { grid-template-columns: 1fr; }
  .snap-metric { border-right: none !important; }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
}
.pagination .current {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ── Coming Soon Pages ─────────────────────────────────────────────────────── */
.cs-full-main {
  grid-column: 1 / -1;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
}

.cs-hero-card {
  background: var(--header-bg);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 40px 36px 36px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.cs-badge-pill {
  display: inline-block;
  background: rgba(0,212,170,.12);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.cs-hero-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 10px;
}

.cs-hero-sub {
  font-size: 15px;
  color: #99aabb;
  line-height: 1.5;
  margin: 0;
}

.cs-expected {
  margin-top: 20px !important;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .cs-hero-card  { padding: 28px 20px 24px; }
  .cs-hero-title { font-size: 26px; }
}

/* ── Podcast Page ──────────────────────────────────────────────────────────── */
.podcast-main {
  grid-column: 1;
}

.podcast-hero-card {
  background: var(--header-bg);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.podcast-hero-title {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.podcast-hero-sub {
  font-size: 14px;
  color: #99aabb;
  margin-bottom: 18px;
  line-height: 1.5;
}

.podcast-rss-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.podcast-rss-btn {
  display: inline-block;
  background: var(--teal);
  color: #0a0f1a !important;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  text-decoration: none !important;
  white-space: nowrap;
}
.podcast-rss-btn:hover { opacity: .88; }

.podcast-rss-note {
  font-size: 12px;
  color: #6b7280;
}

.podcast-ep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.podcast-ep-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.podcast-ep-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--teal-dark);
  background: rgba(0,184,145,.1);
  padding: 2px 8px;
  border-radius: 3px;
}

.podcast-ep-date {
  font-size: 11px;
  color: var(--muted);
}

.podcast-ep-story-link {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}
.podcast-ep-story-link:hover { color: var(--teal-dark); }

.podcast-ep-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
}
.podcast-ep-title a { color: var(--text); }
.podcast-ep-title a:hover { color: var(--teal-dark); }

.podcast-ep-player { margin-bottom: 12px; }
.podcast-ep-player audio { border-radius: 6px; }

.podcast-ep-transcript-toggle details summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-dark);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.podcast-ep-transcript-toggle details summary::-webkit-details-marker { display: none; }
.podcast-ep-transcript-toggle details[open] summary { margin-bottom: 10px; }

.podcast-ep-transcript-body {
  font-size: 13px;
  line-height: 1.7;
  color: #444;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.podcast-ep-transcript-body .ies-pod-line { margin-bottom: 10px; }

.podcast-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
}

/* Briefing button in editorial */
.ed-brief-btn {
  background: transparent;
  border: 1px solid #7c3aed;
  color: #a78bfa;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.ed-brief-btn:hover  { background: rgba(124,58,237,.15); }
.ed-brief-btn:disabled { opacity: .45; cursor: default; }

/* ── Share button ──────────────────────────────────────────────────────────── */
.post-card { position: relative; }

/* ── Byline (Techmeme-style author attribution) ───────────────────────────── */
.post-card-byline {
  font-size: 11.5px;
  color: #9ca3af;
  margin-bottom: 5px;
  line-height: 1.4;
}

.byline-author {
  font-weight: 600;
  color: #9ca3af;
}

.byline-pub {
  color: #9ca3af;
  text-decoration: none;
}
.byline-pub:hover { color: var(--teal-dark); text-decoration: underline; }
