/* Classic template composition. Loaded only when data-template="classic".
   Digest and any future template must ship their own skin. Uses existing
   theme tokens and CSS logical properties for RTL/LTR. */

html[data-template="classic"] {
  overflow-x: clip;
}

[data-template="classic"] {
  --classic-hero-content: minmax(16rem, 0.42fr);
  --classic-hero-media: minmax(0, 0.58fr);
  --classic-ink: var(--color-text);
  --classic-band: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  --classic-band-edge: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
  --classic-rule: color-mix(in srgb, var(--color-primary) 72%, var(--color-text));
}

[data-template="classic"] .site-header {
  border-block-end: 0;
}

[data-template="classic"] .site-masthead {
  padding-block: 0.7rem;
}

[data-template="classic"] .site-brand {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}

[data-template="classic"] .site-nav-row {
  padding-block: 0.3rem;
}

[data-template="classic"] .site-nav a {
  font-weight: 650;
}

/* -------------------------------------------------------------------------- */
/* Homepage hero carousel: content column + cover image, not text-over-image. */
/* -------------------------------------------------------------------------- */

[data-template="classic"] .news-carousel {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--color-surface);
  border-block-end: 1px solid var(--color-border);
  isolation: isolate;
}

[data-template="classic"] .news-carousel-track {
  position: relative;
  width: 100%;
}

[data-template="classic"] .news-carousel-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--classic-hero-content) var(--classic-hero-media);
  grid-template-areas: "content media";
  align-items: stretch;
  min-height: 22rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

[data-template="classic"] .news-carousel-slide.is-active {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

[data-template="classic"] .news-carousel-body {
  grid-area: content;
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding-block: 1.75rem;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  color: var(--color-text);
  text-align: start;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  background: var(--color-surface);
}

[data-template="classic"] .news-carousel-body .news-eyebrow {
  color: var(--color-primary);
  background: transparent;
  padding: 0;
  border-radius: 0;
  width: max-content;
  max-width: 100%;
}

[data-template="classic"] .news-carousel-body .news-eyebrow:hover {
  background: transparent;
  text-decoration: underline;
}

[data-template="classic"] .news-carousel-title {
  margin: 0.35rem 0 0.15rem;
  font-size: clamp(1.35rem, 1.2rem + 1.6vw, 2.35rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: none;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
  max-width: 100%;
}

[data-template="classic"] .news-carousel-title a {
  color: inherit;
  text-decoration: none;
}

[data-template="classic"] .news-carousel-title a:hover {
  text-decoration: underline;
}

[data-template="classic"] .news-carousel-summary {
  margin: 0.35rem 0 0.5rem;
  max-width: 42ch;
  color: var(--color-muted);
  text-shadow: none;
  overflow-wrap: break-word;
  word-break: normal;
}

[data-template="classic"] .news-carousel-body .news-card-date {
  color: var(--color-muted);
  margin-block: 0.15rem 0.5rem;
}

[data-template="classic"] .news-carousel-media {
  grid-area: media;
  min-width: 0;
  position: relative;
  display: block;
  overflow: hidden;
  z-index: 0;
  background: var(--color-bg);
  min-height: 22rem;
  height: 100%;
}

[data-template="classic"] .news-carousel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* No full-image dark overlay: primary text lives in the content column. */
[data-template="classic"] .news-carousel-media::after {
  content: none;
}

[data-template="classic"] .news-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding-block: 0.65rem;
  padding-inline: 1rem;
  background: var(--color-surface);
  border-block-start: 1px solid var(--color-border);
}

[data-template="classic"] .news-carousel-btn {
  position: static;
  inset: auto;
  transform: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-subtle);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

[data-template="classic"] .news-carousel-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-muted);
}

[data-template="classic"] .news-carousel-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

[data-template="classic"] .news-carousel-prev,
[data-template="classic"] .news-carousel-next {
  inset: auto;
}

html[dir="rtl"][data-template="classic"] .news-carousel-prev span,
html[dir="rtl"][data-template="classic"] .news-carousel-next span {
  transform: scaleX(-1);
  display: inline-block;
}

[data-template="classic"] .news-carousel-dots {
  position: static;
  inset: auto;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  z-index: auto;
}

[data-template="classic"] .news-carousel-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-subtle);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

[data-template="classic"] .news-carousel-dot:hover {
  background: var(--color-muted);
}

[data-template="classic"] .news-carousel-dot.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.15);
}

[data-template="classic"] .news-carousel-dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

html:not(.js)[data-template="classic"] .news-carousel-track {
  aspect-ratio: auto;
  max-height: none;
}

html:not(.js)[data-template="classic"] .news-carousel-slide {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  margin-block-end: 0;
  border-block-end: 1px solid var(--color-border);
}

@media (prefers-reduced-motion: reduce) {
  [data-template="classic"] .news-carousel-slide {
    transition: none;
  }
}

