/*
Theme Name: The Cultured Nerd
Theme URI: https://theculturednerd.org
Author: The Cultured Nerd
Description: Custom theme for The Cultured Nerd — homepage built around the Take of the Week, the shows network, curated news with stakes, and original interviews.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: cultured-nerd
*/

:root {
  --ink: #17141F;
  --paper: #F2F0E9;
  --purple: #5B2EBF;
  --purple-deep: #3E1E86;
  --purple-wash: #EAE3F9;
  --gold: #F2B705;
  --halftone: rgba(23, 20, 31, 0.08);
  --halftone-on-purple: rgba(242, 240, 233, 0.14);
  --panel-border: 3px solid var(--ink);
  --panel-shadow: 6px 6px 0 var(--ink);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Libre Franklin', sans-serif;
  line-height: 1.55;
  background-image:
    radial-gradient(var(--halftone) 1px, transparent 1px),
    radial-gradient(ellipse 1200px 700px at 50% 0%, rgba(91,46,191,0.16), transparent 70%);
  background-size: 14px 14px, 100% 900px;
  background-repeat: repeat, no-repeat;
  background-position: 0 0, top center;
  background-attachment: scroll, fixed;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.display { font-family: 'Anton', sans-serif; letter-spacing: 0.01em; line-height: 1.05; text-transform: uppercase; }

/* ============ MASTHEAD ============ */
header.masthead {
  background: var(--purple);
  background-image: radial-gradient(var(--halftone-on-purple) 1px, transparent 1px);
  background-size: 12px 12px;
  color: #fff;
}
.masthead-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; flex-wrap: wrap; }
.logo { font-family: 'Anton', sans-serif; font-size: 2.3rem; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }
.logo span { color: var(--gold); }
.logo-link { display: flex; align-items: center; gap: 18px; }
.logo-mark, .logo-link img.custom-logo {
  height: 84px; width: 84px; object-fit: contain; border-radius: 50%; border: 4px solid var(--gold);
  background: var(--paper); padding: 4px; flex-shrink: 0;
}
.logo-text { line-height: 1.05; }
@media (max-width: 480px) { .logo { font-size: 1.6rem; } .logo-mark, .logo-link img.custom-logo { height: 56px; width: 56px; } }

/* Secondary full-width nav bar beneath the logo row */
.masthead-nav-bar {
  background: var(--ink);
  border-top: var(--panel-border);
  border-bottom: var(--panel-border);
  box-shadow: 0 4px 0 var(--gold);
}
.masthead-nav-bar .wrap { padding-top: 0; padding-bottom: 0; }
nav.main-nav { display: flex; width: 100%; }
nav.main-nav ul {
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; align-items: center;
  list-style: none; margin: 0; padding: 12px 0; width: 100%;
}
nav.main-nav li { list-style: none; }
nav.main-nav a {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper);
  padding: 9px 16px; border: 2px solid transparent; display: inline-block;
}
nav.main-nav a:hover, nav.main-nav a:focus-visible { border-color: var(--gold); background: var(--gold); color: var(--ink); }
nav.main-nav .nav-cta a, nav.main-nav a.nav-cta { background: var(--purple); color: #fff; border-color: var(--gold); box-shadow: 3px 3px 0 var(--gold); }
nav.main-nav .nav-cta a:hover { background: var(--purple-deep); }
.menu-toggle { display: none; background: var(--paper); }

/* ============ HERO SPREAD ============ */
.hero {
  padding: 48px 0 56px;
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-deep) 100%);
  background-image:
    radial-gradient(var(--halftone-on-purple) 1.5px, transparent 1.5px),
    linear-gradient(180deg, var(--purple) 0%, var(--purple-deep) 100%);
  background-size: 16px 16px, 100% 100%;
  border-bottom: var(--panel-border);
}
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.panel { background: #fff; border: var(--panel-border); box-shadow: var(--panel-shadow); padding: 28px; position: relative; }
.panel--purple { background: var(--purple); color: #fff; }
.panel--ink { background: var(--ink); color: var(--paper); }
.kicker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--gold); border: 2px solid var(--ink); padding: 3px 8px; display: inline-block;
}
.panel--purple .tag, .panel--ink .tag { box-shadow: none; }
.hero-title { font-size: clamp(1.9rem, 4.5vw, 3.1rem); margin-bottom: 14px; }
.hero-title a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 4px; }
.hero-dek { font-size: 1.05rem; max-width: 46ch; margin-bottom: 18px; }
.byline { font-family: 'IBM Plex Mono', monospace; font-size: 0.74rem; opacity: 0.75; display: inline-block; margin-top: 6px; }
.read-link {
  display: inline-block; margin-top: 18px;
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  border: 2px solid var(--ink);
}
.read-link:hover { background: var(--paper); color: var(--ink); }
.hero-side { display: flex; flex-direction: column; gap: 24px; }

