@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700;1,900&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
    --bg:       #eae5da;
    --panel:    #4a6b72;
    --ink:      #1a1813;
    --rust:     #8b3a1e;
    --muted:    #7a7060;
    --card-bg:  #fff9f2;
    --hairline: #cdc7bb;
    --radius:   4px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
}

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

html {
    font-family: var(--font-body);
    font-size: 16px;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

/* ── Layout ──────────────────────────────────────────────────── */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* ── Page heading ────────────────────────────────────────────── */
.forum-heading {
    padding: 4rem 0 3rem;
    border-bottom: 1.5px solid var(--hairline);
    margin-bottom: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;
}

.forum-contribute {
    width: min(100%, 340px);
    padding-bottom: .35rem;
}

.forum-contribute p {
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55;
}

.forum-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.forum-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.title-accent {
    color: var(--rust);
    font-style: italic;
}

/* ── Section label ───────────────────────────────────────────── */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hairline);
}

/* ── Featured gallery ────────────────────────────────────────── */
.featured-gallery {
    display: grid;
    grid-template-columns: 1fr 340px;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--ink);
    gap: 2px;
    margin-bottom: 3rem;
}

/* Primary (cream) card */
.gallery-primary {
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.gallery-primary__body {
    flex: 1;
    padding: 2.5rem 2.75rem 1.75rem;
    display: flex;
    flex-direction: column;
}

.cat-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rust);
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: block;
}

.gallery-primary__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--ink);
    margin-bottom: 1rem;
}

.gallery-primary__excerpt {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 1.5rem;
    flex: 1;
}

.gallery-primary__meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 2.75rem;
    border-top: 1px solid var(--hairline);
}

/* Secondary (teal) panel */
.gallery-secondary {
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gallery-tile {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 110px;
}

.gallery-tile__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
    mix-blend-mode: luminosity;
}

.gallery-tile__cat {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.4);
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
}

.gallery-tile__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: 0.9375rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #fff;
    position: relative;
}

.gallery-tile__title a { color: inherit; }
.gallery-tile__title a:hover { text-decoration: none; opacity: 0.8; }

.gallery-tile__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
}

.tile-stats { display: flex; gap: 0.75rem; }

/* ── Shared components ───────────────────────────────────────── */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: #e0d9cc;
    color: #5a5040;
    padding: 3px 8px;
    border-radius: 2px;
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    background: var(--ink);
    color: var(--bg);
    padding: 9px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    align-self: flex-start;
    transition: background 0.15s;
    margin-bottom: 0;
}
.btn-dark:hover { background: #333028; text-decoration: none; }

.meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--hairline);
    flex-shrink: 0;
}

.meta-avatar--sm { width: 26px; height: 26px; }

.meta-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ded4c7;
    color: var(--ink);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.meta-author {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ink);
}

.meta-detail {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.meta-stats {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* ── Controls ────────────────────────────────────────────────── */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
}

.filter-tab {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 7px 14px;
    background: transparent;
    color: var(--muted);
    border-right: 1.5px solid var(--ink);
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    display: inline-block;
}
.filter-tab:last-child { border-right: none; }
.filter-tab:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.filter-tab.is-active { background: var(--ink); color: var(--bg); }

.tab-count { opacity: 0.5; font-size: 0.6rem; }

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.sort-select {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--ink);
    padding: 6px 28px 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231a1813' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.sort-select:focus { outline: 2px solid var(--rust); outline-offset: 1px; }

/* ── Posts grid ──────────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 5rem;
}

/* ── Post card ───────────────────────────────────────────────── */
.post-card {
    background: var(--card-bg);
    border: 1.5px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background 0.2s;
}
.post-card:hover { background: #fff; }

.post-card__thumb {
    position: relative;
    height: 148px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card__thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    mix-blend-mode: multiply;
}

.post-card__thumb-label {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 1.125rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: -0.01em;
    position: relative;
}

.post-card__cat {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.45);
    color: #fff;
    padding: 2px 7px;
    border-radius: 2px;
}

.post-card__body {
    padding: 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.post-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    color: var(--ink);
}
.post-card__title a:hover { text-decoration: none; opacity: 0.7; }

.post-card__excerpt {
    font-size: 0.8125rem;
    line-height: 1.65;
    color: var(--muted);
    margin-bottom: 0.875rem;
    flex: 1;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hairline);
    margin-top: auto;
}

