/* ============================================================
   BLOG — Spaces by MTC
   Built entirely on the existing design system (main.css tokens,
   Cormorant Garamond + DM Sans, gold accents, site easing).
   Loaded ONLY on blog pages; never affects existing pages.
   ============================================================ */

:root {
  --blog-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

body.blog-page {
  background: var(--ivory);
  color: var(--charcoal);
}

/* keep page content clear of the fixed navbar */
.blog-main { display: block; }

/* ---------- shared label (mirrors .section-label) ---------- */
.blog-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: flex;
  align-items: center;
  gap: 16px;
}
.blog-label::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--gold-deep);
}
.blog-label.on-dark { color: var(--gold); }
.blog-label.on-dark::before { background: var(--gold); }
.blog-label.center { justify-content: center; }

/* ============================================================
   HERO (landing + article) — dark image + overlay, ivory text
   ============================================================ */
.blog-hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  padding: 160px 60px 64px;
  overflow: hidden;
}
.blog-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.blog-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,8,5,0.45) 0%, rgba(10,8,5,0.35) 40%, rgba(10,8,5,0.88) 100%);
  z-index: 1;
}
.blog-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
}
.blog-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  line-height: 1.08;
  color: var(--ivory);
  font-size: clamp(40px, 6vw, 86px);
  margin: 22px 0 18px;
}
.blog-hero__title em { font-style: italic; color: var(--gold); }
.blog-hero__sub {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.7;
  color: rgba(247, 242, 234, 0.78);
  max-width: 620px;
}

/* ============================================================
   LANDING — section shell
   ============================================================ */
.blog-section { padding: 72px 60px; }
.blog-shell { max-width: 1280px; margin: 0 auto; }

/* ---------- grid ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  color: var(--olive);
  padding: 60px 0;
}

/* ---------- card (mirrors site card language) ---------- */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border-solid);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.5s var(--blog-ease), box-shadow 0.5s var(--blog-ease);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 60px rgba(26, 29, 36, 0.12);
}
.blog-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--blog-ease);
}
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__cat {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--gold);
  padding: 6px 12px;
}
.blog-card__body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.blog-card__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.22;
  color: var(--charcoal);
  margin-bottom: 12px;
}
.blog-card__excerpt {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: var(--light-text);
  margin-bottom: 20px;
  flex: 1;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--olive);
  margin-bottom: 18px;
}
.blog-card__meta span.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--olive); opacity: 0.5; }
.blog-card__more {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.3s var(--blog-ease);
}
.blog-card:hover .blog-card__more { gap: 14px; }

/* ---------- pagination ---------- */
/* Always flows after the grid (last item before the footer). The
   position resets guard against the global `nav { position:fixed }`
   rule, so pagination is never sticky, floating, or pulled to the top. */
.blog-pagination {
  position: static;
  inset: auto;
  z-index: auto;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.blog-page-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--border-solid);
  cursor: pointer;
  transition: all 0.3s var(--blog-ease);
}
.blog-page-btn:hover:not(:disabled) { border-color: var(--gold-deep); }
.blog-page-btn.is-active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--ivory);
}
.blog-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.blog-page-ellipsis { color: var(--olive); padding: 0 6px; }

/* ============================================================
   ARTICLE (detail page)
   ============================================================ */
.blog-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 64px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 60px 24px;
}
.blog-article__main { min-width: 0; }

.article-breadcrumb {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--olive);
  margin-bottom: 28px;
}
.article-breadcrumb a { color: var(--olive); text-decoration: none; transition: color 0.3s; }
.article-breadcrumb a:hover { color: var(--gold-deep); }
.article-breadcrumb span.sep { margin: 0 8px; opacity: 0.5; }

/* article body typography */
.article-body { max-width: 760px; }
.article-body > * { margin-bottom: 24px; }
.article-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.18;
  color: var(--charcoal);
  margin-top: 48px;
  scroll-margin-top: 110px;
}
.article-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.25;
  color: var(--charcoal);
  margin-top: 32px;
}
.article-body p {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.9;
  color: #34373f;
}
.article-body ul,
.article-body ol {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  color: #34373f;
  padding-left: 22px;
}
.article-body li { margin-bottom: 10px; }
.article-body ul li::marker { color: var(--gold-deep); }
.article-body ol li::marker { color: var(--gold-deep); font-weight: 500; }
.article-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }

