/* ============================================================
   RESOURCES — listing (/resources/) and article (/resources/{slug}/)
   Adapted from Marketing's tubo-insights.html / tubo-insight-article.html.
   Everything is scoped under .res-page so it can't leak into the theme.
   ============================================================ */
.res-page {
  --res-green: #0b6e4f;
  --res-green-dark: #084f38;
  --res-green-deep: #063d2b;
  --res-mint: #eef7f3;
  --res-mint-2: #f5fbf8;
  --res-sun-soft: #fff6d6;
  --res-text: #383838;
  --res-title: #000;
  --res-muted: #5d6b64;
  --res-line: #dfe9e4;
  --res-ph: #e4efe9;
  --res-radius: 14px;
  --res-shadow: 0 1px 2px rgba(11,110,79,.06), 0 10px 26px rgba(11,110,79,.08);
  color: var(--res-text);
  font-size: clamp(14px, 0.95vw, 16px);
  line-height: 1.6;
  background: #fff;
}
.res-page h1, .res-page h2, .res-page h3, .res-page h4 { margin: 0; color: var(--res-title); line-height: 1.2; font-family: inherit; }
.res-page p { margin: 0; }
.res-page img { max-width: 100%; display: block; }
.res-page :focus-visible { outline: 2px solid var(--res-green); outline-offset: 3px; border-radius: 6px; }
.res-container { width: min(92%, 1200px); margin: 0 auto; }
.is-hidden { display: none !important; }

