/*
Theme Name: Hipobuy Spreadsheet
Theme URI: https://sheetfinds.com
Author: Hipobuy Team
Author URI: https://sheetfinds.com
Description: SEO-optimized WordPress theme for Hipobuy Spreadsheet guides and product finds. Features responsive design, 11-category navigation, 9 SEO articles, and Google-indexing optimizations.
Version: 2.0
Requires at least: 5.6
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hipobuy
Tags: blog, custom-menu, featured-images, responsive-layout, translation-ready, seo-ready
*/

/* ── Tokens ─────────────────────────────────────────── */
:root {
  /* Neutral ramp (OKLCH-inspired, HSL approximation) */
  --n-0:  hsl(30,20%,98%);
  --n-1:  hsl(30,15%,96%);
  --n-2:  hsl(28,12%,92%);
  --n-3:  hsl(28,10%,85%);
  --n-4:  hsl(26, 8%,72%);
  --n-5:  hsl(24, 6%,55%);
  --n-6:  hsl(22, 5%,38%);
  --n-7:  hsl(20, 5%,22%);
  --n-8:  hsl(18, 6%,14%);

  /* Accent – warm terracotta */
  --a-light: hsl(20,65%,88%);
  --a-tint:  hsl(20,62%,78%);
  --a-base:  hsl(20,62%,48%);
  --a-dark:  hsl(20,62%,36%);

  /* Semantic roles */
  --color-bg:        var(--n-0);
  --color-surface:   #fff;
  --color-border:    var(--n-2);
  --color-muted:     var(--n-5);
  --color-body:      var(--n-7);
  --color-heading:   var(--n-8);
  --color-accent:    var(--a-base);
  --color-accent-hover: var(--a-dark);
  --color-tint:      var(--a-light);

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-pill: 999px;

  /* Space (4-unit) */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px;  --sp-6: 32px;
  --sp-7: 48px; --sp-8: 64px;  --sp-9: 96px;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  clamp(2.5rem, 5vw, 3.5rem);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-body);
  background: var(--color-bg);
  /* Subtle multicolor shopping gradient */
  background-image:
    radial-gradient(ellipse at 0% 0%,   hsl(340,80%,96%) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%,  hsl(210,70%,95%) 0%, transparent 55%),
    radial-gradient(ellipse at 0% 100%,  hsl(145,60%,95%) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, hsl(50,80%,95%) 0%, transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-accent-hover); }
ul, ol { list-style: none; }

/* ── Layout ──────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-5); }
.container--narrow { max-width: 820px; margin: 0 auto; padding: 0 var(--sp-5); }

/* ── Header ──────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: hsla(0,0%,100%,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 6px hsla(0,0%,0%,.06);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: var(--sp-5);
}
.site-header__logo {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-heading);
  white-space: nowrap;
  letter-spacing: -.025em;
}
.site-header__logo em { color: var(--color-accent); font-style: italic; }

/* Nav */
.site-nav { display: flex; align-items: center; gap: var(--sp-3); }
.nav-dropdown { position: relative; }
.nav-dropdown__toggle {
  display: flex; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  background: none; cursor: pointer;
  font-size: var(--text-sm); font-weight: 500;
  color: var(--color-body);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.nav-dropdown__toggle:hover,
.nav-dropdown__toggle:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px hsla(20,62%,48%,.18);
  transform: translateY(-1px);
  outline: none;
}
.nav-dropdown__toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.nav-dropdown__arrow { font-size: .65em; transition: transform .2s; }
.nav-dropdown:hover .nav-dropdown__arrow { transform: rotate(180deg); }

