/*
Theme Name: USfans Spreadsheet
Theme URI: https://sheetcn.com/
Author: USfans
Author URI: https://sheetcn.com/
Description: SEO-optimized theme for usfans Spreadsheet shopping guide
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: usfans
*/

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --clr-bg:        hsl(38, 22%, 97%);
  --clr-surface:   hsl(0, 0%, 100%);
  --clr-border:    hsl(38, 15%, 88%);
  --clr-text:      hsl(220, 15%, 14%);
  --clr-muted:     hsl(220, 10%, 48%);
  --clr-accent:    hsl(22, 85%, 52%);
  --clr-accent-h:  hsl(22, 85%, 44%);
  --clr-accent-lt: hsl(22, 95%, 95%);
  --clr-teal:      hsl(174, 58%, 38%);
  --clr-teal-lt:   hsl(174, 50%, 94%);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 12px hsl(220 15% 14% / .08);
  --shadow-hover: 0 6px 24px hsl(220 15% 14% / .14);

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Montserrat', 'Inter', system-ui, sans-serif;

  --max-w: 1200px;
  --gap: clamp(1rem, 2.5vw, 2rem);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h4 { font-size: 1.1rem; }
p  { margin-bottom: .9rem; color: var(--clr-text); }
p:last-child { margin-bottom: 0; }

/* ── Layout helpers ──────────────────────────────────────── */
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: clamp(1rem,4vw,2rem); }
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section--alt { background: var(--clr-surface); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-head); font-size: .95rem; font-weight: 700;
  cursor: pointer; border: 2px solid transparent;
  transition: background .18s, transform .14s, box-shadow .18s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--clr-accent); color: #fff;
  box-shadow: 0 4px 14px hsl(22 85% 52% / .35);
}
.btn--primary:hover { background: var(--clr-accent-h); box-shadow: 0 6px 20px hsl(22 85% 52% / .45); }
.btn--outline {
  background: transparent; color: var(--clr-accent);
  border-color: var(--clr-accent);
}
.btn--outline:hover { background: var(--clr-accent-lt); }
.btn--teal {
  background: var(--clr-teal); color: #fff;
  box-shadow: 0 4px 14px hsl(174 58% 38% / .30);
}
.btn--teal:hover { background: hsl(174,58%,30%); }
.btn--lg { padding: .95rem 2.4rem; font-size: 1.05rem; }

/* ── Header / Nav ────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  box-shadow: 0 1px 8px hsl(220 15% 14% / .06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: .85rem;
}
.site-logo { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; color: var(--clr-accent); }
.site-logo span { color: var(--clr-text); }

/* Nav */
.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav > li { position: relative; }
.main-nav > li > a {
  display: block; padding: .5rem .85rem;
  font-weight: 600; font-size: .9rem; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.main-nav > li > a:hover { background: var(--clr-accent-lt); color: var(--clr-accent); }

/* Dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 220px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .18s, visibility .18s, transform .18s;
  z-index: 200;
}
.main-nav > li:hover .nav-dropdown,
.main-nav > li:focus-within .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown a {
  display: block; padding: .65rem 1.1rem;
  font-size: .88rem; font-weight: 500;
  border-radius: 0;
  transition: background .14s, color .14s;
}
.nav-dropdown a:hover { background: var(--clr-accent-lt); color: var(--clr-accent); }
.nav-dropdown li:first-child a { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.nav-dropdown li:last-child  a { border-radius: 0 0 var(--radius-md) var(--radius-md); }

.nav-cta { margin-left: .75rem; }

/* Hamburger */
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .4rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--clr-text); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, hsl(22,95%,96%) 0%, hsl(174,60%,94%) 50%, hsl(38,50%,95%) 100%);
  padding-block: clamp(3.5rem, 8vw, 7rem);
  text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f97316' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; max-width: 780px; margin-inline: auto; }
