/* ============================================================
   Grogile — blog.css
   Styles for the /blog listing page and individual article pages.
   Loaded only on blog pages, alongside main.css.
   ============================================================ */

/* ---- Inner pages: header is always solid (no dark hero behind it) ---- */
body.subpage .site-header {
  background: rgba(240, 233, 225, 0.9);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--surface-line);
}
body.subpage .site-header .brand-mark { filter: none; }
body.subpage .site-header .brand-name { color: var(--c-ink); }
body.subpage .site-header .nav-links a { color: var(--text-body); }
body.subpage .site-header .nav-links a:hover { color: var(--c-ink); }
body.subpage .site-header .nav-toggle { border-color: var(--surface-line-strong); }
body.subpage .site-header .nav-toggle span { background: var(--c-ink); }

/* ---- Page header (title block, clears the fixed nav) ---- */
.page-head {
  padding-top: clamp(7rem, 5rem + 6vw, 9.5rem);
  padding-bottom: clamp(2rem, 1rem + 3vw, 3.5rem);
}
.page-head .eyebrow { margin-bottom: 0.9rem; }
.page-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-h2); letter-spacing: -0.02em; line-height: 1.08;
}
.page-lede { margin-top: 1.1rem; max-width: 58ch; font-size: var(--text-lede); color: var(--text-body); }

/* ---- Listing: reuse .blog-grid / .blog-card from components.css ---- */
.blog-listing { padding-bottom: var(--space-section); }
.blog-card-title { font-size: 1.2rem; line-height: 1.32; margin-bottom: 0.5rem; font-weight: 600; }

/* ---- Article (individual post) ---- */
.article { padding-top: clamp(6.5rem, 5rem + 5vw, 9rem); padding-bottom: var(--space-section); }
.article-head { max-width: 760px; margin: 0 auto clamp(2rem, 1rem + 2vw, 3rem); }
.article-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.9rem; font-weight: 600; color: var(--c-tertiary); margin-bottom: 1.6rem;
  transition: color var(--dur-fast) var(--ease-out-expo);
}
.article-back:hover { color: var(--c-primary); }
.article-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); letter-spacing: -0.02em; line-height: 1.12;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  margin-top: 1.2rem; font-size: 0.88rem; color: var(--c-tertiary);
}
.article-meta .blog-tag { margin: 0; }

.article-cover {
  max-width: 960px; margin: 0 auto clamp(2rem, 1rem + 2vw, 3rem);
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--surface-line);
}
.article-cover img { width: 100%; height: auto; display: block; }

.article-body { max-width: 720px; margin: 0 auto; font-size: 1.08rem; line-height: 1.8; color: var(--text-body); }
.article-body > * + * { margin-top: 1.3rem; }
.article-body h2 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  letter-spacing: -0.01em; margin-top: 2.6rem; line-height: 1.25;
}
.article-body h3 { font-weight: 600; font-size: 1.2rem; color: var(--c-ink); margin-top: 1.8rem; }
.article-body strong { color: var(--c-ink); font-weight: 600; }
.article-body a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }
.article-body li { padding-left: 0.2rem; }
.article-body blockquote {
  border-left: 3px solid var(--c-primary); padding: 0.4rem 0 0.4rem 1.3rem;
  color: var(--c-ink); font-size: 1.15rem; font-weight: 500;
}
.article-body figure { margin-block: 1.8rem; }
.article-body img { border-radius: var(--radius); border: 1px solid var(--surface-line); }
.article-body figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--c-tertiary); text-align: center; }

/* ---- Table ---- */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.6;
  margin-block: 2rem;
}
.article-body thead tr {
  border-bottom: 2px solid var(--c-ink);
}
.article-body th {
  text-align: left;
  font-weight: 600;
  color: var(--c-ink);
  padding: 0.65rem 1rem 0.65rem 0;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.article-body td {
  padding: 0.75rem 1rem 0.75rem 0;
  color: var(--text-body);
  vertical-align: top;
  border-bottom: 1px solid var(--surface-line);
}
.article-body tbody tr:last-child td {
  border-bottom: none;
}
.article-body td:first-child,
.article-body th:first-child {
  color: var(--c-ink);
  font-weight: 500;
  white-space: nowrap;
  width: 8rem;
}

.article-cta {
  max-width: 720px; margin: clamp(2.5rem, 1.5rem + 3vw, 4rem) auto 0;
  padding: clamp(1.6rem, 1rem + 2vw, 2.4rem);
  background: var(--surface-card); border: 1px solid var(--surface-line);
  border-radius: var(--radius-lg); text-align: center; box-shadow: var(--shadow-sm);
}
.article-cta h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h3); margin-bottom: 0.5rem; }
.article-cta p { color: var(--text-muted); margin-bottom: 1.2rem; }

/* ---- Share ---- */
.article-share {
  max-width: 720px;
  margin: clamp(2.4rem, 1.4rem + 3vw, 3.4rem) auto 0;
  padding-top: clamp(1.5rem, 1rem + 1.6vw, 2.1rem);
  border-top: 1px solid var(--surface-line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 1.1rem;
}
.article-share__label {
  font-size: 0.92rem; font-weight: 600; color: var(--c-ink); letter-spacing: -0.01em;
}
.article-share__buttons { display: flex; gap: 0.55rem; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0;
  border-radius: 999px;
  border: 1.5px solid var(--surface-line-strong);
  background: var(--c-bg); color: var(--c-tertiary);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring),
    color var(--dur) var(--ease-out-expo),
    background-color var(--dur) var(--ease-out-expo),
    border-color var(--dur) var(--ease-out-expo),
    box-shadow var(--dur) var(--ease-out-expo);
}
.share-btn:hover { transform: translateY(-3px); color: #fff; }
.share-btn:active { transform: translateY(0) scale(0.94); }
.share-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(210, 91, 49, 0.2); }
.share-btn--facebook:hover {
  background: #1877f2; border-color: #1877f2;
  box-shadow: 0 12px 24px -12px rgba(24, 119, 242, 0.65);
}
.share-btn--x:hover {
  background: var(--c-ink); border-color: var(--c-ink);
  box-shadow: 0 12px 24px -12px rgba(26, 24, 23, 0.6);
}
.share-btn--copy:hover {
  background: var(--c-primary); border-color: var(--c-primary);
  box-shadow: 0 12px 24px -12px rgba(210, 91, 49, 0.6);
}
.article-share__toast {
  font-size: 0.85rem; font-weight: 500; color: var(--c-primary-deep);
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur) var(--ease-out-expo), transform var(--dur) var(--ease-out-expo);
}
.article-share__toast[data-visible] { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .share-btn, .share-btn:hover, .share-btn:active { transform: none; }
}
