/*
Theme Name: cssbuy spreadsheet
Theme URI: https://sheetfinds.com/
Author: cssbuy spreadsheet Team
Description: A crisp, editorial SEO WordPress theme for the cssbuy Spreadsheet shopping guide. Royal blue + canary yellow + chalk white palette.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: cssbuy-spreadsheet
*/

:root {
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-accent: #2342b8;
  --color-accent-dark: #152b7f;
  --color-accent-2: #f7c948;
  --color-text: #0f1734;
  --color-text-muted: #5a6378;
  --color-border: #e2e6f0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(15,23,52,0.06);
  --shadow-md: 0 10px 24px rgba(15,23,52,0.10);
  --shadow-blue: 0 14px 30px rgba(35,66,184,0.18);
  --ff-sans: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --ff-serif: 'Playfair Display', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0a0f1f;
    --color-surface: #161c38;
    --color-accent: #6a7cd9;
    --color-accent-dark: #4e60c0;
    --color-accent-2: #ffd96a;
    --color-text: #eaedf7;
    --color-text-muted: #9aa3bb;
    --color-border: #262d4a;
  }
}
:root[data-theme="dark"] {
  --color-bg: #0a0f1f;
  --color-surface: #161c38;
  --color-accent: #6a7cd9;
  --color-accent-dark: #4e60c0;
  --color-accent-2: #ffd96a;
  --color-text: #eaedf7;
  --color-text-muted: #9aa3bb;
  --color-border: #262d4a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-dark); }
h1, h2, h3, h4 { font-family: var(--ff-serif); color: var(--color-text); line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(32px, 5vw, 54px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); }
h3 { font-size: clamp(19px, 2.4vw, 24px); }
p { margin: 0 0 1em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

:focus-visible { outline: 3px solid var(--color-accent-2); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Announcement */
.announce {
  background: var(--color-accent);
  color: #f6f7fb;
  font-size: 14px;
  text-align: center;
  padding: 10px 16px;
  letter-spacing: 0.02em;
}

/* Header */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 16px 0;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--ff-serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--color-accent);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1.1;
}
.brand .brand-name { font-style: italic; }
.brand .tag {
  font-family: var(--ff-sans);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 11px;
  color: var(--color-accent-2);
  letter-spacing: 0.08em;
  background: var(--color-text);
  padding: 3px 7px;
  border-radius: 4px;
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: flex-end;
}
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 20px; align-items: center;
}
.nav-item { position: relative; }
.nav-item > a,
.nav-item > details > summary {
  color: var(--color-text);
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  user-select: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-item > details > summary::-webkit-details-marker { display: none; }
.nav-item > details > summary::marker { content: ""; }
.nav-item > a:hover,
.nav-item > details > summary:hover,
.nav-item > details[open] > summary {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.nav-item .arrow { font-size: 10px; transition: transform 0.2s ease; line-height: 1; }
.nav-item > details[open] > summary .arrow { transform: rotate(180deg); }

.nav-details { position: static; }
.nav-sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(15,23,52,0.14);
  min-width: 280px;
  padding: 10px;
  list-style: none; margin: 0;
  z-index: 60;
}
.nav-sub li { list-style: none; margin: 0; }
.nav-sub a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text);
  font-family: var(--ff-sans);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-sub a:hover { background: rgba(35,66,184,0.08); color: var(--color-accent); }

.cta-group { display: inline-flex; gap: 10px; align-items: center; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn-primary { background: var(--color-accent-2); color: var(--color-text); border-color: var(--color-accent-2); }
.btn-primary:hover { background: #ffd96a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--color-accent); border-color: var(--color-accent); }
.btn-secondary:hover { background: var(--color-accent); color: #ffffff; }
.btn-ghost { background: transparent; color: #ffffff; border-color: rgba(255,255,255,0.6); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-toggle-label {
  display: none;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 14px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 14px;
  user-select: none;
}
.menu-toggle-label .hamburger-icon { font-size: 18px; line-height: 1; }

@media (max-width: 960px) {
  .masthead { flex-wrap: wrap; gap: 16px; padding: 14px 0; }
  .menu-toggle-label { display: inline-flex; }
  .nav-primary {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
  }
  .menu-toggle:checked ~ .nav-primary { display: flex; }
  .nav-list { flex-direction: column; width: 100%; gap: 2px; align-items: stretch; }
  .nav-item { width: 100%; }
  .nav-item > a,
  .nav-item > details > summary {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    justify-content: space-between;
    background: var(--color-surface);
  }
  .nav-item > a:hover,
  .nav-item > details > summary:hover,
  .nav-item > details[open] > summary {
    border-color: var(--color-accent);
    background: rgba(35,66,184,0.06);
  }
  .nav-sub {
    position: static;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin: -2px 8px 6px 8px;
    min-width: 0;
    padding: 6px;
  }
  .cta-group { width: 100%; flex-wrap: wrap; }
  .cta-group .btn { flex: 1 1 48%; justify-content: center; }
}
@media (max-width: 480px) {
  .brand { font-size: 22px; }
  .brand .tag { display: none; }
  .cta-group .btn { flex: 1 1 100%; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 580px;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(35,66,184,0.82) 0%, rgba(35,66,184,0.46) 55%, rgba(247,201,72,0.28) 100%);
  z-index: -1;
}
.hero-content { position: relative; max-width: 760px; padding: 90px 24px; z-index: 1; color: #ffffff; }
.hero-content .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--color-accent-2);
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}
.hero-content h1 { color: #fff; margin-bottom: 18px; }
.hero-content .lede { font-size: 18px; line-height: 1.6; max-width: 580px; margin-bottom: 26px; color: rgba(255,255,255,0.94); }
.hero-content .cta-group { gap: 14px; }

/* Section wrappers */
.section { padding: 72px 0; }
.section-title { text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--color-text-muted); max-width: 620px; margin: 0 auto 36px; font-size: 16px; }

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 20px 20px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 190px;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-blue); border-color: var(--color-accent); }
.cat-card .num {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-accent-2);
  color: var(--color-text);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 12px;
}
.cat-card .emoji-strip {
  width: 100%;
  padding: 14px 0 6px;
  background: linear-gradient(180deg, rgba(35,66,184,0.08), rgba(35,66,184,0));
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 44px;
  line-height: 1;
}
.cat-card .name {
  font-family: var(--ff-sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  text-align: center;
  color: var(--color-text);
}
.cat-card .open {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-family: var(--ff-sans);
  font-size: 12px;
  color: var(--color-accent);
  font-weight: 600;
}

/* Homepage article */
.home-article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px clamp(24px, 5vw, 56px);
  max-width: 920px;
  margin: 0 auto;
}
.home-article h2 { margin-top: 1.6em; }
.home-article p, .home-article li { color: var(--color-text); font-size: 16.5px; line-height: 1.75; }
.home-article blockquote {
  border-left: 4px solid var(--color-accent-2);
  background: rgba(247,201,72,0.08);
  padding: 16px 20px;
  margin: 1.2em 0;
  font-style: italic;
  color: var(--color-text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.home-article ul { padding-left: 1.25em; }
.home-article a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }

/* Article (entry) cards */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .entry-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .entry-grid { grid-template-columns: 1fr; } }

