/*
 * Brunchie content site styles.
 *
 * Layers on top of css/brand-kit.css (which is synced from trusolution/
 * brunchie-app and MUST NOT be hand-edited). This file holds content-
 * site-specific rules that don't belong in the shared brand kit — body
 * defaults, typography, navbar, and the few utility classes unique to
 * the eleventy site.
 */

/* ========================================
   CONTENT SITE DEFAULTS
   Use Bootstrap 5.3 theme-aware vars (--bs-body-color, --bs-body-bg,
   --bs-heading-color) so light/dark flip automatically via
   [data-bs-theme]. Brand palette (--brunchie-*) is still used for
   accents that stay brand-specific in both themes.

   Typography matches what the Rails app actually renders, not what
   BRAND_KIT.md aspires to. Markdown-rendered prose on /about, /contact,
   /privacy-policy etc. ships plain <p> tags without .text-body, so the
   browser falls back to Bootstrap's system-ui stack (San Francisco on
   macOS, Segoe UI on Windows, Roboto on Android). Forcing Inter on
   <body> here makes guide/blog prose look visibly different from the
   exact same paragraph rendered on the Rails marketing page. Let
   Bootstrap's --bs-body-font-family default win for body; bind Poppins
   on h1-h6 to match the app's .text-heading utility convention.
   ======================================== */
body {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--bs-heading-color, var(--bs-body-color));
}

a {
  color: var(--brunchie-blueberry-blue-text);
}

a:hover {
  color: var(--brunchie-blueberry-blue);
}

.navbar-brand {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--bs-body-color);
}

/* Brunchie's brand-kit applies .bg-warning/.btn-warning overrides for
   pancake gold, but the eleventy site's navbar + proof bands set
   things up slightly differently, so we nail down the content-site
   button pattern here. */
.btn-brand-primary {
  background-color: var(--brunchie-pancake-gold);
  border-color: var(--brunchie-pancake-gold);
  color: var(--brunchie-charcoal-black);
  font-family: var(--font-primary);
  font-weight: 600;
  border-radius: var(--brunchie-radius-button);
  transition: var(--brunchie-transition-smooth);
}

.btn-brand-primary:hover {
  background-color: var(--brunchie-butter-yellow);
  border-color: var(--brunchie-butter-yellow);
  box-shadow: var(--brunchie-shadow-hover);
}

.card {
  border-radius: var(--brunchie-radius-card);
  box-shadow: var(--brunchie-shadow-soft);
}

/* ========================================
   CONTENT-SITE-SPECIFIC LAYOUT
   Used by eleventy-rendered guide + blog pages. Not in the Rails app.
   ======================================== */
/* Keep EVERY part of a content post — breadcrumb, header/title, body, pillar
   callout, FAQ, CTA — at the same reading width as the body prose so nothing
   spans wider than the rest. The body (.landing-proof-band) was the only
   element capped at 48rem; the header/callouts/FAQ were filling the full
   container, which read as inconsistent. Constraining the article unifies
   them (the body band at 48rem simply fills this 48rem article). */
.content-post {
  max-width: 48rem;
  margin-inline: auto;
}

.landing-proof-band {
  max-width: 48rem;
  margin: 0 auto;
}

.landing-proof-band img {
  max-width: 100%;
  height: auto;
}

.feature-icon-circle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   SHARED CHROME — site-wide header + footer
   Mirrors the logged-out shell of brunchie-app's _header.slim and
   _footer.slim so /blog and /guides feel like one product with the
   Rails app instead of an orphaned static site. Uses --bs-* vars so
   dark mode auto-adapts.
   ======================================== */
.site-header {
  background-color: var(--bs-body-bg);
  box-shadow: var(--brunchie-shadow-soft);
  z-index: 1020;
}

