* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: #222;
  background-color: #fefefe;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  margin-bottom: 0.5rem;
}

a {
  text-decoration: none;
}

/* Hero Section */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: url('../img/resalphalogo.png') no-repeat center center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.hero-logo {
  max-width: 300px;
  margin-bottom: 20px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  margin: 0;
}

.tagline {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.cta-buttons .btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px;
  text-decoration: none;
  color: white;
  background-color: #000;
  border-radius: 5px;
}

.cta-buttons .btn.secondary {
  background-color: #1DB954;
}

.icon-small {
  width: 20px;
  vertical-align: middle;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  margin: 0 -10px;
}
.cta-buttons > * {
  margin: 0 10px;
}
.cta-buttons .btn {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  color: #fff;
  background: #000;
  border-radius: 5px;
}
.cta-buttons .btn.secondary {
  background: #444;
}
.icon-small {
  height: 1em;
  vertical-align: middle;
  margin-left: 0.5em;
}

.content {
  max-width: 1200px;
  margin: auto;
  padding: 2rem;
}

/* Latest Episode and Hosts Layout */
.latest-episode {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end; /* Bottom-align video and carousel */
}

.video-header-container {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

.video-header-container h2 {
  margin: 0 0 10px 0;
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
}

/* Video Section Container */
.video-section-container {
  position: relative;
  width: 40vw; /* Reduced from 50vw to 80% of original */
  max-width: 768px; /* Reduced from 960px to 80% of original */
  aspect-ratio: 16 / 9; /* Maintain standard video aspect ratio */
  overflow: hidden;
  background: #000; /* Black background for video frame */
  z-index: 3; /* Above other content */
  box-sizing: border-box;
  contain: strict;
  margin: 20px auto; /* Center horizontally */
  display: flex;
  justify-content: center;
}

/* Video Section */
.video-section {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent; /* Transparent to show video-section-container's black background */
}

#background-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover; /* Ensure video covers the entire section without distortion */
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

/* Handle vertical (9:16) videos */
@media (max-aspect-ratio: 9/16) {
  #background-video {
    object-fit: contain; /* Show full vertical video with letterboxing */
    top: 50%;
    left: 50%;
    transform Ascending
    transform: translate(-50%, -50%);
    width: auto;
    height: 100%;
  }
}

.video-section.fading #background-video {
  opacity: 0;
}

/* Button Styling for Sound Toggle */
.btn-primary {
  background-color: #17a2b8;
  border-color: #17a2b8;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 5px;
}
.btn-primary:hover {
  background-color: #138496;
  border-color: #138496;
}

/* Center text for buttons and links */
.text-center {
  text-align: center;
}

.hosts {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* Ensure carousel is pushed to the bottom */
}

.hosts h2 {
  margin: 0 0 10px 0;
  font-size: 2rem;
}

.carousel {
  position: relative;
  width: 510px; /* Viewport for 3 hosts */
  overflow: hidden; /* Clip to show only 3 hosts */
}

.carousel-track {
  display: flex;
  width: max-content; /* Full width of all hosts */
  min-width: 680px; /* 4 hosts * 170px */
  transition: transform 0.3s ease;
}

.host {
  flex: 0 0 170px; /* 150px image + 10px padding-left + 10px padding-right */
  min-width: 170px;
  text-align: center;
  padding: 0 10px;
}

.host img {
  width: 100%;
  max-width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  padding: 0 10px;
  transition: background 0.3s;
  z-index: 10; /* Ensure buttons are above track and hosts */
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
  left: 0;
}

.carousel-btn.next {
  right: 0;
}

/* Ensure side-by-side layout on larger screens */
@media (min-width: 769px) {
  .latest-episode {
    flex-direction: row;
  }
  .video-header-container {
    flex: 0 0 50%;
  }
  .hosts {
    flex: 0 0 50%;
  }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .latest-episode {
    flex-direction: column;
    align-items: stretch; /* Reset alignment for stacked layout */
  }
  .video-header-container {
    flex: 0 0 100%;
    margin-right: 0;
  }
  .video-section-container {
    width: 72vw; /* Reduced from 90vw to 80% of original */
    max-width: 576px; /* Reduced from 720px to 80% of original */
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
    margin: 10px auto;
  }
  .hosts {
    flex: 0 0 100%;
    justify-content: flex-start; /* Reset for mobile */
  }
  .carousel {
    width: 100%; /* Full width on mobile */
  }
  .host {
    flex: 0 0 170px;
    min-width: 170px;
  }
}

/* iOS Safari Fix */
@supports (-webkit-touch-callout: none) {
  .video-section-container {
    width: 72vw; /* Reduced from 90vw to 80% of original */
    max-width: 576px; /* Reduced from 720px to 80% of original */
    aspect-ratio: 16 / 9;
    margin: 10px auto;
  }
}

.episode-meta, .episode-desc {
  margin-top: 10px;
}

.episodes .episode {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.episodes .btn {
  padding: 0.75rem 1.5rem;
  background: #000;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
}

.newsletter {
  background: #eee;
  padding: 2rem;
  text-align: center;
}

.footer {
  text-align: center;
  padding: 1rem;
  background: #222;
  color: white;
}