/* styles.css */

/* ========== Root variables ========== */
:root {
  --color-primary: #2c3e50;
  --color-secondary: #ffffff;
  --color-accent: #e74c3c;
  --font-primary: 'Helvetica Neue', Arial, sans-serif;
  --spacing: 1rem;
}

/* ========== Base reset ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-primary);
  color: var(--color-primary);
  line-height: 1.6;
  background: var(--color-secondary);
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

/* ========== Header / Navigation ========== */
.site-header {
  background: var(--color-secondary);
  padding: var(--spacing) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing);
  align-items: center;
}
.main-nav li a {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.3s;
}
.main-nav li a:hover {
  background: rgba(44, 62, 80, 0.1);
}
.logo a {
  font-size: 1.25rem;
  font-weight: bold;
}
.nav-icon a {
  font-size: 1.2rem;
}
.main-nav a.active {
  background: rgba(44, 62, 80, 0.1);
  border-radius: 4px;
}

/* ========== Hero (home) ========== */
.hero {
  display: flex;
  align-items: center;
  padding: calc(var(--spacing) * 3) 0;
  gap: calc(var(--spacing) * 2);
}
.hero-image img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.hero-content { flex: 1; }
.tagline {
  color: var(--color-accent);
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero-content h1 {
  font-size: 2rem;
  margin-bottom: var(--spacing);
}
.buttons {
  display: flex;
  gap: var(--spacing);
  margin-bottom: var(--spacing);
}
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: bold;
  transition: background 0.3s, color 0.3s;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-secondary);
}
.btn-primary:hover { background: #1a242f; }
.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-secondary);
}
.blurb {
  margin-top: var(--spacing);
  font-size: 1rem;
  max-width: 600px;
}

/* ========== About ========== */
.about {
  padding: calc(var(--spacing) * 3) 0;
  background: #f9f9f9;
}
.about h2 {
  text-align: center;
  margin-bottom: calc(var(--spacing) * 2);
  font-size: 1.75rem;
}
.about-content {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing) * 2);
}
.about-text { flex: 1; }
.about-image img {
  width: 100%;
  max-width: 250px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ========== Newsletter ========== */
.newsletter {
  text-align: center;
  padding: calc(var(--spacing) * 3) 0;
}
.newsletter h2 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing);
}
.newsletter p { margin-bottom: var(--spacing); }
.newsletter-form {
  display: flex;
  justify-content: center;
  gap: var(--spacing);
}
.newsletter-form input[type="email"] {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  flex: 1;
  max-width: 300px;
}

/* ========== Contact ========== */
.contact { padding: calc(var(--spacing) * 3) 0; }
.contact h2 {
  text-align: center;
  margin-bottom: var(--spacing);
  font-size: 1.75rem;
}
.contact p {
  text-align: center;
  margin-bottom: calc(var(--spacing) * 1.5);
}
.contact-form {
  display: grid;
  gap: var(--spacing);
  max-width: 500px;
  margin: 0 auto;
}
.contact-form label { font-weight: bold; }
.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font-primary);
}

/* ========== Footer ========== */
.site-footer {
  background: var(--color-primary);
  color: var(--color-secondary);
  text-align: center;
  padding: var(--spacing) 0;
}
.site-footer a {
  color: var(--color-secondary);
  margin-bottom: var(--spacing);
  display: inline-block;
}
.site-footer p { font-size: 0.9rem; }

/* ========== Media Page Hero ========== */
.media-hero {
  text-align: center;
  padding: 3rem 0 1rem;
}
.media-hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.media-hero p {
  font-size: 1rem;
  color: #555;
}

/* =========================================================
   AUDIO LIBRARY (compact horizontal cards, grid-stable)
   ========================================================= */
/* Grid: 3 across, then wrap */
.audio-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px 0 36px;
  overflow: visible;          /* no horizontal scroll */
}

/* Responsive: 2 across on tablets, 1 across on phones */
@media (max-width: 1024px) {
  .audio-library {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}
@media (max-width: 640px) {
  .audio-library {
    grid-template-columns: 1fr;
  }
  
}
.audio-library::-webkit-scrollbar { height: 8px; }
.audio-library::-webkit-scrollbar-thumb {
  background: #cfd6dc;
  border-radius: 8px;
}

/* Card as a two-column grid: avatar | content */
.audio-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px;
  width: auto;        /* let the grid size the card */
  min-width: 0;       /* allow shrinking in the grid */
  /* remove flex-shrink entirely */
  transition: transform 0.2s ease, box-shadow 0.2s ease;

  /* Grid layout for perfect internal alignment */
  display: grid;
  grid-template-columns: 48px 1fr;  /* avatar | content */
  column-gap: 12px;
  align-items: start;
}
.audio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Avatar in column 1, spanning the whole card height */
.audio-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  grid-column: 1;
  grid-row: 1 / 4;               /* span the three rows on the right */
}

/* Content column uses its own 3-row grid: title | player | actions */
.audio-info {
  grid-column: 2;
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: auto auto auto;
  row-gap: 8px;
  min-width: 0;                  /* allow title/audio to shrink correctly */
}

