/*
Theme Name: kakobuy spreadsheet
Theme URI: https://sheetcn.com/
Author: kakobuy spreadsheet Team
Description: A warm, editorial SEO WordPress theme for the kakobuy Spreadsheet shopping guide. Burnt orange + deep teal + warm cream palette.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: kakobuy-spreadsheet
*/

:root {
  --color-bg: #faf4e8;
  --color-surface: #ffffff;
  --color-accent: #d4581f;
  --color-accent-dark: #a4421a;
  --color-accent-2: #0e6b74;
  --color-accent-2-dark: #0a4e55;
  --color-text: #1a1512;
  --color-text-muted: #605a52;
  --color-border: #ead9c0;
  --color-soft: #f5e9d5;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ff-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --ff-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 3px rgba(26, 21, 18, 0.08);
  --shadow-md: 0 6px 20px rgba(26, 21, 18, 0.12);
  --shadow-orange: 0 10px 28px rgba(212, 88, 31, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--color-accent-dark); }
h1, h2, h3, h4 { font-family: var(--ff-serif); font-weight: 700; color: var(--color-text); line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); margin-top: 1.4em; }
h3 { font-size: clamp(19px, 2.4vw, 24px); margin-top: 1.2em; }
p { margin: 0 0 1em; }
blockquote {
  margin: 1.4em 0;
  padding: 1em 1.3em;
  border-left: 4px solid var(--color-accent);
  background: var(--color-soft);
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-text);
}
ul { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: 0.3em 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

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

/* Announcement bar */
.announce {
  background: var(--color-accent-2);
  color: var(--color-bg);
  text-align: center;
  padding: 10px 16px;
  font-family: var(--ff-sans);
  font-size: 14px;
  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-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: var(--color-accent-2);
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1.1;
}
.brand .tag {
  font-family: var(--ff-sans);
  font-style: normal;
  font-size: 11px;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.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 10px 30px rgba(26, 21, 18, 0.14);
  min-width: 260px;
  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: none;
  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(212, 88, 31, 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); color: #ffffff; border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent-dark); color: #ffffff; transform: translateY(-1px); box-shadow: var(--shadow-orange); }
.btn-secondary { background: transparent; color: var(--color-accent-2); border-color: var(--color-accent-2); }
.btn-secondary:hover { background: var(--color-accent-2); color: #ffffff; }

.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: #ffffff;
  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(212, 88, 31, 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(14,107,116,0.78) 0%, rgba(14,107,116,0.42) 55%, rgba(212,88,31,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;
  color: var(--color-accent);
  font-size: 17px;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.hero-content h1 { color: #ffffff; margin-bottom: 18px; }
.hero-content .lede { font-size: 18px; line-height: 1.65; max-width: 600px; margin-bottom: 26px; color: rgba(255,255,255,0.94); }
.hero-content .cta-group { gap: 12px; }
.hero-content .btn-secondary { color: #ffffff; border-color: rgba(255,255,255,0.7); }
.hero-content .btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: #ffffff; }

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

/* Category grid - "spreadsheet tile" cards */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-accent-2);
  border-radius: var(--radius-md);
  padding: 28px 20px 22px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.18s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-orange); }
.cat-card .num {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.cat-card .emoji-wrap {
  width: 72px;
  height: 42px;
  background: rgba(14,107,116,0.12);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 14px;
}
.cat-card .emoji { font-size: 36px; line-height: 1; }
.cat-card .name {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: 10px;
}
.cat-card .arrow-link {
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent-2);
  margin-top: auto;
}
@media (max-width: 960px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* Article grid - "sheet entry" cards */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.22s ease;
  position: relative;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.article-card .top-strip {
  height: 10px;
  background: var(--color-accent-2);
  position: relative;
}
.article-card .top-strip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-surface);
}
.article-card .body {
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-card .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 14px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.article-card h3 {
  font-family: var(--ff-serif);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 10px;
  color: var(--color-text);
}
.article-card .excerpt {
  color: var(--color-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 16px;
  flex: 1;
}
.article-card .read-link {
  font-family: var(--ff-sans);
  color: var(--color-accent-2);
  font-weight: 600;
  font-size: 14px;
  margin-top: auto;
}
.article-card a.block-link {
  position: absolute;
  inset: 0;
  overflow: hidden;
  text-indent: -9999px;
}
@media (max-width: 960px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .article-grid { grid-template-columns: 1fr; } }

/* Homepage article container */
.home-article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px clamp(24px, 4vw, 56px);
  max-width: 900px;
  margin: 0 auto;
}
.home-article h2 { color: var(--color-accent-2); }

/* CTA strip */
.cta-strip {
  background: var(--color-accent-2);
  color: var(--color-bg);
  padding: 72px 24px;
  text-align: center;
}
.cta-strip .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 17px;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.cta-strip h2 { color: #ffffff; margin-bottom: 22px; }
.cta-strip .cta-group { justify-content: center; }
.cta-strip .btn-secondary { color: #ffffff; border-color: rgba(255,255,255,0.7); }
.cta-strip .btn-secondary:hover { background: rgba(255,255,255,0.14); border-color: #ffffff; }

/* Guide / page */
.breadcrumb {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--color-accent-2); }
.title-band {
  text-align: center;
  padding: 48px 24px 32px;
  border-bottom: 1px solid var(--color-border);
}
.title-band .eyebrow {
  font-family: var(--ff-serif);
  font-style: italic;
  color: var(--color-accent);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin-bottom: 8px;
}
.title-band::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 20px auto 0;
  border-radius: 2px;
}
.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  padding: 48px 0;
}
.guide-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 36px clamp(20px, 3vw, 40px);
}
.sidebar-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-box h3 {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-2);
  margin: 0 0 14px;
}
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { margin: 6px 0; }
.sidebar-box a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 14px;
  text-decoration: none;
}
.sidebar-box a:hover { background: rgba(14,107,116,0.08); color: var(--color-accent-2); }
.sidebar-cta { background: var(--color-accent-2); color: #ffffff; }
.sidebar-cta h3 { color: var(--color-accent); }
.sidebar-cta p { color: rgba(255,255,255,0.9); font-size: 14px; margin-bottom: 14px; }
.sidebar-cta .cta-group { flex-direction: column; align-items: stretch; }
.sidebar-cta .btn { width: 100%; justify-content: center; }
.related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}
.related h3 {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-2);
  margin-bottom: 20px;
}
@media (max-width: 960px) {
  .guide-layout { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.site-footer h4 {
  font-family: var(--ff-sans);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: rgba(250,244,232,0.84); font-size: 14px; text-decoration: none; }
.site-footer a:hover { color: var(--color-accent); }
.site-footer .brand-block p { color: rgba(250,244,232,0.72); font-size: 14px; margin-bottom: 14px; }
.site-footer .cta-group .btn-secondary { color: #ffffff; border-color: rgba(255,255,255,0.5); }
.footer-bottom {
  border-top: 1px solid rgba(250,244,232,0.14);
  padding-top: 20px;
  font-size: 13px;
  color: rgba(250,244,232,0.6);
  text-align: center;
}
.footer-bottom a { color: var(--color-accent); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f0a08;
    --color-surface: #1c1611;
    --color-accent: #e67a4e;
    --color-accent-dark: #d4581f;
    --color-accent-2: #4ba7af;
    --color-text: #f0e8da;
    --color-text-muted: #a89d8e;
    --color-border: #2d251e;
    --color-soft: #251e18;
  }
  :root:not([data-theme="light"]) .article-card .top-strip::after,
  :root:not([data-theme="light"]) .cat-card .emoji-wrap { background: rgba(75,167,175,0.18); }
  :root:not([data-theme="light"]) .cta-strip h2 { color: #ffffff; }
}
:root[data-theme="dark"] {
  --color-bg: #0f0a08;
  --color-surface: #1c1611;
  --color-accent: #e67a4e;
  --color-accent-dark: #d4581f;
  --color-accent-2: #4ba7af;
  --color-text: #f0e8da;
  --color-text-muted: #a89d8e;
  --color-border: #2d251e;
  --color-soft: #251e18;
}
