/*
Theme Name: Serene Orient
Theme URI: https://sereneorient.com
Author: Serene Orient
Author URI: https://sereneorient.com
Description: Custom WordPress theme for Serene Orient — Five Elements jewelry, incense, and ritual goods. Features a warm earth-tone design system with Playfair Display + Inter typography, WooCommerce integration, and responsive layouts.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: Proprietary
License URI: https://sereneorient.com/terms
Text Domain: flavor
Tags: e-commerce, woocommerce, custom-colors, custom-menu, featured-images, translation-ready
*/

/* ═══════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
    --seed-bg: #ffffff;
    --seed-fg: #1a1a18;
    --seed-primary: #b66a43;
    --seed-accent: #c6a15b;
    --seed-surface: #ffffff;
    --seed-radius: 0px;

    --bg: var(--seed-bg);
    --surface: var(--seed-surface);
    --surface-alt: #f5f5f5;
    --surface-dark: #102c24;
    --fg: var(--seed-fg);
    --ink: var(--fg);
    --muted: #5f584f;
    --border: #e0e0e0;
    --border-light: #eeeeee;
    --primary: var(--seed-primary);
    --primary-hover: #9d5837;
    --clay: var(--primary);
    --clay-deep: var(--primary-hover);
    --accent: var(--seed-accent);
    --gold: var(--accent);
    --gold-dim: rgba(198, 161, 91, 0.26);
    --accent-soft: rgba(198, 161, 91, 0.12);
    --cream: #fffaf2;
    --paper: #f5f5f5;
    --card-glow: rgba(198, 161, 91, 0.14);

    /* Five Elements */
    --forest: #173c31;
    --forest-soft: #285a48;
    --wood: #4a8c5c;
    --fire: #c94a3e;
    --earth: #c99532;
    --metal: #a69e8d;
    --water: #3a7cb8;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radius */
    --radius-sm: 0px;
    --radius: var(--seed-radius);
    --radius-lg: 0px;
    --radius-pill: 0px;

    /* Layout */
    --max-w: 1200px;
    --max-w-narrow: 800px;

    /* Spacing */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
    --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(43, 31, 20, 0.06);
    --shadow-md: 0 4px 16px rgba(43, 31, 20, 0.08);
    --shadow-lg: 0 8px 32px rgba(43, 31, 20, 0.10);
    --shadow: var(--shadow-lg);
    --soft-shadow: 0 14px 35px rgba(23, 60, 49, 0.14);
    --shadow-elevated: 0 2px 4px rgba(43, 31, 20, 0.04), 0 8px 24px rgba(43, 31, 20, 0.08);
    --max: var(--max-w);
}

/* ═══════════════════════════════════════════════
   BASE RESET & GLOBAL
   ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* Focus-visible for keyboard accessibility */
