/* ============================================================================
   DineHop: blog styles
   Loaded only on /blog and /blog/*. Load order: tokens.css, site.css, blog.css.
   Extends the site's existing .prose, .btn, .cta and .hero-wave rules.
   ========================================================================== */

/* ---- Listing hero --------------------------------------------------------- */
.blog-hero {
  position: relative;
  background: var(--hero-gradient);
  color: var(--porcelain);
  overflow: hidden;
  isolation: isolate;
}
.blog-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 55% at 82% 8%, rgba(159,196,130,0.22), transparent 60%);
}
.blog-hero-inner {
  max-width: 44rem;
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(4.5rem, 8vw, 7rem);
}
.blog-hero h1 {
  color: var(--porcelain);
  font-size: var(--step-3);
  font-weight: 560;
  margin-top: 1rem;
  letter-spacing: -0.025em;
}
.blog-hero .lede { color: rgba(250,246,238,0.86); margin-top: 1.1rem; max-width: 52ch; }

/* ---- Search --------------------------------------------------------------- */
.blog-search {
  display: flex; align-items: center; gap: 0.6rem;
  margin-top: 2rem; max-width: 34rem;
  background: rgba(255,252,246,0.10);
  border: 1px solid rgba(255,252,246,0.22);
  border-radius: 14px;
  padding: 0.15rem 0.9rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.blog-search:focus-within { border-color: var(--sage); background: rgba(255,252,246,0.16); }
.blog-search-icon { display: inline-flex; flex: none; color: var(--sage); }
.blog-search-icon svg { width: 20px; height: 20px; }
.blog-search input {
  width: 100%; border: 0; background: none; outline: none;
  font-family: var(--font-body); font-size: var(--step-0); font-weight: 600;
  color: var(--porcelain); padding: 0.85rem 0;
}
.blog-search input::placeholder { color: rgba(250,246,238,0.55); font-weight: 500; }
.blog-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---- Category chips ------------------------------------------------------- */
.blog-filters {
  position: sticky; top: 61px; z-index: 40;
  background: rgba(255,252,246,0.90);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.blog-filters-inner {
  display: flex; gap: 0.5rem; overflow-x: auto;
  padding-block: 0.85rem;
  scrollbar-width: none;
}
.blog-filters-inner::-webkit-scrollbar { display: none; }
.chip {
  flex: none; cursor: pointer; white-space: nowrap;
  font-family: var(--font-body); font-weight: 800; font-size: 0.88rem;
  padding: 0.55rem 1.05rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--hairline); background: #fff; color: var(--muted-ink);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.chip:hover { border-color: var(--olive); color: var(--olive); }
.chip.is-active { background: var(--basil); border-color: var(--basil); color: var(--porcelain); }

/* ---- Sections ------------------------------------------------------------- */
.blog-section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.blog-section-title {
  font-size: var(--step-2);
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--olive);
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
}

/* ---- Post cards ----------------------------------------------------------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.4rem, 2.5vw, 2rem); }
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.4rem, 2.5vw, 2rem); }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .post-grid, .featured-grid { grid-template-columns: 1fr; }
}

.pcard { display: flex; }
.pcard[hidden] { display: none; }
.pcard-link {
  display: flex; flex-direction: column; width: 100%;
  text-decoration: none; background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pcard-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--sage);
}
.pcard-cat {
  display: block; background: var(--sage-mist); color: var(--olive-deep);
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--hairline);
}
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.25rem 1.35rem; }
.pcard-meta {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--muted-ink); font-size: 0.82rem; font-weight: 700;
}
.pcard-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--hairline); }
.pcard h3 {
  font-size: var(--step-1); margin-top: 0.6rem; line-height: 1.2;
  transition: color 0.18s ease;
}
.pcard-link:hover h3 { color: var(--olive); }
.pcard-excerpt { color: var(--muted-ink); font-size: 0.95rem; margin-top: 0.6rem; flex: 1; }
.pcard-more {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--hairline);
  color: var(--olive); font-weight: 800; font-size: 0.9rem;
}
.pcard-more svg { width: 16px; height: 16px; transition: transform 0.18s ease; }
.pcard-link:hover .pcard-more svg { transform: translateX(3px); }

/* Featured cards sit on the warm band and lead with a bigger title */
.pcard-featured .pcard-link { background: var(--porcelain); border-color: var(--sage); }
.pcard-featured .pcard-cat { background: var(--olive); color: var(--ivory); border-bottom-color: transparent; }
.pcard-featured .pcard-body { padding: 1.5rem 1.5rem 1.6rem; }
.pcard-featured h3 { font-size: var(--step-2); }

/* search-term highlighting */
.pcard mark { background: rgba(236,164,63,0.35); color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* ---- Empty state ---------------------------------------------------------- */
.blog-empty {
  text-align: center; background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  box-shadow: var(--shadow-card);
}
.blog-empty-icon {
  width: 60px; height: 60px; margin: 0 auto 1.2rem;
  display: grid; place-items: center;
  background: var(--sage-mist); border-radius: 50%; color: var(--olive);
}
.blog-empty-icon svg { width: 28px; height: 28px; }
.blog-empty h3 { font-size: var(--step-2); }
.blog-empty p { color: var(--muted-ink); margin-top: 0.7rem; max-width: 42ch; margin-inline: auto; }
.blog-empty .btn { margin-top: 1.5rem; }

/* ---- Breadcrumbs ---------------------------------------------------------- */
.crumbs { padding-top: clamp(1.5rem, 3vw, 2.2rem); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.crumbs li { display: flex; align-items: center; gap: 0.5rem; color: var(--muted-ink); font-size: 0.85rem; font-weight: 700; }
.crumbs li + li::before { content: "/"; color: var(--hairline); }
.crumbs a { color: var(--muted-ink); text-decoration: none; }
.crumbs a:hover { color: var(--olive); }
.crumbs [aria-current] {
  color: var(--ink); max-width: 42ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Post header ---------------------------------------------------------- */
.post-head { max-width: 46rem; padding-block: clamp(1.5rem, 3vw, 2.2rem) clamp(1.5rem, 3vw, 2rem); }
.post-cat {
  display: inline-block; text-decoration: none;
  background: var(--sage-mist); color: var(--olive-deep);
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.4rem 0.85rem; border-radius: var(--radius-pill);
}
.post-cat:hover { background: var(--olive); color: var(--ivory); }
.post-head h1 { font-size: var(--step-3); margin-top: 1rem; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem;
  margin-top: 1.4rem; padding-top: 1.3rem; border-top: 1px solid var(--hairline);
  color: var(--muted-ink); font-size: 0.9rem; font-weight: 700;
}
.post-meta-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.post-meta-item svg { width: 17px; height: 17px; color: var(--olive); }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--olive); color: var(--ivory);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
}
.avatar.lg { width: 52px; height: 52px; font-size: 1.5rem; }

/* ---- Post layout ---------------------------------------------------------- */
.post-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 18rem;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-aside { order: -1; }
}

.post-lede {
  font-family: var(--font-display); font-size: var(--step-1); line-height: 1.4;
  color: var(--ink); border-left: 3px solid var(--olive);
  padding-left: 1.2rem; margin-bottom: 2rem;
}

/* extends site.css .prose for long-form articles */
.post-body .prose { margin-top: 0; }
.post-body .prose h2 {
  font-size: var(--step-2); margin-top: 2.6rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--hairline);
  scroll-margin-top: 5.5rem;
}
.post-body .prose h3 { font-family: var(--font-display); font-size: var(--step-1); color: var(--ink); font-weight: 600; margin-top: 1.9rem; }
.post-body .prose h4 { font-family: var(--font-body); font-size: var(--step-0); color: var(--basil); font-weight: 800; margin-top: 1.5rem; }
.post-body .prose ol { margin-top: 0.8rem; padding-left: 1.3rem; color: #34302c; }
.post-body .prose ol li { margin-top: 0.4rem; }
.post-body .prose figure { margin: 1.8rem 0; text-align: center; }
/* max-height keeps a tall/portrait screenshot from swallowing the column;
   width:auto lets it shrink proportionally rather than stretching. */
.post-body .prose figure img, .post-body .prose > p img {
  width: auto; max-width: 100%; max-height: 78vh; margin-inline: auto;
  border-radius: var(--radius); border: 1px solid var(--hairline); box-shadow: var(--shadow-card);
}
.post-body .prose figcaption { text-align: center; color: var(--muted-ink); font-size: 0.85rem; margin-top: 0.7rem; }
.post-body .prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.2rem 0; }
.post-body .prose pre {
  background: var(--pine); color: var(--porcelain); border-radius: var(--radius-sm);
  padding: 1rem 1.15rem; overflow-x: auto; margin-top: 1.2rem; font-size: 0.88rem;
}
.post-body .prose pre code { background: none; color: inherit; padding: 0; }
.post-body .prose code {
  background: var(--sage-mist); color: var(--olive-deep);
  padding: 0.12em 0.4em; border-radius: 5px; font-size: 0.9em;
}