.episode-card .ep-title { font-size: 1.25rem; margin: 8px 0 10px; }
.episode-card .ep-title a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.ep-thumb { position: relative; margin-top: 12px; border: 2px solid rgba(255,255,255,0.6); overflow: hidden; }
.ep-thumb img { width: 100%; }
.ep-thumb iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.player-strip {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.12); border: 2px solid rgba(255,255,255,0.6);
  padding: 10px 12px; cursor: pointer;
}
.play-btn {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold); border: 2px solid var(--ink);
  display: grid; place-items: center; font-size: 0.9rem; cursor: pointer;
}
.player-track-label { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; text-align: left; background: none; border: none; color: inherit; }
.player-time { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; }
.episode-empty { font-size: 0.9rem; opacity: 0.85; }

.newsletter-card .nl-title { font-size: 1.35rem; margin: 8px 0 8px; }
.newsletter-card p { font-size: 0.92rem; margin-bottom: 14px; }
.nl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.nl-row input {
  flex: 1; min-width: 0; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem;
  padding: 10px 12px; border: 2px solid var(--paper); background: transparent; color: var(--paper);
}
.nl-row input::placeholder { color: rgba(242,240,233,0.55); }
.nl-row button {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; background: var(--gold); color: var(--ink);
  border: 2px solid var(--gold); padding: 10px 16px; cursor: pointer;
}
.nl-row button:hover { background: var(--paper); border-color: var(--paper); }
.nl-note { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; margin-top: 10px; }
.nl-note.is-success { color: var(--gold); }
.nl-note.is-error { color: #ff9a9a; }

/* ============ SECTION HEADERS ============ */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-head .rule { flex: 1; height: 4px; background: linear-gradient(90deg, var(--purple), var(--gold) 85%); min-width: 60px; }
.section-head .see-all { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 2px solid var(--gold); }

/* ============ INSTAGRAM ============ */
.instagram-frame {
  display: flex; justify-content: center; padding: 4px;
  border: var(--panel-border); box-shadow: var(--panel-shadow); background: #fff;
}
.instagram-empty { text-align: center; max-width: 480px; margin: 0 auto; border: none; box-shadow: none; }
.instagram-empty p { margin-bottom: 14px; opacity: 0.75; font-size: 0.9rem; }
.instagram-card { width: 100%; max-width: 480px; }
.instagram-card-media { display: block; border-bottom: var(--panel-border); }
.instagram-card-media img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.instagram-card-body { padding: 20px 22px; text-align: center; }
.instagram-caption { font-size: 0.92rem; margin-bottom: 14px; }

/* ============ SHOWS ROW ============ */
.network-badge-row { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.network-badge { border-radius: 50%; flex-shrink: 0; box-shadow: 4px 4px 0 var(--ink); }
.network-badge-copy {
  font-family: 'Libre Franklin', sans-serif; font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--ink); line-height: 1.3;
}
.network-badge-copy a { border-bottom: 3px solid var(--gold); }
.network-badge-copy a:hover { color: var(--purple); }
.shows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.show-card .show-logo { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; }
.show-card {
  border: var(--panel-border); box-shadow: 4px 4px 0 var(--ink);
  padding: 18px 16px; background: #fff;
  transition: transform 0.12s ease;
  display: flex; flex-direction: column; gap: 8px; min-height: 150px;
}
.show-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--purple); }
.show-card .show-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); }
.show-card h3 { font-family: 'Anton', sans-serif; text-transform: uppercase; font-size: 1rem; line-height: 1.15; }
.show-card p { font-size: 0.78rem; opacity: 0.8; }
.show-card .cadence { margin-top: auto; font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.65; }

/* ============ NEWS WITH STAKES ============ */
.stakes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stakes-card { background: #fff; border: var(--panel-border); box-shadow: var(--panel-shadow); padding: 22px 22px 22px 26px; display: flex; flex-direction: column; position: relative; }
.stakes-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--purple); border-right: 3px solid var(--ink); }
.stakes-card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin: 10px 0; }
.stakes-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.stakes-card .why { margin-top: auto; padding-top: 14px; border-top: 2px dashed var(--ink); }
.stakes-card .why .eyebrow { color: var(--purple); display: block; margin-bottom: 4px; }
.stakes-card .why p { font-size: 0.88rem; }

