/* ==========================================================================
   BEE LIKE JENNY — Artisanal Crochet Portfolio
   An editorial craft aesthetic: warm, tactile, honey-soaked
   ========================================================================== */

/* --- Palette & Tokens --- */
:root {
    --honey:        #E8981D;
    --honey-light:  #F5A623;
    --honey-glow:   #FFBE42;
    --amber:        #D4891C;
    --gold:         #FFD54F;
    --cream:        #FFF8E7;
    --cream-deep:   #F5EDD6;
    --warm-white:   #FFFDF7;
    --blush:        #F2D4C4;
    --brown:        #2C2C2C;
    --brown-light:  #6B5B4E;
    --brown-mid:    #8B7B6E;
    --black:        #1A1A1A;
    --white:        #FFFFFF;

    --font-hand:    'Caveat', cursive;
    --font-serif:   'Playfair Display', 'Georgia', serif;
    --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;

    --ease-out:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
    --radius:       16px;
    --radius-sm:    10px;
    --max-w:        1280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    color: var(--brown);
    background: var(--cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- Film-grain Overlay (subtle texture) --- */
.grain-overlay {
    position: fixed; inset: 0; z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    position: sticky; top: 0; z-index: 200;
    background: rgba(255,248,231,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(212,137,28,0.15);
    transition: box-shadow 0.3s var(--ease-out);
}
.site-header.scrolled {
    box-shadow: 0 4px 30px rgba(26,26,26,0.06);
}
.site-header-inner {
    max-width: var(--max-w); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 2rem;
}

/* Logo */
.site-logo {
    display: flex; align-items: center;
    transition: transform 0.3s var(--ease-spring);
}
.site-logo:hover { transform: scale(1.03); }
.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: height 0.3s var(--ease-out);
}
.site-header.scrolled .logo-img {
    height: 38px;
}
.site-name {
    font-family: var(--font-hand);
    font-size: 1.8rem; font-weight: 700;
    color: var(--black);
    letter-spacing: -0.01em;
}

/* Nav */
.site-nav .nav-list {
    display: flex; gap: 0.25rem; align-items: center;
}
.nav-link {
    display: block;
    padding: 0.45rem 0.9rem;
    font-size: 0.88rem; font-weight: 500;
    color: var(--brown-light);
    border-radius: 99px;
    transition: all 0.25s var(--ease-out);
    position: relative;
}
.nav-link:hover {
    color: var(--amber);
    background: rgba(245,166,35,0.08);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    flex-direction: column; gap: 5px;
    padding: 6px; width: 36px; height: 36px;
    justify-content: center; align-items: center;
}
.menu-bar {
    display: block; width: 22px; height: 2px;
    background: var(--black);
    border-radius: 2px;
    transition: all 0.3s var(--ease-out);
    transform-origin: center;
}
.menu-toggle.is-active .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active .menu-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.is-active .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: linear-gradient(160deg, var(--honey) 0%, var(--amber) 40%, #C47A18 100%);
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    opacity: 0.15;
    filter: saturate(0.5);
}

/* Honeycomb pattern overlay */
.hero-honeycomb {
    position: absolute; inset: 0;
    opacity: 0.06;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66ZM28 100L0 84L0 50L28 34L56 50L56 84L28 100Z' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}

.hero-content {
    position: relative; z-index: 2;
    text-align: center;
    padding: 2rem;
    animation: heroReveal 1s var(--ease-out) both;
}
@keyframes heroReveal {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero logo */
.hero-logo {
    margin: 0 auto 1rem;
    animation: floatLogo 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 30px rgba(26,26,26,0.12));
}
.hero-logo img {
    height: clamp(140px, 25vw, 220px);
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}
@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-family: var(--font-hand);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    text-shadow: 0 4px 30px rgba(26,26,26,0.15);
    margin-bottom: 0.6rem;
}
.hero-tagline {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,0.9);
    max-width: 500px; margin: 0 auto;
    letter-spacing: 0.01em;
}

/* Decorative stitch line */
.hero-stitch {
    width: 120px; height: 2px;
    margin: 2rem auto 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.5) 0px,
        rgba(255,255,255,0.5) 8px,
        transparent 8px,
        transparent 14px
    );
}

