/* ================================================================
   KOOPGIDS — Article stylesheet
   Single source of truth for all /koopgids pages.
   Fonts: Inter (body) + DM Serif Display (headings)
   ================================================================ */

/* 1. VARIABLES
   ------------------------------------------------------------ */
:root {
  --coffee:        #b85c38;
  --coffee-light:  #d4784f;
  --coffee-bg:     #fdf3ee;
  --coffee-border: #f0d6c8;
  --text:          #1c1c1c;
  --text-dim:      #555;
  --text-light:    #888;
  --border:        #e8e0d8;
  --bg:            #ffffff;
  --bg-soft:       #fafaf8;
  --bg-warm:       #fdf6f0;
  --ok:            #2e7d32;
  --no:            #c62828;
  --font-sans:     'Inter', system-ui, sans-serif;
  --font-serif:    'DM Serif Display', Georgia, serif;
  --nav-h:         60px;
  --container-w:   1080px;
  --article-w:     680px;
  --sidebar-w:     244px;
}

/* 2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--coffee); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ol, ul { padding-left: 1.4rem; }

/* 3. TYPOGRAPHY
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(1.65rem, 4vw, 2.1rem); margin-bottom: 0.6rem; }
h2 { font-size: clamp(1.15rem, 2.5vw, 1.45rem); margin-top: 2rem; margin-bottom: 0.5rem; }
h3 { font-family: var(--font-sans); font-size: 0.97rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.3rem; }
h4 { font-family: var(--font-sans); font-size: 0.9rem;  font-weight: 600; margin-top: 0.85rem; margin-bottom: 0.2rem; }

p  { font-size: 0.93rem; line-height: 1.78; margin-bottom: 0.7rem; }
li { font-size: 0.93rem; line-height: 1.65; margin-bottom: 0.2rem; }
strong { font-weight: 600; }

/* 4. NAVBAR
   ------------------------------------------------------------ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 1000;
}

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.15rem;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 0.35rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 5px;
  transition: background 140ms, color 140ms;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg-soft); text-decoration: none; }

/* Dropdown */
.nav-item.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 7px;
  min-width: 175px;
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  list-style: none;
  padding: 0.3rem;
  z-index: 200;
}
.nav-item.dropdown:hover .dropdown-menu { display: block; }
.dropdown-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-radius: 5px;
  white-space: nowrap;
}
.dropdown-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }

/* Mobile toggle (hidden desktop) */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms, opacity 200ms;
}
.mobile-menu-overlay { display: none; }

/* 5. BLOG HERO (page header)
   ------------------------------------------------------------ */
.blog-hero {
  padding: calc(var(--nav-h) + 2rem) 0 1.75rem;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
}

.blog-container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.guide-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}
.guide-breadcrumb a { color: var(--text-light); }
.guide-breadcrumb a:hover { color: var(--coffee); text-decoration: none; }
.guide-breadcrumb span { margin: 0 0.3rem; }

.guide-badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--coffee);
  background: var(--coffee-bg);
  border: 1px solid var(--coffee-border);
  border-radius: 2rem;
  padding: 0.17rem 0.62rem;
  margin-bottom: 0.65rem;
}

.guide-meta-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.65rem 0 0;
}
.guide-author-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--coffee);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.guide-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.guide-author-name { font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.guide-author-role { font-size: 0.72rem; color: var(--text-light); }
.guide-meta-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.guide-meta-item { font-size: 0.77rem; color: var(--text-light); }
.guide-meta-item strong { color: var(--text-dim); font-weight: 600; }

.blog-intro-text {
  font-size: 0.97rem;
  color: var(--text-dim);
  line-height: 1.72;
  max-width: var(--article-w);
  margin-top: 0.85rem;
  margin-bottom: 0;
}

/* Reading progress bar */
.guide-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--coffee);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* 6. MAIN LAYOUT
   ------------------------------------------------------------ */
main { background: var(--bg); }

.guide-layout-wrap {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.guide-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2.5rem;
  align-items: start;
  padding: 2.25rem 0 4rem;
}

/* 7. ARTICLE CONTENT
   ------------------------------------------------------------ */
.blog-article, .guide-main-col { min-width: 0; }

.blog-article section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.blog-article section:last-of-type { border-bottom: none; margin-bottom: 0; }

/* Headings inside article */
.blog-article h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.blog-article h3 { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; }
.blog-article h4 { font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600; }

/* Tables */
.blog-article table, .compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  margin: 0.75rem 0;
}
.blog-article th, .compat-table th {
  background: var(--bg-warm);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  text-align: left;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  border-bottom: 2px solid var(--border);
}
.blog-article td, .compat-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.blog-article tr:last-child td, .compat-table tr:last-child td { border-bottom: none; }
.blog-article tr:hover td, .compat-table tr:hover td { background: var(--bg-soft); }
.compat-ok { color: var(--ok); font-weight: 600; }
.compat-no { color: var(--no); font-weight: 600; }

