/*
Theme Name: StudioLights
Theme URI: https://studiolights.org
Author: StudioLights Team
Author URI: https://studiolights.org
Description: Custom WordPress theme for StudioLights.org, an independent review site for photography and video fill lights. Built as a classic PHP theme with custom post types (light, review, guide, knowledge), ACF field groups, and a compare tool.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: studiolights
*/

/* ============================================================
   1. DESIGN TOKENS (CSS custom properties)
   Extracted from static prototypes (全站页总览.html and others).
   Do not rename these without updating every template.
   ============================================================ */
:root {
    --bg-primary: #0c0c0c;
    --bg-secondary: #141414;
    --bg-card: #1e1e1e;
    --bg-card-hover: #282828;
    --bg-elevated: #2a2a2a;

    --text-primary: #f0f0f0;
    --text-secondary: #a8a8a8;
    --text-muted: #6b6b6b;

    --accent-gold: #f5a623;
    --accent-gold-dim: rgba(245, 166, 35, 0.15);
    --accent-gold-hover: #f7c35c;

    --green: #27ae60;
    --red: #e74c3c;

    --border-subtle: #2c2c2c;

    --radius: 12px;
    --radius-sm: 8px;

    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --transition: 0.25s ease;
}

/* ============================================================
   2. RESET
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-gold-hover);
}

ul, ol {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

h1 {
    font-size: clamp(32px, 5vw, 48px);
    letter-spacing: -1px;
}
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p {
    color: var(--text-secondary);
}

small, .text-small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   5. SITE HEADER / NAVIGATION
   ============================================================ */
.site-header {
    background: rgba(20, 20, 20, 0.92);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo i {
    color: var(--accent-gold);
    font-size: 28px;
}
.logo span {
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 14px;
    font-weight: 500;
}
/* wp_nav_menu() renders <ul class="nav-menu-list"><li><a>; style it
   identically to the flat <a> links from the static prototype. */
.nav-links .nav-menu-list {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}
.nav-links a:hover,
.nav-links a.active,
.nav-links .current-menu-item > a {
    color: #fff;
}
.nav-links a.active::after,
.nav-links .current-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gold);
    border-radius: 2px;
}
.nav-cta {
    background: var(--accent-gold);
    color: var(--bg-primary) !important;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 13px;
    transition: background var(--transition);
}
.nav-cta:hover {
    background: var(--accent-gold-hover) !important;
    color: var(--bg-primary) !important;
}

.hamburger {
    display: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
}

/* Nav breakpoint mirrors mobile.css but kept here so the header
   is never unstyled if mobile.css fails to load. */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .hamburger {
        display: block;
    }
    .header-inner {
        flex-wrap: nowrap;
    }
}

/* ============================================================
   6. SITE FOOTER
   ============================================================ */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 40px 0 28px;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
.footer-grid h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}
.footer-grid p,
.footer-grid a {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}
.footer-grid a:hover {
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 12px;
}
.footer-social a {
    font-size: 20px;
    color: var(--text-muted);
    margin-right: 16px;
}
.footer-social a:hover {
    color: var(--accent-gold);
}

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

/* ============================================================
   7. COMMON COMPONENTS
   (shared across templates; page-specific styles are appended
   in later sections as each template is built)
   ============================================================ */
.badge-gold {
    display: inline-block;
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 48px 0 24px;
}
.section-head h2 {
    font-size: 24px;
    font-weight: 600;
}
.section-head .more-link {
    font-size: 14px;
    color: var(--text-secondary);
}

.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }

.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.page-divider {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-subtle);
    border-bottom: 2px solid var(--border-subtle);
    padding: 16px 0;
    margin: 48px 0 32px;
    text-align: center;
}
.page-divider span {
    background: var(--accent-gold);
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 14px;
    padding: 6px 24px;
    border-radius: 100px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Card grid used by review/product/guide listings */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.review-card,
.product-card,
.page-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}
.review-card:hover,
.product-card:hover,
.page-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-3px);
}

.img-placeholder {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    aspect-ratio: 16 / 10;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
}
.btn-primary:hover {
    background: var(--accent-gold-hover);
    color: var(--bg-primary);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Hero search (front page) */
.hero {
    padding: 64px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}
.hero h1 i {
    color: var(--accent-gold);
    font-style: normal;
}
.hero p {
    font-size: 18px;
    max-width: 640px;
    margin: 16px auto 0;
}
.hero-search {
    max-width: 560px;
    margin: 32px auto 0;
    display: flex;
    gap: 8px;
}
.hero-search input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    padding: 14px 22px;
    color: var(--text-primary);
    font-size: 15px;
}
.hero-search input::placeholder {
    color: var(--text-muted);
}
.hero-search button {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border: none;
    width: 48px;
    border-radius: 100%;
    cursor: pointer;
    font-size: 16px;
}
.hero-search button:hover {
    background: var(--accent-gold-hover);
}

