/*
Theme Name:   YWW Studio
Author:       Paull Studio
Description:  Lightweight standard WordPress theme providing header & footer only — built for use with a page builder (Elementor) for the body content. Optimized for performance, accessibility and SEO.
Version:      1.2.1
Requires at least: 6.0
Requires PHP: 8.0
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  yww
*/

/* --------------------------------------------------
 * 0. RESET & BASE
 * -------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

ul {
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

h1, h2, h3, h4 {
    font-family: var(--font-accent);
    line-height: 1.15;
    margin: 0 0 16px 0;
}

/* --------------------------------------------------
 * 1. DESIGN TOKENS
 * -------------------------------------------------- */
:root {
    --color-navy:        #14294A;
    --color-navy-dark:   #0A1830;
    --color-white:       #FFFFFF;
    --color-cream:       #F5F1E8;
    --color-text:        #1B2635;
    --color-bg:          #FFFFFF;
    --color-whatsapp:    #25D366;

    --font-accent: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Customizable typography (overridable per-area from Customizer > Typography) */
    --yww-menu-font-family:   var(--font-body);
    --yww-menu-font-size:     0.85rem;
    --yww-cta-font-family:    var(--font-accent);
    --yww-cta-heading-size:   clamp(2.1rem, 4.5vw, 3.5rem);
    --yww-cta-text-size:      1.1rem;
    --yww-footer-font-family: var(--font-body);
    --yww-footer-font-size:   0.8rem;

    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-full: 999px;

    --container-width: 1280px;
    --navbar-height: 84px;

    --transition-smooth: all 0.3s ease;
}

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --------------------------------------------------
 * 2. ACCESSIBILITY UTILITIES
 * -------------------------------------------------- */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link.screen-reader-text {
    top: -100px;
    left: 12px;
    z-index: 10000;
    background: var(--color-white);
    color: var(--color-navy);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-link.screen-reader-text:focus {
    position: fixed !important;
    top: 12px;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 3px;
}

/* A11y fix: the default navy outline above has ~1.1:1 contrast against
   this theme's dark sections (navbar, footer, footer CTA — all on
   --color-navy / --color-navy-dark), which fails WCAG 1.4.11 (needs
   >=3:1). Swap to the cream outline only inside those dark containers,
   where it measures ~15.7:1. Outside them (the white/Elementor body,
   where most links & buttons actually live) the navy outline above
   measures ~14.5:1. */
.navbar a:focus-visible,
.navbar button:focus-visible,
.site-footer a:focus-visible,
.site-footer button:focus-visible,
.footer-cta a:focus-visible,
.footer-cta button:focus-visible,
.whatsapp-float:focus-visible {
    outline-color: var(--color-cream);
}

/* --------------------------------------------------
 * 3. NAVIGATION BAR
 * -------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: var(--transition-smooth);
    background: linear-gradient(to bottom, rgba(10, 25, 49, 0.7) 0%, rgba(10, 25, 49, 0) 100%);
}

.navbar.scrolled {
    background-color: var(--color-navy-dark);
    padding: 16px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.navbar-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-white);
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-monogram {
    font-family: var(--font-accent);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1.5px solid var(--color-white);
    padding: 2px 8px;
    line-height: 1;
}

/* Logo mark (image) — dipakai baik untuk logo bawaan tema (assets/images/logo-mark.png)
   maupun logo custom dari WP Customizer. Sekarang jadi satu-satunya elemen di
   .nav-logo (title/subtitle text udah dicabut), jadi ukurannya digedein biar
   tetap keliatan proporsional sendirian di navbar. Width auto biar proporsional
   (source-nya hampir persegi, ~1.1:1).

   Ukuran dipisah header vs footer, dan desktop vs mobile, lewat CSS custom
   properties. Nilai aslinya di-inject inline oleh functions.php
   (yww_logo_inline_css()) berdasarkan Customizer > YWW Theme Options >
   Logo Sizes. Fallback di var(...) ini cuma jaga-jaga kalau inline style-nya
   gagal load. */
.nav-logo-image,
.nav-logo-image img {
    display: block;
    width: auto;
    flex-shrink: 0;
}

.nav-logo--header .nav-logo-image,
.nav-logo--header .nav-logo-image img {
    height: var(--yww-logo-header-height-desktop, 64px);
}

.nav-logo--footer .nav-logo-image,
.nav-logo--footer .nav-logo-image img {
    height: var(--yww-logo-footer-height-desktop, 64px);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
}

.nav-logo-title {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    line-height: 1.1;
}

.nav-logo-subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.25em;
    opacity: 0.8;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    font-family: var(--yww-menu-font-family);
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--color-white);
    font-size: var(--yww-menu-font-size);
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-white);
    transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after,