/* ==========================================================================
   POST FEED — Card Grid
   ========================================================================== */
.feed-section {
    position: relative;
    padding: 4rem 0 5rem;
    background: var(--cream);
}
.feed-section::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(212,137,28,0.06), transparent);
}

.feed-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
}

.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
}

/* --- Card --- */
.post-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--warm-white);
    border: 1px solid rgba(212,137,28,0.1);
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease-out);
    opacity: 0;
    transform: translateY(40px);
}
.post-card.is-visible {
    animation: cardIn 0.6s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 0.07s);
}
@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px rgba(212,137,28,0.1),
        0 8px 16px rgba(26,26,26,0.04);
}

.post-card-link {
    display: flex; flex-direction: column;
    height: 100%;
}

.post-card-image-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}
.post-card-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}
.post-card:hover .post-card-image {
    transform: scale(1.06);
}
.post-card-image-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26,26,26,0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}
.post-card:hover .post-card-image-overlay {
    opacity: 1;
}

.post-card-content {
    padding: 1.2rem 1.4rem 1.5rem;
    flex: 1;
    display: flex; flex-direction: column; gap: 0.3rem;
}
.post-card-tag {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--honey);
}
.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--black);
    transition: color 0.3s;
}
.post-card:hover .post-card-title {
    color: var(--amber);
}

/* Featured card — first card spans 2 cols on desktop */
.post-feed .post-card:first-child {
    grid-column: span 2;
}
.post-feed .post-card:first-child .post-card-image-wrap {
    aspect-ratio: 21/9;
}
.post-feed .post-card:first-child .post-card-title {
    font-size: 1.6rem;
}

/* --- Pagination --- */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(212,137,28,0.12);
}
.pagination-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    font-size: 0.88rem; font-weight: 500;
    color: var(--brown);
    border: 1px solid rgba(212,137,28,0.2);
    border-radius: 99px;
    transition: all 0.3s var(--ease-out);
}
.pagination-btn:hover {
    background: var(--honey);
    color: var(--white);
    border-color: var(--honey);
    transform: translateY(-1px);
}
.pagination-btn svg { flex-shrink: 0; }
.pagination-dots {
    display: flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--brown-mid);
}
.pagination-current {
    color: var(--honey);
    font-weight: 600;
}

/* ==========================================================================
   SINGLE POST / PAGE
   ========================================================================== */

/* Hero with featured image */
.post-hero {
    position: relative;
    min-height: 50vh;
    max-height: 65vh;
    display: flex; align-items: flex-end;
    overflow: hidden;
    background: var(--black);
}
.post-hero-image {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.7;
}
.post-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26,26,26,0.8) 0%, rgba(26,26,26,0.1) 60%, transparent 100%);
}
.post-hero-content {
    position: relative; z-index: 2;
    max-width: 900px;
    padding: 3rem 2.5rem;
    animation: heroReveal 0.8s var(--ease-out) both;
}
.post-hero-tag {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--white);
    background: var(--honey);
    border-radius: 99px;
    margin-bottom: 1rem;
}
.post-hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

/* Plain header (no featured image) */
.post-header-plain {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2.5rem 2rem;
    text-align: center;
}
.post-header-plain .post-hero-title {
    color: var(--black);
    text-shadow: none;
}
.post-header-plain .post-hero-tag {
    color: var(--white);
}

/* Post body */
.post-body-wrap {
    position: relative;
    background: var(--warm-white);
}
.post-body-wrap::before {
    content: '';
    position: absolute; top: -40px; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--warm-white));
    pointer-events: none;
}

.post-body-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2.5rem 5rem;
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--brown);
}
.post-body p { margin-bottom: 1.2rem; }
.post-body h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--black);
    margin: 2.5rem 0 0.8rem;
}
.post-body h3 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--black);
    margin: 2rem 0 0.6rem;
}
.post-body img {
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}
.post-body blockquote {
    border-left: 3px solid var(--honey);
    padding: 0.8rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--brown-light);
    background: rgba(245,166,35,0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-body hr {
    border: none;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--honey-glow) 0px,
        var(--honey-glow) 6px,
        transparent 6px,
        transparent 12px
    );
    margin: 2.5rem 0;
    opacity: 0.5;
}
.post-body ul, .post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}
.post-body li { margin-bottom: 0.3rem; }