/* ============ INTERVIEW WIDE PANEL ============ */
.interview-panel { display: grid; grid-template-columns: 180px 1fr; gap: 26px; align-items: center; }
.monocle {
  width: 160px; height: 160px; border-radius: 50%;
  border: 4px solid var(--gold);
  background: radial-gradient(rgba(242,183,5,0.25) 1.5px, transparent 1.5px), var(--purple-deep);
  background-size: 10px 10px; overflow: hidden;
  display: grid; place-items: center;
  color: var(--gold); font-family: 'Anton', sans-serif; font-size: 2.6rem;
  box-shadow: 6px 6px 0 var(--ink);
}
.interview-panel h3 { font-size: clamp(1.3rem, 2.6vw, 1.8rem); margin: 8px 0 10px; }
.interview-panel h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.interview-panel p { max-width: 60ch; }

/* ============ FOOTER ============ */
footer.site-footer {
  margin-top: 40px; background: var(--ink); color: var(--paper);
  border-top: 6px solid var(--gold); box-shadow: 0 -4px 0 var(--purple);
  padding: 36px 0 28px; position: relative; overflow: hidden;
}
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
footer .logo { color: var(--paper); }
footer .logo span { color: var(--gold); }
.footer-badge { border-radius: 50%; border: 3px solid var(--gold); }
.footer-mascot {
  position: absolute; right: 24px; bottom: 0; height: 220px; width: auto;
  pointer-events: none; opacity: 0.95;
}
@media (max-width: 900px) { .footer-mascot { display: none; } }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; }
.footer-links a:hover { opacity: 1; border-bottom: 2px solid var(--gold); }
.footer-note { font-size: 0.75rem; opacity: 0.5; margin-top: 20px; font-family: 'IBM Plex Mono', monospace; }

/* ============ GENERIC PAGE / ARCHIVE / SINGLE CONTENT ============ */
.page-header { padding: 40px 0 10px; }
.page-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.content-wrap { padding: 20px 0 60px; }
.entry-list { display: flex; flex-direction: column; gap: 24px; }
.entry-card { background: #fff; border: var(--panel-border); box-shadow: 4px 4px 0 var(--ink); padding: 22px; display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.entry-card .entry-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 2px solid var(--ink); }
.entry-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.entry-card h2 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.entry-meta { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; opacity: 0.7; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.pagination { display: flex; gap: 10px; margin-top: 30px; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }
.pagination a, .pagination span { padding: 8px 14px; border: 2px solid var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); }

.single-article { background: #fff; border: var(--panel-border); box-shadow: var(--panel-shadow); padding: 34px; max-width: 800px; margin: 0 auto; }
.single-article .entry-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 10px 0 14px; }
.single-article .entry-content { font-size: 1.05rem; }
.single-article .entry-content p { margin-bottom: 1.2em; }
.single-article .entry-content img { border: 2px solid var(--ink); margin: 1.2em 0; }
.single-article .entry-content h2, .single-article .entry-content h3 { margin: 1.4em 0 0.6em; }
.single-article .entry-content a { text-decoration: underline; text-decoration-color: var(--gold); }
.single-article .entry-thumbnail img { border: var(--panel-border); margin-bottom: 20px; }

.search-form { display: flex; gap: 8px; max-width: 480px; }
.search-form input[type="search"] { flex: 1; padding: 10px 12px; border: 2px solid var(--ink); font-family: 'IBM Plex Mono', monospace; }
.search-form button { padding: 10px 16px; border: 2px solid var(--ink); background: var(--gold); font-weight: 600; cursor: pointer; }

.comments-area { max-width: 800px; margin: 40px auto 0; }
.comments-wrap .comment-body { background: #fff; border: 2px solid var(--ink); padding: 16px; }
.comments-wrap .comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; font-weight: 600; }
.comments-wrap .comment-author img { border-radius: 50%; border: 2px solid var(--ink); }
.comments-wrap .comment-metadata { font-size: 0.72rem; opacity: 0.6; }
.comments-wrap .children { list-style: none; margin-top: 16px; padding-left: 28px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--ink); font-family: 'Libre Franklin', sans-serif; margin-bottom: 12px; background: #fff; color: var(--ink);
}
.comment-respond label { font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; text-transform: uppercase; display: block; margin-bottom: 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .shows-grid { grid-template-columns: repeat(2, 1fr); }
  .stakes-grid { grid-template-columns: 1fr; }
  .interview-panel { grid-template-columns: 1fr; justify-items: start; }
  .entry-card { grid-template-columns: 1fr; }
  nav.main-nav { width: 100%; }
}
@media (max-width: 640px) {
  .masthead-nav-bar { display: none; }
  .masthead-nav-bar.is-open { display: block; }
  nav.main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; font-weight: 600;
    text-transform: uppercase; background: var(--paper); border: 2px solid var(--ink);
    padding: 8px 12px; cursor: pointer;
  }
}
@media (max-width: 520px) {
  .shows-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 20px; }
}
