/**
 * Styles for single post template
 */

/* .single-post {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 2rem 15px;
} */
.site-logo::before {
  content: "";
  position: absolute;
  top: 65%;
  width: 38%;
  right: -5%;
  height: 100%;
  background-image: url("../images/pages-logo-mini-puddle.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  z-index: 2;
  pointer-events: none;
}
.entry-title {
  margin-bottom: 0.5rem;
}

.post-meta {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.post-featured-image {
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.entry-content {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.podcast-player {
  background: var(--light-bg);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.podcast-player h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.podcast-player audio {
  width: 100%;
}

.post-tags {
  margin-bottom: 2rem;
}

.tags-title {
  font-weight: bold;
}

/* .post-navigation { */
/* display: flex;
  justify-content: space-between; */
/* margin-top: 3rem; */
/* padding-top: 1.5rem; */
/* border-top: 1px solid var(--border-color); */
/* } */

.prev-post,
.next-post {
  max-width: 45%;
}
.nav-previous .nav-label {
  margin-left: 45px;
}
.nav-next .nav-label {
  margin-right: 45px;
}

.nav-label {
  display: block;
  font-size: 0.85rem;
  color: #000;
  /* margin-bottom: 0.5rem; */
}

/* Post Navigation Styles */
.post-navigation-container {
  /* margin-top: 3rem;
  padding-top: 2rem; */
}

.post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* padding: 10px 15px;
  background: var(--primary-color); */
  /* color: white; */
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

/* .nav-btn:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
} */

/* .nav-btn.disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  transform: none;
} */

/* .nav-btn.disabled:hover {
  background: #ccc;
  transform: none;
} */

/* .nav-icon {
  font-size: 1.2em;
  font-weight: bold;
} */
.prev-btn,
.next-btn {
  position: relative;
  display: inline-block;
}
.prev-btn:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px; /* Adjust as needed */
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background-image: url("../images/icon-prev.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}
.next-btn:after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px; /* Adjust as needed */
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background-image: url("../images/icon-next.svg");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
}

/* Numbered Pagination */
.nav-numbers {
  flex: 1;
  display: flex;
  justify-content: center;
}

.numbered-pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-number {
  display: inline-block;
  padding: 8px 12px;
  background: #f8f8f8;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 40px;
  text-align: center;
}

.page-number:hover {
  background: var(--primary-color);
  color: white;
}

.page-number.current {
  /* background: var(--primary-color); */
  /* color: white; */
  border-left: 3px solid #000000;
  border-right: 3px solid #000000;
  font-weight: bold;
}

.dots {
  padding: 8px 5px;
  color: #666;
}

/* Transcript Formatting */
/* .episode-transcript {
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  background: #fafafa;
  border-radius: 8px;
  line-height: 1.6;
}

.transcript-entry {
  margin-bottom: 15px;
  display: block;
}

.transcript-entry .timestamp {
  font-weight: bold;
  color: #333;
  font-family: "Courier New", monospace;
  background: #e8e8e8;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 10px;  
  font-size: 0.9em;
}

.transcript-entry .speaker {
  font-weight: bold;
  color: var(--primary-color);
  margin-right: 8px;
}

.transcript-entry .text {
  color: #333;
} */
.type-post .col-left {
  /* padding-left: 140px;
  padding-top: 160px; */
}
.entry-title {
  position: relative;
  text-transform: uppercase;
}
.entry-title:before {
  content: "";
  position: absolute;
  top: -45px;
  left: -26px;
  display: block;
  width: 120px;
  height: 120px;
  z-index: -1;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.post-43 .entry-title:before {
  background-image: url("../images/1.svg");
}
.post-81 .entry-title:before {
  background-image: url("../images/2.svg");
}
.post-83 .entry-title:before {
  background-image: url("../images/2.svg");
}
.post-87 .entry-title:before {
  background-image: url("../images/3.svg");
}
/* Transcript Two-Column Layout */
.episode-transcript {
  padding-top: 60px;
  padding-right: 50px;
  padding-left: 20px;
  background: #fafafa;
  border-radius: 8px;
}

.transcript-entry {
  display: flex;
  margin-bottom: 20px;
  gap: 20px;
  align-items: flex-start;
}

.col-left-post {
  flex: 0 0 120px; /* Fixed width for timestamp column */
  text-align: right;
}

.col-right-post {
  flex: 1; /* Takes remaining space */
}

.col-left-post .timestamp {
  font-weight: bold;
  color: #333;
  font-family: "Courier New", monospace;
  background: #e8e8e8;
  padding: 3px 8px;
  font-size: 0.9em;
}

.col-right-post p {
  margin: 0;
  line-height: 1.6;
  color: #333;
}

.col-right-post .speaker {
  font-weight: bold;
  color: #000;
}

/* Reference Links */
.reference-link {
  color: #0073aa;
  cursor: pointer;
  font-weight: bold;
  text-decoration: underline;
  background: #e6f3ff;
  padding: 1px 3px;
  border-radius: 2px;
}

.reference-link:hover {
  background: #cce7ff;
}

/* Reference Popup */
.reference-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.reference-popup {
  background: white;
  width: 300px;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

/* Enlarged popup when it contains images */
.reference-popup:has(.popup-image) {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
}

/* Alternative selector for older browsers that don't support :has() */
.reference-popup.has-image {
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
}

.popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  z-index: 10;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.popup-close:hover {
  background: rgba(255, 255, 255, 1);
  color: #000;
}

.popup-content {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.popup-content h4 {
  margin: 0 0 15px 0;
  color: #0073aa;
  font-size: 18px;
  padding-right: 40px; /* Space for close button */
}

.popup-content h5 {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: #333;
}

.popup-content p {
  margin: 15px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.popup-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  max-height: 400px; /* Prevent extremely tall images */
}

.popup-link {
  display: inline-block;
  background: #0073aa;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 15px;
  align-self: flex-start;
  transition: background 0.3s ease;
}

.popup-link:hover {
  background: #005a87;
  color: white;
}
.flex-dir {
  flex-direction: column;
}
.border-left {
  border-left: none !important;
}
.entry-title {
  max-width: 50%;
  margin-top: 50px;
  margin-bottom: 50px;
  margin-left: 20px;
}
.main-episode-content {
  padding-left: 20px;
}
.spotify-embed.margin-top-75 {
  margin-top: 0 !important;
}
.post-text-dropdown.padding-right-100,
.episode-intro.padding-right-100 {
  padding-right: 20px;
}
.spotify-embed iframe {
  padding-right: 20px;
}
.entry-content {
  font-size: 0.875rem;
}
.entry-title h1 {
  font-size: 1rem !important;
}
@media (min-width: 1020px) {
  .type-post .col-left {
    padding-left: 140px;
    padding-top: 160px;
  }
  .flex-dir {
    flex-direction: row;
  }
  .border-left {
    border-left: 4px solid #000 !important;
  }
  .episode-transcript {
    padding-left: 0;
  }
  .entry-content {
    font-size: 1rem;
  }
  .entry-title {
    max-width: 100%;
    margin-top: 50px;
    /* margin-bottom: 50px; */
    margin-left: 0;
  }
  .entry-title h1 {
    font-size: 2.5rem;
  }
  .main-episode-content {
    padding-left: 0;
  }
  .spotify-embed.margin-top-75 {
    margin-top: 75px !important;
  }
  .spotify-embed iframe {
    padding-right: 0;
  }
  .post-text-dropdown.padding-right-100,
  .episode-intro.padding-right-100 {
    padding-right: 100px;
  }
}
/* Mobile Styles */
@media (max-width: 768px) {
  .post-navigation {
    flex-direction: column;
  }

  .prev-post,
  .next-post {
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .post-navigation .nav-links {
    flex-direction: column;
    gap: 15px;
  }

  .nav-numbers {
    order: 1;
  }

  .nav-previous,
  .nav-next {
    order: 2;
  }

  .numbered-pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
  }

  .page-number {
    padding: 6px 10px;
    font-size: 0.9em;
  }

  .transcript-entry {
    margin-bottom: 12px;
    flex-direction: column;
    gap: 5px;
  }

  .transcript-entry .timestamp {
    display: block;
    margin-bottom: 5px;
    margin-right: 0;
  }

  .transcript-entry .speaker {
    display: inline;
  }

  .col-left-post {
    flex: none;
    text-align: left;
  }

  .col-left-post .timestamp {
    display: inline-block;
  }

  .reference-popup-overlay {
    padding: 10px;
  }

  .reference-popup {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0;
    margin: 0;
  }

  .reference-popup:has(.popup-image),
  .reference-popup.has-image {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
  }

  .popup-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 28px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
  }

  .popup-close:hover {
    background: rgba(0, 0, 0, 0.9);
    color: white;
  }

  .popup-content {
    padding: 70px 20px 30px 20px; /* Extra top padding for close button */
  }

  .popup-content h4 {
    font-size: 20px;
    padding-right: 0;
  }

  .popup-content h5 {
    font-size: 18px;
  }

  .popup-content p {
    font-size: 16px;
    line-height: 1.7;
  }

  .popup-image {
    margin: 20px 0;
    border-radius: 0;
    max-height: 50vh; /* Limit height on mobile */
  }

  .popup-link {
    padding: 12px 24px;
    font-size: 16px;
    margin-top: 20px;
  }

  /* Pagination Container */
  .section-pagination {
    /* padding: 15px; */
    margin-bottom: 20px;
  }

  .post-navigation-container {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
  }

  .post-navigation .nav-links {
    flex-direction: row;
    gap: 15px;
    /* align-items: stretch; */
  }

  /* Reorder for mobile:  Numbers first, then buttons */
  .nav-numbers {
    display: none;
    /* order: 1; */
    flex: none;
    text-align: center;
    margin-bottom: 10px;
  }
  /* 
  .nav-previous {
    order: 1;
  }

  .nav-next {
    order: 3;
  } */

  /* Navigation buttons - stack vertically on mobile */
  .nav-btn {
    width: 100%;
    justify-content: center;
    /* padding: 12px 20px; */
    margin-bottom: 0px;
    font-size: 0.9rem;
    position: relative;
    text-align: center;
  }

  /* Hide prev/next icons on mobile for cleaner look */
  /* .prev-btn:before,
  .next-btn:after {
    display: none;
  } */

  /* Adjust label spacing for mobile */
  .nav-previous .nav-label,
  .nav-next .nav-label {
    margin-left: 50px;
    margin-right: 50px;
  }

  /* Numbered pagination - mobile optimized */
  .numbered-pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    max-width: 100%;
  }

  .page-number {
    padding: 6px 8px;
    font-size: 0.8rem;
    min-width: 30px;
    flex-shrink: 0;
  }

  .page-number.current {
    border-left: 2px solid #000;
    border-right: 2px solid #000;
    font-weight: bold;
    background: #f0f0f0;
  }

  .dots {
    padding: 6px 4px;
    font-size: 0.8rem;
  }
}

/* Small mobile phones - 320px to 480px */
@media (max-width: 480px) {
  /* .section-pagination {
    padding: 10px;
  } */

  .post-navigation-container {
    padding: 10px 0;
  }

  .nav-btn {
    /* padding: 10px 15px; */
    font-size: 0.85rem;
  }

  .page-number {
    padding: 5px 6px;
    font-size: 0.75rem;
    min-width: 26px;
  }

  /* Limit number of visible page numbers on very small screens */
  .numbered-pagination {
    gap: 2px;
  }

  /* Stack pagination if too many numbers */
  .page-number:nth-child(n + 8) {
    display: none;
  }

  .dots {
    padding: 5px 3px;
  }
}

/* Medium mobile phones - 481px to 600px */
@media (min-width: 481px) and (max-width: 600px) {
  .nav-btn {
    /* padding: 11px 18px; */
    font-size: 0.87rem;
  }

  .page-number {
    padding: 6px 9px;
    font-size: 0.85rem;
    min-width: 32px;
  }
}

/* Large mobile/small tablet - 601px to 768px */
@media (min-width: 601px) and (max-width: 768px) {
  /* .section-pagination {
    padding: 18px;
  } */

  .post-navigation-container {
    padding: 18px 0;
  }

  .nav-btn {
    /* padding: 12px 20px; */
    font-size: 0.9rem;
  }

  .page-number {
    padding: 7px 10px;
    font-size: 0.9rem;
    min-width: 35px;
  }

  /* Show prev/next icons on larger mobile devices */
  .prev-btn:before,
  .next-btn:after {
    display: block;
    width: 20px;
    height: 20px;
  }

  .nav-previous .nav-label {
    margin-left: 40px;
  }

  .nav-next .nav-label {
    margin-right: 40px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .reference-popup:has(.popup-image),
  .reference-popup.has-image {
    width: 550px;
    max-width: 85vw;
  }
}
