/* ==========================================================================
   Madison Ave Magazine — Article (Single Post) Stylesheet
   Page-specific styles only. Fonts, tokens, header, and footer are
   provided by mam-shared.css which is enqueued before this file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base reset (scoped to .mam-article)
   -------------------------------------------------------------------------- */
.mam-article {
  background: var(--mam-bg);
  color: var(--mam-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mam-article *,
.mam-article *::before,
.mam-article *::after { box-sizing: border-box; }
.mam-article a { color: inherit; text-decoration: none; }
.mam-article a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.mam-article img { display: block; max-width: 100%; height: auto; }
.mam-article ul,
.mam-article ol { list-style: none; }

/* --------------------------------------------------------------------------
   Reduce motion — article-scoped animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .mam-article *, .mam-article *::before, .mam-article *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.mam-breadcrumb {
  background: var(--mam-sand);
  padding-block: 10px;
}
.mam-breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
}
.mam-breadcrumb__item a { color: var(--mam-accent); }
.mam-breadcrumb__item a:hover { text-decoration: underline; }
.mam-breadcrumb__item--current { color: #555; }

/* --------------------------------------------------------------------------
   Category + Date Bar
   -------------------------------------------------------------------------- */
.mam-article-catbar {
  border-bottom: 1px solid var(--mam-border);
}
.mam-article-catbar__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 20px;
}
.mam-article-catbar__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--mam-white);
  background: var(--mam-accent);
  padding: 5px 10px;
  white-space: nowrap;
  transition: background .2s;
}
.mam-article-catbar__badge:hover { background: #b88a50; text-decoration: none; }
.mam-article-catbar__rule {
  flex: 1;
  height: 1px;
  background: var(--mam-border-light);
}
.mam-article-catbar__date {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--mam-text-muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Article Page container
   -------------------------------------------------------------------------- */
.mam-article-page {
  padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   Article Header
   -------------------------------------------------------------------------- */
.mam-article-header {
  padding-block: 32px 0;
  max-width: var(--mam-content-w);
}

/* H1 Title */
.mam-article-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -.02em;
  color: var(--mam-text);
  margin-bottom: 20px;
}

/* Deck (excerpt) */
.mam-article-deck {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
  color: var(--mam-text-body);
  max-width: 820px;
  margin-bottom: 28px;
}

/* Byline row */
.mam-article-byline {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 16px;
  border-top: 1px solid var(--mam-border-light);
  border-bottom: 1px solid var(--mam-border-light);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mam-article-byline__rule { display: none; } /* used in design only */
.mam-article-byline__author {
  color: var(--mam-text);
  font-weight: 500;
  letter-spacing: 1.2px;
  white-space: nowrap;
}
.mam-article-byline__author:hover { text-decoration: underline; }
.mam-article-byline__sep {
  color: var(--mam-border-light);
  font-size: 11px;
}
.mam-article-byline__section { color: var(--mam-text-muted); }
.mam-article-byline__fill { flex: 1; }
.mam-article-byline__read-time { color: var(--mam-text-muted); white-space: nowrap; }

/* --------------------------------------------------------------------------
   Hero Image Row (with AT A GLANCE)
   -------------------------------------------------------------------------- */
.mam-article-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  padding-block: 32px 0;
  align-items: start;
}
.mam-article-hero {
  min-width: 0;
}
.mam-article-hero__figure { margin: 0; }
.mam-article-hero__img {
  width: 100%;
  height: auto;
  display: block;
}
.mam-article-hero__caption {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--mam-text-muted);
  line-height: 1.5;
}
.mam-article-hero__caption svg { flex-shrink: 0; margin-top: 1px; }

/* Hero row: Promoted post panel */
.mam-hero-promoted {
  background: var(--mam-sand);
  border-top: 3px solid var(--mam-accent);
  padding: 24px;
  align-self: start;
}
.mam-hero-promoted__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mam-accent);
  margin-bottom: 10px;
}
.mam-hero-promoted__rule {
  border: none;
  border-top: 1px solid var(--mam-accent);
  margin-bottom: 18px;
}
.mam-hero-promoted__thumb {
  display: block;
  margin-bottom: 14px;
  overflow: hidden;
}
.mam-hero-promoted__thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .3s ease;
}
.mam-hero-promoted__thumb:hover img { transform: scale(1.03); }
.mam-hero-promoted__body { display: flex; flex-direction: column; gap: 8px; }
.mam-hero-promoted__cat { margin-bottom: 2px; }
.mam-hero-promoted__title {
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--mam-text);
}
.mam-hero-promoted__title a { color: inherit; }
.mam-hero-promoted__title a:hover { color: var(--mam-accent); text-decoration: none; }
.mam-hero-promoted__excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--mam-text-body);
}
.mam-hero-promoted__meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Two-column body layout
   -------------------------------------------------------------------------- */
