/* SWFL Spotlight — Article component styles
 *
 * Extracted from ui_kits/article_samples/06-arts-and-beats-artwalk-recap.html
 * All selectors scoped under .swfl-article so generic class names (.hero,
 * .body, .cta, .facts, etc.) don't collide with theme defaults.
 *
 * Design tokens referenced via var(--swfl-*) — see swfl-tokens.css.
 *
 * Usage in a block pattern: wrap the article body in
 *   <div class="swfl-article"> ... </div>
 * and the rest of the classes (hero, pullq, facts, etc.) "just work".
 */

/* ---------- Hero ---------- */
.swfl-article .hero {
  padding: 72px 32px 40px;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.swfl-article .series {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--swfl-teal-deep);
  text-transform: uppercase;
}
.swfl-article .hero h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 56px;
  line-height: 1.06;
  margin: 16px 0 18px;
  letter-spacing: -0.015em;
  color: var(--swfl-slate);
}
.swfl-article .hero .dek {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--fg-3);
  max-width: 54ch;
  margin: 0 auto;
}
.swfl-article .hero .meta {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--fg-3);
  font-size: 13px;
}
/* Author avatar — .av is a core/image wrapper (figure); style both the
 * figure and the inner <img> so it becomes a 42px circle whether Melannie
 * has uploaded an image or not. */
.swfl-article .av,
.swfl-article figure.wp-block-image.av {
  width: 42px;
  height: 42px;
  margin: 0;
  flex-shrink: 0;
}
.swfl-article .av img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.swfl-article .meta .line {
  text-align: left;
  line-height: 1.35;
}
.swfl-article .meta .line b {
  color: var(--swfl-slate);
  font-weight: var(--fw-bold);
}

/* ---------- Hero image ---------- */
.swfl-article .heroimg {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 0 32px;
}
.swfl-article .heroimg .frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-md);
}
.swfl-article .heroimg .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.swfl-article .heroimg .frame .bug {
  position: absolute;
  top: 18px;
  left: 18px;
  background: var(--swfl-slate);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.swfl-article .heroimg .frame .bug a {
  color: inherit;
  text-decoration: none;
}
.swfl-article .heroimg .frame .bug::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swfl-amber);
}
.swfl-article .heroimg .cap {
  font-style: italic;
  font-size: 13px;
  color: var(--fg-3);
  margin-top: 12px;
  text-align: center;
}

/* ---------- Body layout (2-col) ----------
 * .layout may render as core/columns (flex) from a block pattern — override
 * to grid so the 1fr + 320px sidebar ratio is exact, not flex-proportional.
 */
.swfl-article .layout,
.swfl-article .wp-block-columns.layout {
  max-width: 1120px;
  margin: 56px auto 64px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
}
/* Neutralize core/columns default flex on our override */
.swfl-article .wp-block-columns.layout > .wp-block-column {
  flex-basis: auto;
  flex-grow: 0;
  width: auto;
}

.swfl-article .body > p,
.swfl-article .body > .wp-block-paragraph > p,
.swfl-article .body .wp-block-paragraph p {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.75;
  color: var(--swfl-slate-2);
  margin: 0 0 22px;
  max-width: none;
}
.swfl-article .body > p:first-of-type::first-letter {
  font-size: 76px;
  font-weight: var(--fw-bold);
  float: left;
  line-height: 0.88;
  padding: 8px 14px 0 0;
  color: var(--swfl-teal-deep);
  font-family: var(--font-display);
}
.swfl-article .body h2,
.swfl-article .body .wp-block-heading {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
  color: var(--swfl-slate);
}

/* Section eyebrow — the "Section 01 — The Night" label.
 * In the block pattern it's a sibling paragraph before the h2 (not a span
 * inside the h2) because block editor can't cleanly edit nested inline
 * elements. Paired selector tightens the gap to the following heading. */
.swfl-article .body .num,
.swfl-article .body h2 .num {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--swfl-teal-deep);
  text-transform: uppercase;
  display: block;
}
.swfl-article .body > .num,
.swfl-article .body .wp-block-paragraph.num {
  margin: 44px 0 0;
}
.swfl-article .body .num + h2,
.swfl-article .body .num + .wp-block-heading {
  margin-top: 8px;
}

/* ---------- Pullquote ---------- */
.swfl-article .pullq {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 28px;
  line-height: 1.32;
  color: var(--swfl-slate);
  border-left: 4px solid var(--swfl-amber);
  padding: 6px 0 6px 24px;
  margin: 36px 0;
  text-wrap: balance;
}

/* ---------- Video embed ---------- */
.swfl-article .vidwrap { margin: 34px 0; }
.swfl-article .vid {
  aspect-ratio: 16/9;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  background: var(--swfl-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.swfl-article .vid .thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}
.swfl-article .vid .play {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--swfl-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sun);
}
.swfl-article .vid .play::after {
  content: "";
  border-left: 22px solid var(--swfl-slate);
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 6px;
}
.swfl-article .vid .label {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(20,20,20,0.75);
  padding: 8px 14px;
  border-radius: var(--r-pill);
}
.swfl-article .vid .runtime {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  background: rgba(20,20,20,0.75);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}
.swfl-article .vidcap {
  font-size: 13px;
  color: var(--fg-3);
  font-style: italic;
  margin: 12px 0 0;
  text-align: center;
}