/* ---- Lead answer ----------------------------------------------------------
   Set apart on purpose: this is the passage that gets quoted, both by a reader
   skimming and by an AI answer engine lifting a snippet. */
.post-answer {
  padding: clamp(1rem, 3vw, 1.35rem) clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  border-left: 4px solid var(--sage);
  background: var(--sage-mist);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--basil);
}
.post-answer a { color: var(--olive-deep); text-underline-offset: 2px; }

/* ---- Post FAQ -------------------------------------------------------------
   Namespaced as .post-faq-item, never a bare .faq-item: site.css already owns
   that selector for the homepage FAQ and the two must not collide. */
.post-faq { margin-top: 2.5rem; }
.post-faq h2 { font-size: var(--step-2); padding-bottom: 0.6rem; border-bottom: 1px solid var(--hairline); scroll-margin-top: 5.5rem; }
.post-faq-item { border-bottom: 1px solid var(--hairline); padding: 0.95rem 0; }
.post-faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  font-weight: 800; color: var(--basil);
}
.post-faq-item summary::-webkit-details-marker { display: none; }
.post-faq-item summary:hover { color: var(--olive); }
.post-faq-item summary::after {
  content: "+"; flex: none; font-size: 1.4rem; line-height: 1;
  color: var(--olive); transition: transform 0.2s ease;
}
.post-faq-item[open] summary::after { transform: rotate(45deg); }
.post-faq-item p { margin-top: 0.6rem; color: #34302c; }

/* ---- Version note --------------------------------------------------------- */
.post-version {
  margin-top: 1.6rem; color: var(--muted-ink);
  font-size: 0.9rem; font-weight: 700;
}

/* ---- Sources -------------------------------------------------------------- */
.post-sources {
  margin-top: 2.5rem; background: var(--porcelain);
  border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden;
}
.post-sources summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.55rem;
  padding: 0.95rem 1.2rem; font-weight: 800; color: var(--ink); font-size: 0.95rem;
}
.post-sources summary::-webkit-details-marker { display: none; }
.post-sources summary::after {
  content: "+"; margin-left: auto; font-size: 1.35rem; line-height: 1;
  color: var(--olive); transition: transform 0.2s ease;
}
.post-sources[open] summary::after { transform: rotate(45deg); }
.post-sources summary:hover { color: var(--olive); }
.post-sources summary svg { width: 17px; height: 17px; color: var(--olive); }
.post-sources ol { margin: 0; padding: 0 1.4rem 1.2rem 2.6rem; color: var(--muted-ink); font-size: 0.9rem; }
.post-sources li { margin-top: 0.45rem; }
.post-sources a { color: var(--olive); text-underline-offset: 2px; }