.hero-badge {
  display: inline-block; margin-bottom: 1rem;
  padding: .3rem .9rem; border-radius: 999px;
  background: var(--clr-accent); color: #fff;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.hero h1 { margin-bottom: 1.1rem; }
.hero p.lead {
  font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--clr-muted);
  max-width: 560px; margin-inline: auto; margin-bottom: 2rem;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Category Grid ───────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px,18vw,175px), 1fr));
  gap: clamp(.75rem, 2vw, 1.25rem);
}
.cat-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); aspect-ratio: 4/5;
  background: var(--clr-border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
}
.cat-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow-hover); }
.cat-card__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .35s;
}
.cat-card:hover .cat-card__bg { transform: scale(1.07); }
.cat-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, hsl(220 15% 10% / .7) 0%, transparent 55%);
}
.cat-card__label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1rem .85rem .9rem;
  color: #fff; font-family: var(--font-head); font-weight: 700;
  font-size: clamp(.8rem, 1.4vw, .95rem);
  text-shadow: 0 1px 4px hsl(0 0% 0% / .4);
}

/* ── Article / Post Content ──────────────────────────────── */
.entry-content h2 { margin-top: 2rem; margin-bottom: .6rem; color: var(--clr-accent); }
.entry-content h3 { margin-top: 1.6rem; margin-bottom: .5rem; }
.entry-content p  { margin-bottom: 1rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.entry-content li { margin-bottom: .4rem; }
.entry-content a  { color: var(--clr-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--clr-accent-h); }

.prose-wrap { max-width: 820px; margin-inline: auto; }

/* ── Blog Card Grid ──────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: var(--gap);
}
.blog-card {
  background: var(--clr-surface); border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.blog-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.blog-card__thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--clr-accent-lt), var(--clr-teal-lt));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.blog-card__body { padding: 1.25rem; }
.blog-card__cat {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--clr-accent); margin-bottom: .4rem;
}
.blog-card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: .55rem; line-height: 1.3; }
.blog-card__title a:hover { color: var(--clr-accent); }
.blog-card__excerpt { font-size: .88rem; color: var(--clr-muted); }
.blog-card__link { display: inline-block; margin-top: .85rem; font-size: .85rem; font-weight: 700; color: var(--clr-accent); }
.blog-card__link:hover { text-decoration: underline; }

/* ── CTA Banner ──────────────────────────────────────────── */
.cta-banner {
  background: linear-gradient(135deg, var(--clr-accent) 0%, hsl(22,85%,62%) 100%);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
  text-align: center; color: #fff;
}
.cta-banner h2 { color: #fff; margin-bottom: .7rem; }
.cta-banner p { color: hsl(22,95%,93%); margin-bottom: 1.6rem; max-width: 520px; margin-inline: auto; }
.cta-banner .btn--surface {
  background: #fff; color: var(--clr-accent); font-weight: 800;
  box-shadow: 0 4px 16px hsl(0 0% 0% / .15);
}
.cta-banner .btn--surface:hover { background: hsl(38,22%,97%); }

/* ── Single Post ─────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; }
.post-header .post-cat {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--clr-accent); margin-bottom: .5rem;
}
.post-header h1 { margin-bottom: 1rem; }
.post-meta { font-size: .85rem; color: var(--clr-muted); }

.post-related { border-top: 1px solid var(--clr-border); margin-top: 3rem; padding-top: 2rem; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: hsl(220,18%,12%); color: hsl(220,10%,75%);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem); margin-bottom: 2.5rem;
}
.footer-brand h3 { color: #fff; font-size: 1.3rem; margin-bottom: .6rem; }
.footer-brand p { font-size: .88rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .92rem; margin-bottom: .9rem; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col a { font-size: .87rem; transition: color .15s; }
.footer-col a:hover { color: var(--clr-accent); }
.footer-bottom {
  border-top: 1px solid hsl(220,15%,22%);
  padding-top: 1.3rem; text-align: center; font-size: .82rem;
}
.footer-bottom a { color: var(--clr-accent); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; }
}
@media (max-width: 700px) {
  .main-nav, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem;
    box-shadow: var(--shadow-hover);
  }
  .main-nav.is-open .nav-dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; background: var(--clr-bg);
    border-radius: var(--radius-sm); margin-top: .25rem;
  }
  .header-inner { flex-wrap: wrap; position: relative; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-btns { flex-direction: column; align-items: center; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-accent  { color: var(--clr-accent); }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.section-title { text-align: center; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.section-title p { color: var(--clr-muted); margin-top: .5rem; }
