/* ==========================================================================
   Nevoura Journal (Blog) — plugin module
   Built entirely on the shared tokens from nv-shared-components.css
   (--nv-ink, --nv-accent, --nv-off, --nv-border, --nv-muted, Playfair
   Display / Raleway). Do not introduce new colors here — reuse a token.
   ========================================================================== */

/* Hide the theme's default page-title bar on blog pages; the hero below
   replaces it, same pattern used on My Account. */
body.blog .entry-header,
body.archive .entry-header,
body.single-post .entry-header,
body.search .entry-header {
    display: none !important;
}

.nv-blog {
    background: var(--nv-off);
    font-family: "Raleway", sans-serif;
}

/* ---------- Hero ---------- */
.nv-blog-hero {
    background: var(--nv-ink);
    padding: 120px 40px 90px;
    text-align: center;
}
.nv-blog-hero-eyebrow { color: rgba(255, 255, 255, .6); }
.nv-blog-hero .nv-opening-title { color: var(--nv-white); margin-bottom: 14px; }
.nv-blog-hero-sub {
    color: rgba(255, 255, 255, .78);
    max-width: 640px;
    margin: 0 auto 26px;
    font-size: 1rem;
    line-height: 1.7;
}

/* ---------- Category tab bar ---------- */
.nv-blog-tabs {
    max-width: 1320px;
    margin: 0 auto;
    padding: 26px 40px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nv-blog-tabs::-webkit-scrollbar { display: none; }

.nv-blog-tab {
    flex: none;
    padding: 10px 20px;
    border: 1px solid var(--nv-border);
    border-radius: 30px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nv-ink);
    text-decoration: none !important;
    background: var(--nv-white);
    transition: background .2s, color .2s, border-color .2s;
}
.nv-blog-tab:hover { border-color: var(--nv-ink); }
.nv-blog-tab.is-active {
    background: var(--nv-ink);
    border-color: var(--nv-ink);
    color: var(--nv-white) !important;
}

/* ---------- Layout: grid + sidebar ---------- */
.nv-blog-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 10px 40px 100px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 56px;
    align-items: start;
}

/* ---------- Masonry-feel grid ----------
   True CSS masonry isn't reliably supported yet, so we use a dense grid
   with a repeating "feature" card (post #1 and every 7th) that spans two
   columns and two rows. This gives the mixed big/small rhythm from the
   reference layout without a JS masonry library. */
.nv-blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: dense;
    gap: 28px;
}

.nv-blog-card {
    background: var(--nv-white);
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}
.nv-blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .1);
}

.nv-blog-card--feature {
    grid-column: span 2;
    grid-row: span 2;
}
.nv-blog-card--feature .nv-blog-card-img { aspect-ratio: 16 / 10; }

.nv-blog-card-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--nv-border);
}
.nv-blog-card-img img,
.nv-blog-card-img--placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .8s ease;
}
.nv-blog-card-img--placeholder { background: var(--nv-border); }
.nv-blog-card:hover .nv-blog-card-img img { transform: scale(1.06); }

.nv-blog-card-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--nv-ink);
    color: var(--nv-white);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 6px 12px;
}
.nv-blog-card-tag--static { position: static; display: inline-block; margin-bottom: 16px; }

.nv-blog-card-body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.nv-blog-card--feature .nv-blog-card-body { padding: 32px; }

.nv-blog-card-title {
    font-family: "Playfair Display", serif;
    font-weight: 500;
    font-size: 1.18rem;
    line-height: 1.35;
    margin: 0 0 10px;
}
.nv-blog-card--feature .nv-blog-card-title { font-size: 1.7rem; }
.nv-blog-card-title a { color: var(--nv-ink); text-decoration: none; }
.nv-blog-card-title a:hover { color: var(--nv-mid); }

.nv-blog-card-excerpt {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--nv-mid);
    flex-grow: 1;
    margin-bottom: 14px;
}

.nv-blog-card-meta {
    font-size: .62rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nv-muted);
    margin-top: auto;
}

