/* ==========================================================================
   Food Arcade — Editorial / article styles
   Long-form reading layout, table of contents, author box, key takeaways.
   ========================================================================== */

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--fa-sp-6);
  align-items: start;
  padding-block: var(--fa-sp-6);
}

.article-main {
  min-width: 0;
}

/* ------------------------------------------------------------------
   Article header
   ------------------------------------------------------------------ */
.article-header {
  margin-bottom: var(--fa-sp-5);
  padding-bottom: var(--fa-sp-5);
  border-bottom: 1px solid var(--fa-line);
}

.article-header h1 {
  font-size: var(--fa-step-4);
  margin-bottom: var(--fa-sp-3);
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: var(--fa-sp-3);
}

.article-dek {
  font-size: var(--fa-step-1);
  color: var(--fa-ink-2);
  line-height: 1.55;
  margin-bottom: var(--fa-sp-4);
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--fa-text-muted);
}

.byline-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: 0 0 42px;
  background: linear-gradient(140deg, var(--fa-amber), var(--fa-tomato));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: var(--fa-shadow-sm);
}

.byline-text strong {
  display: block;
  color: var(--fa-ink);
  font-size: 0.92rem;
}

.byline-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
}

/* Featured image placeholder built from CSS (no external asset needed) */
.article-figure {
  margin: 0 0 var(--fa-sp-5);
}

.article-figure img {
  width: 100%;
  border-radius: var(--fa-radius-lg);
  box-shadow: var(--fa-shadow-sm);
}

.article-figure figcaption {
  font-size: 0.8rem;
  color: var(--fa-text-muted);
  margin-top: 0.5rem;
  text-align: center;
}

.figure-canvas {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: var(--fa-radius-lg);
  background: linear-gradient(140deg, var(--f1, #ffb02e), var(--f2, #e8452c));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--fa-shadow-sm);
}

.figure-canvas::before {
  content: "";
  position: absolute;
  inset: -20%;
  background-image: radial-gradient(circle at 16% 30%, rgba(255, 255, 255, 0.3) 0 22px, transparent 23px),
    radial-gradient(circle at 84% 22%, rgba(255, 255, 255, 0.2) 0 30px, transparent 31px),
    radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.08) 0 40px, transparent 41px);
}

.figure-canvas span {
  position: relative;
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}

/* ------------------------------------------------------------------
   Table of contents
   ------------------------------------------------------------------ */
.toc {
  background: var(--fa-surface-2);
  border: 1px solid var(--fa-line);
  border-left: 4px solid var(--fa-amber);
  border-radius: var(--fa-radius);
  padding: var(--fa-sp-4) var(--fa-sp-5);
  margin-bottom: var(--fa-sp-6);
}

.toc h2 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fa-ink-3);
  margin-bottom: var(--fa-sp-3);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  columns: 2;
  column-gap: var(--fa-sp-5);
}

.toc li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

.toc a {
  color: var(--fa-ink-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--fa-tomato-dark);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .toc ol {
    columns: 1;
  }
}

/* ------------------------------------------------------------------
   Article body
   ------------------------------------------------------------------ */
.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--fa-ink-2);
  max-width: 72ch;
}

.article-body > h2 {
  font-size: var(--fa-step-2);
  margin-top: var(--fa-sp-7);
  margin-bottom: var(--fa-sp-3);
  scroll-margin-top: calc(var(--fa-header-h) + 16px);
  padding-top: var(--fa-sp-2);
}

.article-body > h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--fa-amber), var(--fa-tomato));
  margin-bottom: var(--fa-sp-3);
}

.article-body h3 {
  font-size: var(--fa-step-1);
  margin-top: var(--fa-sp-5);
  margin-bottom: var(--fa-sp-2);
  scroll-margin-top: calc(var(--fa-header-h) + 16px);
  color: var(--fa-ink);
}

.article-body h4 {
  font-size: 1.02rem;
  margin-top: var(--fa-sp-4);
  margin-bottom: var(--fa-sp-2);
  color: var(--fa-ink);
}

.article-body p {
  margin-bottom: var(--fa-sp-4);
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--fa-sp-4);
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  color: var(--fa-tomato-dark);
  font-weight: 600;
}

.article-body img {
  border-radius: var(--fa-radius);
  margin-block: var(--fa-sp-4);
}

.article-body > .panel,
.article-body > .table-wrap,
.article-body > .callout {
  margin-block: var(--fa-sp-5);
}

/* Callouts */
.callout {
  border-radius: var(--fa-radius);
  padding: var(--fa-sp-4) var(--fa-sp-5);
  border: 1px solid var(--fa-line);
  background: var(--fa-surface);
  position: relative;
}

.callout h3,
.callout h4,
.callout .callout-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-family: var(--fa-font-display);
  font-weight: 800;
  color: var(--fa-ink);
  font-size: 1rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

.callout--tip {
  background: var(--fa-basil-soft);
  border-color: color-mix(in srgb, var(--fa-basil) 35%, transparent);
}

.callout--warn {
  background: var(--fa-tomato-soft);
  border-color: color-mix(in srgb, var(--fa-tomato) 35%, transparent);
}