/* Scrollable table wrapper */
.blog-article div[style*="overflow"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 8. COMPONENTS
   ------------------------------------------------------------ */

/* Compare box (2-col grid) */
.blog-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.blog-compare > div {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1rem 1.1rem;
}
.blog-compare h3 { margin-top: 0; }
.blog-compare h4 { margin-top: 0.6rem; }

/* Callout boxes */
.blog-callout {
  background: var(--coffee-bg);
  border-left: 3px solid var(--coffee);
  border-radius: 0 7px 7px 0;
  padding: 0.85rem 1rem;
  margin: 1rem 0;
}
.blog-callout.blog-callout-neutral {
  background: var(--bg-soft);
  border-left-color: var(--border);
}
.blog-callout h4 { margin-top: 0; color: var(--coffee); }
.blog-callout-neutral h4 { color: var(--text); }
.blog-callout p:last-child, .blog-callout ul:last-child { margin-bottom: 0; }
.blog-callout-attr { font-size: 0.82rem; color: var(--text-light); font-style: italic; }

/* Scenarios */
.blog-scenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.blog-scenario {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 1rem;
}
.blog-scenario h4 { font-size: 0.87rem; margin-top: 0; color: var(--coffee); }
.blog-scenario blockquote {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 0.4rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
}
.blog-scenario p { font-size: 0.83rem; margin-bottom: 0; }

/* FAQ (details/summary) */
.blog-faq { margin: 0.5rem 0; }
.blog-faq details { border-bottom: 1px solid var(--border); }
.blog-faq details:first-child { border-top: 1px solid var(--border); }
.blog-faq summary {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.91rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  color: var(--text);
  gap: 0.5rem;
}
.blog-faq summary::-webkit-details-marker { display: none; }
.blog-faq summary::after { content: '+'; color: var(--coffee); font-size: 1.1rem; font-weight: 300; flex-shrink: 0; }
.blog-faq details[open] summary::after { content: '−'; }
.blog-faq details p { font-size: 0.9rem; color: var(--text-dim); margin: 0 0 0.75rem; }

/* CTA block */
.blog-cta {
  background: var(--bg-warm);
  border: 1px solid var(--coffee-border);
  border-radius: 8px;
  padding: 1.4rem 1.5rem;
  margin: 2rem 0;
}
.blog-cta h2 { margin-top: 0; font-size: 1.15rem; }
.blog-cta li { font-size: 0.9rem; }
.blog-cta ul { margin-bottom: 0; }

/* Related articles */
.blog-related-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.similar-articles h3 { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-bottom: 0.75rem; }
.similar-articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.similar-article-card { display: block; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; transition: border-color 140ms, box-shadow 140ms; }
.similar-article-card:hover { border-color: var(--coffee); box-shadow: 0 2px 10px rgba(0,0,0,.07); text-decoration: none; }
.similar-article-image { width: 100%; height: 80px; object-fit: cover; }
.similar-article-content { padding: 0.6rem 0.75rem 0.75rem; }
.similar-article-title { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 0.2rem; }
.similar-article-summary { font-size: 0.75rem; color: var(--text-light); margin: 0; }

/* Author box */
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem;
  margin-top: 2rem;
}
.author-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--coffee);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-body { min-width: 0; }
.author-label { font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-light); margin-bottom: 0.1rem; }
.author-name { font-size: 0.93rem; font-weight: 700; margin-bottom: 0.1rem; }
.author-role { font-size: 0.78rem; color: var(--text-light); margin-bottom: 0.4rem; }
.author-bio { font-size: 0.83rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 0; }

/* 9. SIDEBAR
   ------------------------------------------------------------ */
.guide-sidebar-col { min-width: 0; }
.guide-sidebar-sticky { position: sticky; top: calc(var(--nav-h) + 1.25rem); }

.guide-sidebar-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
}

.guide-sidebar-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

/* TOC list */
.guide-toc-list { list-style: none; counter-reset: toc-c; padding: 0; }
.guide-toc-list li { counter-increment: toc-c; margin-bottom: 0; }
.guide-toc-list a {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 0.17rem 0;
  line-height: 1.45;
  transition: color 140ms;
}
.guide-toc-list a::before {
  content: counter(toc-c);
  font-size: 0.62rem;
  font-weight: 700;
  color: #ccc;
  min-width: 0.85rem;
  flex-shrink: 0;
}
.guide-toc-list a:hover, .guide-toc-list a.toc-active { color: var(--coffee); text-decoration: none; }
.guide-toc-list a.toc-active::before { color: var(--coffee); }