.site-header .navbar-brand {
  color: var(--bs-body-color);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

.site-header .site-wordmark {
  color: var(--bs-body-color);
  font-size: 1.5rem;
  line-height: 1;
}

.site-header .navbar-logo {
  height: 1.75rem;
  width: auto;
  object-fit: contain;
}

.site-header .nav-link {
  --bs-nav-link-color: var(--bs-emphasis-color);
  --bs-nav-link-hover-color: var(--brunchie-blueberry-blue);
  font-family: var(--font-primary);
  font-weight: 500;
}

.site-header .navbar-brand,
.site-header .site-wordmark {
  color: var(--bs-emphasis-color);
}

.site-footer {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.site-footer .link-plain,
.site-footer a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.site-footer .link-plain:hover,
.site-footer a:hover {
  color: var(--brunchie-blueberry-blue);
  text-decoration: underline;
}

/* Dark-mode footer: charcoal background, light text + light links.
   Brand-kit's [data-bs-theme="dark"] .footer override sets a charcoal bg,
   but the .text-muted and .link-plain classes still resolve to the
   light-mode grey, which leaves the copy near-invisible. Pin the
   readable colors here. */
[data-bs-theme="dark"] .site-footer,
[data-bs-theme="dark"] .site-footer .text-muted {
  color: var(--brunchie-flour-white) !important;
}

[data-bs-theme="dark"] .site-footer .link-plain,
[data-bs-theme="dark"] .site-footer a {
  color: var(--brunchie-flour-white) !important;
}

[data-bs-theme="dark"] .site-footer .link-plain:hover,
[data-bs-theme="dark"] .site-footer a:hover {
  color: var(--brunchie-pancake-gold) !important;
}

/* ========================================
   LIST GROUP (guides + blog indexes)
   Bootstrap's dark-mode .list-group-item flips the background to
   --bs-tertiary-bg but brand-kit-loaded pages sometimes need the
   inner heading to re-pick up the theme-aware heading color, since
   guide-list titles use <h5>. Ensure .list-group-item headings
   inherit from theme.
   ======================================== */
.list-group-item h1,
.list-group-item h2,
.list-group-item h3,
.list-group-item h4,
.list-group-item h5,
.list-group-item h6 {
  color: var(--bs-heading-color, var(--bs-body-color));
}

/* ========================================
   POST CHROME — Rails parity
   Breadcrumb + post header treatment that matches the Rails marketing
   pages so /blog/<slug>, /guides/<slug>, /careers/<slug> feel like
   the same site as /about, /contact, /free-forever.
   ======================================== */
.content-post .breadcrumb {
  --bs-breadcrumb-divider: '\203A';
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.content-post .breadcrumb a {
  color: var(--bs-secondary-color);
}

.content-post .breadcrumb a:hover {
  color: var(--brunchie-blueberry-blue-text);
}

.content-post .breadcrumb-item.active {
  color: var(--bs-body-color);
  font-weight: 500;
}

.content-post__header h1 {
  letter-spacing: -0.01em;
}

.content-post__meta i {
  color: var(--bs-tertiary-color);
}

/* ========================================
   POST BODY — section dividers + tip box
   Markdown-rendered <hr> gets the same airy section break Rails uses
   for marketing pages. Tip/callout boxes share the brand-info accent.
   ======================================== */
.content-post__body hr {
  border: 0;
  border-top: 1px solid var(--bs-border-color);
  opacity: 1;
  margin: 3rem auto;
  max-width: 6rem;
}

.content-post__body .content-tip {
  background-color: rgba(var(--bs-info-rgb), 0.06);
  border-left: 3px solid var(--brunchie-blueberry-blue, var(--bs-info));
  border-radius: 0 var(--brunchie-radius-card, 12px) var(--brunchie-radius-card, 12px) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.content-post__body .content-tip__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--bs-heading-color);
}

.content-post__body .content-tip__body {
  margin: 0;
  color: var(--bs-body-color);
}

/* ========================================
   INDEX HERO — shared hero shell for /blog, /guides, /careers
   Mirrors the Rails marketing-page hero rhythm (display-5 + lead +
   centered CTA, breezy py-5 outer pad).
   ======================================== */
.content-index-hero {
  border-bottom: 1px solid var(--bs-border-color-translucent);
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.content-index-hero h1 {
  letter-spacing: -0.015em;
}

.content-index .list-group-item {
  border-color: var(--bs-border-color-translucent);
  transition: var(--brunchie-transition-smooth, all 0.2s ease);
}

.content-index .list-group-item:hover {
  background-color: rgba(var(--bs-tertiary-bg-rgb, 248, 249, 250), 0.6);
}

/* ========================================
   POST CTA — bottom-of-post conversion card
   Lifts the Rails _cta_card.slim treatment: centered card, brand
   primary button, breezy padding.
   ======================================== */
.post-cta-card {
  background-color: var(--bs-tertiary-bg);
  border-radius: var(--brunchie-radius-card, 16px);
}

[data-bs-theme="dark"] .post-cta-card {
  background-color: var(--bs-secondary-bg);
}

/* ========================================
   SCREENSHOT — dual-theme {{screenshot:key}} renderer
   The renderer in .eleventy.js emits a <figure> wrapping a <picture>
   with light + dark sources. The frame gives the screenshot a card
   treatment that contrasts against either page background, so a
   light-mode capture doesn't dissolve into a dark page (and vice
   versa). Shadow tokens flip with theme via brand-kit. Border removed
   so images render without an outline box.
   ======================================== */
.content-screenshot-figure {
  text-align: center;
  margin: 1.75rem 0;
}

.content-screenshot {
  display: inline-block;
  max-width: 100%;
  border-radius: var(--brunchie-radius-card, 12px);
  box-shadow: var(--brunchie-shadow-card);
  overflow: hidden;
  background-color: var(--bs-body-bg);
}

.content-screenshot__img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  object-fit: contain;
}

/* ========================================
   MICROSITE VISUALS GRID
   Screenshots in the per-lead microsite visual gallery. max-height
   prevents a single tall app screenshot from requiring a full-page
   scroll before the reader reaches the next section. object-fit:
   contain scales down proportionally without cropping.
   ======================================== */
.microsite-visual__img {
  max-height: 60vh;
  object-fit: contain;
}

/* ========================================
   SOCIAL LINKS ROW
   Used on /about/, /contact/, and in the site footer (partials/
   social-links.njk). Theme-aware circular icon buttons that lift on
   hover into the brand color. RedNote has no Bootstrap Icons glyph, so
   its link inlines the Simple Icons logo as an <svg> (.social-links__svg,
   fill: currentColor) sized to 1em to match the <i> bi icons.
   ======================================== */
.social-links__link {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.15rem;
  color: var(--bs-body-color);
  background-color: var(--bs-tertiary-bg);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.social-links__link:hover,
.social-links__link:focus-visible {
  color: #fff;
  background-color: var(--brunchie-primary, #ff7a59);
  transform: translateY(-2px);
}

.social-links__svg {
  display: block;
}

/* Footer variant: a touch smaller and quieter until hovered. */
.site-footer .social-links__link {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1rem;
  background-color: transparent;
  color: var(--bs-secondary-color, #6c757d);
}

/* FAQ question (the <summary>) carries `.text-heading`, which is a HEADING
   sizer (clamp up to 1.75rem / 28px). That's far too large for a clickable
   question — body copy is 1rem. Override with an explicit, comfortable size.
   Specificity (0,2,0) beats `.text-heading` (0,1,0). Answer text stays 1rem. */
.content-faq .content-faq__question {
  font-size: 1.0625rem;
  line-height: 1.4;
}

/* ========================================
   CONTENT DISCOVERY — category chips + cards (PR-2)
   Dual-theme via Bootstrap --bs-* vars.
   ======================================== */
.content-category-chips {
  align-items: center;
}

.content-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--bs-border-color, #dee2e6);
  background: transparent;
  color: var(--bs-body-color, #212529);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.content-chip:hover {
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-color: var(--bs-secondary-color, #adb5bd);
}

.content-chip--active {
  background: var(--brunchie-pancake-gold, #f0b429);
  border-color: var(--brunchie-pancake-gold, #f0b429);
  color: var(--brunchie-charcoal-black, #1a1a1a);
}

/* Card grid (hub pages now; index in PR-3). */
.content-card {
  display: flex;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: var(--brunchie-radius-card, 0.75rem);
  background: var(--bs-body-bg, #fff);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.content-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--bs-secondary-color, #adb5bd);
  color: inherit;
}

[data-bs-theme="dark"] .content-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* Pillar card — the hub of its category. */
.content-card--pillar {
  border-left: 3px solid var(--brunchie-pancake-gold, #f0b429);
}

.content-card__title {
  color: var(--bs-heading-color, var(--bs-body-color));
}

.content-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-related-guides__link {
  color: var(--bs-link-color, #0d6efd);
  text-decoration: none;
}

.content-related-guides__link:hover {
  text-decoration: underline;
}

/* Blog/guides index list sits flat on the page background — Bootstrap's
   list-group-item paints a lighter --bs-list-group-bg that reads as a floating
   charcoal panel in dark mode. Make the flush list + its items transparent so
   posts sit on the page in both themes. */
.content-index .list-group,
.content-index .list-group-flush > .list-group-item {
  background-color: transparent;
}

/* Discovery search input (PR-3) — icon-prefixed search box. */
.content-filter__search-inner {
  position: relative;
  max-width: 28rem;
}
.content-filter__search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-secondary-color, #6c757d);
  pointer-events: none;
}
.content-filter__input {
  padding-left: 2.4rem;
}

/* ========================================
   LINKS — never the default Bootstrap blue (PR: brand link color)
   Charcoal, underlined; pancake-gold on hover. Light body-color in dark mode.
   Sets both the plain and -rgb Bootstrap link vars (BS 5.3 `a` uses -rgb).
   ======================================== */
:root,
[data-bs-theme="light"] {
  --bs-link-color: #222222;
  --bs-link-color-rgb: 34, 34, 34;
  --bs-link-hover-color: #b3852f;
  --bs-link-hover-color-rgb: 179, 133, 47;
}
[data-bs-theme="dark"] {
  --bs-link-color: #e5e7eb;
  --bs-link-color-rgb: 229, 231, 235;
  --bs-link-hover-color: #FFC44D;
  --bs-link-hover-color-rgb: 255, 196, 77;
}

/* ========================================
   STATUS PAGE — 90-day uptime bars
   incident.io / Statuspage-style per-service bar. Segment colors come from
   Bootstrap's theme-aware semantic vars so light/dark flip automatically via
   [data-bs-theme]; --bs-orange carries a hard fallback for the partial-outage
   amber-orange that Bootstrap does not redefine per theme.
   ======================================== */
.status-components {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.status-bar {
  display: flex;
  gap: 2px;
  align-items: stretch;
  width: 100%;
}

.status-seg {
  flex: 1 1 0;
  min-width: 2px;
  height: 34px;
  border-radius: 2px;
  background-color: var(--bs-secondary-bg, #e9ecef); /* nodata default */
  transition: filter 0.12s ease;
}

.status-seg:hover,
.status-seg:focus {
  filter: brightness(1.12);
}

.status-seg--up       { background-color: var(--bs-success); }
.status-seg--degraded { background-color: var(--bs-warning); }
.status-seg--partial  { background-color: var(--bs-orange, #fd7e14); }
.status-seg--down     { background-color: var(--bs-danger); }
.status-seg--nodata   { background-color: var(--bs-secondary-bg, #e9ecef); }

/* Legend swatches reuse the same segment colors at a small fixed size. */
.status-legend__swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

/* Narrow screens: the bar still shows all 90 days; segments get thin but the
   bar stays tappable-tall. */
@media (max-width: 575.98px) {
  .status-bar { gap: 1px; }
  .status-seg { height: 30px; min-width: 1px; }
}