/* ---------- Instagram embed ---------- */
.swfl-article .igwrap {
  margin: 34px 0;
  background: #fff;
  border: 1px solid var(--swfl-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.swfl-article .igwrap .ighead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--swfl-line);
}
.swfl-article .igwrap .igav {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
  padding: 2px;
  box-sizing: border-box;
  display: flex;
}
.swfl-article .igwrap .igav::after {
  content: "";
  flex: 1;
  border-radius: 50%;
  background-color: #fff;
  background-position: center;
  background-size: 70%;
  background-repeat: no-repeat;
}
.swfl-article .igwrap .ighandle {
  font-weight: var(--fw-bold);
  font-size: 14px;
}
.swfl-article .igwrap .igmeta {
  font-size: 12px;
  color: var(--fg-3);
}
.swfl-article .igwrap .igimg {
  aspect-ratio: 1/1;
  background-size: cover;
  background-position: center;
  position: relative;
}
.swfl-article .igwrap .igimg::after {
  content: "VIEW ON INSTAGRAM";
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(255,255,255,0.9);
  color: var(--swfl-slate);
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.14em;
  padding: 6px 10px;
  border-radius: var(--r-pill);
}
.swfl-article .igwrap .igfoot {
  padding: 12px 18px;
  font-size: 13px;
  color: var(--fg-3);
}
.swfl-article .igwrap .igfoot b {
  color: var(--swfl-slate);
}

/* ---------- Instagram fallback card ----------
 * Rendered HTML lives in functions.php (swfl_render_ig_fallback). All
 * styles are inlined on each element there because the block editor's
 * <SandBox> iframe (used for embed previews) does NOT inherit theme
 * stylesheets — only inline styles survive that boundary. Frontend
 * picks up the same inline styles, so no rules are needed here. */

/* ---------- Sidebar ----------
 * Pattern uses core/column with className="sidebar"; reference HTML used
 * bare <aside>. Support both so future hand-rolled markup still styles. */
.swfl-article aside,
.swfl-article .sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.swfl-article .facts {
  background: var(--swfl-amber-wash);
  border: 1px dashed var(--swfl-amber-deep);
  border-radius: var(--r-lg);
  padding: 22px;
}
.swfl-article .facts h4 {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a87f00;
  margin: 0 0 14px;
}
.swfl-article .facts .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(168,127,0,0.22);
  font-size: 13px;
  align-items: baseline;
}
.swfl-article .facts .row:first-of-type {
  border-top: none;
  padding-top: 0;
}
.swfl-article .facts .k { color: var(--fg-3); }
.swfl-article .facts .v {
  font-weight: var(--fw-bold);
  color: var(--swfl-slate);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.swfl-article .noticed {
  background: #fff;
  border: 1px solid var(--swfl-line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.swfl-article .noticed h4 {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--swfl-teal-deep);
  margin: 0 0 14px;
}
/* .item has 2 paragraph children (.t + .d). The teal dot is a ::before
 * pseudo-element — keeping it in CSS instead of the DOM avoids Gutenberg
 * rendering a "Type /" placeholder in an empty paragraph that then wraps
 * letter-by-letter in the narrow 22px grid column.
 *
 * grid-template-areas:
 *   row 1: dot | title
 *   row 2:  .  | description  (dot column stays empty under the bullet)
 */
.swfl-article .noticed .item {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-areas:
    "dot t"
    ".   d";
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--swfl-line);
}
.swfl-article .noticed .item:first-of-type {
  border-top: none;
  padding-top: 0;
}
.swfl-article .noticed .item::before {
  content: '';
  grid-area: dot;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--swfl-teal);
  align-self: start;
  margin-top: 6px;
}
.swfl-article .noticed .item .t { grid-area: t; }
.swfl-article .noticed .item .d { grid-area: d; }

.swfl-article .noticed .t {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 14px;
  line-height: 1.3;
  color: var(--swfl-slate);
  margin: 0;
}
.swfl-article .noticed .d {
  font-size: 12.5px;
  color: var(--fg-3);
  line-height: 1.5;
  margin: 0;
}

/* !important on flex-wrap: core/buttons writes its own layout CSS with
 * higher specificity than class selectors; at 320px sidebar width the
 * three buttons don't fit on one row and nowrap-default would squeeze
 * them. */
.swfl-article .share {
  display: flex !important;
  gap: 8px;
  flex-wrap: wrap !important;
}
/* Supports both plain <a> (reference markup) and core/buttons output */
.swfl-article .share a,
.swfl-article .share .wp-block-button__link {
  background: #fff;
  border: 1px solid var(--swfl-line);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--swfl-slate);
  text-decoration: none;
  font-weight: var(--fw-semibold);
}
.swfl-article .share a:hover,
.swfl-article .share .wp-block-button__link:hover {
  border-color: var(--swfl-teal);
  color: var(--swfl-teal-deep);
  background: #fff;
}

