/*
Theme Name: AiAgiNation
Theme URI: https://aiagination.com
Author: Gaurav Mishra
Description: Custom theme for AiAgiNation — AI blog and video hub. Hand-coded to match the approved brand design (network graphic hero, im-agi-nation wordplay, coral/amber palette).
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
  --ink: #142329;
  --paper: #F5F3EF;
  --surface: #ECE8E0;
  --muted: #5B6B67;
  --accent: #F2665A;      /* coral — buttons, agents pill, network spark */
  --accent-2: #F2A65A;    /* amber — the "agi" wordplay highlight */
  --border: #D9D3C8;

  --bg: var(--paper);
  --bg-surface: var(--surface);
  --text: var(--ink);
  --text-muted: var(--muted);
  --nav-bg: var(--ink);
  --nav-text: var(--paper);

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--ink);
    --bg-surface: #1D2F35;
    --text: var(--paper);
    --text-muted: #9FB0AC;
    --border: #2B3E42;
    --nav-bg: #0C1619;
    --nav-text: var(--paper);
  }
}

html { scroll-padding-top: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.spark { font-style: italic; color: var(--accent-2); }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* ---------- NAV ---------- */
nav { background: var(--nav-bg); padding-top: env(safe-area-inset-top, 0px); }
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px clamp(20px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--nav-text);
}
.logo { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.2rem; color: var(--nav-text); }
.nav-links { display: flex; gap: clamp(16px, 3vw, 30px); align-items: center; font-size: 0.93rem; }
.nav-links a, .nav-links span { color: var(--nav-text); opacity: 0.8; }
.nav-links a:hover { opacity: 1; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  list-style: none;
  background: var(--accent);
  color: #1F0C08;
  padding: 9px 17px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  opacity: 1;
  user-select: none;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: " ▾"; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--nav-bg);
  border: 1px solid rgba(245,243,239,0.15);
  border-radius: 4px;
  min-width: 200px;
  overflow: hidden;
  z-index: 20;
}
.dropdown-menu a { display: block; padding: 12px 16px; font-size: 0.88rem; color: var(--nav-text); opacity: 0.9; }
.dropdown-menu a:hover { background: rgba(245,243,239,0.08); opacity: 1; }
.dropdown-menu a + a { border-top: 1px solid rgba(245,243,239,0.1); }

@media (max-width: 640px) {
  .nav-links span, .nav-links a:not(.nav-dropdown) { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  padding: clamp(48px, 9vw, 100px) 0 clamp(36px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 60px);
  align-items: center;
}
.hero h1 { font-size: clamp(2.15rem, 4.6vw, 3.2rem); line-height: 1.12; max-width: 17ch; }
.hero p.lede { margin-top: 22px; font-size: 1.08rem; color: var(--text-muted); max-width: 44ch; line-height: 1.6; }
.cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 13px 24px; border-radius: 3px; font-weight: 600; font-size: 0.96rem; font-family: 'Work Sans', sans-serif; }
.btn-primary { background: var(--accent); color: #1F0C08; }
.btn-secondary { border: 1.5px solid var(--border); color: var(--text); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary:hover { border-color: var(--text-muted); }

/* ---------- NETWORK GRAPHIC ---------- */
.network { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1 / 0.95; margin: 0 auto; }
.network svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.net-line { stroke: var(--border); stroke-width: 0.6; }
.net-spark { fill: var(--accent); transform-origin: 50px 50px; animation: pulse 3.4s ease-in-out infinite; }
.net-halo { fill: var(--accent); opacity: 0.16; transform-origin: 50px 50px; animation: halo 3.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { r: 3.4; } 50% { r: 4.2; } }
@keyframes halo { 0%,100% { r: 8; opacity: 0.12; } 50% { r: 11; opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .net-spark, .net-halo { animation: none; } }
.node-pill {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 0.82rem; font-weight: 500; font-family: 'Work Sans', sans-serif;
  padding: 7px 13px; border-radius: 20px;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted);
  white-space: nowrap;
}
.node-pill.accent { background: var(--accent); color: #1F0C08; border-color: var(--accent); font-weight: 600; }

/* ---------- SECTIONS ---------- */
.section { padding: clamp(40px, 7vw, 72px) 0; border-top: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 34px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); }
.section-head .sub { color: var(--text-muted); font-size: 0.96rem; max-width: 36ch; }

/* ---------- POST LIST ---------- */
.post-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: start; padding: 21px 0; border-top: 1px solid var(--border); }
.post-tag {
  font-size: 0.76rem; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  display: inline-block; margin-top: 4px; width: fit-content;
  background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border);
}
.post-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.18rem; margin-bottom: 6px; }
.post-row a:hover .post-title { text-decoration: underline; text-decoration-color: var(--border); }
.post-desc { color: var(--text-muted); font-size: 0.95rem; max-width: 50ch; }
.post-meta { color: var(--text-muted); font-size: 0.84rem; white-space: nowrap; padding-top: 4px; }
@media (max-width: 640px) { .post-row { grid-template-columns: 1fr; } .post-tag { margin-bottom: 8px; } }

/* ---------- FEATURED VIDEO ---------- */
.video-block { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
.video-embed { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-copy h3 { font-size: 1.3rem; margin-bottom: 10px; }
.video-copy p { color: var(--text-muted); margin-bottom: 20px; }

/* ---------- FOOTER ---------- */
footer { background: var(--nav-bg); color: var(--nav-text); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 48px) 40px; }
.footer-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-bottom: 40px; border-bottom: 1px solid rgba(245,243,239,0.15); }
footer h2 { color: var(--nav-text); font-size: clamp(1.6rem, 3.4vw, 2rem); max-width: 17ch; }
footer .sub { color: rgba(245,243,239,0.62); margin-top: 12px; max-width: 36ch; }
.follow-row { display: flex; gap: 14px; flex-wrap: wrap; }
.follow-btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 3px; font-weight: 600; font-size: 0.95rem; font-family: 'Work Sans', sans-serif; }
.follow-btn.youtube { background: var(--accent); color: #1F0C08; }
.follow-btn.instagram { border: 1.5px solid rgba(245,243,239,0.3); color: var(--nav-text); }
.follow-btn:hover { filter: brightness(1.06); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 0.84rem; color: rgba(245,243,239,0.42); flex-wrap: wrap; gap: 12px; }

/* ---------- SINGLE POST ---------- */
.entry-content { font-size: 1.05rem; line-height: 1.75; max-width: 68ch; }
.entry-content h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.entry-content h3 { font-size: 1.2rem; margin: 32px 0 12px; }
.entry-content p { margin: 0 0 22px; }
.entry-content a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--border); }
.entry-content img { max-width: 100%; border-radius: 4px; }
.entry-content blockquote { border-left: 3px solid var(--accent); margin: 24px 0; padding: 4px 0 4px 20px; color: var(--text-muted); font-style: italic; }

@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; }
  .network { max-width: 340px; }
  .video-block { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; text-align: left; }
}
