/*
Theme Name: Kakobuy Spreadsheet
Theme URI: https://sheetfinds.com/
Author: Sheet Finds
Author URI: https://sheetfinds.com/
Description: A clean, light, modern SEO theme dedicated to the Kakobuy Spreadsheet community. Features a category dropdown, fast CTA buttons to the main store, original SEO articles, and a Western-friendly UI.
Version: 1.0.0
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: kakobuy-spreadsheet
Tags: blog, one-column, two-columns, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   1. Reset & Base
   ========================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1a202c;
    background-color: #fafbfc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: #ff6b35; text-decoration: none; transition: color .2s ease; }
a:hover { color: #e55a2b; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    margin: 0 0 .6em;
    letter-spacing: -.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }
p  { margin: 0 0 1em; color: #334155; }

ul, ol { padding-left: 1.25rem; }

/* =========================================================
   2. Layout helpers
   ========================================================= */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 70px 0; }
.section-sm { padding: 45px 0; }

.section-title {
    text-align: center;
    margin-bottom: 14px;
}
.section-sub {
    text-align: center;
    color: #64748b;
    max-width: 680px;
    margin: 0 auto 48px;
    font-size: 1.05rem;
}

/* =========================================================
   3. Header
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
}
.site-logo:hover { color: #0f172a; }
.site-logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg,#ff6b35 0%,#ff9758 100%);
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 14px -6px rgba(255,107,53,.65);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}
.main-nav a {
    color: #334155;
    font-weight: 500;
    font-size: .96rem;
}
.main-nav a:hover { color: #ff6b35; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle {
    background: none; border: 0; cursor: pointer;
    font: inherit; color: #334155; font-weight: 500;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 2px;
}
.dropdown-toggle .caret {
    width: 10px; height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform .2s ease;
}
.dropdown[open] .dropdown-toggle .caret { transform: rotate(-135deg); margin-top: 3px; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 40px -16px rgba(15,23,42,.18);
    padding: 8px;
    display: none;
}
.dropdown[open] .dropdown-menu { display: block; }

.dropdown-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #334155;
    font-size: .94rem;
}
.dropdown-menu a:hover {
    background: #fff5f0;
    color: #ff6b35;
}

/* Header CTA */
.header-cta { display: flex; gap: 10px; }
.header-cta .btn { padding: 9px 16px; font-size: .9rem; }

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: none; border: 0; cursor: pointer;
    width: 40px; height: 40px;
    border-radius: 10px;
    color: #0f172a;
    align-items: center; justify-content: center;
}
.menu-toggle:hover { background: #f1f5f9; }

@media (max-width: 960px) {
    .menu-toggle { display: inline-flex; }
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 14px 18px 22px;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 10px 20px -10px rgba(15,23,42,.1);
        display: none;
    }
    .main-nav.is-open { display: flex; }
    .main-nav a, .dropdown-toggle { padding: 10px 0; }
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: 0;
        padding: 0 0 0 12px;
        min-width: 0;
    }
    .header-cta { display: none; }
}

/* =========================================================
   4. Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: #ff6b35;
    color: #fff;
    box-shadow: 0 10px 24px -10px rgba(255,107,53,.7);
}
.btn-primary:hover { background: #e55a2b; color: #fff; }

.btn-secondary {
    background: #0f172a;
    color: #fff;
}
.btn-secondary:hover { background: #1e293b; color: #fff; }

.btn-ghost {
    background: #fff;
    color: #0f172a;
    border-color: #e5e7eb;
}
.btn-ghost:hover { border-color: #ff6b35; color: #ff6b35; }

.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-sm { padding: 9px 16px; font-size: .9rem; }

/* =========================================================
   5. Hero
   ========================================================= */