/* Gallery grid inside posts (injected HTML) */
.post-body div[style*="grid"] {
    gap: 1.2rem !important;
    margin: 2rem 0 !important;
}
.post-body div[style*="grid"] > div {
    border-radius: var(--radius-sm) !important;
    border: 1px solid rgba(212,137,28,0.08) !important;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out) !important;
}
.post-body div[style*="grid"] > div:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 30px rgba(212,137,28,0.12) !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    position: relative;
    background: var(--black);
    color: var(--cream);
    overflow: hidden;
}
.footer-honeycomb {
    position: absolute; inset: 0;
    opacity: 0.03;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66ZM28 100L0 84L0 50L28 34L56 50L56 84L28 100Z' fill='none' stroke='%23F5A623' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 56px 100px;
}
.site-footer-inner {
    position: relative; z-index: 1;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 4rem 2rem 2.5rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

.footer-title {
    font-family: var(--font-hand);
    font-size: 2rem;
    color: var(--honey-glow);
    margin-bottom: 0.4rem;
}
.footer-desc {
    font-size: 0.9rem;
    color: rgba(255,248,231,0.6);
    max-width: 360px;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}
.footer-contact {
    display: flex; gap: 0.6rem; align-items: center;
    font-size: 0.88rem;
    color: rgba(255,248,231,0.5);
}
.footer-phone { color: var(--honey-glow); font-weight: 500; }
.footer-phone-sep { opacity: 0.3; }

.footer-nav { justify-self: end; }
.footer-nav-list {
    display: flex; flex-direction: column; gap: 0.5rem;
}
.footer-nav-list a {
    font-size: 0.88rem;
    color: rgba(255,248,231,0.55);
    transition: color 0.25s;
}
.footer-nav-list a:hover { color: var(--honey-glow); }

.footer-bottom {
    grid-column: 1 / -1;
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,248,231,0.07);
    font-size: 0.8rem;
    color: rgba(255,248,231,0.3);
}
.footer-made {
    font-family: var(--font-hand);
    font-size: 1rem;
    color: rgba(255,248,231,0.25);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .post-feed .post-card:first-child {
        grid-column: span 1;
    }
    .post-feed .post-card:first-child .post-card-image-wrap {
        aspect-ratio: 4/3;
    }
    .post-feed .post-card:first-child .post-card-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .site-header-inner { padding: 0.7rem 1.2rem; }
    .menu-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: rgba(255,248,231,0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(212,137,28,0.1);
        padding: 1rem 1.5rem 1.5rem;
    }
    .site-nav.is-open { display: block; }
    .site-nav .nav-list {
        flex-direction: column;
        gap: 0;
    }
    .nav-link {
        padding: 0.7rem 0.9rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    .hero { min-height: 55vh; }
    .hero-title { font-size: clamp(2.4rem, 10vw, 3.5rem); }

    .feed-container { padding: 0 1.2rem; }
    .post-feed {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1.2rem;
    }

    .post-hero { min-height: 40vh; }
    .post-hero-content { padding: 2rem 1.5rem; }
    .post-body-inner { padding: 2rem 1.5rem 3rem; }

    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 1.5rem 2rem;
    }
    .footer-nav { justify-self: start; }
    .footer-bottom { flex-direction: column; gap: 0.3rem; text-align: center; }
}

@media (max-width: 480px) {
    .post-feed { grid-template-columns: 1fr; }
    .hero { min-height: 50vh; }
    .post-card-content { padding: 1rem 1.1rem 1.2rem; }
    .post-card-title { font-size: 1.05rem; }
}

/* ==========================================================================
   KG Card Styles (Ghost Koenig editor)
   ========================================================================== */
.kg-card { margin: 1.5rem 0; }
.kg-image-card img { border-radius: var(--radius-sm); }
.kg-gallery-card { margin: 2rem 0; }
.kg-gallery-container { gap: 0.75rem; }
.kg-gallery-image img { border-radius: var(--radius-sm); }

/* Required width classes for Koenig editor */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin-left: calc(50% - 42.5vw);
    margin-right: calc(50% - 42.5vw);
}
.kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.kg-width-wide img,
.kg-width-full img {
    width: 100%;
}