/* Tables (spec sheets, comparisons) */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}
tr:last-child td {
    border-bottom: none;
}

/* Empty state (used by search, compare with no results, archives) */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 40px;
    color: var(--border-subtle);
    margin-bottom: 16px;
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 14px;
}
.pagination .current {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-primary);
    font-weight: 600;
}
.pagination a:hover {
    border-color: var(--accent-gold);
    color: #fff;
}

/* ============================================================
   8. FRONT PAGE COMPONENTS
   Ported from 首页.html (front-page.php)
   ============================================================ */

/* Review card badge + meta (front page "latest reviews" grid) */
.review-card .card-img {
    height: 200px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: var(--text-muted);
    position: relative;
}
.review-card .card-img .badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--accent-gold);
    color: var(--bg-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.review-card .card-body {
    padding: 20px 22px 22px;
}
.review-card .card-body .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.review-card .card-body .meta .dot {
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
}
.review-card .card-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}
.review-card .card-body h3 a {
    color: #fff;
}
.review-card .card-body h3 a:hover {
    color: var(--accent-gold);
}
.review-card .card-body .excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.review-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
}
.review-card .card-footer .rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 15px;
}
.review-card .card-footer .rating i {
    color: var(--accent-gold);
}
.review-card .card-footer .price-tag {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Compare tool preview block */
.compare-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    padding: 32px;
    margin: 16px 0 8px;
}
.compare-preview .empty-state {
    padding: 40px 20px;
}
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.compare-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    border: 1px solid var(--border-subtle);
    text-align: center;
}
.compare-item.compare-item-add {
    border-style: dashed;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    opacity: 0.6;
}
.compare-item .icon-box {
    font-size: 32px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.compare-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.compare-item .sub {
    font-size: 13px;
    color: var(--text-muted);
}
.compare-item .param-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.compare-item .param-row:last-child {
    border-bottom: none;
}
.compare-item .param-row .label {
    color: var(--text-muted);
}
.compare-item .param-row .value {
    font-weight: 500;
}
.compare-item .highlight-value {
    color: var(--accent-gold);
}

/* Knowledge base quick-links grid */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 8px 0 24px;
}
.quick-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    text-align: center;
    border: 1px solid var(--border-subtle);
    transition: border-color var(--transition);
}
.quick-item:hover {
    border-color: #3a3a3a;
}
.quick-item i {
    font-size: 28px;
    color: var(--accent-gold);
    margin-bottom: 6px;
}
.quick-item h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.quick-item p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Review detail hero (also reused by single-review.php) */
.review-detail {
    margin: 32px 0 48px;
}
.review-detail .back-link {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: inline-block;
}
.review-detail .back-link i {
    margin-right: 6px;
}
.detail-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    padding: 32px;
    margin-bottom: 32px;
}
.detail-hero .image-area {
    flex: 1 1 280px;
    min-height: 200px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}
.detail-hero .info-area {
    flex: 2 1 380px;
}
.detail-hero .info-area .badge-gold {
    margin-bottom: 8px;
}
.detail-hero .info-area h1 {
    font-size: 28px;
    margin-bottom: 4px;
}
.detail-hero .info-area .subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 16px;
}
.score-box {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-secondary);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-gold);
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.score-box .big-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
}
.score-box .score-detail {
    font-size: 14px;
    color: var(--text-secondary);
}
.score-box .score-detail strong {
    color: #fff;
}
.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.param-grid .param-cell {
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.param-grid .param-cell .label {
    color: var(--text-muted);
}
.param-grid .param-cell .value {
    font-weight: 500;
}
.pros-cons-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}
.pros-cons-box .pros,
.pros-cons-box .cons {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
}
.pros-cons-box .pros {
    background: rgba(39, 174, 96, 0.12);
    border-left: 3px solid var(--green);
}
.pros-cons-box .cons {
    background: rgba(231, 76, 60, 0.12);
    border-left: 3px solid var(--red);
}
.pros-cons-box h4 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.pros-cons-box ul {
    font-size: 14px;
    color: var(--text-secondary);
}
.pros-cons-box ul li {
    padding: 2px 0;
}
.pros-cons-box ul li::before {
    content: '• ';
    color: var(--text-muted);
}
.btn-buy {
    display: inline-block;
    background: var(--accent-gold);
    color: var(--bg-primary) !important;
    font-weight: 700;
    padding: 14px 36px;
    border-radius: 100px;
    font-size: 15px;
    transition: background var(--transition);
    border: none;
    cursor: pointer;
}
.btn-buy:hover {
    background: var(--accent-gold-hover);
}
.affiliate-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

@media (max-width: 768px) {
    .pros-cons-box {
        grid-template-columns: 1fr;
    }
}
