* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #F5F0E8;
    background: #0D0D0D;
}

/* ── Centered container ── */
.site-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ── Site header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0D0D0D;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    overflow: visible;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background: #1E1E1E;
}

.site-title {
    font-family: 'Barlow', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.site-title a {
    text-decoration: none;
}

:root { --accent: #CC1A1A; }

.logo-funny {
    color: #F5F0E8;
}

.logo-accent {
    color: var(--accent);
}

.site-tagline {
    color: rgba(245, 240, 232, 0.4);
    font-style: italic;
    font-size: 0.85rem;
}

/* ── Page layout ── */
.page-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - 52px);
}

/* ── Sidebar ── */
.sidebar {
    position: sticky;
    top: 52px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    background: #111111;
    border-right: 1px solid #1E1E1E;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.3);
    margin-bottom: 0.25rem;
}

.sidebar-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #F5F0E8;
    text-decoration: none;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 0.9rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.sidebar-tag:hover {
    color: #C9A84C;
    border-bottom-color: rgba(201, 168, 76, 0.3);
}

.sidebar-count {
    font-style: normal;
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sidebar-social-link {
    display: block;
    color: rgba(245, 240, 232, 0.55);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    transition: color 0.15s;
}

.sidebar-social-link:hover {
    color: #C9A84C;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.72rem;
    color: rgba(245, 240, 232, 0.2);
}

/* ── Site content ── */
.site-content {
    min-width: 0; /* prevent grid blowout */
}

/* ── Page container (taxonomy, etc.) ── */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Feed (homepage) ── */
.feed {
    background: #0D0D0D;
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feed-post {
    background: #181818;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feed-post-header {
    padding: 1rem 1.25rem 0.75rem;
}

.feed-post-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #F5F0E8;
}

.feed-post-title-link {
    color: inherit;
    text-decoration: none;
}

.feed-post-title-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.feed-post-img-wrap {
    width: 100%;
    line-height: 0;
}

.feed-post-img {
    width: 100%;
    height: auto;
    display: block;
}

.feed-post-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.feed-categories {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.feed-category {
    display: inline-block;
    background: #C9A84C;
    color: #1A1A1A;
    padding: 0.2rem 0.65rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    border-radius: 2px;
}

.feed-category:hover {
    background: #B8924A;
}

/* ── Taxonomy page (category listing) ── */
.taxonomy-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 1.5rem 1rem 0;
    margin-bottom: 0;
}

.taxonomy-header h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: #F5F0E8;
}

.back-link {
    color: #C9A84C;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* ── Card grid (taxonomy page) ── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #1A1A1A;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-info {
    padding: 1rem;
}

.post-info h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: #F5F0E8;
}

.post-info time {
    color: rgba(245, 240, 232, 0.45);
    font-size: 0.85rem;
    display: block;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.post-card-categories {
    padding: 0 1rem 1rem;
}

.category {
    display: inline-block;
    background: #C9A84C;
    color: #1A1A1A;
    padding: 0.2rem 0.65rem;
    border-radius: 2px;
    font-size: 0.8rem;
    font-style: italic;
    font-family: 'Playfair Display', Georgia, serif;
    text-decoration: none;
}

.category:hover {
    background: #B8924A;
}

/* ── Single post page ── */
.post-single {
    background: #1A1A1A;
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 2rem auto;
}

.post-single header {
    margin-bottom: 1.5rem;
}

.post-single h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #F5F0E8;
}

.post-meta {
    color: rgba(245, 240, 232, 0.5);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-image {
    margin-bottom: 2rem;
}

.post-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-content {
    margin-bottom: 2rem;
    color: #F5F0E8;
}

.post-navigation {
    padding-top: 1.5rem;
    border-top: 1px solid #2A2A2A;
}

.post-navigation a {
    color: #C9A84C;
    text-decoration: none;
}

.post-navigation a:hover {
    text-decoration: underline;
}


/* ── Share bar ── */
.share-bar {
    position: relative;
    padding-top: 0.5rem;
}

.share-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.35);
    font-family: inherit;
    font-size: 0.78rem;
    padding: 0.2rem 0;
    cursor: pointer;
    transition: color 0.15s;
    letter-spacing: 0.02em;
}

.share-trigger:hover,
.share-trigger[aria-expanded="true"] {
    color: rgba(245, 240, 232, 0.7);
}

.share-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: block;
}

.share-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.35rem;
    min-width: 160px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.share-dropdown[hidden] {
    display: none;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: rgba(245, 240, 232, 0.65);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.1s, color 0.1s;
    line-height: 1;
}

.share-option svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: block;
    color: inherit;
    fill: currentColor;
}

.share-option[href] svg {
    fill: currentColor;
    stroke: none;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #F5F0E8;
}

.share-copy.copied {
    color: #C9A84C;
}

/* share bar on single post page sits under the image, right-aligned */
.post-single .share-bar {
    padding: 0.75rem 0 1.25rem;
    display: flex;
    justify-content: flex-end;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .site-header {
        padding: 0.9rem 1rem;
    }

    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #1E1E1E;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        padding: 1.25rem 1rem;
    }

    .sidebar-footer {
        display: none;
    }

    .feed {
        padding: 1.5rem 1rem 3rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-single {
        padding: 1.25rem;
        margin: 1rem;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .feed-post-img {
        transition: none;
    }
}