.mam-article-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0 48px;
  align-items: start;
  padding-block: 36px 0;
}

/* --------------------------------------------------------------------------
   Article Content Typography
   -------------------------------------------------------------------------- */
.mam-article-content {
  min-width: 0;
  padding-bottom: 60px;
}

/* WPBakery row reset — neutralise the -15px negative margins that cause bleed */
.mam-article-content .vc_row,
.mam-article-content .vc_row-fluid {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: auto !important;
  max-width: 100% !important;
}
.mam-article-content .vc_column_container {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* WordPress classic-editor captions carry an inline style="width:Npx" that
   is wider than the content column. Override it so the caption scales down. */
.mam-article-content .wp-caption {
  width: 100% !important;
  max-width: 100% !important;
}
.mam-article-content .wp-caption img {
  width: 100% !important;
  height: auto !important;
}

/* All inline images — hard cap at column width regardless of source */
.mam-article-content img,
.mam-article-content .wp-block-image img,
.mam-article-content .vc_single_image-img,
.mam-article-content .wpb_single_image img {
  max-width: 100% !important;
  height: auto;
}

/* Gutenberg wide/full alignment — collapse inside the content column */
.mam-article-content .alignwide,
.mam-article-content .alignfull {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Prose typography — applied to all standard WP/Gutenberg blocks */
.mam-article-content p,
.mam-article-content li {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--mam-text-body);
  margin-bottom: .7em;
}
.mam-article-content p:last-child { margin-bottom: 0; }
.mam-article-content a {
  color: var(--mam-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.mam-article-content a:hover { color: var(--mam-accent); }

.mam-article-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--mam-text);
  margin-bottom: .75em;
}
.mam-article-content h3 {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--mam-text);
  margin-top: 1.75em;
  margin-bottom: .6em;
}
.mam-article-content h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mam-text);
  margin-top: 1.75em;
  margin-bottom: .5em;
}

/* First paragraph emphasis (lede drop-cap effect) */
.mam-article-content > p:first-of-type {
  font-size: 18px;
  color: var(--mam-text);
}

/* Blockquotes / pull quotes */
.mam-article-content blockquote {
  border-left: 3px solid var(--mam-accent);
  margin-inline: 0;
  padding: 16px 24px;
  background: var(--mam-sand);
  margin-bottom: 1.6em;
}
.mam-article-content blockquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--mam-text);
  margin-bottom: 0;
}
.mam-article-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
}

/* Lists */
.mam-article-content ul,
.mam-article-content ol {
  padding-left: 1.4em;
  margin-bottom: 1.4em;
}
.mam-article-content li { margin-bottom: .4em; }

/* Horizontal rules */
.mam-article-content hr {
  border: none;
  border-top: 1px solid var(--mam-border);
  margin-block: 2em;
}

/* Images inside content */
.mam-article-content figure { margin-block: 2em; }
.mam-article-content figure img { width: 100%; height: auto; }
.mam-article-content figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--mam-text-muted);
  margin-top: 8px;
}

/* Strong / emphasis */
.mam-article-content strong { font-weight: 700; color: var(--mam-text); }
.mam-article-content em { font-style: italic; }

/* Code */
.mam-article-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--mam-sand);
  padding: 2px 5px;
  border-radius: 2px;
}
.mam-article-content pre {
  background: #1c1c1c;
  color: #f2f0ec;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 1.6em;
}
.mam-article-content pre code { background: none; padding: 0; color: inherit; }

/* --------------------------------------------------------------------------
   Special Editorial Blocks (added via Gutenberg custom block or class)
   -------------------------------------------------------------------------- */

/* Stat strip */
.wp-block-mam-stat-strip,
.mam-stat-strip {
  display: flex;
  gap: 0;
  border-top: 2px solid var(--mam-text);
  border-bottom: 2px solid var(--mam-text);
  padding-block: 24px;
  margin-block: 2em;
}
.mam-stat-strip__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-inline: 20px;
  border-left: 1px solid var(--mam-border);
}
.mam-stat-strip__item:first-child { padding-left: 0; border-left: none; }
.mam-stat-strip__number {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--mam-text);
}
.mam-stat-strip__label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
}

/* Timeline block (dark background) */
.wp-block-mam-timeline,
.mam-timeline {
  background: #1c1c1c;
  color: #f2f0ec;
  padding: 32px 36px;
  margin-block: 2em;
}
.mam-timeline__heading {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mam-accent);
  margin-bottom: 24px;
}
.mam-timeline__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}
.mam-timeline__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  padding-block: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.mam-timeline__item:first-child { border-top: none; }
.mam-timeline__year {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--mam-accent);
  padding-top: 2px;
}
.mam-timeline__name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  color: #f2f0ec;
  margin-bottom: 4px;
}
.mam-timeline__desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(242,240,236,.65);
}

