/**
 * @file
 * Article: article layout, typography, related cards, article-only overrides.
 *
 * Rules from design/article.css that differ from or extend the shared theme.
 * Class names and selectors preserved from the approved article prototype.
 */

body {
  line-height: 1.8;
}

/* Paragraph text size — tablet vs big screens */
@media (min-width: 768px) {
  .article-wrap p,
  .lead p,
  .content p {
    font-size: 20px;
  }

  .lead {
    font-size: 20px;
  }
  li {
    font-size: 18px;
}
}

@media (min-width: 1200px) {
  .article-wrap p,
  .lead p,
  .content p {
    font-size: 20px;
  }

  .lead {
    font-size: 20px;
  }
  li {
    font-size: 18px;
}
}

/* Shared site header is multi-row. Do not collapse it into the old single bar. */
header.site-header {
  display: block;
  padding: 0;
  background: #fff;
  color: inherit;
}

.article-wrap {
  width: min(70%, 1000px);
  margin: 30px auto;
  background: #fff;
  padding: 30px;
}

.article-ad-row {
  width: 100%;
  max-width: 100%;
  margin: 0 0 24px;
}

.article-ad-row:not(:has(.advertisement)) {
  display: none;
}

.article-ad-row .advertisement {
  margin: 0;
  width: 100%;
  max-width: 100%;
}

.article-ad-row img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 992px) {
  .article-wrap {
    width: min(92%, 1000px);
    padding: 24px 20px;
  }
}

@media (max-width: 768px) {
  .article-wrap {
    width: 100%;
    margin: 0;
    padding: 18px;
  }
}

/* Category badge — red to match brand (overrides article prototype black). */
.cat {
  background: var(--red, #c1121f);
  color: #fff;
  padding: 6px 12px;
  border-radius: 0;
  font-size: inherit;
}

.lead {
  border-top: 4px solid #c1121f;
  border-bottom: 4px solid #c1121f;
  padding: 18px 0;
  margin: 24px 0;
  font-style: oblique;
}

/* CKEditor inline paragraph styles (also available in editor Style dropdown). */
.redline-lead {
  padding: 11.5px 25px;
  margin-left: 30px;
  font-size: 18.5px;
  border-left: 8px solid #cf290f;
  color: #23569C;
}

.border-left-red {
  padding: 11.5px 25px;
  margin-left: 30px;
  font-size: 18.5px;
  border-left: 8px solid #23569C;
  color: #cf290f;
}

/*
 * In-body and gallery images stay full content width.
 * The featured image is .article-featured (medium image style), not these rules.
 */
.article-wrap > img,
.article-wrap > picture,
.content img {
  width: 100%;
  margin-top: 24px;
  border-radius: 8px;
  height: auto;
  display: block;
}

/* Article full featured image: medium style, centered, natural ratio. */
.article-featured {
  margin-top: 24px;
  text-align: center;
}

.article-featured img {
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-top: 0;
  border-radius: 8px;
  vertical-align: middle;
}

/*
 * Editorial, cover story, കാഴ്ചപ്പാട്, and സംവാദം.
 * Same frame as .hero-card: nellu_hero responsive image, 8:5, object-fit cover.
 * Width matches the homepage hero column (.section max 1400px, 24px padding,
 * .top50 20px gap, two equal columns) and never exceeds the article column.
 * Below 992px the hero column itself becomes one column, so the image fills
 * the article column instead.
 */
.article-featured.article-featured--hero {
  width: min(100%, calc((min(100vw, 1400px) - 48px - 20px) / 2));
  margin-inline: auto;
  text-align: center;
}

.article-featured.article-featured--hero .field,
.article-featured.article-featured--hero .media,
.article-featured.article-featured--hero picture {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.article-featured.article-featured--hero picture {
  aspect-ratio: 8 / 5;
}

.article-featured.article-featured--hero img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin-top: 0;
  margin-inline: auto;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 12px;
  vertical-align: top;
}

@media (max-width: 992px) {
  .article-featured.article-featured--hero {
    width: 100%;
  }
}

.article-wrap > picture img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* Category badge may wrap a taxonomy term link from Drupal. */
.article-wrap .cat a {
  color: inherit;
  text-decoration: none;
}

.article-wrap .meta a {
  color: inherit;
  text-decoration: none;
}

.article-wrap h1 {
  margin: 16px 0 8px;
  line-height: 1.3;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.article-wrap .meta {
  margin-bottom: 8px;
  color: #444;
}

/* Remote video embeds from paragraph video / Media oEmbed. */
.content .media--type-remote-video,
.content .paragraph--type--video {
  margin-top: 24px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}

.content .media--type-remote-video iframe,
.content .paragraph--type--video iframe,
.content .media-oembed-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.content .paragraph--type--gallery {
  margin-top: 24px;
}

.content .paragraph--type--gallery img {
  margin-top: 16px;
}

.content .paragraph--type--gallery img:first-child {
  margin-top: 0;
}

.related-articles {
  margin-top: 40px;
}

.related-articles h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

/* Related articles grid (article prototype values). */
.grid6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-top: 0;
}

.card1 {
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/*
 * Related cards — square thumbs (prototype 120×120).
 * Crop from nellu_related_* (1:1). Homepage .card1 rules do not apply the
 * 30%/120px strip here because .related-articles / .grid6 use block cards.
 */
.related-articles .card1 img,
.grid6 .card1 img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.card1 div {
  padding: 10px;
}

.label {
  background: #c1121f;
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
}

/* Article prototype simple footer (when used without .footer). */
footer:not(.footer) {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 30px;
}

@media (max-width: 1400px) {
  .grid6 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .grid6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .grid6 {
    grid-template-columns: 1fr;
  }

  .related-articles .card1,
  .grid6 .card1 {
    display: grid;
    grid-template-columns: 90px 1fr;
  }

  .related-articles .card1 img,
  .grid6 .card1 img {
    width: 90px;
    height: 90px;
    aspect-ratio: 1 / 1;
    max-width: none;
  }
}

/* —— Column article full page —— */
.article-wrap--column .column-rule {
  border: 0;
  border-top: 3px solid var(--red, #c1121f);
  margin: 16px 0 24px;
  height: 0;
}

.column-byline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.column-byline__text {
  text-align: right;
  justify-self: stretch;
}

.column-byline__author {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
}

.column-byline__date {
  display: block;
  margin-top: 6px;
  color: #444;
}

.column-byline__photo {
  justify-self: start;
  width: 100%;
  max-width: 220px;
}

.column-byline__photo img,
.column-byline__photo picture {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.column-byline__photo-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e8e8e8;
  border-radius: 8px;
}

.column-content {
  position: relative;
}

.column-quote {
  margin: 0 0 12px;
  color: var(--red, #c1121f);
  line-height: 0;
}

.column-quote__icon {
  display: block;
  width: 42px;
  height: 42px;
  opacity: 0.9;
}

.article-wrap--column .column-content .field--name-body,
.article-wrap--column .column-content .field--name-field-post-paragraph {
  margin-top: 0;
}

@media (max-width: 768px) {
  .column-byline {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .column-byline__text {
    text-align: left;
  }

  .column-byline__photo {
    max-width: 200px;
    justify-self: start;
  }
}
