/* ==========================================================================
   Blog Subpage Stylesheet
   ========================================================================== */

/* Main layout containers */
.blog-container {
  max-width: 100%;
  padding: 110px 40px 40px;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  color: #363535;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 40px;
  height: calc(100vh - 160px);
  min-height: 500px;
  overflow: hidden;
}

/* Scrollbar styles for the internal scrollable columns */
.blog-feed-col::-webkit-scrollbar,
.blog-reader-col::-webkit-scrollbar {
  width: 5px;
}

.blog-feed-col::-webkit-scrollbar-thumb,
.blog-reader-col::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* ==========================================================================
   LEFT COLUMN: Blog Feed
   ========================================================================== */
.blog-feed-col {
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Feed Search Bar & Filters */
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
}

#search-input {
  border: none;
  background: transparent;
  font-size: 15px;
  color: #363535;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-weight: 500;
}

#search-input::placeholder {
  color: #94a3b8;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #64748b;
  transition: color 0.2s ease;
}

.filter-bar:hover {
  color: var(--primary);
}

.sort-label {
  font-size: 13.5px;
  font-weight: 700;
}

.sort-icon {
  width: 14px;
  height: 14px;
}

/* Article Feed Cards */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 24px;
}

.blog-card:hover {
  transform: translateY(-2px);
}

.blog-card-category {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card-title {
  font-size: 21px;
  font-weight: 800;
  color: #363535;
  line-height: 1.35;
  margin: 0;
}

.blog-card-excerpt {
  font-size: 13.5px;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Author row cards inside feed cards */
.blog-card-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.author-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
}

.author-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.author-name {
  font-size: 12.5px;
  font-weight: 750;
  color: #363535;
}

.author-role {
  font-size: 10.5px;
  color: #64748b;
}

/* Audio Podcast Card styling at bottom left */
.audio-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
}

.audio-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
}

.audio-icon {
  width: 16px;
  height: 16px;
}

.audio-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audio-card {
  background: #fafaf7; /* cream-beige tint mimicking mockup */
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #e2e1dc;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audio-title {
  font-size: 16px;
  font-weight: 800;
  color: #363535;
  line-height: 1.35;
  margin: 0;
}

.audio-player-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(3, 139, 222, 0.2);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.audio-play-btn:active {
  transform: scale(0.95);
}

.audio-play-btn svg {
  width: 16px;
  height: 16px;
}

.audio-progress-bar {
  flex-grow: 1;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.progress-fill {
  width: 40%; /* Mock initial state */
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  position: absolute;
  top: 0;
  left: 0;
  transition: width 0.1s linear;
}

.audio-duration {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  min-width: 32px;
  text-align: right;
}

/* ==========================================================================
   RIGHT COLUMN: Reader View Page
   ========================================================================== */
.blog-reader-col {
  overflow-y: auto;
  height: 100%;
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative;
}

.reader-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  font-weight: 600;
  font-size: 15px;
}

.reader-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* Back controls header (only active on mobile view) */
.reader-nav-header {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.reader-back-btn,
.reader-option-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  color: #363535;
  transition: transform 0.2s ease;
}

.reader-back-btn:active,
.reader-option-btn:active {
  transform: scale(0.92);
}

.reader-back-btn svg,
.reader-option-btn svg {
  width: 16px;
  height: 16px;
}

/* Hero image cutout display banner */
.reader-hero-card {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  position: relative;
}

.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.95) 95%, #ffffff 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px 24px 36px;
}

.hero-overlay-text {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

/* Reader Body text info */
.reader-body {
  padding: 32px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
}

.reader-article-title {
  font-size: 26px;
  font-weight: 900;
  color: #363535;
  line-height: 1.3;
  margin: 0;
}

.reader-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1.5px solid #f1f5f9;
  padding-bottom: 16px;
}

.reader-text-content {
  font-size: 14.5px;
  line-height: 1.6;
  color: #555555;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Latest Podcasts element box at bottom reader sheet */
.latest-podcasts-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.podcasts-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #363535;
  letter-spacing: 0.5px;
  margin: 0;
}

.podcast-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fafaf7;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid #f1effa;
}

.guest-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
}

.guest-details {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.guest-name {
  font-size: 13px;
  font-weight: 750;
  color: #363535;
}

.guest-role {
  font-size: 11px;
  color: #64748b;
}

/* ==========================================================================
   RESPONSIVE STATES (Mobile / Desktop)
   ========================================================================== */

/* Show back button only on mobile viewports */
@media (min-width: 769px) {
  .reader-back-btn {
    display: none !important;
  }
}

/* Large Background Name SVG style */
.blog-bg-text {
  display: none;
}
.blog-bg-text svg text {
  fill: currentColor;
}

@media (max-width: 768px) {
  .blog-container {
    padding: 80px 20px 40px;
    position: relative;
  }

  .blog-grid {
    display: block; /* flat flow */
    height: auto;
    overflow: visible;
    position: relative;
    z-index: 2;
  }

  .blog-feed-col {
    overflow-y: visible;
    height: auto;
    padding-right: 0;
  }

  .audio-section {
    margin-top: 32px;
  }

  /* Make reader pop up fullscreen on mobile */
  .blog-reader-col {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    z-index: 10005;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .blog-reader-col.active {
    transform: translateX(0);
  }
  
  .reader-body {
    padding: 24px 20px 40px;
  }

  .blog-bg-text {
    display: block;
    position: absolute;
    top: 55px;
    left: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
    color: #f1f5f9;
    opacity: 0.55;
  }
}