/* Security / alert box */
.wp-block-mam-alert,
.mam-alert {
  border: 1px solid var(--mam-accent);
  border-top: 3px solid var(--mam-accent);
  margin-block: 2em;
}
.mam-alert__header {
  background: var(--mam-accent);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mam-alert__header-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mam-white);
}
.mam-alert__body {
  padding: 20px;
  background: var(--mam-bg);
}
.mam-alert__body p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: var(--mam-text-body);
  margin-bottom: .8em;
}
.mam-alert__body p:last-child { margin-bottom: 0; }

/* Pull quote (standalone) */
.wp-block-mam-pull-quote,
.mam-pull-quote {
  border-top: 2px solid var(--mam-text);
  border-bottom: 2px solid var(--mam-text);
  padding-block: 24px;
  margin-block: 2em;
  text-align: center;
}
.mam-pull-quote__text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
  color: var(--mam-text);
  margin-bottom: 12px;
}
.mam-pull-quote__attr {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.mam-article-sidebar {
  border-left: 1px solid var(--mam-border-light);
  padding: 0 0 0 40px;
  position: sticky;
  top: 130px; /* Below sticky header */
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.mam-sb-heading {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mam-accent);
  margin-bottom: 16px;
}
.mam-sb-rule {
  border: none;
  border-top: 1px solid var(--mam-border-light);
  margin-block: 16px;
}

/* Related articles */
.mam-sb-related {}
.mam-sb-list { list-style: none; display: flex; flex-direction: column; }
.mam-sb-item { border-bottom: 1px solid var(--mam-border-light); }
.mam-sb-item:last-child { border-bottom: none; }
.mam-sb-item__link {
  display: flex;
  gap: 12px;
  padding-block: 14px;
  align-items: flex-start;
}
.mam-sb-item__link:hover { text-decoration: none; }
.mam-sb-item__thumb {
  flex-shrink: 0;
  width: 88px;
  height: 64px;
  overflow: hidden;
  background: var(--mam-border);
}
.mam-sb-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mam-sb-item__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mam-sb-item__title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--mam-text);
}
.mam-sb-item__link:hover .mam-sb-item__title { text-decoration: underline; text-decoration-thickness: 1px; }
.mam-sb-item__date {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
}


/* --------------------------------------------------------------------------
   Article Bottom — Tags + Author Bio
   -------------------------------------------------------------------------- */
.mam-article-bottom {
  border-top: 2px solid var(--mam-text);
  padding-block: 32px 56px;
}

/* Tags */
.mam-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.mam-article-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mam-text-muted);
  border: 1px solid var(--mam-border);
  padding: 5px 12px;
  transition: all .2s;
}
.mam-article-tag:hover {
  color: var(--mam-text);
  border-color: var(--mam-text);
  text-decoration: none;
}

/* Author bio */
.mam-author-bio {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--mam-sand);
  padding: 24px;
}
.mam-author-bio__avatar {
  flex-shrink: 0;
}
.mam-author-bio__avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: block;
}
.mam-author-bio__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mam-text);
  color: var(--mam-white);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}
.mam-author-bio__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mam-author-bio__name {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--mam-text);
}
.mam-author-bio__name:hover { text-decoration: underline; }
.mam-author-bio__desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.65;
  color: var(--mam-text-body);
}


/* --------------------------------------------------------------------------
   Responsive — Tablet ≤ 1100px
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .mam-article-hero-row {
    grid-template-columns: minmax(0, 2fr) 260px;
  }
  .mam-article-body {
    grid-template-columns: minmax(0, 2fr) 260px;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile ≤ 768px
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Hero image row: stack vertically */
  .mam-article-hero-row {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }
  .mam-hero-promoted { border-top-width: 2px; }

  /* Body: single column */
  .mam-article-body,
  .mam-article-body--no-hero {
    grid-template-columns: 1fr;
  }
  .mam-article-sidebar {
    position: static;
    top: auto;
    border-left: none;
    border-top: 1px solid var(--mam-border-light);
    padding: 32px 0 0;
  }

  /* Decrease title size */
  .mam-article-title { font-size: clamp(26px, 7vw, 40px); }

  /* Author bio: stack */
  .mam-author-bio { flex-direction: column; gap: 16px; }

}

@media (max-width: 480px) {
  .mam-article-byline { flex-wrap: wrap; gap: 8px; }
  .mam-article-byline__fill { display: none; }
}