:focus-visible {
    outline: 2px solid var(--wood, #4a8c5c);
    outline-offset: 2px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--wood, #4a8c5c);
    outline-offset: 2px;
}

/* Typography scale */
.t-display { font-family: var(--font-display); font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.t-h1      { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.t-h2      { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.t-h3      { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.t-body-lg { font-size: 18px; line-height: 1.7; }
.t-body    { font-size: 16px; line-height: 1.6; }
.t-small   { font-size: 14px; line-height: 1.5; }
.t-caption { font-size: 12px; line-height: 1.4; letter-spacing: 0.01em; }

/* Utility */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Five Elements pills */
.el-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill);
}
.el-pill--wood  { color: var(--wood);  background: rgba(74, 140, 92, 0.1); }
.el-pill--fire  { color: var(--fire);  background: rgba(201, 74, 62, 0.1); }
.el-pill--earth { color: var(--earth); background: rgba(201, 149, 50, 0.1); }
.el-pill--metal { color: var(--metal); background: rgba(166, 158, 141, 0.1); }
.el-pill--water { color: var(--water); background: rgba(58, 124, 184, 0.1); }

/* Product image placeholder */
.ph-img {
    background: linear-gradient(135deg, var(--surface-alt), #e8e8e8);
    position: relative;
}
.ph-img::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px dashed var(--border);
    border-radius: inherit;
}

/* ═══════════════════════════════════════════════
   HEADER — Sticky frosted glass
   ═══════════════════════════════════════════════ */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6);
    height: 68px;
}
.site-logo { display: flex; align-items: center; }
.site-logo .custom-logo-link { display: flex; align-items: center; text-decoration: none; }
.site-logo .custom-logo-link img.custom-logo,
.site-logo img { height: 36px !important; width: auto !important; max-width: 160px; object-fit: contain; }
.site-logo--text {
    font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--fg);
    text-decoration: none;
}
.nav-desktop { display: flex; align-items: center; gap: var(--sp-8); }
.nav-desktop__link {
    font-size: 15px; font-weight: 500; color: var(--fg);
    position: relative; padding: 4px 0;
}
.nav-desktop__link::after {
    content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1.5px;
    background: var(--primary); transition: width 0.25s ease;
}
.nav-desktop__link:hover::after { width: 100%; }
.nav-desktop__item { position: relative; }
.nav-desktop__dropdown {
    position: absolute; top: 100%; left: -16px; padding-top: 12px;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: all 0.2s ease;
}
.nav-desktop__item:hover .nav-desktop__dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-desktop__dropdown-inner {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: var(--sp-3);
    box-shadow: var(--shadow-elevated); min-width: 200px;
}
.nav-desktop__dropdown a {
    display: block; padding: 10px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--fg);
}
.nav-desktop__dropdown a:hover { background: var(--surface-alt); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-4); }
.nav-actions__btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--fg); transition: background 0.2s;
    position: relative;
}
.nav-actions__btn:hover { background: var(--surface-alt); }
.nav-actions__btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.cart-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 600; width: 18px; height: 18px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.nav-toggle {
    display: none; width: 40px; height: 40px;
    flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 20px; height: 1.5px; background: var(--fg); transition: all 0.3s; }
.mobile-drawer {
    display: none; position: fixed; top: 68px; left: 0; right: 0; bottom: 0;
    background: var(--bg); z-index: 99; padding: var(--sp-6);
    overflow-y: auto;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer a {
    display: block; padding: 14px 0; font-size: 17px; font-weight: 500;
    border-bottom: 1px solid var(--border-light);
}
@media (max-width: 768px) {
    .nav-desktop { display: none; }
    .nav-toggle { display: flex; }
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer {
    background: var(--surface-dark); color: rgba(255, 255, 255, 0.8);
    padding: var(--sp-16) 0 var(--sp-8);
}
.site-footer__grid {
    display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--sp-10); max-width: var(--max-w); margin: 0 auto;
    padding: 0 var(--sp-6); margin-bottom: var(--sp-12);
}
.footer-brand__name {
    font-family: var(--font-display); font-size: 22px; font-weight: 600;
    color: #fff; margin-bottom: var(--sp-4);
}
.footer-brand__desc {
    font-size: 14px; line-height: 1.7; color: rgba(255, 255, 255, 0.6);
    max-width: 300px;
}
.footer-col__title {
    font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: rgba(255, 255, 255, 0.4);
    margin-bottom: var(--sp-5);
}
.footer-col a {
    display: block; font-size: 14px; color: rgba(255, 255, 255, 0.7);
    padding: 5px 0; transition: color 0.2s;
}
.footer-col a:hover { color: #fff; }
.footer-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.footer-social a:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.05); }
.footer-social svg { width: 16px; height: 16px; stroke: rgba(255, 255, 255, 0.7); fill: none; stroke-width: 1.6; }
.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--sp-6) var(--sp-6) 0;
    max-width: var(--max-w); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.site-footer__copy { font-size: 13px; color: rgba(255, 255, 255, 0.4); }
.site-footer__legal { display: flex; gap: var(--sp-5); }
.site-footer__legal a { font-size: 13px; color: rgba(255, 255, 255, 0.4); }
.site-footer__legal a:hover { color: rgba(255, 255, 255, 0.7); }
@media (max-width: 768px) {
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__bottom { flex-direction: column; gap: var(--sp-3); text-align: center; }
}
@media (max-width: 500px) {
    .site-footer__grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════
   WORDPRESS DEFAULT OVERRIDES
   ═══════════════════════════════════════════════ */

/* Hide default WooCommerce styles that conflict with custom design */
.woocommerce-page .woocommerce-message,
.woocommerce-page .woocommerce-error,
.woocommerce-page .woocommerce-info {
    border-radius: var(--radius);
}

/* WordPress admin bar offset */
body.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* Screen reader text (WP requirement) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}