.nv-blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--nv-muted);
    padding: 60px 0;
}

/* ---------- Sidebar ---------- */
.nv-blog-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Category rail — reference layout's circular avatar strip, repurposed
   as a quick category jump list. */
.nv-blog-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    background: var(--nv-white);
    padding: 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
}
.nv-blog-rail-item { display: block; }
.nv-blog-rail-dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--nv-off) center / cover no-repeat;
    border: 1px solid var(--nv-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    color: var(--nv-ink);
    text-transform: uppercase;
    transition: border-color .2s, background .2s;
}
.nv-blog-rail-item:hover .nv-blog-rail-dot { border-color: var(--nv-ink); }
.nv-blog-rail-dot--all { background: var(--nv-accent); font-size: .56rem; }

.nv-blog-widget {
    background: var(--nv-white);
    padding: 28px 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
}

.nv-blog-sidebar-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--nv-ink);
}

.nv-blog-recent {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none !important;
    margin-bottom: 20px;
}
.nv-blog-recent:last-child { margin-bottom: 0; }
.nv-blog-recent img,
.nv-blog-recent-thumb--placeholder {
    width: 60px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--nv-border);
}
.nv-blog-recent-text { display: flex; flex-direction: column; gap: 4px; }
.nv-blog-recent-title {
    font-family: "Playfair Display", serif;
    font-size: .92rem;
    line-height: 1.3;
    color: var(--nv-ink);
}
.nv-blog-recent-date {
    font-size: .58rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nv-muted);
}

/* ---------- Pagination ---------- */
.nv-blog-pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}
.nv-blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--nv-border);
    color: var(--nv-ink);
    text-decoration: none !important;
    font-size: .8rem;
    font-weight: 600;
}
.nv-blog-pagination .page-numbers.current,
.nv-blog-pagination .page-numbers:hover {
    background: var(--nv-ink);
    color: var(--nv-white);
    border-color: var(--nv-ink);
}

/* ==========================================================================
   Single Post
   ========================================================================== */
.nv-blog-single-hero {
    position: relative;
    background: var(--nv-ink);
    overflow: hidden;
}
.nv-blog-single-hero-img { position: relative; }
.nv-blog-single-hero-img img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
    opacity: .55;
}
.nv-blog-single-hero-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 70px 40px;
    text-align: center;
}
.nv-blog-single-hero-img + .nv-blog-single-hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.nv-blog-single-hero-content .nv-opening-title { color: var(--nv-white); margin: 10px 0 14px; }
.nv-blog-single-meta {
    color: rgba(255, 255, 255, .75);
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.nv-blog-wrap--single { grid-template-columns: 1fr 300px; padding-top: 70px; }

.nv-blog-single-content {
    background: var(--nv-white);
    padding: 50px 56px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--nv-mid);
}
.nv-blog-single-content h2,
.nv-blog-single-content h3 {
    font-family: "Playfair Display", serif;
    color: var(--nv-ink);
}
.nv-blog-single-content img { max-width: 100%; height: auto; }
.nv-blog-single-content p { margin: 0 0 22px; }

.nv-blog-single-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0 10px;
}
.nv-blog-single-nav-link {
    flex: 1;
    text-decoration: none !important;
    padding: 18px 20px;
    border: 1px solid var(--nv-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nv-blog-single-nav-link--next { text-align: right; }
.nv-blog-single-nav-label {
    font-size: .6rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--nv-muted);
}
.nv-blog-single-nav-title {
    font-family: "Playfair Display", serif;
    color: var(--nv-ink);
    font-size: .95rem;
}

.nv-blog-back-btn { margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .nv-blog-wrap,
    .nv-blog-wrap--single { grid-template-columns: 1fr; }
    .nv-blog-sidebar { position: static; }
    .nv-blog-grid { grid-template-columns: 1fr; }
    .nv-blog-card--feature { grid-column: span 1; grid-row: span 1; }
    .nv-blog-single-content { padding: 34px 26px; }
    .nv-blog-single-hero-content { padding: 50px 24px; }
}
