/* ============================================
   Content Sections — Sandan Koyo Theme
   Monthly content, seasonal categories
   ============================================ */

/* --- Featured Articles (Editorial Grid) --- */
.featured {
  padding: 7rem 0;
  background: var(--color-snow);
}

.featured .section-header {
  margin-top: 0;
  padding-top: 0;
}

.featured__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-md);
}

/* Large featured card — left column, fills full height */
.featured__main {
  grid-row: 1 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--color-midnight);
  min-height: 520px;
  cursor: pointer;
}

.featured__main-image {
  position: absolute;
  inset: 0;
}

.featured__main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out-expo);
}

.featured__main:hover .featured__main-image img {
  transform: none;
}

.featured__main-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 50%,
    rgba(10, 22, 40, 0.4) 75%,
    rgba(10, 22, 40, 0.85) 100%
  );
  z-index: 2;
}

.featured__main-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2xl);
  z-index: 3;
}

.featured__main-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--color-autumn-red);
  color: var(--color-white);
  font-family: var(--font-accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.featured__main-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: var(--space-md);
}

.featured__main-excerpt {
  font-size: 0.95rem;
  color: var(--color-glacier);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Side stack — right column, 3 small cards */
.featured__side {
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.featured__side-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-midnight);
  flex: 1;
  min-height: 0;
  cursor: pointer;
}

.featured__side-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.featured__side-image {
  position: absolute;
  inset: 0;
}

.featured__side-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out-expo);
}

.featured__side-card:hover .featured__side-image img {
  transform: none;
}

.featured__side-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 20%,
    rgba(10, 22, 40, 0.5) 60%,
    rgba(10, 22, 40, 0.85) 100%
  );
  z-index: 2;
}

.featured__side-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  z-index: 3;
}

.featured__side-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: var(--color-autumn-red);
  color: var(--color-white);
  font-family: var(--font-accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}

/* Season-specific badge colors */
.featured__side-badge--winter,
.featured__main-badge--winter {
  background: var(--color-navy);
}

.featured__side-badge--all-season,
.featured__main-badge--all-season {
  background: var(--color-forest);
}

.featured__side-badge--activity,
.featured__main-badge--activity {
  background: var(--color-orange);
}

.featured__side-title {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.2vw, 1.05rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-white);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Excerpt hidden on desktop for side cards */
.featured__side-excerpt { display: none; }

/* Dots hidden on desktop (JS also hides, this is fallback) */
.featured__dots { display: none; }

/* --- Category Navigation --- */
.categories {
  padding: 7rem 0;
  background: var(--color-cream);
  position: relative;
  overflow: hidden;
}

.categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.category-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.category-card__image {
  position: absolute;
  inset: 0;
}

.category-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out-expo);
}

.category-card:hover .category-card__image img {
  transform: none;
}

.category-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.25) 40%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.category-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xl);
  z-index: 3;
}


.category-card__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-xs);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.category-card__count {
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-glacier);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.category-card__arrow {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  z-index: 3;
  opacity: 0;
  transform: translateX(-10px);
  transition: all var(--transition-base);
}

.category-card:hover .category-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* --- Latest Articles Grid --- */
.latest {
  padding: 7rem 0 var(--space-5xl);
}

.latest__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.latest__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .featured__grid {
    grid-template-columns: 1fr 1fr;
  }

  .featured__main {
    min-height: 360px;
  }

  .featured__side-card {
    min-height: 200px;
  }

  .categories__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .latest__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  /* Mobile carousel — grid becomes overflow viewport, track slides inside */
  .featured__grid {
    display: block;
    overflow: hidden;
  }

  .featured__track {
    display: flex;
    gap: 16px;
    transition: transform 0.35s ease;
  }

  .featured__side {
    display: none; /* JS moves cards out; hide empty wrapper */
  }

  .featured__main,
  .featured__side-card {
    flex: 0 0 100%;
    min-width: 0;
    min-height: 420px;
    border-radius: var(--radius-lg);
  }

  .featured__main {
    min-height: 420px;
  }

  /* Unify side-card layout to match main card on mobile */
  .featured__side-overlay {
    background: linear-gradient(180deg,
      transparent 30%,
      rgba(10, 22, 40, 0.5) 60%,
      rgba(10, 22, 40, 0.9) 100%
    );
  }

  .featured__side-content {
    padding: var(--space-2xl);
  }

  .featured__side-badge {
    padding: 0.35rem 0.85rem;
    font-size: 0.7rem;
    margin-bottom: var(--space-md);
  }

  .featured__side-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.25;
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
  }

  .featured__side-excerpt {
    font-size: 0.95rem;
    color: var(--color-glacier);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Dot indicators */
  .featured__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-lg);
  }

  .featured__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--color-glacier, #b0bec5);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
  }

  .featured__dot.active {
    background: var(--color-autumn-red, #c0392b);
  }

  .categories__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .category-card {
    aspect-ratio: 1 / 1.1;
  }

  .latest__grid {
    grid-template-columns: 1fr;
  }

  .latest__header {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
  }
}