.entry-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.entry-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: var(--color-accent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.entry-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--color-accent-2);
  border-radius: 999px;
  border: 2px solid var(--color-surface);
}
.entry-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.entry-card .entry-eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent-2);
  font-size: 14px;
  margin-top: 8px;
  letter-spacing: 0.03em;
}
.entry-card h3 {
  font-family: var(--ff-sans);
  font-weight: 700;
  color: var(--color-text);
  font-size: 19px;
  margin: 4px 0 6px;
}
.entry-card .excerpt {
  color: var(--color-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-card .read {
  margin-top: 8px;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-accent);
}
.entry-card a.stretched { position: absolute; inset: 0; z-index: 2; text-indent: -9999px; }

/* CTA strip */
.cta-strip {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding: 60px 24px;
  border-radius: var(--radius-lg);
  margin: 48px auto;
  max-width: 1120px;
}
.cta-strip .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent-2);
  margin-bottom: 10px;
}
.cta-strip h2 { color: #fff; margin-bottom: 22px; }
.cta-strip .cta-group { justify-content: center; }

/* Page / Guide layout */
.page-wrap { padding: 48px 0; }
.breadcrumb { font-family: var(--ff-sans); font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--color-accent); }
.title-band {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--color-accent-2);
}
.title-band .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent-2);
  font-size: 15px;
  margin-bottom: 8px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.title-band h1 { margin: 0; color: var(--color-text); }

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 960px) { .guide-layout { grid-template-columns: 1fr; } }

.guide-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 36px clamp(20px, 4vw, 44px);
}
.guide-content p, .guide-content li { font-size: 16.5px; line-height: 1.75; color: var(--color-text); }
.guide-content h2 { margin-top: 1.6em; }
.guide-content blockquote {
  border-left: 4px solid var(--color-accent-2);
  background: rgba(247,201,72,0.08);
  padding: 14px 18px;
  margin: 1.2em 0;
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.guide-content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.guide-content ul { padding-left: 1.25em; }

.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.sidebar-box h3 {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin: 0 0 12px;
}
.sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.sidebar-box li { margin: 0; }
.sidebar-box li a {
  display: block;
  padding: 7px 0;
  font-size: 14px;
  color: var(--color-text);
  border-bottom: 1px dashed var(--color-border);
  text-decoration: none;
}
.sidebar-box li:last-child a { border-bottom: 0; }
.sidebar-box li a:hover { color: var(--color-accent); }
.sidebar-box.cta-box { background: var(--color-accent); color: #fff; }
.sidebar-box.cta-box h3 { color: var(--color-accent-2); }
.sidebar-box.cta-box p { color: rgba(255,255,255,0.9); font-size: 14.5px; margin: 0 0 14px; }
.sidebar-box.cta-box .cta-group { flex-wrap: wrap; }
.sidebar-box.cta-box .btn { flex: 1 1 100%; }

.related-wrap { margin-top: 60px; }
.related-wrap h2 { text-align: center; margin-bottom: 24px; }

/* Footer */
.site-footer {
  background: var(--color-text);
  color: #d6dbea;
  padding: 56px 0 28px;
  margin-top: 72px;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 36px;
}
@media (max-width: 820px) { .site-footer .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-family: var(--ff-sans);
  color: var(--color-accent-2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a {
  display: block; padding: 6px 0;
  color: #d6dbea;
  font-size: 14.5px;
  text-decoration: none;
}
.site-footer li a:hover { color: var(--color-accent-2); }
.site-footer .brand-block p { color: rgba(255,255,255,0.75); font-size: 14.5px; margin-bottom: 18px; }
.site-footer .cta-group { gap: 10px; flex-wrap: wrap; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: 20px;
  margin-top: 36px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-align: center;
}
.footer-bottom a { color: var(--color-accent-2); }