.article-body figure { margin: 36px 0; }
.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-body figcaption {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--olive);
  margin-top: 10px;
  text-align: center;
}

.article-body blockquote {
  border-left: 2px solid var(--gold);
  padding: 8px 0 8px 28px;
  margin: 36px 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  color: var(--charcoal);
}
.article-body blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: 'DM Sans', sans-serif;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--olive);
}

.article-body .highlight-box {
  background: var(--beige);
  border-left: 3px solid var(--gold-deep);
  padding: 28px 30px;
  margin: 36px 0;
}
.article-body .highlight-box h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 10px;
}
.article-body .highlight-box p { margin-bottom: 0; color: var(--charcoal); }

.article-table-wrap { overflow-x: auto; margin: 32px 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
}
.article-body thead th {
  background: var(--charcoal);
  color: var(--ivory);
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 14px 16px;
  font-size: 12px;
  text-transform: uppercase;
}
.article-body tbody td {
  border-bottom: 1px solid var(--border-solid);
  padding: 14px 16px;
  color: #34373f;
  vertical-align: top;
  line-height: 1.6;
}
.article-body tbody tr:nth-child(even) { background: rgba(235, 227, 212, 0.35); }

/* ---------- sticky table of contents (desktop) ---------- */
.article-aside { position: relative; }
.toc-desktop {
  position: sticky;
  top: 110px;
  border-left: 1px solid var(--border-solid);
  padding-left: 24px;
}
.toc-desktop h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 18px;
}
.toc-desktop ul { list-style: none; }
.toc-desktop li { margin-bottom: 12px; }
.toc-desktop a {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--olive);
  text-decoration: none;
  display: block;
  transition: color 0.3s var(--blog-ease);
}
.toc-desktop a:hover { color: var(--charcoal); }
.toc-desktop a.is-active { color: var(--gold-deep); font-weight: 500; }

/* ---------- mobile TOC accordion ---------- */
.toc-mobile {
  display: none;
  max-width: 760px;
  margin: 0 auto 8px;
  border: 1px solid var(--border-solid);
  background: var(--card);
}
.toc-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--charcoal);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: '+'; color: var(--gold-deep); font-size: 18px; }
.toc-mobile[open] summary::after { content: '–'; }
.toc-mobile ul { list-style: none; padding: 0 20px 16px; }
.toc-mobile li { margin-bottom: 10px; }
.toc-mobile a {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--olive);
  text-decoration: none;
}
.toc-mobile a:hover { color: var(--gold-deep); }

/* ============================================================
   RELATED ARTICLES
   ============================================================ */
.blog-related { padding: 72px 60px; background: var(--beige); }
.blog-related__head { max-width: 1180px; margin: 0 auto 40px; }
.blog-related__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(28px, 3.5vw, 46px);
  color: var(--charcoal);
  margin-top: 18px;
}
.blog-related .blog-grid { max-width: 1180px; margin: 0 auto; }
.blog-related .blog-card { background: var(--ivory); }

/* ============================================================
   CTA (mirrors site CTA language)
   ============================================================ */
.blog-cta { background: var(--charcoal); padding: 100px 60px; text-align: center; }
.blog-cta__inner { max-width: 760px; margin: 0 auto; }
.blog-cta__title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(34px, 4.5vw, 64px);
  line-height: 1.1;
  color: var(--ivory);
  margin: 22px 0 18px;
}
.blog-cta__title em { font-style: italic; color: var(--gold); }
.blog-cta__text {
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(247, 242, 234, 0.6);
  margin-bottom: 36px;
}
.blog-cta__actions { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
  .blog-article { grid-template-columns: 1fr; gap: 0; padding: 48px 40px 16px; }
  .article-aside { display: none; }
  .toc-mobile { display: block; }
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .blog-section,
  .blog-related { padding: 56px 40px; }
  .blog-hero { padding: 140px 40px 52px; min-height: 52vh; }
}

@media (max-width: 767px) {
  .blog-grid { grid-template-columns: 1fr; gap: 24px; }
  .blog-section,
  .blog-related,
  .blog-cta { padding: 48px 20px; }
  .blog-hero { padding: 130px 20px 44px; min-height: 46vh; }
  .blog-article { padding: 36px 20px 8px; }
  .article-body { max-width: none; }
  .article-body h2 { scroll-margin-top: 90px; }
  .blog-cta { padding: 72px 20px; }
}
