/* resources.css — Grilling Resource Pages
   Light theme · Clean · Professional · Core Web Vitals optimized
   ─────────────────────────────────────────────────────────────── */

/* ── Reset & Tokens ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light palette */
  --bg:          #f7faf9;
  --bg-card:     #ffffff;
  --bg-sidebar:  #f0faf6;
  --border:      #d1e9df;
  --text:        #0f1f18;
  --text-muted:  #4b6b5e;

  /* Brand */
  --emerald:     #059669;
  --emerald-lt:  #d1fae5;
  --emerald-dim: #ecfdf5;
  --blue:        #2563eb;
  --blue-lt:     #dbeafe;
  --accent:      #059669;   /* emerald as primary accent on light bg */
  --tag-bg:      #ecfdf5;

  /* Code blocks stay dark for readability */
  --code-bg:     #1e293b;
  --code-header: #0f172a;
  --code-border: #334155;

  /* Misc */
  --radius:      8px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,.08);
  --font:        'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --nav-h:       64px;
  --sidebar-w:   230px;
  --max-content: 820px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
}
a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── Top Nav ─────────────────────────────────────────────────── */
.r-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 2rem;
  padding: 0 2rem;
  background: #ffffff;
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
  border-bottom: 3px solid var(--emerald);
}
.r-nav__logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  text-decoration: none; flex-shrink: 0;
  letter-spacing: -.02em;
}
.r-nav__logo img { border-radius: 50%; width: 32px; height: 32px; }
.r-nav__logo span { color: var(--emerald); }

.r-nav__links {
  display: flex; gap: .25rem; flex-wrap: wrap;
  font-size: .82rem; font-weight: 500;
}
.r-nav__links a {
  color: var(--text-muted); padding: .35rem .7rem;
  border-radius: 6px; transition: background .15s, color .15s;
  text-decoration: none;
}
.r-nav__links a:hover {
  background: var(--emerald-lt); color: var(--emerald);
  text-decoration: none;
}

.r-nav__cta {
  margin-left: auto; flex-shrink: 0;
  padding: .5rem 1.2rem;
  background: var(--emerald);
  color: #fff; font-weight: 700; font-size: .82rem;
  border-radius: var(--radius);
  transition: background .2s, transform .15s;
  letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(5,150,105,.25);
}
.r-nav__cta:hover {
  background: #047857; transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(5,150,105,.35);
}

/* ── Layout ──────────────────────────────────────────────────── */
.r-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.r-sidebar {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  display: flex; flex-direction: column; gap: .75rem;
}
.r-sidebar__label {
  font-size: .65rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--emerald);
  padding-bottom: .5rem; border-bottom: 2px solid var(--emerald-lt);
}
.r-sidebar__nav { display: flex; flex-direction: column; gap: .15rem; }
.r-sidebar__link {
  font-size: .8rem; color: var(--text-muted); font-weight: 500;
  padding: .35rem .75rem; border-radius: var(--radius);
  transition: background .15s, color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid transparent;
  display: block;
}
.r-sidebar__link:hover {
  background: var(--emerald-lt); color: var(--emerald);
  text-decoration: none;
}
.r-sidebar__link.active {
  background: var(--emerald-lt);
  color: var(--emerald); font-weight: 700;
  border-left-color: var(--emerald);
  text-decoration: none;
}

/* ── Ad in sidebar ───────────────────────────────────────────── */
.r-ad--sidebar {
  margin-top: auto;
  min-height: 250px;
}

/* ── Main Content ────────────────────────────────────────────── */
.r-main {
  padding: 2rem 2rem 5rem;
  max-width: calc(var(--max-content) + 4rem);
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.r-breadcrumb {
  font-size: .78rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .3rem; align-items: center;
}
.r-breadcrumb a { color: var(--text-muted); font-weight: 500; }
.r-breadcrumb a:hover { color: var(--emerald); }

/* ── Tag badge ───────────────────────────────────────────────── */
.r-tag {
  display: inline-block;
  background: var(--emerald-lt); color: var(--emerald);
  font-size: .68rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; border-radius: 20px;
  padding: .2rem .65rem; margin-bottom: .75rem;
  border: 1px solid rgba(5,150,105,.2);
}

/* ── Article ─────────────────────────────────────────────────── */
.r-article__header { margin-bottom: 2rem; }
.r-article__header h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800; line-height: 1.2;
  color: var(--text); margin-bottom: .75rem;
  letter-spacing: -.02em;
}
.r-article__desc { color: var(--text-muted); font-size: 1.05rem; margin-bottom: .5rem; }
.r-article__date, .r-article__meta { font-size: .78rem; color: var(--text-muted); }

/* ── Table of Contents ───────────────────────────────────────── */
.r-toc {
  background: var(--emerald-dim); border: 1px solid var(--border);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.r-toc__label {
  font-size: .7rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--emerald); margin-bottom: .6rem;
}
.r-toc ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.r-toc a { color: var(--text-muted); font-size: .875rem; font-weight: 500; }
.r-toc a:hover { color: var(--emerald); }

/* ── Sections / Headings ─────────────────────────────────────── */
.r-article section { margin-bottom: 2.5rem; }
.r-article h2 {
  font-size: 1.2rem; font-weight: 800; color: var(--text);
  margin-bottom: .75rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: -.01em;
}
.r-article h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.r-article p { color: var(--text-muted); margin-bottom: .75rem; }
.r-article ul, .r-article ol { padding-left: 1.4rem; color: var(--text-muted); }

