/*
Theme Name: Hipibuy SEO
Theme URI: https://sheetcn.com/
Author: Hipibuy
Author URI: https://sheetcn.com/
Description: SEO-optimized WordPress theme for the Hipibuy Spreadsheet affiliate site. Includes dropdown category menu, Guide article dropdown, product category buttons, and dedicated article landing pages for fast Google indexing.
Version: 1.0.0
Requires at least: 5.5
Tested up to: 6.6
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: hipibuy-seo
Tags: one-column, custom-menu, featured-images, seo, affiliate
*/

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; color: #111827; margin: 0 0 .6em; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; margin-top: 1.6em; }
h3 { font-size: 1.25rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }

ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .4em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}
.site-brand a {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.01em;
}
.site-brand .brand-accent { color: #ea580c; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav > ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav a,
.main-nav .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    color: #1f2937;
    font-weight: 600;
    font-size: .95rem;
    border-radius: 6px;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.main-nav a:hover,
.main-nav .nav-toggle:hover { background: #fff7ed; color: #ea580c; }
.main-nav .caret { font-size: .7rem; }

.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    padding: 8px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all .18s ease;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li { margin: 0; }
.dropdown-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
}
.dropdown-menu a:hover { background: #fff7ed; color: #ea580c; }

.mobile-toggle {
    display: none;
    background: none;
    border: 0;
    font-size: 1.4rem;
    cursor: pointer;
    color: #111827;
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 60%, #fed7aa 100%);
    padding: 70px 0 60px;
    text-align: center;
    border-bottom: 1px solid #fde0c3;
}
.hero h1 {
    font-size: 2.6rem;
    max-width: 820px;
    margin: 0 auto .5em;
    letter-spacing: -0.02em;
}
.hero .lede {
    font-size: 1.15rem;
    color: #4b5563;
    max-width: 720px;
    margin: 0 auto 2em;
}
.cta-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    white-space: nowrap;
}
.btn-primary {
    background: #ea580c;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(234,88,12,.25);
}
.btn-primary:hover {
    background: #c2410c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(234,88,12,.32);
}
.btn-secondary {
    background: #ffffff;
    color: #ea580c;
    border-color: #ea580c;
}
.btn-secondary:hover {
    background: #ea580c;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-light { background: #fafafa; }
.section-title {
    text-align: center;
    font-size: 1.9rem;
    margin-bottom: .4em;
}
.section-sub {
    text-align: center;
    color: #6b7280;
    max-width: 720px;
    margin: 0 auto 2.6em;
}

/* ---------- Category grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.category-card {
    display: block;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 26px 20px;
    text-align: center;
    color: #111827;
    font-weight: 600;
    transition: all .18s ease;
}
.category-card:hover {
    border-color: #ea580c;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(234,88,12,.1);
    color: #ea580c;
}
.category-card .icon {
    font-size: 1.9rem;
    display: block;
    margin-bottom: 10px;
}
.category-card .label {
    display: block;
    font-size: 1rem;
}

/* ---------- Article grid ---------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.article-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    transition: all .18s ease;
}
.article-card:hover {
    border-color: #ea580c;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(234,88,12,.08);
}
.article-card .tag {
    display: inline-block;
    background: #fff7ed;
    color: #ea580c;
    font-size: .75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .04em;
    text-transform: uppercase;
    align-self: flex-start;
    margin-bottom: 14px;
}
.article-card h3 {
    margin: 0 0 10px;
    font-size: 1.15rem;
}
.article-card p {
    color: #4b5563;
    font-size: .95rem;
    flex-grow: 1;
    margin-bottom: 1.1em;
}
.article-card .read-more {
    font-weight: 700;
    font-size: .9rem;
    align-self: flex-start;
}
.article-card .read-more:after { content: " →"; }

/* ---------- Content / article body ---------- */
.content-area {
    max-width: 820px;
    margin: 0 auto;
    padding: 64px 20px;
}
.content-area h1 { font-size: 2.2rem; letter-spacing: -0.02em; }
.content-area h2 { font-size: 1.55rem; }
.content-area h3 { font-size: 1.2rem; }
.content-area ul li, .content-area ol li { color: #374151; }
.content-area .lede {
    font-size: 1.12rem;
    color: #4b5563;
    margin-bottom: 1.6em;
}
.content-area .inline-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}
.related-box {
    margin-top: 50px;
    padding: 24px 26px;
    background: #fff7ed;
    border-left: 4px solid #ea580c;
    border-radius: 8px;
}
.related-box h3 { margin-top: 0; }
.related-box ul { margin-bottom: 0; }

.back-home {
    display: inline-block;
    margin-top: 32px;
    font-weight: 600;
}
.back-home:before { content: "← "; }

/* ---------- Footer ---------- */
.site-footer {
    background: #111827;
    color: #d1d5db;
    padding: 48px 0 24px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 32px;
}
.site-footer h4 {
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 14px;
    letter-spacing: .02em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #d1d5db; font-size: .92rem; }
.site-footer a:hover { color: #fdba74; }
.footer-bottom {
    border-top: 1px solid #1f2937;
    padding-top: 20px;
    text-align: center;
    font-size: .85rem;
    color: #9ca3af;
}
.footer-bottom a { color: #fdba74; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    h1 { font-size: 1.7rem; }
    .hero { padding: 50px 0 44px; }
    .hero h1 { font-size: 1.95rem; }
    .hero .lede { font-size: 1.02rem; }
    .section { padding: 48px 0; }
    .section-title { font-size: 1.5rem; }

    .mobile-toggle { display: inline-flex; }
    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 10px 20px rgba(0,0,0,.06);
        display: none;
        padding: 10px 16px;
    }
    .main-nav.open { display: block; }
    .main-nav > ul {
        flex-direction: column;
        gap: 2px;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: 0;
        padding-left: 10px;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    .dropdown.open .dropdown-menu { display: block; }

    .article-grid { grid-template-columns: 1fr; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 420px) {
    .category-grid { grid-template-columns: 1fr 1fr; }
    .btn { padding: 12px 20px; font-size: .95rem; }
}
