/* ==========================================================
   DIGEST ARCHIVE PAGE
========================================================== */
html {
  scroll-behavior: smooth !important;
}

.digest-archive {
  padding: 100px 20px;
}

.digest-container {
  max-width: 1400px;
  margin: auto;
}

/* Filter Bar */
.digest-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.digest-filter-label {
  font-size: 14px;
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.digest-year-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.digest-pill {
  padding: 8px 22px;
  border: 1.5px solid #d0d8e4;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.digest-pill:hover {
  border-color: #1c75bc;
  color: #1c75bc;
}

.digest-pill.active {
  background: #1c75bc;
  border-color: #1c75bc;
  color: #fff;
}

/* Year Sections */
.digest-year-section {
  margin-bottom: 80px;
  /* No transition here — animations handle it */
     text-align: left;
}

.digest-year-section.digest-hidden {
  display: none;
}

.digest-year-section.digest-hiding {
  animation: digestFadeOut 0.22s ease forwards;
  pointer-events: none;
}

.digest-year-section.digest-showing {
  animation: digestFadeIn 0.38s ease forwards;
}

.digest-year-heading {
  margin: 0 0 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e5eaf2;
  color: #111;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.2;
}

/* Cards */
.digest-issues-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.digest-issue-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 60px) / 3);
  width: calc((100% - 60px) / 3);
  overflow: hidden;
  border: 1px solid #eef2f7;
  background: #fff;
  color: #111;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 20px 60px rgba(8, 39, 70, 0.14) !important;
}

.digest-issue-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.digest-card-image {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: #f5f5f5;
}

.digest-card-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.digest-issue-card:hover .digest-card-image img {
  transform: scale(1.03);
}

.digest-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 30px;
}

.digest-issue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-bottom: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #1c75bc;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.digest-month {
  margin: 0 0 15px;
  color: #111;
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.2;
}

.digest-meta {
  margin-bottom: 30px;
  color: #666;
  font-size: 16px;
}

.digest-arrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  color: #1c75bc;
  font-weight: 600;
  transition: gap 0.2s ease;
}

.digest-issue-card:hover .digest-arrow {
  gap: 15px;
}

.digest-arrow::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  background: #1c75bc;
  transition: width 0.2s ease;
}

.digest-issue-card:hover .digest-arrow::after {
  width: 44px;
}

/* Animations */
@keyframes digestFadeIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==========================================================
   DIGEST ISSUE PAGE (GRID LAYOUT)
========================================================== */

.digest-banner {
  position: relative;
  height: 50vh;
  min-height: 450px;
  overflow: hidden;
}

.digest-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.digest-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.digest-banner-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.digest-banner-inner {
  max-width: 800px;
  padding: 0 20px;
}

.digest-banner-content h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.digest-banner-inner p {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px !important;
  margin-top: 20px;	
}

.digest-single-banner .digest-banner-inner p::before,
.digest-single-banner .digest-banner-inner p::after {
  content: "";
   width: 40px;
  height: 1px;
  background: #fff; 
  margin: 0 10px;
}

/* Grid System */
.digest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  background: #eee;
}

.digest-card {
  position: relative;
  overflow: hidden;
  background: #000;
}

.digest-card-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  color: #fff;
  text-decoration: none;
}

.digest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.digest-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.55) 35%,
    rgba(0, 0, 0, 0.15) 65%,
    rgba(0, 0, 0, 0) 100%
  );
}

.digest-content {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 2;
  text-align: center;
}

.digest-card h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.digest-reading-time {
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.9;
}

/* Grid Variants */
:where(.digest-card.small) {
  grid-column: span 1;
  grid-row: span 1;
}

:where(.digest-card.tall) {
  grid-column: span 1;
  grid-row: span 2;
}

:where(.digest-card.wide) {
  grid-column: span 2;
  grid-row: span 1;
}

:where(.digest-card.large) {
  grid-column: span 2;
  grid-row: span 2;
}