/* ---------- Perspective block (teal wash) ---------- */
.swfl-article .perspective {
  background: var(--swfl-teal-wash);
  border-top: 1px solid var(--swfl-line-cool);
  border-bottom: 1px solid var(--swfl-line-cool);
  padding: 72px 32px;
}
.swfl-article .perspective-in {
  max-width: 780px;
  margin: 0 auto;
}
.swfl-article .perspective .series {
  color: var(--swfl-teal-deep);
}
.swfl-article .perspective h2 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 36px;
  line-height: 1.12;
  margin: 12px 0 24px;
  letter-spacing: -0.01em;
  color: var(--swfl-slate);
}
.swfl-article .perspective p {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.75;
  color: var(--swfl-slate-2);
  margin: 0 0 22px;
  max-width: none;
}
.swfl-article .perspective .pullq {
  font-size: 30px;
  border-left-color: var(--swfl-teal);
  color: var(--swfl-slate);
}
.swfl-article .sig {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-3);
}
.swfl-article .sig .bug {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--swfl-amber);
  position: relative;
}
.swfl-article .sig .bug::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--swfl-slate);
}

/* ---------- CTA ---------- */
.swfl-article .cta {
  background: var(--swfl-slate);
  color: #fff;
  text-align: center;
  padding: 64px 32px;
}
.swfl-article .cta .series {
  color: var(--swfl-amber);
}
.swfl-article .cta h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 34px;
  margin: 14px auto 22px;
  letter-spacing: -0.01em;
  max-width: 26ch;
  color: #fff;
  line-height: 1.15;
}
.swfl-article .cta .row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
/* CTA buttons — support both the reference .btn/.btn.ghost and core/buttons
 * with style variation "outline" for the ghost treatment. */
.swfl-article .cta .btn,
.swfl-article .cta .wp-block-button__link {
  background: var(--swfl-amber);
  color: var(--swfl-slate);
  padding: 14px 26px;
  border-radius: var(--r-md);
  font-weight: var(--fw-bold);
  text-decoration: none;
  font-size: 15px;
  transition:
    transform var(--dur-fast) var(--ease-smooth),
    box-shadow var(--dur-fast) var(--ease-smooth);
}
.swfl-article .cta .btn:hover,
.swfl-article .cta .wp-block-button__link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sun);
  background: var(--swfl-amber);
}
.swfl-article .cta .btn.ghost,
.swfl-article .cta .is-style-outline .wp-block-button__link {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
.swfl-article .cta .btn.ghost:hover,
.swfl-article .cta .is-style-outline .wp-block-button__link:hover {
  border-color: var(--swfl-teal);
  box-shadow: var(--shadow-wave);
  background: transparent;
}
.swfl-article .cta .when {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.04em;
}

/* ---------- Sources ---------- */
.swfl-article .sources {
  background: var(--swfl-sand);
  padding: 40px 32px;
  border-top: 1px solid var(--swfl-line);
}
.swfl-article .sources-in {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.swfl-article .sources h5 {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 12px;
}
.swfl-article .sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.swfl-article .sources li { font-size: 13px; }
.swfl-article .sources a {
  color: var(--swfl-slate);
  word-break: break-all;
}
.swfl-article .sources .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.swfl-article .sources .tag {
  background: #fff;
  border: 1px solid var(--swfl-line);
  color: var(--fg-3);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.swfl-article .sources a.tag:hover {
  border-color: var(--swfl-teal);
  color: var(--swfl-teal-deep);
}
.swfl-article .sources .swfl-tags-empty {
  opacity: 0.72;
  font-style: italic;
}

/* ---------- Core WordPress gallery block ----------
 * WP's nested gallery captions are absolute overlays by default. On
 * narrow article layouts, long captions can cover the entire image, so
 * mobile captions become editorial text below each photo instead.
 */
.swfl-article .wp-block-gallery.has-nested-images {
  margin: 34px 0;
}

.swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
  font-family: var(--font-body);
  line-height: 1.4;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .swfl-article .layout,
  .swfl-article .wp-block-columns.layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .swfl-article aside,
  .swfl-article .sidebar { position: static; }
  .swfl-article .hero h1 { font-size: 40px; }
  .swfl-article .perspective h2 { font-size: 28px; }
  .swfl-article .cta h3 { font-size: 26px; }
  .swfl-article .sources-in { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .swfl-article .wp-block-gallery.has-nested-images {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    align-items: start !important;
  }

  .swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image),
  .swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    flex-grow: 0 !important;
    margin: 0 !important;
    background: var(--bg-surface, #fff);
  }

  .swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  .swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
    display: none !important;
  }

  .swfl-article .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 10px 0 0 !important;
    background: transparent !important;
    color: var(--fg-3, #555) !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    text-align: left !important;
  }
}