.callout--note {
  background: var(--fa-amber-soft);
  border-color: color-mix(in srgb, var(--fa-amber) 45%, transparent);
}

.callout--example {
  background: var(--fa-berry-soft);
  border-color: color-mix(in srgb, var(--fa-berry) 30%, transparent);
}

/* Key takeaways */
.takeaways {
  background: var(--fa-surface);
  border: 2px solid var(--fa-amber);
  border-radius: var(--fa-radius-lg);
  padding: var(--fa-sp-5);
  margin-block: var(--fa-sp-6);
  box-shadow: var(--fa-shadow-sm);
}

.takeaways h2 {
  font-size: var(--fa-step-1);
  margin-top: 0 !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.takeaways h2::before {
  display: none;
}

.takeaways ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

.takeaways li {
  margin-bottom: 0.6rem;
}

/* Inline "play this" CTA inside articles */
.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fa-sp-4);
  align-items: center;
  background: linear-gradient(135deg, var(--fa-amber-soft), var(--fa-tomato-soft));
  border: 1px solid var(--fa-line);
  border-radius: var(--fa-radius-lg);
  padding: var(--fa-sp-5);
  margin-block: var(--fa-sp-6);
}

.inline-cta-body {
  flex: 1 1 240px;
}

.inline-cta h3 {
  margin-top: 0 !important;
  margin-bottom: 0.3rem;
  font-size: 1.15rem;
}

.inline-cta p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--fa-ink-2);
}

/* References */
.references {
  font-size: 0.88rem;
  background: var(--fa-surface-2);
  border: 1px solid var(--fa-line);
  border-radius: var(--fa-radius);
  padding: var(--fa-sp-4) var(--fa-sp-5);
  margin-block: var(--fa-sp-5);
}

.references h2 {
  font-size: 0.95rem !important;
  margin-top: 0 !important;
  margin-bottom: var(--fa-sp-3) !important;
}

.references h2::before {
  display: none;
}

.references ol {
  margin-bottom: 0;
  padding-left: 1.3rem;
}

.references li {
  margin-bottom: 0.45rem;
  color: var(--fa-text-muted);
}

/* ------------------------------------------------------------------
   Author box
   ------------------------------------------------------------------ */
.author-box {
  display: flex;
  gap: var(--fa-sp-4);
  align-items: flex-start;
  background: var(--fa-surface);
  border: 1px solid var(--fa-line);
  border-radius: var(--fa-radius-lg);
  padding: var(--fa-sp-5);
  margin-block: var(--fa-sp-6);
  box-shadow: var(--fa-shadow-sm);
}

.author-box .author-avatar {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--fa-amber), var(--fa-tomato));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: var(--fa-shadow-sm);
}

.author-portrait {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--fa-shadow-sm);
}

.author-box h2,
.author-box h3 {
  font-size: 1.05rem;
  margin-top: 0 !important;
  margin-bottom: 0.15rem;
}

.author-box h2::before {
  display: none;
}

.author-role {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--fa-tomato-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.author-box p {
  font-size: 0.9rem;
  color: var(--fa-text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .author-box {
    flex-direction: column;
  }
}

/* ------------------------------------------------------------------
   Article sidebar
   ------------------------------------------------------------------ */
.article-sidebar {
  position: sticky;
  top: calc(var(--fa-header-h) + var(--fa-sp-4));
  display: grid;
  gap: var(--fa-sp-4);
  font-size: 0.9rem;
}

.sidebar-block {
  background: var(--fa-surface);
  border: 1px solid var(--fa-line);
  border-radius: var(--fa-radius);
  padding: var(--fa-sp-4);
  box-shadow: var(--fa-shadow-sm);
}

.sidebar-block h2 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fa-ink-3);
  margin-bottom: var(--fa-sp-3);
}

.sidebar-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-block li {
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed var(--fa-line);
  line-height: 1.4;
}

.sidebar-block li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.sidebar-block a {
  color: var(--fa-ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.sidebar-block a:hover {
  color: var(--fa-tomato-dark);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-sidebar {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .article-body {
    max-width: none;
  }
}

/* ------------------------------------------------------------------
   Article index listing
   ------------------------------------------------------------------ */
.cluster-block {
  margin-bottom: var(--fa-sp-6);
}

.cluster-block > h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fa-step-2);
  padding-bottom: var(--fa-sp-2);
  border-bottom: 2px solid var(--fa-line);
  margin-bottom: var(--fa-sp-4);
}

.cluster-block > h2 .badge {
  font-size: 0.65rem;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.article-list li {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--fa-surface);
  border: 1px solid var(--fa-line);
  border-radius: var(--fa-radius-sm);
  transition: border-color var(--fa-transition), transform var(--fa-transition);
}

.article-list li:hover {
  border-color: var(--fa-tomato);
  transform: translateX(2px);
}

.article-list a {
  color: var(--fa-ink);
  text-decoration: none;
  font-weight: 700;
  display: block;
}

.article-list a:hover {
  color: var(--fa-tomato-dark);
}

.article-list p {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--fa-text-muted);
}

.article-list .meta {
  font-size: 0.74rem;
  color: var(--fa-ink-4);
  margin-top: 0.3rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
