/*
Theme Name: Cozy Winter Finds
Theme URI: https://cozywinterfinds.com
Author: Efte Khairul
Description: Custom theme for Cozy Winter Finds, a winter home comfort affiliate site.
Version: 1.0
Text Domain: cozywinterfinds
*/

/* ==========================================================================
   Design tokens — Article.com-inspired: clean, white, sans-serif,
   photography-led, minimal color
   ========================================================================== */

:root {
    --ink: #171614;
    --white: #FFFFFF;
    --stone: #F4F2EE;
    --line: #E4E0D8;
    --text: #1D1B18;
    --text-muted: #6E6A62;
    --accent: #86583B;
    --sage: #E3E8DC;
    --sage-line: #C9D2BE;

    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --step-hero: clamp(2.5rem, 4.5vw + 1rem, 4.25rem);
    --step-h2: clamp(1.75rem, 2vw + 1rem, 2.5rem);
    --step-h3: clamp(1.1rem, 0.5vw + 1rem, 1.3rem);
    --step-body: 1rem;
    --step-lede: clamp(1rem, 0.4vw + 1rem, 1.15rem);

    --wrap-max: 1320px;
    --gutter: clamp(1.5rem, 5vw, 4rem);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }
[id] { scroll-margin-top: 90px; }

.wrap {
    max-width: var(--wrap-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- Accessibility utilities ---------- */

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--ink);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    z-index: 100;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    padding: 0.95rem 2rem;
    text-decoration: none;
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-cover {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--white);
}
.btn-cover:hover {
    background: var(--white);
    color: var(--ink);
    border-color: var(--white);
}

/* ==========================================================================
   Brand lockup — mug mark + wordmark (header + footer)
   ========================================================================== */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}

.site-header .brand {
    position: relative;
    z-index: 45;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--ink);
    border-radius: 10px;
    color: var(--sage);
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.brand:hover .brand-mark { background: var(--accent); }
.brand-mark svg { width: 24px; height: 24px; }

.brand-text {
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.brand-text em { font-style: normal; color: var(--accent); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow 0.25s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(23, 22, 20, 0.06); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.1rem;
}

.site-nav { display: flex; align-items: center; gap: 2.75rem; }

.site-nav a {
    position: relative;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: var(--text);
    padding-bottom: 4px;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    transition: right 0.25s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after { right: 0; }
.site-nav a:hover,
.site-nav a:focus-visible { color: var(--accent); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    position: relative;
    z-index: 60;
}

.menu-toggle-bar,
.menu-toggle-bar::before,
.menu-toggle-bar::after {
    content: "";
    position: absolute;
    left: 0.375rem;
    right: 0.375rem;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.28s ease, opacity 0.2s ease, top 0.28s ease;
}

.menu-toggle-bar { top: 50%; transform: translateY(-50%); }
.menu-toggle-bar::before { top: -7px; }
.menu-toggle-bar::after { top: 7px; }

.menu-toggle.is-active .menu-toggle-bar { background: transparent; }
.menu-toggle.is-active .menu-toggle-bar::before { top: 0; transform: rotate(45deg); }
.menu-toggle.is-active .menu-toggle-bar::after { top: 0; transform: rotate(-45deg); }

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 22, 20, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 40;
}
.nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { background: var(--white); padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.hero-inner {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}

.hero-kicker {
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: var(--step-hero);
    font-weight: 300;
    color: var(--ink);
    margin-bottom: 0.55em;
}

.hero-lede {
    font-size: var(--step-lede);
    color: var(--text-muted);
    max-width: 36ch;
    margin-bottom: 2rem;
}

.hero-motif { aspect-ratio: 5 / 6; overflow: hidden; animation: hero-reveal 0.9s ease-out both; }
.hero-motif img { width: 100%; height: 100%; object-fit: cover; }

@keyframes hero-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Full-cover editorial section
   ========================================================================== */

.cover {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--cover-image, none);
    background-size: cover;
    background-position: center;
    filter: brightness(1.3) contrast(1.02);
}

.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 60%);
}

.cover-inner { position: relative; z-index: 1; padding-block: clamp(2.5rem, 6vw, 4.5rem); max-width: 62ch; }

.cover-kicker {
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--sage);
    margin-bottom: 1rem;
}

.cover h2 { font-size: clamp(2rem, 3vw + 1rem, 3.25rem); font-weight: 300; color: var(--white); margin-bottom: 0.5em; }
.cover p { font-size: var(--step-lede); color: rgba(255, 255, 255, 0.85); margin-bottom: 2rem; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section-parchment { background: var(--white); }
.section-ink { background: var(--stone); color: var(--text); }
.section-ink h3 { color: var(--ink); }

.section-title { font-size: var(--step-h2); font-weight: 300; max-width: 20ch; }

.section-lede {
    font-size: var(--step-lede);
    max-width: 55ch;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* ==========================================================================
   Product shelf — 3 big cards, hover zoom + accent title
   ========================================================================== */

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 2.5vw, 2.5rem);
}