.nav-dropdown__menu {
  position: absolute; top: calc(100% + var(--sp-2)); left: 0;
  min-width: 210px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 28px hsla(0,0%,0%,.10);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, visibility .2s, transform .2s;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown__menu a {
  display: block;
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  color: var(--color-body);
  border-bottom: 1px solid var(--color-border);
  transition: background .12s, color .12s, padding-left .12s;
}
.nav-dropdown__menu a:last-child { border-bottom: none; }
.nav-dropdown__menu a:hover { background: var(--color-tint); color: var(--color-accent); padding-left: calc(var(--sp-5) + 4px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-pill);
  font-weight: 600; font-size: var(--text-sm);
  transition: background .15s, transform .15s, box-shadow .15s;
  min-height: 44px;
}
.btn--primary {
  background: var(--color-accent); color: #fff; border: none;
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--color-accent-hover); color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px hsla(20,62%,48%,.35);
}
.btn--primary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn--outline {
  background: #fff; color: var(--color-body);
  border: 1px solid var(--color-border);
}
.btn--outline:hover, .btn--outline:focus-visible {
  border-color: var(--color-accent); color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsla(0,0%,0%,.08);
}
.btn--outline:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: var(--sp-2);
  color: var(--color-body);
}
.nav-toggle__bar {
  display: block; width: 22px; height: 2px;
  background: currentColor; margin: 4px 0;
  transition: transform .2s, opacity .2s;
}

/* ── Hero ────────────────────────────────────────────── */
.hero {
  padding: var(--sp-9) 0;
  text-align: center;
}
.hero__eyebrow {
  display: inline-block;
  background: var(--color-tint); color: var(--color-accent);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
.hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
  color: var(--color-heading);
  margin-bottom: var(--sp-5);
}
.hero__title em { color: var(--color-accent); font-style: italic; }
.hero__desc {
  font-size: var(--text-xl);
  color: var(--color-muted);
  max-width: 640px; margin: 0 auto var(--sp-7);
  font-weight: 300; line-height: 1.6;
}
.hero__actions { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; }
.hero__actions .btn { padding: var(--sp-4) var(--sp-8); font-size: var(--text-base); }

/* ── Featured image ──────────────────────────────────── */
.featured-banner {
  max-width: 1000px; margin: var(--sp-8) auto;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 16px 48px hsla(0,0%,0%,.14);
}
.featured-banner img { width: 100%; height: 420px; object-fit: cover; }

/* ── Section headers ─────────────────────────────────── */
.section-head { text-align: center; margin-bottom: var(--sp-8); }
.section-head__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-4xl); font-weight: 700;
  letter-spacing: -.02em; color: var(--color-heading);
  margin-bottom: var(--sp-3);
}
.section-head__title em { color: var(--color-accent); font-style: italic; }
.section-head__sub { font-size: var(--text-lg); color: var(--color-muted); }

/* ── Category grid ───────────────────────────────────── */
.categories { padding: var(--sp-9) 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-6);
}
.category-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  overflow: hidden;
  color: var(--color-body);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px hsla(0,0%,0%,.11);
  border-color: var(--color-accent);
}
.category-card__img { width: 100%; height: 200px; object-fit: cover; }
.category-card__body { padding: var(--sp-5); }
.category-card__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-xl); font-weight: 600;
  color: var(--color-heading); margin-bottom: var(--sp-2);
}
.category-card__desc { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--sp-4); }
.category-card__cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-accent);
}
.category-card__cta::after { content: '→'; transition: margin-left .15s; }
.category-card:hover .category-card__cta::after { margin-left: var(--sp-2); }

