/* ============================================================
   Ricky's Gutters: blog (index + article)
   Built on tokens.css. The index is a navy masthead over a light card grid;
   the article is a 68ch reading column with a sticky aside on wide screens.
   ============================================================ */

/* ---------- shared: masthead ---------- */

.rg-blogmast {
  position: relative;
  overflow: hidden;
  background: var(--rg-navy-ink);
  color: var(--rg-on-dark);
  padding-block: clamp(48px, 7vw, 88px);
}
.rg-blogmast::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: url("/assets/water-droplets-light.webp") center / cover no-repeat;
  opacity: .14;
  -webkit-mask-image: linear-gradient(transparent 0, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(transparent 0, #000 20%, #000 80%, transparent 100%);
}
.rg-blogmast::after {
  content: "";
  position: absolute;
  right: -10vw;
  top: -30%;
  width: min(60vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0,200,255,.22) 0%, rgba(0,200,255,.06) 45%, transparent 70%);
}
.rg-blogmast .rg-in { position: relative; z-index: 1; display: grid; gap: 14px; }
.rg-blogmast .rg-eyebrow { color: var(--rg-cyan-light); margin: 0; }
.rg-blogmast__title {
  font-family: var(--rg-font-head);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  color: #fff;
  margin: 0;
  max-width: 18ch;
  text-wrap: balance;
}
.rg-blogmast__lede { font-size: var(--rg-body); line-height: 1.6; color: var(--rg-on-dark-dim); max-width: 56ch; margin: 0; }

/* category chips: links, so they work without JS and are crawlable */
.rg-blogcats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rg-blogcats a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 999px;
  font-family: var(--rg-font-head); font-size: .85rem; font-weight: 700; text-decoration: none;
  color: #fff; border: 1px solid rgba(255,255,255,.3);
  transition: background 160ms ease, border-color 160ms ease;
}
.rg-blogcats a:hover { border-color: #fff; }
.rg-blogcats a[aria-current="true"] { background: var(--rg-cyan); border-color: var(--rg-cyan); color: var(--rg-navy-ink); }
.rg-blogcats a span { font-size: .75rem; opacity: .75; }
.rg-blogcats a[aria-current="true"] span { opacity: .8; }

/* ---------- index: featured + grid ---------- */

.rg-blogindex { background: var(--rg-surface); }
.rg-blogindex .rg-in { display: grid; gap: clamp(28px, 4vw, 48px); }

.rg-post-card {
  display: grid;
  gap: 0;
  border-radius: var(--rg-r-lg);
  background: var(--rg-surface);
  box-shadow: inset 0 0 0 1px var(--rg-border);
  overflow: hidden;
  color: var(--rg-text);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.rg-post-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--rg-border-cool), var(--rg-shadow-soft); }
.rg-post-card:focus-visible { outline: 3px solid var(--rg-cyan); outline-offset: 3px; }
.rg-post-card__media { position: relative; aspect-ratio: 16 / 9; background: var(--rg-surface-alt); overflow: hidden; }
.rg-post-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.rg-post-card:hover .rg-post-card__media img { transform: scale(1.03); }
.rg-post-card__body { display: grid; gap: 10px; padding: 22px 24px 24px; align-content: start; }
.rg-post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--rg-font-head); font-size: .78rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--rg-text-muted); }
.rg-post-card__meta b { color: var(--rg-blue); }
.rg-post-card h2, .rg-post-card h3 {
  font-family: var(--rg-font-head); font-weight: 800; line-height: 1.2; margin: 0; color: var(--rg-text); text-wrap: balance;
}
.rg-post-card h3 { font-size: 1.2rem; }
.rg-post-card p { margin: 0; font-size: .97rem; line-height: 1.6; color: var(--rg-text-body); }
.rg-post-card__more { font-family: var(--rg-font-head); font-weight: 800; font-size: .92rem; color: var(--rg-navy); margin-top: 4px; }