/* ── Placeholder card ────────────────────────────────────────── */
.post-card--placeholder {
    border-style: dashed;
    cursor: default;
}
.post-card--placeholder:hover { background: var(--card-bg); }

.post-card__thumb--empty {
    background: #ddd8ce;
}

.skel {
    background: #e5e0d6;
    border-radius: 2px;
    margin-bottom: 0.5rem;
}
.skel--short   { width: 60px;  height: 10px; }
.skel--title   { width: 88%;   height: 16px; }
.skel--title-sm { width: 60%;  height: 16px; }
.skel--line    { width: 100%;  height: 10px; background: #edeae4; }
.skel--line-short { width: 75%; }

.skel-tags { display: flex; gap: 5px; margin-bottom: 0.5rem; }
.skel--tag      { width: 50px; height: 16px; background: #e0d9cc; }
.skel--tag-wide { width: 64px; }

.post-card__placeholder-label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b5ae9f;
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--hairline);
    margin-top: auto;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    padding: 3rem;
}
.empty-state__msg {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--hairline);
    padding: 2rem 0;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .featured-gallery { grid-template-columns: 1fr; }

    .gallery-secondary {
        flex-direction: row;
        min-height: 200px;
    }

    .gallery-tile { flex: 1 1 33%; }
}

@media (max-width: 700px) {
    .page-wrap { padding: 0 1.25rem; }

    .forum-title { font-size: 3rem; }

    .gallery-secondary { flex-direction: column; }

    .gallery-tile { min-height: 120px; }

    .controls { flex-direction: column; align-items: flex-start; }

    .filter-tabs { flex-wrap: wrap; }

    .gallery-primary__body { padding: 1.5rem; }

    .gallery-primary__meta { padding: 1rem 1.5rem; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }

/* ── Post detail helpers ─────────────────────────────────────── */
.post-description.container { max-width: 820px; margin: 1.25rem auto; padding: 1.25rem 1.5rem; }
.post-body { max-width: 820px; margin: 0 auto 1.5rem; padding: 1.25rem 1.5rem; }

/* Make the back link more prominent with increased padding */
.btn-link { display: inline-block; padding: 12px 18px; border-radius: var(--radius); border: 1.5px solid var(--hairline); background: var(--card-bg); margin-top: 1.25rem; }

/* Ensure post-card detail uses the same card styling */
.post-card--detail { max-width: 820px; margin: 0 auto 2rem; }

/* ── Community comments ─────────────────────────────────────── */
.forum-comments {
    max-width: 820px;
    margin: 4rem auto 6rem;
    padding-top: 2.5rem;
    border-top: 1.5px solid var(--ink);
}

.forum-comments-heading h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1;
}

.forum-comments-empty,
.forum-comment-sign-in {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--hairline);
    background: var(--card-bg);
    color: var(--muted);
}

.forum-comment-list {
    margin-top: 1.5rem;
    border-top: 1px solid var(--hairline);
}

.forum-comment {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--hairline);
}

.forum-comment-author {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
}

.forum-comment-author strong,
.forum-comment-author small {
    display: block;
}

.forum-comment-author small {
    margin-top: .25rem;
    color: var(--muted);
    font-size: .68rem;
}

.forum-comment-body {
    line-height: 1.7;
}

.forum-comment-form {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--hairline);
    background: var(--card-bg);
}

.forum-comment-form label {
    display: block;
    margin-bottom: .5rem;
    font-size: .8rem;
    font-weight: 700;
}

.forum-comment-form textarea {
    width: 100%;
    padding: .9rem;
    border: 1px solid var(--hairline);
    background: #fff;
    font: inherit;
    resize: vertical;
}

.forum-comment-form .btn-dark {
    margin-top: 1rem;
    border: 0;
    cursor: pointer;
}

@media (max-width: 700px) {
    .forum-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .forum-contribute {
        width: 100%;
    }

    .forum-comment {
        grid-template-columns: 1fr;
    }
}

.community-rating {
    margin: 0 0 1rem;
    color: #70483e;
    font-weight: 800;
}

.community-rating span {
    margin-left: 8px;
    color: var(--muted);
    font-weight: 600;
}