:where(.digest-card.fullwidth) {
  grid-column: 1 / -1;
  grid-row: span 2;
}

/* ==========================================================
   DIGEST SINGLE PAGE
========================================================== */

.digest-single-banner {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.digest-banner-image {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.digest-banner-image img {
  width: 100%;
  height: 140%;
  object-fit: cover;
  transform: scale(1.3);
  will-change: transform;
}

.digest-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.digest-banner-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scroll Down Button */
.digest-scroll-down {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
  animation: digestBounce 2s infinite;
}

.digest-scroll-down svg {
  width: 20px;
  height: 20px;
  display: block;
}

.digest-scroll-down svg path {
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

.digest-scroll-down:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%) scale(1.05);
}

@keyframes digestBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  60% {
    transform: translateX(-50%) translateY(-4px);
  }
}

/* Post Navigation */
.digest-post-nav {
  display: flex;
  justify-content: space-between;
}

.digest-nav-btn {
  position: relative;
  flex: 1;
  min-height: 250px;
  padding: 40px;
  text-decoration: none;
  transition: transform 0.3s ease;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.digest-post-nav:has(.digest-nav-btn:only-child) .digest-nav-btn {
  text-align: center;
}

.digest-nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  transition: background 0.3s ease;
}

.digest-nav-btn:hover::before {
  background: rgba(0, 0, 0, 0.4);
}

.digest-nav-btn > * {
  position: relative;
  z-index: 2;
  color: #fff;
  transition: transform 0.3s ease;
}

.digest-nav-btn span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.9;
  margin-bottom: 8px;
}

.digest-nav-btn strong {
  display: block;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.4;
  font-weight: 600;
}

.digest-nav-btn.prev {
  text-align: right;
}

.digest-nav-btn.next {
  text-align: left;
}

.digest-nav-btn:hover > * {
  transform: translateY(-8px);
}

/* Single Page Content */
.digest-single-content * {
  font-size: 16px !important;
  color: #676767;
  line-height: 1.6 !important;
}

/* Container for single page */
.digest-container {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

/* ==========================================================
   RESPONSIVE DESIGN
========================================================== */

/* Tablet */
@media (max-width: 991px) {
  .digest-issue-card {
    flex: 1 1 calc(50% - 15px);
  }
}

/* Small Tablet / Large Mobile */
@media (max-width: 980px) {
  .digest-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }

  .digest-card.wide,
  .digest-card.fullwidth {
    grid-column: 1 / -1;
    grid-row: span 1;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .digest-archive {
    padding: 60px 20px;
  }

  .digest-filter-bar {
    gap: 10px;
    margin-bottom: 40px;
  }

  .digest-card-image {
    height: 200px;
  }

  .digest-issue-card {
    flex: 1 1 100%;
  }

  .digest-card-content {
    padding: 20px;
  }

  .digest-banner {
    height: 40vh;
    min-height: 300px;
  }

  .digest-banner-content p {
    margin-top: 15px;
    font-size: 15px;
    line-height: 1.6;
  }

  .digest-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
  }

  .digest-card,
  .digest-card.small,
  .digest-card.tall,
  .digest-card.wide,
  .digest-card.large,
  .digest-card.fullwidth {
    height: 300px;
  }

  .digest-card h2 {
    font-size: 18px;
  }

  .digest-single-banner {
    height: 70vh;
  }

  .digest-post-nav {
    flex-direction: column;
  }

  .digest-nav-btn {
    max-width: 100%;
    min-height: 200px;
    text-align: center !important;
  }

  .digest-scroll-down {
    width: 40px;
    height: 40px;
    bottom: 20px;
  }

  .digest-scroll-down svg {
    width: 16px;
    height: 16px;
  }
}

/* Print styles */
@media print {
  .digest-scroll-down,
  .digest-post-nav {
    display: none;
  }

  .digest-single-banner {
    height: auto;
    page-break-inside: avoid;
  }
}