/* the newest post gets the wide treatment */
.rg-post-card--featured { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.rg-post-card--featured .rg-post-card__media { aspect-ratio: auto; min-height: 320px; }
.rg-post-card--featured .rg-post-card__body { padding: clamp(24px, 3.5vw, 44px); justify-content: center; align-content: center; }
.rg-post-card--featured h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); }
.rg-post-card--featured p { font-size: 1.05rem; }

.rg-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.rg-post-grid > .rg-post-card > .rg-post-card__media { aspect-ratio: 5 / 3; }

.rg-blog-empty { padding: 40px; border-radius: var(--rg-r-lg); background: var(--rg-surface-alt); text-align: center; color: var(--rg-text-body); }
.rg-blog-empty a { color: var(--rg-navy); font-weight: 700; }

/* ---------- article ---------- */

.rg-article-head { background: var(--rg-surface); padding-block: clamp(32px, 5vw, 64px) 0; }
.rg-article-head .rg-in { display: grid; gap: 16px; max-width: 980px; }
.rg-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 0; list-style: none; font-size: .9rem; color: var(--rg-text-muted); }
.rg-crumbs a { color: var(--rg-text-muted); text-decoration: none; }
.rg-crumbs a:hover { color: var(--rg-navy); text-decoration: underline; }
.rg-crumbs li + li::before { content: "/"; margin-right: 10px; color: var(--rg-border-cool); }
.rg-article-head .rg-post-card__meta { font-size: .8rem; }
.rg-article-title {
  font-family: var(--rg-font-head);
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.01em;
  color: var(--rg-text);
  margin: 0;
  text-wrap: balance;
}
.rg-article-lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.6; color: var(--rg-text-body); margin: 0; max-width: 62ch; text-wrap: pretty; }
.rg-article-by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .92rem; color: var(--rg-text-muted); margin: 0; }
.rg-article-by b { color: var(--rg-text); font-weight: 700; }
.rg-article-by img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: inset 0 0 0 1px var(--rg-border); }

.rg-article-hero { background: var(--rg-surface); padding-block: 26px 0; }
.rg-article-hero .rg-in { max-width: 980px; }
.rg-article-hero figure { margin: 0; }
.rg-article-hero img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--rg-r-lg); box-shadow: var(--rg-shadow-soft); }
.rg-article-hero figcaption { margin-top: 10px; font-size: .85rem; color: var(--rg-text-muted); }

.rg-article { background: var(--rg-surface); padding-block: clamp(32px, 5vw, 56px) clamp(40px, 6vw, 72px); }
.rg-article .rg-in { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(32px, 5vw, 64px); align-items: start; }

.rg-prose { font-size: 1.125rem; line-height: 1.75; color: var(--rg-text-body); max-width: 68ch; }
.rg-prose > * + * { margin-top: 1.2em; }
.rg-prose h2 {
  font-family: var(--rg-font-head); font-size: clamp(1.4rem, 1.15rem + 1vw, 1.85rem); font-weight: 800; line-height: 1.2;
  color: var(--rg-text); margin: 2em 0 .6em; text-wrap: balance; scroll-margin-top: 110px;
}
.rg-prose h2:first-child { margin-top: 0; }
.rg-prose h3 { font-family: var(--rg-font-head); font-size: 1.2rem; font-weight: 800; color: var(--rg-text); margin: 1.6em 0 .5em; scroll-margin-top: 110px; }
.rg-prose h4 { font-family: var(--rg-font-head); font-size: 1.05rem; font-weight: 800; color: var(--rg-text); margin: 1.4em 0 .4em; }
.rg-prose p { margin: 0; }
.rg-prose p + p { margin-top: 1.2em; }
.rg-prose a { color: var(--rg-navy); font-weight: 500; text-decoration: underline; text-decoration-color: var(--rg-cyan); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.rg-prose a:hover { text-decoration-color: var(--rg-navy); }
.rg-prose strong { color: var(--rg-text); }
.rg-prose ul, .rg-prose ol { padding-left: 1.3em; }
.rg-prose li { margin: .45em 0; }
.rg-prose li::marker { color: var(--rg-blue); font-weight: 700; }
.rg-prose blockquote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 4px solid var(--rg-action); border-radius: 0 var(--rg-r-md) var(--rg-r-md) 0;
  background: var(--rg-surface-alt); color: var(--rg-text); font-size: 1.15rem; line-height: 1.55;
}
.rg-prose blockquote p { margin: 0; }
.rg-prose img { max-width: 100%; height: auto; border-radius: var(--rg-r-md); box-shadow: var(--rg-shadow-soft); }
.rg-prose hr { border: 0; border-top: 1px solid var(--rg-hairline); margin: 2em 0; }
.rg-prose code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--rg-surface-alt); padding: .1em .35em; border-radius: 4px; }
.rg-prose table { border-collapse: collapse; width: 100%; font-size: 1rem; }
.rg-prose th, .rg-prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rg-hairline); vertical-align: top; }
.rg-prose th { font-family: var(--rg-font-head); font-size: .8rem; letter-spacing: .8px; text-transform: uppercase; color: var(--rg-text-muted); }