/* Buttons */
.res-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9em; padding: 0.6em 1.4em;
  border-radius: 999px; border: 2px solid var(--res-green);
  font: inherit; font-size: 0.95em; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.res-btn--primary { background: var(--res-green); color: #fff; }
.res-btn--primary:hover { background: var(--res-green-dark); border-color: var(--res-green-dark); color: #fff; }
.res-btn--outline { background: #fff; color: var(--res-green); }
.res-btn--outline:hover { background: var(--res-green); color: #fff; }
.res-btn--light { background: #fff; color: var(--res-green); border-color: #fff; }
.res-btn--light:hover { background: var(--res-mint); }
.res-btn--block { width: 100%; }
.res-btn[disabled] { opacity: .6; cursor: progress; }

/* Image placeholder (no featured image yet) */
.res-ph { display: block; width: 100%; height: 100%; min-height: inherit; background: var(--res-ph) linear-gradient(135deg, rgba(11,110,79,.06), rgba(11,110,79,0)); }

/* Meta + tags */
.res-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 1em; font-size: 0.85em; color: var(--res-muted); }
.res-tag { display: inline-block; background: var(--res-mint); color: var(--res-green-dark); font-weight: 700; font-size: 0.85em; padding: 0.25em 0.8em; border-radius: 999px; }
.res-tag--sun { background: var(--res-sun-soft); color: #7a5a00; }
.res-tag--outline { background: #fff; border: 1px solid var(--res-line); font-size: 0.8em; padding: 0.3em 0.9em; }

/* ── Listing hero + tabs ───────────────────────────────────── */
.res-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--res-mint) 0%, var(--res-mint-2) 60%, #fff 100%);
  padding: 3.5em 0 3em;
}
.res-hero::after {
  content: ""; position: absolute; right: -10%; top: -30%; width: 45%; height: 160%;
  background: radial-gradient(closest-side, rgba(11,110,79,.10), transparent 70%);
  pointer-events: none;
}
.res-hero .res-container { position: relative; z-index: 1; }
.res-eyebrow {
  display: inline-block; background: #fff; color: var(--res-green); font-weight: 700;
  font-size: 0.8em; padding: 0.35em 1em; border-radius: 999px; border: 1px solid var(--res-line); letter-spacing: 0.02em;
}
.res-hero h1 { font-size: clamp(1.8em, 3.2vw, 2.6em); font-weight: 900; margin: 0.5em 0 0.4em; letter-spacing: -0.01em; }
.res-hero h1 em { font-style: normal; color: var(--res-green); }
.res-hero p { font-size: 1em; max-width: 36em; }

.res-tabs { display: flex; gap: 0.5em; overflow-x: auto; padding: 1.4em 0 2px; margin: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.res-tabs::-webkit-scrollbar { display: none; }
.res-tab {
  flex: 0 0 auto; scroll-snap-align: start;
  background: #fff; border: 1px solid var(--res-line); border-radius: 999px;
  padding: 0.5em 1.1em; font-size: 0.9em; font-weight: 500; color: var(--res-text); text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.res-tab:hover { border-color: var(--res-green); color: var(--res-green); }
.res-tab.is-active { background: var(--res-green); border-color: var(--res-green); color: #fff; font-weight: 700; }

/* ── Listing layout ────────────────────────────────────────── */
.res-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22em; gap: 3em; padding: 3em 0 4em; }

.res-featured {
  display: grid; grid-template-columns: 1.15fr 1fr;
  background: #fff; border: 1px solid var(--res-line); border-radius: var(--res-radius);
  overflow: hidden; box-shadow: var(--res-shadow); text-decoration: none; color: inherit;
  margin-bottom: 2.4em; transition: transform .2s, box-shadow .2s;
}
.res-featured:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(11,110,79,.14); }
.res-featured__img { min-height: 20em; position: relative; }
.res-featured__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.res-featured__body { padding: 2em 2.2em; display: flex; flex-direction: column; justify-content: center; gap: 0.8em; }
.res-featured__body h2 { font-size: clamp(1.15em, 1.5vw, 1.4em); font-weight: 900; }
.res-read-link { color: var(--res-green); font-weight: 700; font-size: 0.95em; }
.res-featured:hover .res-read-link { text-decoration: underline; }

.res-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; margin-bottom: 1.2em; flex-wrap: wrap; }
.res-section-head h2 { font-size: 1.25em; font-weight: 900; }
.res-section-head span { color: var(--res-muted); font-size: 0.9em; }

.res-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4em; }
.res-card {
  background: #fff; border: 1px solid var(--res-line); border-radius: var(--res-radius);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  box-shadow: var(--res-shadow); transition: transform .2s, box-shadow .2s;
}
.res-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(11,110,79,.14); }
.res-card__img { height: 11em; position: relative; }
.res-card__img img { width: 100%; height: 100%; object-fit: cover; }
.res-card__body { padding: 1.2em 1.3em 1.4em; display: flex; flex-direction: column; gap: 0.7em; flex: 1; }
.res-card h3 { font-size: 1em; font-weight: 700; }
.res-card p { font-size: 0.92em; }
.res-card .res-meta { margin-top: auto; }
.res-grid.is-loading { opacity: .5; transition: opacity .15s; }

.res-empty { display: none; color: var(--res-muted); padding: 2em 0; text-align: center; }
.res-empty.is-shown { display: block; }
.res-load-more { display: flex; justify-content: center; margin-top: 2em; }

/* No-JS pager (resources.js hides it in favour of Load more) */
.res-pager { margin-top: 2em; }
.res-pager[hidden] { display: none; }
.res-pager ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em; }
.res-pager a, .res-pager span { display: inline-flex; align-items: center; min-height: 2.4em; padding: 0.3em 0.9em; border: 1px solid var(--res-line); border-radius: 999px; text-decoration: none; color: var(--res-text); font-size: 0.9em; }
.res-pager a:hover { border-color: var(--res-green); color: var(--res-green); }
.res-pager .current { background: var(--res-green); border-color: var(--res-green); color: #fff; font-weight: 700; }

/* Sidebar */
.res-side { display: flex; flex-direction: column; gap: 1.4em; align-self: start; position: sticky; top: calc(var(--header-height, 73px) + 24px); }
.res-panel { background: #fff; border: 1px solid var(--res-line); border-radius: var(--res-radius); padding: 1.4em; }
.res-panel h3 { font-size: 1.1em; font-weight: 900; margin-bottom: 0.4em; }
.res-panel > p { font-size: 0.92em; margin-bottom: 1em; }
.res-panel--green { background: var(--res-green); border-color: var(--res-green); color: #fff; }
.res-panel--green h3 { color: #fff; }
.res-panel--green > p { color: #d8efe5; }
.res-subscribe { position: relative; }
.res-hp { position: absolute !important; left: -9999px; top: -9999px; }
.res-field {
  width: 100%; padding: 0.75em 1em; border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-size: 16px; margin-bottom: 0.7em; background: #fff; color: var(--res-text);
}
.res-field:focus { outline: 2px solid var(--res-green-deep); outline-offset: 0; }
.res-subscribe .res-btn { width: 100%; }
.res-subscribe__msg { font-size: 0.88em; margin-top: 0.7em; min-height: 0; }
.res-subscribe__msg:empty { display: none; }
.res-subscribe__msg.newsletter-msg--ok { color: #fff; font-weight: 500; }
.res-subscribe__msg.newsletter-msg--err { color: #ffe08a; }
.res-popular { list-style: none; margin: 0; padding: 0; counter-reset: pop; }
.res-popular li { counter-increment: pop; display: flex; gap: 0.8em; padding: 0.8em 0; border-bottom: 1px solid var(--res-line); }
.res-popular li:last-child { border-bottom: 0; }
.res-popular li::before {
  content: counter(pop); flex: 0 0 1.9em; height: 1.9em; border-radius: 50%;
  background: var(--res-mint); color: var(--res-green); font-weight: 700; font-size: 0.85em;
  display: flex; align-items: center; justify-content: center;
}
.res-popular a { text-decoration: none; color: var(--res-text); font-weight: 500; font-size: 0.95em; line-height: 1.4; }
.res-popular a:hover { color: var(--res-green); }

/* ── Article ───────────────────────────────────────────────── */
.res-article { line-height: 1.7; }
.res-article-head { background: linear-gradient(160deg, var(--res-mint) 0%, var(--res-mint-2) 70%, #fff 100%); padding: 2.6em 0 2.2em; }
.res-crumbs { font-size: 0.85em; color: var(--res-muted); margin-bottom: 1.2em; display: flex; flex-wrap: wrap; gap: 0.4em; }
.res-crumbs a { text-decoration: none; color: var(--res-green); font-weight: 500; }
.res-crumbs a:hover { text-decoration: underline; }
.res-article-head h1 { font-size: clamp(1.6em, 2.6vw, 2.3em); font-weight: 900; margin: 0.7em 0 0.6em; max-width: 26em; letter-spacing: -0.01em; line-height: 1.25; }
.res-deck { max-width: 40em; font-size: 1.05em; margin: 0 0 1em !important; }
.res-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em 1.2em; font-size: 0.88em; color: var(--res-muted); }
.res-byline strong { color: var(--res-text); font-weight: 700; }
.res-hero-img { margin-top: 2em; border-radius: var(--res-radius); overflow: hidden; box-shadow: var(--res-shadow); height: 26em; position: relative; }
.res-hero-img img { width: 100%; height: 100%; object-fit: cover; }

.res-article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 16em; gap: 3em; padding: 3em 0 2em; }
.res-article-body { max-width: 42em; min-width: 0; }
.res-article-body p { margin: 0 0 1.1em; }
.res-article-body h2 { font-size: 1.3em; font-weight: 900; margin: 1.8em 0 0.6em; scroll-margin-top: calc(var(--header-height, 73px) + 16px); }
.res-article-body h3 { font-size: 1.05em; font-weight: 700; margin: 1.4em 0 0.4em; }
.res-article-body ul, .res-article-body ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.res-article-body ul { list-style: disc; }
.res-article-body ol { list-style: decimal; }
.res-article-body li::marker { color: var(--res-green); }
.res-article-body li { margin-bottom: 0.5em; }
.res-article-body a { color: var(--res-green); font-weight: 500; }
.res-article-body img { height: auto; border-radius: var(--res-radius); }
/* Content blocks used in Marketing's article HTML */
.res-article-body .figure, .res-article-body figure { margin: 1.8em 0; }
.res-article-body .ph { height: 15em; border-radius: var(--res-radius); background: var(--res-ph); display: flex; align-items: center; justify-content: center; color: #6f8a7d; font-size: 0.85em; font-weight: 500; }
.res-article-body figcaption { font-size: 0.82em; color: var(--res-muted); margin-top: 0.5em; }
.res-article-body .quote, .res-article-body blockquote {
  margin: 1.8em 0; padding: 1.2em 1.4em; background: var(--res-mint);
  border-left: 4px solid var(--res-green); border-radius: 0 var(--res-radius) var(--res-radius) 0;
}
.res-article-body .quote p, .res-article-body blockquote p { font-size: 1.05em; font-weight: 500; color: var(--res-green-deep); margin: 0 0 0.6em; }
.res-article-body cite { font-size: 0.85em; color: var(--res-muted); font-style: normal; }
.res-article-body .note { background: var(--res-sun-soft); border-radius: var(--res-radius); padding: 1em 1.2em; font-size: 0.92em; margin: 1.6em 0; }
.res-article-body .note ul { margin-bottom: 0; margin-top: 0.5em; }
.res-article-body .sources { font-size: 0.88em; }

/* Demo banner — the .res-cta after the article, and the .cta block inside article content */
.res-cta, .res-article-body .cta {
  background: var(--res-green); color: #fff; border-radius: 1.2em; padding: 2.2em 2.4em;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5em; flex-wrap: wrap; margin: 3em 0;
}
.res-article-body .cta { margin: 2em 0 0; }
.res-cta h2, .res-article-body .cta h2 { color: #fff; font-size: 1.25em; font-weight: 900; margin: 0 0 0.3em; }
.res-cta p, .res-article-body .cta p { color: #d8efe5; margin: 0; }
.res-article-body .cta .btn, .res-article-body .cta a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.8em; padding: 0.55em 1.3em;
  border-radius: 999px; background: #fff; color: var(--res-green); border: 2px solid #fff;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.res-article-body .cta a:hover { background: var(--res-mint); }

/* Rail: share + table of contents */
.res-rail { align-self: start; position: sticky; top: calc(var(--header-height, 73px) + 24px); display: flex; flex-direction: column; gap: 1.2em; }
.res-rail-box { border: 1px solid var(--res-line); border-radius: var(--res-radius); padding: 1.1em; background: #fff; }
.res-rail-box h4 { font-size: 0.95em; font-weight: 700; margin-bottom: 0.7em; }
.res-share { display: flex; flex-direction: column; gap: 0.5em; align-items: flex-start; }
.res-share a, .res-share__copy { font: inherit; font-size: 0.9em; color: var(--res-green); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.res-share a:hover, .res-share__copy:hover { text-decoration: underline; }
.res-toc { list-style: none; margin: 0; padding: 0; font-size: 0.9em; }
.res-toc li { padding: 0.45em 0; border-bottom: 1px solid var(--res-line); line-height: 1.4; }
.res-toc li:last-child { border-bottom: 0; }
.res-toc a { text-decoration: none; color: var(--res-text); }
.res-toc a:hover { color: var(--res-green); }

/* Related */
.res-related { background: var(--res-mint-2); padding: 3em 0; margin-top: 1em; }
.res-related h2 { font-size: 1.3em; font-weight: 900; margin-bottom: 1.2em; }
.res-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2em; }
.res-rcard { background: #fff; border: 1px solid var(--res-line); border-radius: var(--res-radius); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--res-shadow); display: flex; flex-direction: column; transition: transform .2s; }
.res-rcard:hover { transform: translateY(-3px); }
.res-rcard__img { height: 9em; }
.res-rcard__img img { width: 100%; height: 100%; object-fit: cover; }
.res-rcard__body { padding: 1em 1.1em 1.2em; display: flex; flex-direction: column; gap: 0.5em; }
.res-rcard h3 { font-size: 0.98em; font-weight: 700; }
.res-rcard__meta { font-size: 0.8em; color: var(--res-muted); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .res-layout { grid-template-columns: 1fr; }
  .res-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .res-article-wrap { grid-template-columns: 1fr; }
  .res-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .res-rail > .res-rail-box { flex: 1 1 14em; }
  .res-related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .res-page { font-size: 15px; }
  .res-container { width: auto; margin: 0 16px; }
  .res-tabs { margin-right: -16px; padding-right: 16px; }
  .res-hero { padding: 2.2em 0 2em; }
  .res-featured { grid-template-columns: 1fr; }
  .res-featured__img { min-height: 13em; }
  .res-featured__body { padding: 1.4em; }
  .res-grid { grid-template-columns: 1fr; gap: 1.1em; }
  .res-card__img { height: 12em; }
  .res-side { grid-template-columns: 1fr; }
  .res-article-head { padding: 1.8em 0 1.6em; }
  .res-hero-img { height: 14em; }
  .res-article-body .ph { height: 11em; }
  .res-article-wrap { padding: 2em 0 1em; gap: 2em; }
  .res-related-grid { grid-template-columns: 1fr; }
  .res-cta, .res-article-body .cta { padding: 1.6em 1.4em; }
}
@media (prefers-reduced-motion: reduce) {
  .res-card, .res-featured, .res-rcard { transition: none; }
  .res-card:hover, .res-featured:hover, .res-rcard:hover { transform: none; }
}
