/* ===========================
   Digest Archive Styles
   =========================== */

:root {
  --digest-dark-bg: #1a1a19;
  --digest-text-light: #e8dccf;
  --digest-accent: #DC6228;
}

/* Header above hero slider - transparent */
body.digest-archive-template .gh-head.outer,
body.digest-archive-template header.gh-head,
body.digest-archive-template .gh-head,
body.digest-archive-template #gh-head {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100% !important;
  z-index: 1000;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

body.digest-archive-template .gh-head.outer::before,
body.digest-archive-template .gh-head.outer::after,
body.digest-archive-template header.gh-head::before,
body.digest-archive-template header.gh-head::after,
body.digest-archive-template .gh-head::before,
body.digest-archive-template .gh-head::after,
body.digest-archive-template #gh-head::before,
body.digest-archive-template #gh-head::after {
  background: none !important;
  content: none !important;
  display: none !important;
}

/* Base */
.digest-page {
  background: var(--digest-dark-bg);
  min-height: 100vh;
}

body.digest-archive-template {
  background: var(--digest-dark-bg) !important;
}

/* Hero Section */
.digest-hero {
  position: relative;
  width: 100vw;
  height: 840px;
  overflow: hidden;
  margin-left: calc(-50vw + 50%);
  margin-bottom: 0;
}

/* Hero Slider */
.digest-hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.digest-hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.digest-hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.digest-hero-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Hero Overlay and Text */
.digest-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
  z-index: 2;
}

.digest-hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(40px, 8vw, 80px);
  padding-bottom: clamp(60px, 10vw, 120px);
  color: white;
  width: 100%;
  max-width: 900px;
}

.digest-slide-title {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 900;
  line-height: 0.95;
  margin: 0 0 24px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  letter-spacing: -1px;
}

.digest-slide-title a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

.digest-slide-title a:hover {
  color: var(--digest-accent);
}

.digest-slide-excerpt {
  font-size: 20px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  max-width: 600px;
}

.digest-slide-meta {
  display: grid;
  grid-template-rows: auto auto;
  gap: 20px;
  margin-top: 24px;
}

.digest-meta-info {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

.digest-read-button {
  background: var(--digest-accent);
  color: #1f160f;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  display: inline-block;
  width: fit-content;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.digest-read-button:hover {
  transform: translateY(-2px);
}

/* Hero Navigation Dots */
.digest-hero-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.digest-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.digest-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.digest-dot.active {
  background: var(--digest-accent);
  border-color: var(--digest-accent);
}


/* Navigation */
.digest-nav {
  background: var(--digest-dark-bg);
  border-bottom: 3px solid #333;
  position: sticky;
  top: 0;
  z-index: 100;
}

.digest-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 clamp(20px, 5vw, 80px);
}

.digest-nav-link {
  padding: 24px 32px;
  color: #888;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-transform: uppercase;
}

.digest-nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.digest-nav-link.active {
  color: white;
  border-bottom-color: var(--digest-accent);
}

/* Content */
.digest-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px clamp(20px, 5vw, 80px);
  min-height: 60vh;
}

.digest-section {
  display: none;
}

.digest-section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.digest-section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--digest-text-light);
  margin: 0 0 60px 0;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* Topic Index */
.digest-topic-index {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 60px;
  padding-bottom: 40px;
  border-bottom: 2px solid #333;
}

.digest-topic-pill {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #333;
  border-radius: 24px;
  color: var(--digest-text-light);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.digest-topic-pill:hover {
  background: var(--digest-accent);
  border-color: var(--digest-accent);
  color: white;
  transform: translateY(-2px);
}

.digest-topic-pill.active {
  background: var(--digest-accent);
  border-color: var(--digest-accent);
  color: white;
}

/* Month/Topic/Contributor Sections */
.digest-month-section,
.digest-topic-section,
.digest-contributor-section {
  margin-bottom: 80px;
  scroll-margin-top: 100px;
}

.digest-month-title,
.digest-topic-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--digest-accent);
  margin: 0 0 32px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Contributor Header */
.digest-contributor-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #333;
}

.digest-contributor-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--digest-accent);
}

.digest-contributor-info {
  flex: 1;
}

.digest-contributor-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--digest-text-light);
  margin: 0 0 8px 0;
}

.digest-contributor-bio {
  font-size: 14px;
  color: #999;
  margin: 0;
  line-height: 1.5;
}

/* Posts Grid */
.digest-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.digest-post-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.digest-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.digest-post-image-link {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.digest-post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.digest-post-card:hover .digest-post-image {
  transform: scale(1.05);
}

.digest-post-content {
  padding: 24px;
}

.digest-post-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
}

.digest-post-title a {
  color: var(--digest-text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.digest-post-title a:hover {
  color: white;
}

.digest-post-excerpt {
  color: #999;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px;
}

.digest-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #666;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.digest-post-date {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.digest-featured-badge {
  background: var(--digest-accent);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Footer */
body.digest-archive-template footer.site-footer.outer,
body.digest-archive-template .site-footer.outer {
  background: #0a0a09 !important;
  color: #e8dccf !important;
}

/* Responsive */
@media (max-width: 768px) {
  .digest-hero {
    padding: 80px 0 0;
  }
  
  .digest-hero-main {
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
  }
  
  .digest-hero-image-container {
    width: 90%;
    max-width: 400px;
    margin-top: 0;
  }
  
  .digest-header-info {
    text-align: center;
    max-width: 100%;
    padding: 0 20px 40px;
  }
  
  .digest-featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .digest-nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
  }
  
  .digest-nav-link {
    padding: 18px 20px;
    font-size: 13px;
  }
  
  .digest-content {
    padding: 60px 20px;
  }
  
  .digest-posts-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .digest-contributor-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .digest-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