/* aside: contents, then the ask */
.rg-aside { position: sticky; top: 104px; display: grid; gap: 18px; }
.rg-aside__box { padding: 20px 22px; border-radius: var(--rg-r-md); background: var(--rg-surface-alt); box-shadow: inset 0 0 0 1px var(--rg-border); display: grid; gap: 10px; }
.rg-aside__box .rg-eyebrow { margin: 0; }
.rg-toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: toc; }
.rg-toc a { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: baseline; font-size: .93rem; line-height: 1.4; color: var(--rg-text-body); text-decoration: none; padding: 3px 0; }
.rg-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-family: var(--rg-font-head); font-size: .72rem; font-weight: 800; letter-spacing: 1px; color: var(--rg-blue); }
.rg-toc a:hover { color: var(--rg-navy); text-decoration: underline; }
.rg-aside__ask { background: var(--rg-navy); color: #fff; }
.rg-aside__ask .rg-eyebrow { color: var(--rg-cyan-light); }
.rg-aside__ask b { font-family: var(--rg-font-head); font-size: 1.15rem; line-height: 1.25; color: #fff; }
.rg-aside__ask p { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--rg-on-dark-dim); }
.rg-aside__ask a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: var(--rg-r-sm); font-family: var(--rg-font-head); font-weight: 800; font-size: .95rem; text-decoration: none;
}
.rg-aside__ask .rg-aside__call { background: #fff; color: var(--rg-navy); }
.rg-aside__ask .rg-aside__call:hover { background: var(--rg-cyan-light); }
.rg-aside__ask .rg-aside__quote { color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.rg-aside__ask .rg-aside__quote:hover { box-shadow: inset 0 0 0 2px #fff; }
.rg-share { display: flex; flex-wrap: wrap; gap: 8px; }
.rg-share a, .rg-share button {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--rg-border-cool); background: #fff; color: var(--rg-navy); font-family: var(--rg-font-head); font-size: .82rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.rg-share a:hover, .rg-share button:hover { border-color: var(--rg-navy); }
.rg-share svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* the quote form after the article */
.rg-article-ask { background: var(--rg-navy-ink); padding-block: clamp(48px, 6vw, 80px); }
.rg-article-ask .rg-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 480px); gap: clamp(28px, 5vw, 72px); align-items: center; max-width: 1120px; }
.rg-article-ask .rg-eyebrow { color: var(--rg-cyan-light); }
.rg-article-ask .rg-h2 { color: #fff; }
.rg-article-ask .rg-lede { color: var(--rg-on-dark-dim); }

.rg-readnext { background: var(--rg-surface-alt); }
.rg-readnext .rg-in { display: grid; gap: 22px; }

@media (max-width: 980px) {
  .rg-article .rg-in { grid-template-columns: 1fr; }
  .rg-aside { position: static; }
  .rg-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rg-post-card--featured { grid-template-columns: 1fr; }
  .rg-post-card--featured .rg-post-card__media { aspect-ratio: 16 / 9; min-height: 0; }
  .rg-article-ask .rg-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rg-post-grid { grid-template-columns: 1fr; }
  .rg-prose { font-size: 1.0625rem; }
  .rg-article-hero img { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-post-card, .rg-post-card__media img { transition: none; }
}
