/*
Theme Name: Wandering Ambivert
Description: A nature journal theme for wanderingambivert.com
Version: 1.0
Author: Hannes van Eeden
*/

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream: #F5F0E8;
    --ink: #2C2C2C;
    --green: #3D5A3E;
    --brown: #8B7355;
    --amber: #C4843E;
    --moss: #2A3A2A;
    --card-bg: #FAF7F2;
    --border: #E0D8CC;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    color: var(--ink);
    background-color: var(--cream);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Paper grain texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    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-size: 256px 256px;
}

a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--amber); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

/* ── Hero ── */
.site-hero {
    position: relative;
    height: 50vh;
    min-height: 340px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.site-hero__bg {
    position: absolute;
    inset: 0;
    background: url('/wp-content/uploads/2020/05/voice-video-ffnkhw_48-y-unsplash-scaled.jpg') center/cover no-repeat;
    filter: brightness(0.45);
}

.site-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1rem;
}

.site-hero__title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(2.4rem, 6vw, 4rem);
    color: #fff;
    letter-spacing: 0.02em;
    font-weight: 700;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.site-hero__subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.75rem;
}

/* ── Navbar ── */
.site-nav {
    background: var(--moss);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-nav__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 52px;
}

.site-nav__brand {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}
.site-nav__brand:hover { color: var(--amber); }

.site-nav__links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.site-nav__links a {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.2s;
}
.site-nav__links a:hover,
.site-nav__links a.current { color: #fff; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: transform 0.3s, opacity 0.3s;
}

/* ── Feed ── */
.feed {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

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

.feed__heading {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Post Cards ── */
.post-card {
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s, transform 0.3s;
}
.post-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}

.post-card__image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--border);
}

.post-card__image.broken {
    display: none;
}
.post-card__image.broken + .post-card__play-overlay {
    display: none;
}

.post-card__body {
    padding: 1.5rem 1.75rem;
}

.post-card__meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-card__category {
    color: var(--green);
    font-weight: 600;
}

.post-card__title {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--green); }

.post-card__excerpt {
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.7;
}
.post-card__excerpt p { margin: 0; }

.post-card__read-more {
    display: inline-block;
    margin-top: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    letter-spacing: 0.04em;
    transition: color 0.2s;
}
.post-card__read-more:hover { color: var(--amber); }

/* ── Quote Card ── */
.post-card--quote {
    grid-column: 1 / -1;
    background: var(--card-bg);
    text-align: center;
    padding: 3rem 2.5rem;
}
.post-card--quote .post-card__body { padding: 0; }

.post-card--quote .post-card__quote-text {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--ink);
    max-width: 600px;
    margin: 0 auto;
}

.post-card--quote .post-card__quote-text::before {
    content: '\201C';
    display: block;
    font-size: 3.5rem;
    color: var(--brown);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-style: normal;
}

/* ── Video Card ── */
.post-card--video .post-card__video-wrap {
    position: relative;
}

.post-card--video .post-card__play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.25);
    transition: background 0.3s;
}
.post-card:hover .post-card__play-overlay {
    background: rgba(0,0,0,0.15);
}

.post-card__play-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.post-card:hover .post-card__play-icon { transform: scale(1.08); }

.post-card__play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 0 9px 16px;
    border-color: transparent transparent transparent var(--moss);
    margin-left: 3px;
}

/* ── Single Post Layout ── */
.single-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2.5rem;
    align-items: start;
}

.single-hero {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.single-content {
    max-width: none;
    padding: 2.5rem 0 4rem;
}

.single-content__header {
    margin-bottom: 2rem;
    text-align: center;
}

.single-content__title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 0.75rem;
}

.single-content__meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.single-content__body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-content__body p { margin-bottom: 1.4rem; }

.single-content__body h2 {
    font-size: 1.6rem;
    margin: 2.5rem 0 1rem;
}

.single-content__body h3 {
    font-size: 1.3rem;
    margin: 2rem 0 0.75rem;
}

.single-content__body blockquote {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--ink);
    padding: 1.25rem 0 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border: none;
    position: relative;
}

.single-content__body img {
    border-radius: 4px;
    margin: 1.5rem 0;
}

.single-content__body .wp-block-embed {
    margin: 2rem 0;
}

.single-content__body iframe {
    border-radius: 4px;
    border: 2px solid var(--border);
    max-width: 100%;
}

/* ── Sidebar ── */
.single-sidebar {
    position: sticky;
    top: 68px;
    padding-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sidebar-card__title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-card__desc {
    font-size: 0.85rem;
    color: var(--ink);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.newsletter-form__input {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s;
    width: 100%;
}
.newsletter-form__input:focus {
    outline: none;
    border-color: var(--green);
}

.newsletter-form__hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

.newsletter-form__btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.7rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.02em;
}
.newsletter-form__btn:hover { background: var(--moss); }
.newsletter-form__btn:disabled { opacity: 0.6; cursor: not-allowed; }

.newsletter-form__msg {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 0.6rem 0.85rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}
.newsletter-form__msg--ok {
    background: rgba(61,90,62,0.1);
    color: var(--green);
}
.newsletter-form__msg--err {
    background: rgba(196,132,62,0.1);
    color: var(--amber);
}

/* ── Ko-fi Card ── */
.sidebar-kofi {
    display: block;
    text-decoration: none;
    transition: box-shadow 0.3s, transform 0.3s;
}
.sidebar-kofi:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    color: inherit;
}