/* Picks */
.guide-pick { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.guide-pick:last-child { border-bottom: none; padding-bottom: 0; }
.guide-pick-lbl { font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-bottom: 0.08rem; }
.guide-pick-name { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.05rem; }
.guide-pick-detail { font-size: 0.76rem; color: var(--text-dim); margin-bottom: 0.15rem; }
.guide-pick-link { font-size: 0.76rem; color: var(--coffee); font-weight: 600; }
.guide-pick-link:hover { text-decoration: underline; }

/* 10. FOOTER
   ------------------------------------------------------------ */
.footer { background: #1a1a1a; padding: 3rem 0 1.5rem; margin-top: 2rem; }

/* Grid row */
.footer .container > div:first-child {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #333;
  margin-bottom: 1.5rem;
}

/* Brand column – first p is the brand name */
.footer .container > div:first-child > div:first-child > p:first-child {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: white;
  margin-bottom: 0.75rem;
}
.footer .container > div:first-child > div:first-child > p:last-child {
  color: #999;
  font-size: 0.85rem;
  line-height: 1.7;
  margin: 0;
}

/* Link columns */
.footer .container > div:first-child > div:not(:first-child) h4 {
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
  margin-top: 0;
}
.footer .container > div:first-child > div:not(:first-child) ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer .container > div:first-child > div:not(:first-child) li { margin-bottom: 0.5rem; }
.footer .container > div:first-child > div:not(:first-child) a {
  color: #aaa;
  font-size: 0.85rem;
  transition: color 140ms;
}
.footer .container > div:first-child > div:not(:first-child) a:hover { color: white; text-decoration: none; }

/* Bottom row */
.footer .container > div:last-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer .container > div:last-child p { color: #666; font-size: 0.8rem; margin: 0; }

/* 10b. UTILITY & REMAINING INLINE OVERRIDES
   ------------------------------------------------------------ */

/* Green/red h4 in compare boxes (inline style="color:#4caf50 / #e53935") */
h4[style*="color:#4caf50"], h4[style*="color: #4caf50"] { color: var(--ok) !important; }
h4[style*="color:#e53935"], h4[style*="color: #e53935"] { color: var(--no) !important; }

/* Small note paragraph */
p[style*="font-size:.82rem"] { font-size: 0.82rem !important; color: var(--text-dim) !important; }

/* Overflow table wrappers */
div[style*="overflow-x:auto"] { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Author avatar — inline background redundant, CSS already sets it */
.author-avatar[style] { background: var(--coffee) !important; }

/* Sidebar CTA card */
.guide-sidebar-card[style*="background:var(--coffee)"] {
  background: var(--coffee) !important;
  border-color: var(--coffee) !important;
}
.guide-sidebar-card[style*="background:var(--coffee)"] .guide-sidebar-label {
  color: rgba(255,255,255,.65) !important;
}
.guide-sidebar-card[style*="background:var(--coffee)"] p {
  color: white !important;
  font-size: 0.82rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}
.guide-sidebar-card[style*="background:var(--coffee)"] a {
  display: block;
  text-align: center;
  background: white;
  color: var(--coffee) !important;
  border-radius: 5px;
  padding: 0.45rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none !important;
}
.guide-sidebar-card[style*="background:var(--coffee)"] a:hover { opacity: 0.9; }

/* 11. RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; gap: 0; padding-top: 1.5rem; }
  .guide-sidebar-col { order: -1; margin-bottom: 1.5rem; }
  .guide-sidebar-sticky { position: static; }
  .guide-toc-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
  .guide-toc-list li { margin: 0; counter-increment: none; }
  .guide-toc-list a { font-size: 0.75rem; background: var(--bg-warm); padding: 0.22rem 0.55rem; border-radius: 2rem; line-height: 1.4; }
  .guide-toc-list a::before { display: none; }
  .guide-meta-sep { display: none; }
  .blog-compare, .blog-scenarios { grid-template-columns: 1fr; }
  .similar-articles-grid { grid-template-columns: 1fr 1fr; }
  .footer .container > div:first-child { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
}

@media (max-width: 640px) {
  .blog-hero { padding-top: calc(var(--nav-h) + 1.25rem); padding-bottom: 1.25rem; }
  .guide-layout-wrap, .blog-container { padding: 0 1rem; }
  .nav-menu { display: none; }
  .mobile-menu-toggle { display: flex; }
  .nav-menu.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    gap: 0.2rem;
    z-index: 999;
  }
  .mobile-menu-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 998;
  }
  .similar-articles-grid { grid-template-columns: 1fr; }
  .footer .container > div:first-child { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer .container > div:last-child { flex-direction: column; text-align: center; }
}