.current-menu-item > .nav-link::after {
    width: 100%;
}

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
    color: var(--color-white);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cart-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cart-count {
    background-color: var(--color-cream);
    color: var(--color-navy);
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-white);
    transition: var(--transition-smooth);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------
 * 4. BUTTONS
 * -------------------------------------------------- */
.btn-primary-light,
.btn-secondary-light {
    display: inline-block;
    font-family: var(--yww-cta-font-family);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 16px 36px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.btn-primary-light {
    background-color: var(--color-cream);
    color: var(--color-navy);
    border: 1px solid var(--color-cream);
}

.btn-primary-light:hover {
    background-color: var(--color-white);
    transform: translateY(-2px);
}

.btn-secondary-light {
    border: 1px solid var(--color-cream);
    color: var(--color-cream);
    font-weight: 600;
    background: transparent;
}

.btn-secondary-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------
 * 5. FOOTER CTA & FOOTER
 * -------------------------------------------------- */
.footer-cta {
    background-color: var(--color-navy);
    color: var(--color-white);
    padding: 90px 24px;
    text-align: center;
}

.footer-cta-inner {
    max-width: 640px;
    margin: 0 auto;
}

.footer-cta .section-headline {
    color: var(--color-white);
    margin-bottom: 16px;
    font-family: var(--yww-cta-font-family);
    font-size: var(--yww-cta-heading-size);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.footer-cta p {
    font-family: var(--yww-cta-font-family);
    font-size: var(--yww-cta-text-size);
    opacity: 0.85;
    margin-bottom: 36px;
    font-weight: 300;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-footer {
    background-color: var(--color-navy-dark);
    color: var(--color-white);
    padding: 60px 0 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav {
    display: flex;
    gap: 32px;
    list-style: none;
    flex-wrap: wrap;
    font-family: var(--yww-footer-font-family);
}

.footer-nav a {
    font-size: var(--yww-footer-font-size);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

.footer-nav a:hover {
    opacity: 1;
}

.footer-bottom {
    padding-top: 30px;
    text-align: center;
    font-family: var(--yww-footer-font-family);
    font-size: var(--yww-footer-font-size);
    opacity: 0.5;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --------------------------------------------------
 * 6. WHATSAPP FLOAT BUTTON
 * -------------------------------------------------- */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background-color: var(--color-whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    z-index: 999;
    transition: var(--transition-smooth);
}

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.05);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: var(--color-white);
}

/* --------------------------------------------------
 * 7. MAIN CONTENT FALLBACK (index.php loop)
 * -------------------------------------------------- */
.site-main {
    min-height: 40vh;
}

/*
 * Reserve space below the fixed navbar + apply a readable content width,
 * but ONLY for regular WordPress content (blog index/single, search, 404…).
 * Elementor-built pages manage their own width & spacing per section —
 * forcing padding here would break full-width/stretched Elementor sections.
 */
body:not(.yww-elementor-content) .site-main {
    padding-top: calc(var(--navbar-height) + 40px);
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* --------------------------------------------------
 * 8. RESPONSIVE
 * -------------------------------------------------- */
@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(320px, 80vw);
        background-color: var(--color-navy-dark);
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 28px;
        padding: 32px;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    }

    .nav-links.is-open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        width: 100%;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-nav {
        justify-content: center;
        gap: 12px;
    }

    .nav-logo--header .nav-logo-image,
    .nav-logo--header .nav-logo-image img {
        height: var(--yww-logo-header-height-mobile, 64px);
    }

    .nav-logo--footer .nav-logo-image,
    .nav-logo--footer .nav-logo-image img {
        height: var(--yww-logo-footer-height-mobile, 64px);
    }
}

@media (max-width: 600px) {
    .footer-cta {
        padding: 64px 20px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 50px;
        height: 50px;
    }
}