@media (max-width: 900px) {
  [data-template="classic"] .news-carousel-slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "media"
      "content";
    min-height: 0;
  }

  [data-template="classic"] .news-carousel-media {
    min-height: 12rem;
    max-height: 18rem;
    aspect-ratio: 16 / 9;
    height: auto;
  }

  [data-template="classic"] .news-carousel-body {
    padding-block: 1.15rem 1.35rem;
    padding-inline: 1.1rem;
  }

  [data-template="classic"] .news-carousel-title {
    font-size: clamp(1.25rem, 5vw, 1.7rem);
    text-wrap: pretty;
  }

  [data-template="classic"] .news-carousel-summary {
    max-width: none;
  }

  [data-template="classic"] .news-carousel-btn {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.2rem;
  }
}

@media (max-width: 430px) {
  [data-template="classic"] .news-carousel-title,
  [data-template="classic"] .news-carousel-summary {
    overflow-wrap: anywhere;
  }
}

/* -------------------------------------------------------------------------- */
/* Cards: cover on top, semantic title/metadata below. No headline overlay.  */
/* -------------------------------------------------------------------------- */

[data-template="classic"] .classic-news-card:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

[data-template="classic"] .classic-news-card .news-card-media {
  aspect-ratio: 16 / 9;
}

[data-template="classic"] .classic-news-card .news-card-media img {
  object-fit: cover;
  object-position: center;
}

[data-template="classic"] .classic-news-card .news-card-body {
  text-align: start;
}

[data-template="classic"] .classic-news-card .news-card-body .news-eyebrow {
  margin-block-end: 0.35rem;
}

[data-template="classic"] .classic-news-card .news-card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

[data-template="classic"] .classic-news-card .news-card-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
}

[data-template="classic"] .classic-news-card .news-card-title a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Article/detail: keep the semantic h1 out of the cover image. */
[data-template="classic"] .article > h1,
[data-template="classic"] .article h1 {
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
  line-height: 1.25;
}

[data-template="classic"] .article-hero {
  display: block;
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
  object-position: center;
  border-radius: 0.5rem;
  margin-block: 1rem 1.25rem;
}

/* -------------------------------------------------------------------------- */
/* Classic homepage: editorial strip + carded story grids.                   */
/* -------------------------------------------------------------------------- */

[data-template="classic"] .home-classic {
  display: flex;
  flex-direction: column;
  gap: 2.35rem;
  padding-block: 0.65rem 3.25rem;
  max-width: 76rem;
  min-width: 0;
}

[data-template="classic"] .home-classic img {
  max-width: 100%;
}

[data-template="classic"] .home-masthead {
  margin: 0;
  padding-block: 0.1rem 0;
}

[data-template="classic"] .home-masthead h1 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--color-muted);
  overflow-wrap: break-word;
}

[data-template="classic"] .home-masthead .muted {
  margin-block-start: 0.2rem;
  margin-block-end: 0;
  max-width: 40rem;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-muted);
}

[data-template="classic"] .home-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-block-end: 1.05rem;
  padding-block-end: 0.65rem;
  border-block-end: 1px solid var(--color-border);
}

[data-template="classic"] .home-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--color-text);
  overflow-wrap: break-word;
  padding-block-end: 0.12rem;
  border-block-end: 2px solid var(--classic-rule);
}

[data-template="classic"] .home-section-title a {
  color: inherit;
  text-decoration: none;
}

[data-template="classic"] .home-section-title a:hover {
  color: var(--color-primary);
}

[data-template="classic"] .home-section-all,
[data-template="classic"] .home-view-all-link {
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

[data-template="classic"] .home-section-all:hover,
[data-template="classic"] .home-view-all-link:hover {
  text-decoration: underline;
}

[data-template="classic"] .home-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-muted);
}

[data-template="classic"] .home-top-stories {
  min-width: 0;
}

[data-template="classic"] .home-top-stories-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
}

[data-template="classic"] .home-top-stories-lead {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

[data-template="classic"] .home-top-stories-media {
  display: block;
  overflow: hidden;
  background: var(--color-subtle);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}

[data-template="classic"] .home-top-stories-media img,
[data-template="classic"] .home-story-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

[data-template="classic"] .home-top-stories-media:hover img,
[data-template="classic"] .home-story-card-media:hover img {
  transform: scale(1.035);
}

[data-template="classic"] .home-top-stories-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.35rem;
  min-width: 0;
}

