/* Modern Light Design - The Downshift Podcast */
:root {
  /* Core Colors */
  --bg: #ffffff;
  --bg-subtle: #f9f9fa;
  --bg-card: #ffffff;
  --text-main: #111111;
  --text-muted: #666666;
  --border: #ececec;
  --accent: #e10600;
  --accent-hover: #cc0600;

  /* Shadows */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.08);

  /* Spacing */
  --container-width: 800px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Modal */
  --modal-overlay: rgba(0, 0, 0, 0.4);
}

/* Dark Mode Overrides (Optional/Secondary) */
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-subtle: #111111;
  --bg-card: #161616;
  --text-main: #ffffff;
  --text-muted: #888888;
  --border: #222222;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.4);
  --modal-overlay: rgba(0, 0, 0, 0.8);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  letter-spacing: -0.03em;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

/* Layout Utilities */
.container {
  width: min(100%, var(--container-width));
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-child {
  border-bottom: none;
}

/* Header */
.header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

:root[data-theme="dark"] .header {
  background: rgba(10, 10, 10, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.7;
}

.nav a:hover {
  opacity: 1;
  color: var(--accent);
}

/* Hero */
.hero {
  padding: 120px 0 100px;
  text-align: center;
}

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.hero h1 {
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.button:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
  border-color: var(--text-muted);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
}

.button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(225, 6, 0, 0.4);
}

/* Episodes */
.episode {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.episode:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.episode-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.episode-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.episode-actions {
  display: flex;
  gap: 12px;
}

.episode-actions .button {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* YouTube */
.youtube-featured {
  margin-bottom: 40px;
}

.youtube-embed-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 */
  height: 0;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.youtube-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.youtube-thumb {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.youtube-thumb:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.youtube-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-subtle);
  display: block;
}

.thumb-info {
  padding: 16px;
}

/* Note: app.js creates a div (meta) but no class 'thumb-info' on it. It just appends div. */
/* app.js structure: 
   a.youtube-thumb
     img
     div (meta wrapper)
       div.youtube-thumb-title
       div.youtube-thumb-date
       span.youtube-badge (optional)
*/

.youtube-thumb>div {
  padding: 16px;
}

.youtube-thumb-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.youtube-thumb-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.youtube-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* About / Hosts */
.hosts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.host-badge {
  text-align: center;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .hosts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Footer */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-main);
  font-weight: 500;
}

/* Modal */
.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(600px, 90%);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: var(--modal-overlay);
  backdrop-filter: blur(4px);
}

.modal-inner {
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

/* Utilities */
.text-center {
  text-align: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fineprint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
}