@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@700;900&display=swap');

:root {
  /* Light Mode Palette - Warm, Nude, Beige */
  color-scheme: light dark;
  --bg-color: #faf7f2;       
  --text-color: #33302e;     
  --text-muted: #756f6a;     
  --accent-color: #524c47;   
  --link-hover: #1a1817;     
  --border-color: #e0dad3;   
  --code-bg: #eee8e0;        
  --shadow-color: rgba(60, 50, 40, 0.06); 
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Mode Palette - Deep Warm Charcoal & Beige */
    --bg-color: #22201f;     
    --text-color: #e6e2de;   
    --text-muted: #99938d;   
    --accent-color: #c2b6a6; 
    --link-hover: #e8e1d5;   
    --border-color: #3b3734; 
    --code-bg: #2e2b29;      
    --shadow-color: rgba(15, 12, 10, 0.5); 
  }
}

/* --- THE FIX FOR THE CUT-OFF PLAYER --- */
/* This forces padding/borders to stay inside the width constraints */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base typography and layout */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Centered layout container */
#header, #content, #footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Header Styling */
#header {
  text-align: center;
  padding-top: 4rem;
  padding-bottom: 0.5rem;
}

#header h1 {
  margin: 0 0 1rem 0;
  font-size: 4.5rem; 
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

#header h1 a {
  color: var(--text-color); 
  text-decoration: none;
}

#header h1 a:hover {
  text-decoration: none;
  color: var(--accent-color);
}

#header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* --- MAGIC REORDERING FOR #CONTENT --- */
#content {
  display: flex;
  flex-direction: column;
}

#content > * {
  order: 10;
}

#content > ul:nth-of-type(1) {
  order: 1;
  margin: 0.5rem 0 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

#content > ul:nth-of-type(2) {
  order: 2;
  margin: 0 0 2rem 0;
  font-size: 0.95rem;
}

#content > p:first-of-type {
  order: 3;
  text-align: left;
  font-size: 1.15rem;
  margin: 0 0 2rem 0; /* Muutsime 3rem -> 2rem peale */
  color: var(--text-muted);
}

#content > p:not(:first-of-type) {
  display: none;
}

/* --- FORMATTING THE HORIZONTAL LISTS --- */
#content > ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

#content > ul li {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

#content > ul li .banner {
  height: 40px;
  border-radius: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 5px var(--shadow-color);
  display: block;
}

#content > ul li a:hover .banner {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

span.pre {
  font-family: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", monospace;
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-color);
}

/* --- EPISODE BLOCKS --- */
.episode-title {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin: 3rem 0 0 0;
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  color: var(--text-color);
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-bottom: none; 
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.episode-title i {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  font-style: normal;
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
}

.episode-title {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin: 0; /* Võtsime ära 3rem ülemise vahe */
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  color: var(--text-color);
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-bottom: none; 
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.episode-title a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.player {
  padding: 0.5rem 1.5rem;
  background-color: transparent;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

audio {
  width: 100%;
  border-radius: 30px;
  outline: none;
}

.episode-content {
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  margin: 0 0 2rem 0; /* Muutsime 3rem -> 2rem peale */
  font-size: 1.05rem;
  line-height: 1.5; 
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-top: none; 
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.episode-content p {
  margin-top: 0;
}

/* List fixes */
.episode-content ul, .episode-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.episode-content li {
  margin-bottom: 0.5rem;
}

.episode-content li > ul, 
.episode-content li > ol {
  margin-top: 0.5rem; 
  margin-bottom: 0;   
}

/* Footer Styling */
#footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* --- MOBILE RESPONSIVENESS --- */
/* This makes sure things scale elegantly on phone screens */
@media (max-width: 600px) {
  #header h1 {
    font-size: 3rem; /* Scales down the massive title for phones */
  }
  
  .episode-title, .player, .episode-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}