/*
Theme Name: oopbuy Spreadsheet
Theme URI: https://cnbuyspreadsheet.com/
Author: cnbuyspreadsheet
Author URI: https://cnbuyspreadsheet.com/
Description: A light, colorful, SEO-optimized WordPress theme for oopbuy Spreadsheet guides. Includes category navigation, Guide dropdown, built-in schema markup, Open Graph tags and 6 auto-created SEO guide articles.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: oopbuy-spreadsheet
Tags: blog, one-column, custom-menu, featured-images, translation-ready
*/

/* ========== Design tokens ========== */
:root {
  --c-bg: #fffaf6;
  --c-surface: #ffffff;
  --c-text: #1f2333;
  --c-muted: #5d6478;
  --c-line: #eee6df;
  --c-primary: #ff5e7e;      /* coral pink */
  --c-primary-d: #e8456a;
  --c-accent: #3cc8c0;       /* mint teal */
  --c-sun: #ffc94d;          /* sunny yellow */
  --c-sky: #6aa8ff;          /* sky blue */
  --c-lilac: #b28dff;        /* lilac */
  --grad-main: linear-gradient(135deg, #ff5e7e 0%, #ff9a6b 50%, #ffc94d 100%);
  --grad-cool: linear-gradient(135deg, #3cc8c0 0%, #6aa8ff 100%);
  --grad-soft: linear-gradient(135deg, #fff0f3 0%, #fff7e6 50%, #eafaf8 100%);
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 10px 30px rgba(31, 35, 51, .08);
  --shadow-h: 0 18px 40px rgba(255, 94, 126, .22);
  --wrap: 1180px;
  --font: "Poppins", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* ========== Reset / base ========== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-bg);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255, 94, 126, .08) 0, transparent 32%),
    radial-gradient(circle at 92% 30%, rgba(60, 200, 192, .09) 0, transparent 30%),
    radial-gradient(circle at 20% 85%, rgba(255, 201, 77, .10) 0, transparent 30%);
  background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary-d); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; color: var(--c-text); }
h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); letter-spacing: -.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { clip: auto; width: auto; height: auto; left: 10px; top: 10px; z-index: 999; background: #fff; padding: 8px 14px; border-radius: 8px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.7em; border-radius: 999px; font-weight: 700; font-size: 1rem;
  line-height: 1.2; border: 2px solid transparent; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: var(--shadow-h); }