.audio-info h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  color: #333;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;        /* long titles don’t break layout */
}

.audio-info audio {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;                      /* normalize spacing */
}

/* Actions row */
.audio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;                /* wraps nicely if space is tight */
}

/* Skip buttons (10s back/forward) */
.skip-btn {
  background: none;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.skip-btn:hover {
  transform: scale(1.05);
  background: #f7f9fb;
}

.like-btn, .dislike-btn {
  background: none;
  border: 1px solid #e5e8eb;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.like-btn:hover, .dislike-btn:hover {
  transform: scale(1.05);
  background: #f7f9fb;
}
.like-btn.active {
  background: #e8f6ed;
  border-color: #38b26b;
}
.dislike-btn.active {
  background: #fdecec;
  border-color: #e74c3c;
}

.speed-control {
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 13px;
  cursor: pointer;
}

/* ========== Insights / Posts (cover image) ========== */
.post-cover {
  width: 100%;
  max-width: 1000px;     /* keep within your content width */
  max-height: 360px;     /* control visible height */
  object-fit: cover;     /* crop edges nicely */
  display: block;
  margin: 16px auto;     /* center the image */
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* ========== Insights list (cards on Insights page) ========== */
.articles {
  display: grid;
  gap: 24px;
  padding: 16px 0 32px;
}
.article-item {
  display: grid;
  grid-template-columns: 140px 1fr;  /* 👈 thumbnail width | content */
  column-gap: 16px;
  align-items: start;

  /* keep your existing card look; adjust if you already have these */
  background: #f7f9fb;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
/* Square thumbnail on the left */
.article-item .article-cover {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0;                 /* override any previous margin */
  grid-column: 1;
  grid-row: 1 / span 4;      /* occupy full height of the right column */
}
/* Content flows in the right column */
.article-item h2,
.article-item .date,
.article-item p,
.article-item .btn {
  grid-column: 2;
}
/* Title and date spacing (keep your colors/fonts if you like) */
.article-item h2 { 
  margin: 0 0 6px;
}
.article-item .date {
  color: #667;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
/* Push the Read insight button down a bit more */
.article-item .btn {
  margin-top: 14px;          /* 👈 lower than before */
}
/* ---------- Mobile: stack vertically (image on top again) ---------- */
@media (max-width: 768px) {
  .article-item {
    display: block;
  }
  .article-item .article-cover {
    width: 100%;
    height: 160px;           /* smaller banner on phones */
    margin-bottom: 10px;
  }
  .article-item .btn {
    margin-top: 10px;
  }
}
/* ========== Single insight view ========== */
.article-view h2 { margin-bottom: 8px; }
.article-view .date { color: #667; margin-bottom: 16px; }
.article-view p { margin: 0 0 1rem; }

/* ========== Responsive tweaks ========== */
@media (max-width: 768px) {
  .hero { flex-direction: column; text-align: center; }
  .hero-content { margin: var(--spacing) 0 0; }
  .about-content { flex-direction: column; text-align: center; }

  .audio-library { gap: 12px; }
  .audio-card { width: auto; min-width: 0; }

  .post-cover { max-height: 240px; }
}
/* === Insights list: compact "Read insight" button === */
.articles a.btn,
.articles button.btn {
  display: inline-flex !important;   /* shrink to text */
  align-items: center;
  justify-content: center;
  width: auto !important;            /* kill any width:100% */
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-weight: 600;
  box-sizing: border-box;
}

.articles a.btn:hover,
.articles button.btn:hover {
  background: var(--color-primary);
  color: var(--color-secondary);
}

/* If the card uses a grid, keep the button from stretching */
.articles .article-item .btn { justify-self: start; }

/* Comment count link sits next to the button */
.article-item .comment-count {
  margin-left: 12px;
  font-size: 0.92rem;
  color: #556;
}
.article-item .comment-count:hover { text-decoration: underline; }

/* === Video tabs === */

.video-tab.active {
background: #2c3e50;
color: #fff;
border-color: #2c3e50;
}


/* Panels */
.video-panel { margin-bottom: 8px; }


/* === Videos page grid (2 across, then wrap) === */
.video-grid {
display: grid;
grid-template-columns: repeat(2, minmax(300px, 1fr));
gap: 16px;
padding: 12px 0 28px;
}


.video-card {
background: #fff;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
padding: 12px;
display: grid;
grid-template-rows: auto auto 1fr;
gap: 10px;
}
.video-card h2 { font-size: 1.05rem; }


/* 16:9 default frame */
.video-embed iframe {
width: 100%;
aspect-ratio: 16 / 9;
height: auto;
display: block;
border-radius: 8px;
background: #000;
}


/* 9:16 Shorts variant */
.video-embed--shorts iframe {
aspect-ratio: 9 / 16;
}


/* description */
.video-desc { color: #556; font-size: .95rem; }


/* responsive */
@media (max-width: 900px) {
.video-grid { grid-template-columns: 1fr; }
}

/* --- Book badges (price + Kindle Unlimited) --- */
.book-badges{
  display:flex; gap:.6rem; align-items:center; margin-top:.75rem; flex-wrap:wrap;
}

/* Price: clean red pill */
.price-badge{
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.4rem .7rem; border-radius:999px; font-weight:700; 
  background:#fff; color:#c62828; border:1px solid #ffcdd2;
  box-shadow:0 1px 0 rgba(0,0,0,.06);
}

/* KU: flashy gradient badge */
.ku-badge{
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.45rem .8rem; border-radius:999px; font-weight:700;
  background:linear-gradient(135deg,#ffb300,#ff7043 45%,#ab47bc 95%);
  color:#fff; text-decoration:none; box-shadow:0 6px 18px rgba(171,71,188,.35);
  position:relative; overflow:hidden;
}
/* little sparkle + soft pulse */
.ku-spark{ font-size:1rem; line-height:1; filter:drop-shadow(0 0 4px rgba(255,255,255,.7)); }
.ku-badge::after{
  content:""; position:absolute; inset:0; 
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);
  transform:translateX(-120%); animation:ku-shine 2.4s ease-in-out infinite;
}
@keyframes ku-shine{ 0%{transform:translateX(-120%);} 55%{transform:translateX(190%);} 100%{transform:translateX(190%);} }

/* Respect small screens */
@media (max-width: 640px){
  .book-badges{ gap:.5rem; }
  .price-badge, .ku-badge{ font-size:.95rem; }
}

/* ---------- Audio tabs ---------- */
.audio-tabs{
  display:flex; gap:.5rem; margin:12px 0 4px; flex-wrap:wrap;
}
.audio-tabs .tab-btn{
  border:1px solid #e2e8f0; background:#fff; color:#334155;
  padding:.45rem .8rem; border-radius:999px; font-weight:600;
  cursor:pointer; box-shadow:0 1px 0 rgba(0,0,0,.04);
}
.audio-tabs .tab-btn:hover{ background:#f8fafc; }
.audio-tabs .tab-btn.active{
  background:#0ea5e9; color:#fff; border-color:#0ea5e9;
  box-shadow:0 6px 16px rgba(14,165,233,.25);
}
@media (max-width:560px){
  .audio-tabs{ gap:.4rem; }
  .audio-tabs .tab-btn{ padding:.4rem .7rem; font-weight:600; }
}

/* ---- Trust row under CTAs ---- */
.trust-row{
  display:flex; flex-wrap:wrap; gap:.75rem 1.25rem;
  margin:10px 0 6px; padding:0; list-style:none;
  color:#334155; font-weight:600; font-size:.95rem;
}
.trust-row li{ white-space:nowrap; }

/* ---- Kindle Unlimited badge ---- */
.ku-wrap{ margin:8px 0 0; }
.ku-badge{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.55rem .9rem; border-radius:999px; font-weight:800;
  background:linear-gradient(135deg,#f59e0b,#ef4444 60%,#8b5cf6);
  color:#fff; text-decoration:none; box-shadow:0 8px 20px rgba(0,0,0,.15);
}
.ku-badge .ku-dot{
  width:10px;height:10px;border-radius:50%; background:#fff; opacity:.9;
  box-shadow:0 0 8px rgba(255,255,255,.9);
}
.ku-badge:hover{ filter:brightness(1.05); }

/* Prevent book cover from stretching */
.hero-image {
  display: flex;
  align-items: flex-start;   /* no vertical stretch */
  justify-content: center;   /* center nicely */
}

.hero-image img{
  width: 100%;
  height: auto !important;   /* override any height:100% rules */
  max-width: 420px;          /* reasonable desktop cap; tweak if you want */
  object-fit: contain;       /* never crop or warp */
  aspect-ratio: auto;        /* ensure the browser keeps natural ratio */
}

/* Layout help so the image column doesn't stretch oddly */
@media (min-width: 960px){
  .hero.container{
    display: grid;
    grid-template-columns: 420px 1fr; /* image column then content */
    gap: 36px;
  }
}
/* About layout tweaks (optional but nice) */
.about-content{
  display: grid;
  grid-template-columns: 1.25fr 340px;  /* text | headshot */
  gap: 28px;
  align-items: start;
}
.about-image{
  display: flex;
  justify-content: center;
}

/* Make the headshot a proper circle without distortion */
.headshot{
  width: 260px;              /* pick your size */
  aspect-ratio: 1 / 1;       /* guarantees a square */
  height: auto;              /* let browser compute from aspect-ratio */
  border-radius: 50%;        /* circular mask */
  object-fit: cover;         /* fill the circle without stretching */
  object-position: 50% 40%;  /* nudge framing if needed (x y) */
  box-shadow: 0 10px 28px rgba(2, 6, 23, .08);
  display: block;
}

/* Mobile: stack and center */
@media (max-width: 860px){
  .about-content{
    grid-template-columns: 1fr;
    text-align: left;
  }
  .about-image{ justify-content: start; }
  .headshot{ width: 220px; }
}