[data-template="classic"] .home-top-stories-title {
  margin: 0;
  font-size: clamp(1.35rem, 1.15rem + 1.1vw, 2rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

[data-template="classic"] .home-top-stories-title a {
  color: inherit;
  text-decoration: none;
}

[data-template="classic"] .home-top-stories-title a:hover {
  color: var(--color-primary);
}

[data-template="classic"] .home-top-stories-summary {
  margin: 0;
  max-width: 42rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-muted);
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

[data-template="classic"] .home-top-stories-pair {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

[data-template="classic"] .home-top-stories-list {
  min-width: 0;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.35rem 0.15rem;
}

[data-template="classic"] .home-top-stories-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

[data-template="classic"] .home-top-stories-list-item {
  padding: 0.85rem 1rem;
  border-block-end: 1px solid var(--color-border);
}

[data-template="classic"] .home-top-stories-list-item:first-child {
  padding-block-start: 0.95rem;
}

[data-template="classic"] .home-top-stories-list-item:last-child {
  border-block-end: 0;
  padding-block-end: 0.95rem;
}

[data-template="classic"] .home-top-stories-list-item:hover {
  background: var(--classic-band);
}

[data-template="classic"] .home-top-stories-list .news-eyebrow {
  color: var(--color-primary);
}

[data-template="classic"] .home-top-stories-list-title {
  margin: 0.2rem 0 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

[data-template="classic"] .home-top-stories-list-title a {
  color: inherit;
  text-decoration: none;
}

[data-template="classic"] .home-top-stories-list-title a:hover {
  color: var(--color-primary);
}

[data-template="classic"] .home-story-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

[data-template="classic"] .home-story-card-media {
  display: block;
  overflow: hidden;
  background: var(--color-subtle);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}

[data-template="classic"] .home-card-grid .home-story-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0 0 0.85rem;
  overflow: hidden;
}

[data-template="classic"] .home-card-grid .home-story-card-media {
  border-radius: 0;
}

[data-template="classic"] .home-card-grid .home-story-card-body {
  padding-inline: 0.85rem;
}

[data-template="classic"] .home-story-card-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0.22rem;
  min-width: 0;
}

[data-template="classic"] .home-story-card-title {
  margin: 0;
  font-size: clamp(0.98rem, 0.92rem + 0.28vw, 1.12rem);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

[data-template="classic"] .home-story-card-title a {
  color: inherit;
  text-decoration: none;
}

[data-template="classic"] .home-story-card-title a:hover {
  color: var(--color-primary);
}

[data-template="classic"] .home-story-card-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--color-muted);
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

[data-template="classic"] .home-classic .news-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
}

[data-template="classic"] .home-news {
  display: flex;
  flex-direction: column;
  gap: 2.1rem;
}

[data-template="classic"] .home-card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem 1.15rem;
  min-width: 0;
}

[data-template="classic"] .home-view-all {
  margin: 0;
}

@media (min-width: 641px) {
  [data-template="classic"] .home-top-stories-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  [data-template="classic"] .home-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-template="classic"] .home-card-grid[data-count="1"] {
    grid-template-columns: minmax(0, 22rem);
  }
}

@media (min-width: 960px) {
  [data-template="classic"] .home-top-stories-grid {
    gap: 0;
    align-items: stretch;
  }

  [data-template="classic"] .home-top-stories-grid:has(.home-top-stories-pair):has(.home-top-stories-list) {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.92fr);
  }

  [data-template="classic"] .home-top-stories-grid:has(.home-top-stories-pair):not(:has(.home-top-stories-list)) {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  [data-template="classic"] .home-top-stories-grid:has(.home-top-stories-pair) .home-top-stories-pair {
    grid-column: 2 / 4;
    align-self: stretch;
    gap: 0;
    padding-inline: 1.15rem;
    border-inline: 1px solid var(--color-border);
  }

  [data-template="classic"] .home-top-stories-pair > .home-story-card + .home-story-card {
    border-inline-start: 1px solid var(--color-border);
    padding-inline-start: 1.15rem;
    margin-inline-start: 1.15rem;
  }

  [data-template="classic"] .home-top-stories-grid:has(.home-top-stories-list) .home-top-stories-list {
    grid-column: 4;
    align-self: stretch;
    margin-inline-start: 1.15rem;
  }

  [data-template="classic"] .home-top-stories-lead {
    padding-inline-end: 1.15rem;
  }

  [data-template="classic"] .home-top-stories-title {
    font-size: clamp(1.28rem, 1.1rem + 0.7vw, 1.7rem);
  }
}

@media (min-width: 1100px) {
  [data-template="classic"] .home-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  [data-template="classic"] .home-card-grid[data-count="1"] {
    grid-template-columns: minmax(0, 22rem);
  }

  [data-template="classic"] .home-card-grid[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 46rem;
  }

  [data-template="classic"] .home-card-grid[data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 70rem;
  }
}

@media (max-width: 430px) {
  [data-template="classic"] .home-top-stories-title,
  [data-template="classic"] .home-top-stories-summary,
  [data-template="classic"] .home-story-card-title,
  [data-template="classic"] .home-story-card-summary {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-template="classic"] .home-top-stories-media img,
  [data-template="classic"] .home-story-card-media img {
    transition: none;
  }

  [data-template="classic"] .home-top-stories-media:hover img,
  [data-template="classic"] .home-story-card-media:hover img {
    transform: none;
  }
}