/* ---- Author box ----------------------------------------------------------- */
.post-author-box {
  display: flex; gap: 1.2rem; align-items: flex-start;
  margin-top: 2.5rem; padding: 1.5rem;
  background: var(--porcelain); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.post-author-box h2 { font-size: var(--step-1); }
.post-author-box p { color: var(--muted-ink); margin-top: 0.5rem; font-size: 0.95rem; }

/* ---- Tags ----------------------------------------------------------------- */
.post-tags { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }
.post-tags-title {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-ink);
}
.post-tags ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin-top: 0.9rem; }
.post-tags a {
  display: inline-block; text-decoration: none;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 700; color: var(--muted-ink);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.post-tags a:hover { background: var(--sage-mist); border-color: var(--sage); color: var(--olive-deep); }

/* ---- Sidebar -------------------------------------------------------------- */
.aside-sticky { position: sticky; top: 5.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
@media (max-width: 1000px) { .aside-sticky { position: static; } }
.aside-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-ink);
  margin-bottom: 0.9rem;
}
.aside-title svg { width: 15px; height: 15px; color: var(--olive); }

.toc, .share, .related {
  background: #fff; border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-card);
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: block; text-decoration: none; color: var(--muted-ink);
  font-size: 0.9rem; font-weight: 600; line-height: 1.35;
  padding: 0.4rem 0 0.4rem 0.8rem; border-left: 2px solid var(--hairline);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: var(--olive); border-left-color: var(--sage); }
.toc a.is-current { color: var(--olive-deep); border-left-color: var(--olive); font-weight: 800; }

/* ---- Share ---------------------------------------------------------------- */
.share-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.share-btn {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  cursor: pointer; text-decoration: none; text-align: left;
  font-family: var(--font-body); font-weight: 800; font-size: 0.9rem;
  padding: 0.65rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--porcelain); color: var(--muted-ink);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.share-btn svg { width: 17px; height: 17px; flex: none; }
.share-btn:hover { border-color: var(--olive); color: var(--olive-deep); background: var(--sage-mist); }
.share-btn.fb:hover { border-color: #1877F2; color: #1877F2; background: rgba(24,119,242,0.08); }
.share-btn.x:hover { border-color: var(--ink); color: var(--ink); background: rgba(32,26,22,0.06); }
.share-btn.is-copied { border-color: var(--hygiene-green); color: var(--hygiene-green); background: rgba(46,125,50,0.08); }

/* ---- Related -------------------------------------------------------------- */
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.related a { display: block; text-decoration: none; padding: 0.7rem 0; border-top: 1px solid var(--hairline); }
.related li:first-child a { border-top: 0; padding-top: 0; }
.related-cat { display: block; color: var(--olive); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.related-title {
  display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
  line-height: 1.25; color: var(--ink); margin-top: 0.3rem;
  transition: color 0.18s ease;
}
.related a:hover .related-title { color: var(--olive); }
.related-meta { display: flex; align-items: center; gap: 0.35rem; color: var(--muted-ink); font-size: 0.78rem; font-weight: 700; margin-top: 0.35rem; }
.related-meta svg { width: 13px; height: 13px; }

/* ---- Responsive nudges ---------------------------------------------------- */
@media (max-width: 460px) {
  .blog-filters { top: 55px; }
  .post-meta { gap: 0.5rem 1rem; font-size: 0.85rem; }
}