/* ── Articles grid ───────────────────────────────────── */
.articles-section {
  padding: var(--sp-9) 0;
  background: hsla(0,0%,100%,.55);
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-6);
}
.article-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  color: var(--color-body);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px hsla(0,0%,0%,.10);
  border-color: var(--color-accent);
}
.article-card__icon {
  width: 48px; height: 48px;
  background: var(--color-tint);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: var(--sp-5);
}
.article-card__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-2xl); font-weight: 600;
  color: var(--color-heading); margin-bottom: var(--sp-3);
  line-height: 1.3;
}
.article-card__excerpt { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--sp-4); line-height: 1.6; }
.article-card__read {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-sm); font-weight: 600; color: var(--color-accent);
}
.article-card__read::after { content: '→'; transition: margin-left .15s; }
.article-card:hover .article-card__read::after { margin-left: var(--sp-2); }

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: var(--n-8); color: hsla(0,0%,100%,.75);
  padding: var(--sp-9) 0 var(--sp-6);
  margin-top: var(--sp-9);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-7); margin-bottom: var(--sp-7);
}
.site-footer__heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-lg); font-weight: 600;
  color: #fff; margin-bottom: var(--sp-4);
}
.site-footer__links { display: flex; flex-direction: column; gap: var(--sp-2); }
.site-footer__links a { font-size: var(--text-sm); color: hsla(0,0%,100%,.65); }
.site-footer__links a:hover { color: var(--a-tint); }
.site-footer__bar {
  border-top: 1px solid hsla(0,0%,100%,.1);
  padding-top: var(--sp-5);
  text-align: center;
  font-size: var(--text-sm); color: hsla(0,0%,100%,.4);
}
.site-footer__bar a { color: var(--a-tint); }

/* ── Article page ────────────────────────────────────── */
.article-page { padding: var(--sp-9) 0 var(--sp-9); }
.article-page__header { text-align: center; margin-bottom: var(--sp-8); }
.article-page__eyebrow {
  display: inline-block;
  background: var(--color-tint); color: var(--color-accent);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.article-page__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -.025em;
  color: var(--color-heading); line-height: 1.15;
  max-width: 840px; margin: 0 auto var(--sp-4);
}
.article-page__meta { color: var(--color-muted); font-size: var(--text-sm); }

.article-body {
  background: hsla(0,0%,100%,.82);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: var(--sp-8) clamp(var(--sp-5), 6%, var(--sp-9));
}
.article-body h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-3xl); font-weight: 700;
  color: var(--color-heading);
  margin: var(--sp-8) 0 var(--sp-4);
  letter-spacing: -.02em; line-height: 1.2;
}
.article-body h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-2xl); font-weight: 600;
  color: var(--color-heading);
  margin: var(--sp-6) 0 var(--sp-3);
}
.article-body p { margin-bottom: var(--sp-5); font-size: var(--text-lg); line-height: 1.8; }
.article-body ul, .article-body ol {
  margin: var(--sp-4) 0 var(--sp-5) var(--sp-6);
  list-style: disc;
}
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: var(--sp-3); font-size: var(--text-lg); line-height: 1.7; }
.article-body a {
  color: var(--color-accent);
  border-bottom: 1px solid var(--a-tint);
  transition: color .15s, border-color .15s;
}
.article-body a:hover { color: var(--color-accent-hover); border-bottom-color: var(--color-accent-hover); }
.article-body strong { font-weight: 600; color: var(--color-heading); }

.related-box {
  background: var(--color-tint);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--r-sm);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-7) 0;
}
.related-box__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--text-lg); font-weight: 700;
  color: var(--color-heading); margin-bottom: var(--sp-3);
}
.related-box__links { display: flex; flex-direction: column; gap: var(--sp-2); }
.related-box__links a { font-size: var(--text-sm); font-weight: 500; }

/* Back to top */
.back-top {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-accent); color: #fff;
  border: none; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px hsla(20,62%,48%,.4);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .2s;
  z-index: 300;
}
.back-top.visible { opacity: 1; visibility: visible; }
.back-top:hover { transform: translateY(-3px); }
.back-top:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header__inner { flex-wrap: wrap; height: auto; padding: var(--sp-3) 0; }
  .site-nav { display: none; flex-direction: column; width: 100%; padding: var(--sp-3) 0; }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-dropdown__menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; border-top: 1px solid var(--color-border); border-radius: 0; }
  .hero__title { font-size: clamp(2rem, 7vw, 3rem); }
  .category-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-body { padding: var(--sp-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