.shelf-card { background: transparent; display: flex; flex-direction: column; }

.shelf-media {
    aspect-ratio: 1 / 1;
    background: var(--stone);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.shelf-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.shelf-card:hover .shelf-media img,
.shelf-card:focus-within .shelf-media img { transform: scale(1.04); }

.media-placeholder { font-size: 0.8rem; color: var(--text-muted); }

.shelf-body { display: flex; flex-direction: column; flex: 1; }

.shelf-eyebrow {
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.shelf-card h3 { font-size: var(--step-h3); font-weight: 500; margin-bottom: 0.3rem; transition: color 0.2s ease; }
.shelf-card:hover h3 { color: var(--accent); }

.shelf-price { font-weight: 400; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.9rem; }
.shelf-desc { flex: 1; font-size: 0.92rem; color: var(--text-muted); }
.shelf-body .btn { align-self: flex-start; margin-top: 0.5rem; }

.shelf-more {
    margin-bottom: 0.75rem;
}

.shelf-more summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.shelf-more summary::-webkit-details-marker { display: none; }

.shelf-more summary::after {
    content: "+";
    font-weight: 400;
    transition: transform 0.2s ease;
}

.shelf-more[open] summary::after { transform: rotate(45deg); }

.shelf-more div {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

.also-considered {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 60ch;
}
.also-considered strong { color: var(--ink); font-weight: 500; }
.also-considered a { color: var(--accent); font-weight: 500; }

.fine-note {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 60ch;
}

/* ==========================================================================
   Trust strip
   ========================================================================== */

.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(2rem, 4vw, 3rem); }
.trust-item { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.trust-item h3 { font-size: var(--step-h3); font-weight: 500; color: var(--ink); }
.trust-item p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 0; }

/* ==========================================================================
   FAQ — hairline accordions
   ========================================================================== */

.faq-list { max-width: 72ch; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }

.faq-list summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-block: 1.15rem;
    font-weight: 500;
    font-size: 0.98rem;
    color: var(--ink);
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list details p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin: 0 0 1.15rem;
    max-width: 60ch;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-body { max-width: 68ch; color: var(--text-muted); font-size: var(--step-lede); }

/* ==========================================================================
   Generic page content (page.php) — Privacy Policy, Disclosure, Contact
   ========================================================================== */

.page-content {
    max-width: 72ch;
    padding-block: clamp(3rem, 6vw, 5rem);
}
.page-content h1 { font-size: var(--step-h2); font-weight: 300; margin-bottom: 0.75em; }
.page-content h2 { font-size: 1.4rem; font-weight: 500; margin-top: 2em; }
.page-content p, .page-content li { color: var(--text-muted); font-size: 1rem; }
.page-content a { color: var(--accent); }

/* ==========================================================================
   Footer — light sage, structured columns
   ========================================================================== */

.site-footer { background: var(--sage); color: var(--text); border-top: 1px solid var(--sage-line); }

.footer-top {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: clamp(2rem, 4vw, 3rem);
    padding-block: clamp(3rem, 6vw, 4.5rem);
    border-bottom: 1px solid var(--sage-line);
}

.footer-brand .brand { margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; color: var(--text-muted); max-width: 32ch; }

.footer-col h4 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.65rem; }

.footer-col a { text-decoration: none; font-size: 0.9rem; color: var(--text-muted); transition: color 0.2s ease; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--accent); }

.footer-bottom {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 2rem;
}

.disclosure { font-size: 0.82rem; max-width: 65ch; line-height: 1.6; color: var(--text-muted); }
.footer-meta { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; margin-bottom: 0; }

/* ==========================================================================
   Enhancement layer — scroll reveal
   ========================================================================== */

html.js [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--d, 0s);
}

html.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 940px) {

    .menu-toggle { display: block; }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: min(70vw, 290px);
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        padding-top: 6rem;
        transform: translateX(100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 50;
    }

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

    .site-nav a {
        padding: 1.1rem var(--gutter);
        border-bottom: 1px solid var(--line);
        width: 100%;
        font-size: 0.95rem;
    }

    .hero-inner { grid-template-columns: 1fr; }
    .hero-motif { order: -1; aspect-ratio: 4 / 3; }

    .shelf-grid { grid-template-columns: 1fr; }
    .trust-strip { grid-template-columns: 1fr; gap: 2rem; }

    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; gap: 1rem; }

    .cover { min-height: 60vh; }
}

@media (max-width: 420px) {
    .brand-mark { width: 34px; height: 34px; }
    .brand-mark svg { width: 20px; height: 20px; }
    .brand-text { font-size: 1rem; }
}

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