.sidebar-kofi__top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.sidebar-kofi__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-kofi__label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-kofi__name {
    display: block;
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}

.sidebar-kofi__text {
    font-size: 0.8rem;
    color: var(--ink);
    line-height: 1.55;
    margin-bottom: 0.85rem;
}

.sidebar-kofi__btn {
    display: block;
    text-align: center;
    background: var(--amber);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.65rem;
    border-radius: 4px;
    letter-spacing: 0.01em;
}

.sidebar-kofi__powered {
    display: block;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    color: var(--brown);
    margin-top: 0.5rem;
}

/* ── Comments ── */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-section__heading {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.3rem;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.comment-item {
    margin-bottom: 1.25rem;
}

.comment-item .children {
    list-style: none;
    margin: 1rem 0 0 2.5rem;
    padding: 0;
}

.comment-item__inner {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.comment-item__avatar img {
    border-radius: 50%;
    display: block;
}

.comment-item__content {
    flex: 1;
    min-width: 0;
}

.comment-item__meta {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.comment-item__author {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
}

.comment-item__date {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comment-item__text {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ink);
}

.comment-item__text p { margin-bottom: 0.75rem; }
.comment-item__text p:last-child { margin-bottom: 0; }

.comment-item__reply a {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.35rem;
    display: inline-block;
}
.comment-item__reply a:hover { color: var(--moss); }

.comment-nav {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    margin-bottom: 2rem;
}
.comment-nav a { color: var(--green); }
.comment-nav a:hover { color: var(--moss); }

.comment-respond {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.comment-respond__title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.comment-respond__title small a {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: var(--brown);
    font-weight: 400;
}

.comment-form__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.comment-form__input {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s;
}
.comment-form__input:focus {
    outline: none;
    border-color: var(--green);
}

.comment-form__textarea {
    width: 100%;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: 0.92rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--ink);
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
    transition: border-color 0.2s;
    margin-bottom: 0.6rem;
}
.comment-form__textarea:focus {
    outline: none;
    border-color: var(--green);
}

.comment-form__btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-form__btn:hover { background: var(--moss); }

.comments-closed {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--brown);
    font-style: italic;
    padding-top: 1rem;
}

#cancel-comment-reply-link { display: none; }
.comment-respond__title small #cancel-comment-reply-link { display: inline; }

/* ── Related Posts ── */
.related-posts {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

.related-posts__heading {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.related-card {
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s, transform 0.3s;
}
.related-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.related-card__image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.related-card__body { padding: 1rem; }

.related-card__title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 0.95rem;
    line-height: 1.35;
}
.related-card__title a { color: var(--ink); }
.related-card__title a:hover { color: var(--green); }

.related-card__date {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--brown);
    margin-top: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Infinite Scroll ── */
.feed-sentinel {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 2rem 0 3rem;
    min-height: 60px;
}

.feed-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.feed-sentinel.loading .feed-spinner {
    opacity: 1;
    animation: wa-spin 0.8s linear infinite;
}

@keyframes wa-spin {
    to { transform: rotate(360deg); }
}

/* ── Footer ── */
.site-footer {
    background: var(--moss);
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 1rem;
    text-align: center;
}

.site-footer__brand {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1rem;
}

.site-footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    margin-bottom: 1.5rem;
}

.site-footer__links a {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.site-footer__links a:hover { color: #fff; }

.site-footer__copy {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .site-hero { height: 40vh; min-height: 280px; }

    .site-nav__links {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--moss);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        z-index: 200;
    }
    .site-nav__links.open { display: flex; }
    .site-nav__links a { font-size: 1rem; }

    .nav-toggle { display: block; z-index: 201; }
    .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.open span:nth-child(2) { opacity: 0; }
    .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .feed { padding: 1.5rem 1rem 3rem; }
    .feed__grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .post-card__body { padding: 1.25rem; }
    .post-card__title { font-size: 1.25rem; }
    .post-card--quote { padding: 2rem 1.5rem; }
    .post-card--quote .post-card__quote-text { font-size: 1.15rem; }

    .single-layout { grid-template-columns: 1fr; gap: 0; }
    .single-content { padding: 1.5rem 0 2rem; }
    .single-sidebar { position: static; padding-top: 0; padding-bottom: 2rem; }

    .related-posts__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .site-footer__links { flex-wrap: wrap; gap: 0.75rem 1.25rem; }

    .comment-form__fields { grid-template-columns: 1fr; }
    .comment-item .children { margin-left: 1.25rem; }
}