.btn-primary:hover { color: #fff; box-shadow: 0 22px 44px rgba(255, 94, 126, .32); }
.btn-cool { background: var(--grad-cool); color: #fff; box-shadow: 0 14px 30px rgba(60, 200, 192, .28); }
.btn-cool:hover { color: #fff; }
.btn-ghost { background: #fff; color: var(--c-text); border-color: var(--c-line); }
.btn-ghost:hover { color: var(--c-primary-d); border-color: var(--c-primary); }
.btn-lg { font-size: 1.1rem; padding: 1em 2.1em; }
.btn-sm { font-size: .9rem; padding: .6em 1.2em; }

/* ========== Header ========== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--c-text); white-space: nowrap; }
.logo:hover { color: var(--c-text); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad-main);
  display: grid; place-items: center; color: #fff; font-size: 1.1rem; box-shadow: var(--shadow-h);
}
.logo span b { color: var(--c-primary); }

.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; align-items: center; gap: 4px; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a,
.main-nav .dd-toggle {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px;
  color: var(--c-text); font-weight: 600; font-size: .98rem; background: none; border: 0;
  font-family: inherit; cursor: pointer;
}
.main-nav > ul > li > a:hover,
.main-nav .dd-toggle:hover,
.main-nav .has-dd:hover > .dd-toggle { background: #fff0f3; color: var(--c-primary-d); }
.dd-toggle .caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.has-dd:hover .caret, .has-dd.open .caret { transform: rotate(225deg) translateY(-2px); }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  background: #fff; border-radius: var(--radius-s); box-shadow: 0 18px 48px rgba(31,35,51,.14);
  border: 1px solid var(--c-line); padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(8px); transition: all .2s;
}
.dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.has-dd:hover > .dropdown, .has-dd.open > .dropdown, .has-dd:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--c-text); font-size: .95rem; font-weight: 500; line-height: 1.35; }
.dropdown a:hover { background: var(--grad-soft); color: var(--c-primary-d); }
.dropdown .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dropdown-guide { min-width: 340px; }
.header-cta { display: flex; gap: 10px; }
.menu-btn { display: none; background: none; border: 0; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 22px; height: 2px; background: var(--c-text); margin: 0 auto; position: relative; transition: .25s; content: ""; }
.menu-btn span::before { position: absolute; top: -7px; }
.menu-btn span::after { position: absolute; top: 7px; }
.nav-open .menu-btn span { background: transparent; }
.nav-open .menu-btn span::before { top: 0; transform: rotate(45deg); }
.nav-open .menu-btn span::after { top: 0; transform: rotate(-45deg); }

/* ========== Hero ========== */
.hero { position: relative; overflow: hidden; padding: 90px 0 110px; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center right; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(255,250,246,.97) 0%, rgba(255,250,246,.9) 38%, rgba(255,240,243,.55) 62%, rgba(255,255,255,0) 100%);
}
.hero-content { max-width: 620px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--c-line); font-size: .85rem; font-weight: 600; color: var(--c-primary-d);
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 0 4px rgba(60,200,192,.2); }
.hero h1 .hl { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.15rem; color: var(--c-muted); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 26px; }
.hero-select { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-select label { font-weight: 600; font-size: .95rem; color: var(--c-muted); }
.hero-select select {
  appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 12px 44px 12px 16px; border-radius: 12px; border: 2px solid var(--c-line); background: #fff
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff5e7e' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--c-text); cursor: pointer; min-width: 230px;
}
.hero-select select:focus { outline: none; border-color: var(--c-primary); }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { font-size: .9rem; color: var(--c-muted); }
.hero-stats b { display: block; font-size: 1.6rem; color: var(--c-text); }

/* ========== Sections ========== */
.section { padding: 80px 0; }
.section-soft { background: var(--grad-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.section-head .eyebrow { display: inline-block; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--c-accent); margin-bottom: 10px; }
.section-head p { color: var(--c-muted); }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.cat-card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; color: var(--c-text);
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-h); color: var(--c-text); }
.cat-card figure { margin: 0; aspect-ratio: 1 / 1; overflow: hidden; }
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat-card:hover img { transform: scale(1.07); }
.cat-card .cat-body { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; gap: 10px; }
.cat-card h3 { margin: 0; font-size: 1.08rem; }
.cat-card .arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.cat-card .tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { background: #fff; border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow); position: relative; }
.step .num { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; margin-bottom: 14px; font-size: 1.2rem; }
.step h3 { font-size: 1.08rem; }
.step p { color: var(--c-muted); font-size: .95rem; margin: 0; }

/* Guide cards */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-h); }
.post-card .thumb { aspect-ratio: 1200 / 630; overflow: hidden; display: block; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card:hover .thumb img { transform: scale(1.06); }
.post-card .pc-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card .pc-cat { font-size: .78rem; font-weight: 700; color: var(--c-accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.post-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.post-card h3 a { color: var(--c-text); }
.post-card h3 a:hover { color: var(--c-primary-d); }
.post-card p { color: var(--c-muted); font-size: .94rem; flex: 1; }
.read-more { font-weight: 700; font-size: .95rem; }

/* Article (home + single) */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.article-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 48px 54px; }
.entry-content h2 { margin-top: 1.6em; padding-left: 14px; border-left: 5px solid var(--c-primary); font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.entry-content h3 { margin-top: 1.4em; color: var(--c-primary-d); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--c-primary); font-weight: 700; }
.entry-content blockquote, .entry-content .tip {
  margin: 1.5em 0; padding: 18px 22px; border-radius: var(--radius-s);
  background: var(--grad-soft); border-left: 5px solid var(--c-accent); color: var(--c-text);
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
.entry-content th, .entry-content td { padding: 11px 14px; border-bottom: 1px solid var(--c-line); text-align: left; }
.entry-content th { background: #fff0f3; }
.entry-content a { font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,94,126,.35); text-underline-offset: 3px; }
.entry-content .cta-inline { text-align: center; margin: 2em 0; }
.entry-content .cta-inline a { text-decoration: none; }
.toc { background: #fffaf6; border: 1px dashed #ffc2cf; border-radius: var(--radius-s); padding: 18px 24px; margin: 0 0 1.8em; }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc a { text-decoration: none; font-weight: 500; }

.sidebar { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 22px; }
.widget { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.widget h3 { font-size: 1.05rem; margin-bottom: 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li a { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--c-line); color: var(--c-text); font-size: .94rem; line-height: 1.4; }
.widget li:last-child a { border-bottom: 0; }
.widget li a:hover { color: var(--c-primary-d); }
.widget-cta { background: var(--grad-main); color: #fff; text-align: center; }
.widget-cta h3, .widget-cta p { color: #fff; }
.widget-cta .btn { background: #fff; color: var(--c-primary-d); width: 100%; margin-top: 6px; }

/* Single post header */
.post-hero { padding: 54px 0 34px; }
.breadcrumbs { font-size: .9rem; color: var(--c-muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-primary-d); }
.post-meta { color: var(--c-muted); font-size: .92rem; display: flex; gap: 16px; flex-wrap: wrap; }
.post-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; box-shadow: var(--shadow); }
.related { margin-top: 50px; }

/* FAQ */
.faq { max-width: 860px; margin: 0 auto; }
.faq details { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow); margin-bottom: 14px; padding: 0 22px; }
.faq summary { cursor: pointer; padding: 18px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--c-primary); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--c-muted); padding-bottom: 18px; margin: 0; }

/* CTA band */
.cta-band { border-radius: 26px; padding: 56px 40px; text-align: center; color: #fff; background: var(--grad-main); position: relative; overflow: hidden; }
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.15); }
.cta-band::before { width: 260px; height: 260px; top: -90px; right: -60px; }
.cta-band::after { width: 180px; height: 180px; bottom: -70px; left: -40px; }
.cta-band h2, .cta-band p { color: #fff; position: relative; }
.cta-band .btn { position: relative; background: #fff; color: var(--c-primary-d); }
.cta-band .btn + .btn { background: transparent; color: #fff; border-color: #fff; }

/* Footer */
.site-footer { background: #1f2333; color: #c9cddb; padding: 64px 0 26px; margin-top: 80px; }
.site-footer a { color: #e8eaf2; }
.site-footer a:hover { color: var(--c-sun); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .94rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; font-size: .85rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-footer .logo { color: #fff; margin-bottom: 14px; }

/* Archive / pagination */
.archive-head { padding: 60px 0 30px; text-align: center; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination .page-numbers { padding: 8px 15px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); font-weight: 600; }
.pagination .current { background: var(--grad-main); color: #fff; }

/* Back to top */
.to-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; background: var(--grad-main); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-h); opacity: 0; visibility: hidden; transition: .3s; z-index: 90; font-weight: 800; }
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { color: #fff; }

/* ========== Responsive ========== */
@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .header-cta { display: none; }
  .main-nav {
    position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: #fff; padding: 18px 22px 40px;
    overflow-y: auto; transform: translateX(100%); transition: transform .3s;
  }
  .nav-open .main-nav { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav > ul > li > a, .main-nav .dd-toggle { width: 100%; justify-content: space-between; padding: 14px 10px; font-size: 1.05rem; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; display: none; padding: 0 0 8px 10px; min-width: 0; }
  .has-dd:hover > .dropdown { display: none; }
  .has-dd.open > .dropdown { display: block; }
  .mobile-cta { display: flex !important; flex-direction: column; gap: 10px; margin-top: 18px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .hero::after { background: linear-gradient(180deg, rgba(255,250,246,.93) 0%, rgba(255,250,246,.86) 100%); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 56px 0; }
  .hero { padding: 56px 0 70px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-card .cat-body { padding: 10px 12px; }
  .cat-card h3 { font-size: .95rem; }
  .cat-card .arrow { width: 28px; height: 28px; }
  .steps, .post-grid { grid-template-columns: 1fr; }
  .article-box { padding: 28px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 42px 22px; }
  .hero-select select { min-width: 0; width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; }
}
.mobile-cta { display: none; }