.hero {
    position: relative;
    padding: 90px 0 80px;
    background:
        radial-gradient(1200px 600px at 80% -20%, #ffe4d2 0%, transparent 60%),
        radial-gradient(1000px 500px at -10% 110%, #ffeede 0%, transparent 55%),
        #fafbfc;
    overflow: hidden;
}
.hero-inner {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}
.eyebrow {
    display: inline-block;
    padding: 6px 14px;
    background: #fff5f0;
    color: #ff6b35;
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .04em;
    border-radius: 999px;
    margin-bottom: 18px;
    border: 1px solid #ffd9c2;
    text-transform: uppercase;
}
.hero h1 {
    font-size: clamp(2rem, 4.4vw, 3.4rem);
    margin-bottom: 18px;
}
.hero h1 .highlight {
    background: linear-gradient(90deg,#ff6b35,#ff9758);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead {
    font-size: 1.15rem;
    color: #475569;
    max-width: 680px;
    margin: 0 auto 30px;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-meta {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 38px;
    flex-wrap: wrap;
    font-size: .92rem;
    color: #64748b;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta strong { color: #0f172a; font-weight: 700; }

/* =========================================================
   6. Categories grid
   ========================================================= */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 18px;
}
.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 22px 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    transition: transform .18s ease, border-color .2s ease, box-shadow .25s ease;
    color: #0f172a;
}
.cat-card:hover {
    transform: translateY(-3px);
    border-color: #ffd9c2;
    box-shadow: 0 18px 30px -18px rgba(255,107,53,.35);
    color: #0f172a;
}
.cat-card .ico {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: #fff5f0;
    color: #ff6b35;
    display: grid; place-items: center;
    font-size: 1.4rem;
}
.cat-card h4 { margin: 0; font-size: 1.05rem; }
.cat-card p { margin: 0; color: #64748b; font-size: .9rem; }
.cat-card .arrow {
    margin-top: 6px;
    color: #ff6b35;
    font-weight: 600;
    font-size: .9rem;
    display: inline-flex; align-items: center; gap: 4px;
}

/* =========================================================
   7. Article grid
   ========================================================= */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(290px,1fr));
    gap: 22px;
}
.article-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
}
.article-card:hover {
    transform: translateY(-4px);
    border-color: #ffd9c2;
    box-shadow: 0 24px 40px -22px rgba(15,23,42,.18);
}
.article-thumb {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg,#ffe4d2,#ffd1b3);
    display: grid; place-items: center;
    color: #ff6b35;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.article-thumb.v2 { background: linear-gradient(135deg,#fef3c7,#fde68a); color:#d97706; }
.article-thumb.v3 { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color:#2563eb; }
.article-thumb.v4 { background: linear-gradient(135deg,#dcfce7,#bbf7d0); color:#16a34a; }
.article-thumb.v5 { background: linear-gradient(135deg,#fce7f3,#fbcfe8); color:#db2777; }
.article-thumb.v6 { background: linear-gradient(135deg,#ede9fe,#ddd6fe); color:#7c3aed; }

.article-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.article-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff5f0;
    color: #ff6b35;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.article-card h3 {
    font-size: 1.15rem;
    margin: 0 0 10px;
    line-height: 1.35;
}
.article-card h3 a { color: #0f172a; }
.article-card h3 a:hover { color: #ff6b35; }
.article-card .excerpt {
    color: #64748b;
    font-size: .94rem;
    margin: 0 0 18px;
    flex: 1;
}
.article-card .read-more {
    font-weight: 600;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* =========================================================
   8. Why / SEO text block
   ========================================================= */
.text-block {
    max-width: 880px;
    margin: 0 auto;
}
.text-block p { font-size: 1.05rem; color: #334155; }
.text-block ul li { padding: 4px 0; color: #334155; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
    gap: 22px;
    margin-top: 36px;
}
.feature-card {
    padding: 26px 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}
.feature-card .ico {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #fff5f0;
    color: #ff6b35;
    display: grid; place-items: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
}
.feature-card h4 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: #64748b; font-size: .95rem; }

/* =========================================================
   9. CTA banner
   ========================================================= */
.cta-banner {
    background: linear-gradient(135deg,#ff6b35 0%,#ff9758 100%);
    border-radius: 28px;
    padding: 60px 40px;
    text-align: center;
    color: #fff;
    box-shadow: 0 30px 50px -28px rgba(255,107,53,.55);
}
.cta-banner h2 { color: #fff; font-size: 2.1rem; margin-bottom: 12px; }
.cta-banner p { color: #ffece1; font-size: 1.05rem; margin: 0 auto 26px; max-width: 620px; }
.cta-banner .btn-primary {
    background: #fff;
    color: #ff6b35;
    box-shadow: none;
}
.cta-banner .btn-primary:hover { background: #fff5f0; color: #e55a2b; }
.cta-banner .btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,.7);
}
.cta-banner .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }

/* =========================================================
   10. FAQ
   ========================================================= */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 0 22px;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.faq-item[open] {
    border-color: #ffd9c2;
    box-shadow: 0 14px 22px -16px rgba(15,23,42,.1);
}
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 0;
    font-weight: 600;
    font-size: 1.05rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.6rem;
    color: #ff6b35;
    font-weight: 400;
    transition: transform .2s ease;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { padding-bottom: 20px; margin: 0; color: #475569; }

/* =========================================================
   11. Article (single) layout
   ========================================================= */
.article-page {
    padding: 60px 0 80px;
}
.article-hero {
    max-width: 820px;
    margin: 0 auto 40px;
    text-align: center;
}
.article-hero .breadcrumb {
    font-size: .9rem;
    color: #64748b;
    margin-bottom: 18px;
}
.article-hero .breadcrumb a { color: #64748b; }
.article-hero .breadcrumb a:hover { color: #ff6b35; }
.article-hero h1 {
    font-size: clamp(1.9rem,3.6vw,2.9rem);
    margin-bottom: 16px;
}
.article-hero .meta {
    color: #64748b;
    font-size: .92rem;
    display: inline-flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.article-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: #1f2937;
}
.article-content h2 {
    font-size: 1.7rem;
    margin: 44px 0 16px;
    scroll-margin-top: 90px;
}
.article-content h3 {
    font-size: 1.25rem;
    margin: 30px 0 12px;
}
.article-content p { line-height: 1.8; margin: 0 0 18px; }
.article-content ul, .article-content ol { margin: 0 0 22px; }
.article-content ul li, .article-content ol li {
    margin: 6px 0;
    line-height: 1.75;
}
.article-content blockquote {
    margin: 26px 0;
    padding: 18px 22px;
    background: #fff5f0;
    border-left: 4px solid #ff6b35;
    border-radius: 8px;
    color: #5b3520;
    font-style: italic;
}
.article-content a {
    color: #ff6b35;
    border-bottom: 1px solid #ffd9c2;
}
.article-content a:hover { border-color: #ff6b35; }
.article-content strong { color: #0f172a; }

.callout {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px 24px;
    margin: 30px 0;
}
.callout h4 { margin: 0 0 6px; color: #ff6b35; font-size: .9rem; letter-spacing:.06em; text-transform: uppercase; }
.callout p { margin: 0; color: #334155; }

/* Article CTA */
.article-cta {
    margin: 40px 0;
    padding: 30px 30px;
    background: linear-gradient(135deg,#fff5f0,#fff);
    border: 1px solid #ffd9c2;
    border-radius: 16px;
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.article-cta h4 { margin: 0 0 4px; font-size: 1.15rem; }
.article-cta p { margin: 0; color: #64748b; font-size: .95rem; }
.article-cta .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Related */
.related {
    max-width: 1080px;
    margin: 60px auto 0;
}
.related h3 { text-align: center; margin-bottom: 28px; font-size: 1.5rem; }

/* =========================================================
   12. Footer
   ========================================================= */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 70px 0 24px;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.site-footer h5 {
    color: #fff;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 18px;
}
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #ff9758; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin: 8px 0; font-size: .94rem; }

.footer-brand p { color: #94a3b8; font-size: .94rem; margin-top: 14px; }
.footer-cta { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #1e293b;
    color: #94a3b8;
    font-size: .88rem;
}
.footer-bottom a { color: #ff9758; }

@media (max-width: 820px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   13. 404
   ========================================================= */
.error-404 {
    padding: 120px 0;
    text-align: center;
}
.error-404 .num {
    font-size: 6rem;
    font-weight: 800;
    color: #ff6b35;
    line-height: 1;
    margin-bottom: 8px;
}

/* =========================================================
   14. Utility
   ========================================================= */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.center-cta { text-align: center; margin-top: 36px; }

@media (max-width: 640px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.55rem; }
    .section { padding: 50px 0; }
    .cta-banner { padding: 44px 22px; border-radius: 22px; }
    .cta-banner h2 { font-size: 1.65rem; }
    .article-cta { padding: 22px; }
}
