/**
 * Legal articles index — isolated (do not mix with home-standard.css).
 * Constitutions #03 / #22 · Gold #c5a059 · Tajawal / Inter local.
 */

body[data-page="legal-articles"] .site-main {
  --ai-gold: #c5a059;
  --ai-ink: #1a1a1a;
  --ai-muted: #5b5b5b;
  --ai-mist: #f7f5f1;
  --ai-line: rgba(11, 11, 11, 0.08);
  font-family: "Tajawal", system-ui, sans-serif;
  background: #fff;
  color: var(--ai-ink);
  max-width: 100%;
  overflow-x: hidden;
}

html[lang="en"] body[data-page="legal-articles"] .site-main {
  font-family: "Inter", system-ui, sans-serif;
}

.articles-index {
  background: #fff;
  width: 100%;
  overflow-x: hidden;
}

.articles-wrap {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
  box-sizing: border-box;
}

.articles-hero {
  position: relative;
  isolation: isolate;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
  overflow: hidden;
  border-bottom: 3px solid var(--ai-gold);
}

.articles-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  z-index: 0;
}

.articles-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.58) 0%, rgba(10, 10, 10, 0.78) 100%),
    linear-gradient(90deg, rgba(197, 160, 89, 0.28) 0%, transparent 58%);
}

.articles-hero__inner {
  position: relative;
  z-index: 2;
  padding: 48px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.articles-crumb {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.articles-crumb a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.articles-crumb a:hover {
  color: var(--ai-gold);
}

.articles-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem);
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.articles-hero__rule {
  display: block;
  width: 64px;
  height: 3px;
  margin: 14px auto 16px;
  background: var(--ai-gold);
  border-radius: 2px;
}

.articles-hero__lede {
  margin: 0;
  max-width: 36em;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.02rem;
  line-height: 1.8;
}

.articles-body {
  background: var(--ai-mist);
  padding: 40px 0 64px;
}

.articles-empty {
  margin: 0;
  text-align: center;
  color: var(--ai-muted);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

/* Tablet: 2 columns */
@media (min-width: 720px) and (max-width: 1023px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Desktop only: 3 cards per row */
@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.articles-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(11, 11, 11, 0.05);
}

.articles-card__media {
  display: block;
  background: #111;
}

.articles-card__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.articles-card__body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 18px 20px 20px;
}

.articles-card__kicker {
  margin: 0;
  color: #8a5a10;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
}

.articles-card__title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}

.articles-card__title a {
  display: inline;
  color: var(--ai-ink);
  text-decoration: none;
}

.articles-card__title a:hover {
  color: #8a5a10;
}

.articles-card__excerpt {
  margin: 0;
  color: var(--ai-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-card__more {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--ai-gold);
  color: #111;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.articles-card__more:hover {
  filter: brightness(1.06);
  color: #111;
}