/* ── Code Block (intentionally dark for readability) ─────────── */
.r-code-block {
  border: 1px solid var(--code-border); border-radius: var(--radius-lg);
  overflow: hidden; margin: 1.25rem 0;
  box-shadow: var(--shadow-md);
}
.r-code-block__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--code-header); border-bottom: 1px solid var(--code-border);
}
.r-code-block__lang {
  font-size: .65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--emerald);
}
.r-copy-btn {
  font-size: .72rem; font-weight: 700; padding: .2rem .7rem;
  background: rgba(255,255,255,.08); color: #94a3b8;
  border: 1px solid rgba(255,255,255,.12); border-radius: 5px;
  cursor: pointer; transition: background .15s, color .15s;
}
.r-copy-btn:hover { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.r-code-block pre {
  background: var(--code-bg); padding: 1.25rem 1rem;
  overflow-x: auto;
}
.r-code-block code {
  font-family: var(--font-mono); font-size: .875rem;
  color: #e2e8f0; line-height: 1.65;
}

/* ── Bullet list ─────────────────────────────────────────────── */
.r-bullet-list {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 0; list-style: none;
}
.r-bullet-list li {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .65rem 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: .9rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s;
}
.r-bullet-list li:hover { border-color: var(--emerald); }
.r-bullet-list li::before {
  content: '▸'; color: var(--emerald); flex-shrink: 0; margin-top: .05rem;
}

/* ── Step List ───────────────────────────────────────────────── */
.r-steps { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.r-step {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.r-step:hover {
  border-color: var(--emerald);
  box-shadow: 0 4px 16px rgba(5,150,105,.1);
}
.r-step__num {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), #34d399);
  font-weight: 800; font-size: .875rem; color: #fff;
  box-shadow: 0 2px 8px rgba(5,150,105,.3);
}
.r-step__heading { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; color: var(--text); }
.r-step__body p { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* ── Tips block ──────────────────────────────────────────────── */
.r-tips {
  background: var(--emerald-dim);
  border: 1px solid rgba(5,150,105,.3);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.r-tips h2 { border-bottom: none; color: var(--emerald); margin-bottom: .75rem; }
.r-tips li { color: var(--text-muted); margin-bottom: .4rem; font-size: .9rem; }

/* ── Q&A List ────────────────────────────────────────────────── */
.r-qa-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.r-qa {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.r-qa:hover {
  border-color: var(--emerald);
  box-shadow: 0 4px 20px rgba(5,150,105,.08);
}
.r-qa__question {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, var(--emerald-dim), #fff);
  border-bottom: 1px solid var(--border);
}
.r-qa__num {
  font-size: .68rem; font-weight: 900; letter-spacing: .08em;
  color: var(--emerald); white-space: nowrap; padding-top: .2rem;
  background: var(--emerald-lt); padding: .15rem .45rem;
  border-radius: 4px;
}
.r-qa__q { font-size: .97rem; font-weight: 700; color: var(--text); margin: 0; line-height: 1.4; }
.r-qa__answer { padding: 1rem 1.25rem; }
.r-qa__answer p { color: var(--text-muted); font-size: .9rem; line-height: 1.75; }
.r-qa__howto {
  margin-top: .75rem; padding: .75rem 1rem;
  background: var(--emerald-dim);
  border-left: 3px solid var(--emerald);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .875rem; color: var(--text-muted);
}
.r-qa__howto strong { color: var(--emerald); }
.r-qa-item-ad { list-style: none; }

/* ── FAQ List ────────────────────────────────────────────────── */
.r-faq-list { display: flex; flex-direction: column; gap: .85rem; }
.r-faq {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}
.r-faq:hover { border-color: var(--emerald); }
.r-faq__q {
  font-size: .95rem; font-weight: 700; color: var(--text);
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, var(--emerald-dim), #fff);
  border-bottom: 1px solid var(--border);
  cursor: pointer; list-style: none;
}
.r-faq__a {
  padding: 1rem 1.25rem; color: var(--text-muted);
  font-size: .9rem; line-height: 1.75;
}

/* ── In-article Ad (inline, no reserved space) ───────────────── */
.r-ad--inarticle {
  width: 100%; margin-bottom: 1.5rem; text-align: center;
  min-height: 0;   /* no blank space if ad doesn't load */
}

/* ── Resource Index Page ─────────────────────────────────────── */
.r-index__hero {
  text-align: center; padding: 4rem 1rem 3rem;
}
.r-index__hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 900;
  color: var(--text);
  margin-bottom: 1rem; letter-spacing: -.03em;
}
.r-index__hero h1 span {
  color: var(--emerald);
}
.r-index__hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }
.r-index__section { margin-bottom: 3rem; }
.r-index__section h2 {
  font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
  color: var(--text); letter-spacing: -.01em;
}
.r-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .85rem;
}
.r-card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  text-decoration: none;
}
.r-card:hover {
  border-color: var(--emerald); transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(5,150,105,.1);
  text-decoration: none;
}
.r-card h3 { font-size: .9rem; font-weight: 700; color: var(--text); }

/* ── Footer ──────────────────────────────────────────────────── */
.r-footer {
  text-align: center; padding: 2rem 1rem 3rem;
  color: var(--text-muted); font-size: .78rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.r-footer a { color: var(--text-muted); font-weight: 500; }
.r-footer a:hover { color: var(--emerald); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .r-layout { grid-template-columns: 1fr; }
  .r-sidebar { display: none; }
  .r-main { padding: 1.25rem 1.25rem 4rem; }
  .r-nav { padding: 0 1rem; gap: 1rem; }
  .r-nav__links { display: none; }
}
@media (max-width: 480px) {
  .r-qa__question { flex-direction: column; gap: .25rem; }
  .r-step { flex-direction: column; }
  .r-nav__cta { padding: .4rem .8rem; font-size: .78rem; }
}
