@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,400&family=Lato:wght@400;700&display=swap');

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #Fdfcf8;
    /* Warm off-white, paper-like */
    color: #2D2D2D;
    overflow-anchor: none;
    /* Hide Scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Hide Scrollbar for Chrome/Safari */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

::selection {
    background-color: #D4CDBC;
    color: #1a1a1a;
}

:root {
    --spinoza-bg: #Fdfcf8;
    --spinoza-card-bg: #FFFFFF;
    --spinoza-text-primary: #1F1F1F;
    --spinoza-text-secondary: #5F5F5F;
    --spinoza-accent: #78350F;
    /* Amber/Brown for that classic feel */

    --spinoza-font-serif: 'Crimson Pro', serif;
    --spinoza-font-sans: 'Lato', sans-serif;

    --spinoza-max-width: 680px;
    --spinoza-radius: 4px;
    /* Sharper corners for a bookish feel */

    --spinoza-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Quarto Overrides */
div.quarto-title-block,
div.quarto-title-meta,
.quarto-page-breadcrumbs,
#title-block-header {
    display: none !important;
}

#quarto-content,
.page-columns,
main.content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Wrapper */
.spinoza-wrapper {
    background-color: var(--spinoza-bg);
    min-height: 100vh;
    font-family: var(--spinoza-font-serif);
    line-height: 1.6;
}

/* Header */
.header-container {
    padding: 40px 0 20px;
    text-align: center;
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.header-container .main-title {
    display: block;
    /* Ensure visibility */
    margin: 0;
    font-family: var(--spinoza-font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--spinoza-text-primary);
    text-transform: uppercase;
}

.header-container .subtitle {
    display: block;
    margin-top: 8px;
    font-family: var(--spinoza-font-sans);
    font-size: 0.9rem;
    color: var(--spinoza-text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Filter UI */
.filter-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--spinoza-accent);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 12px rgba(120, 53, 15, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.filter-fab:active {
    transform: scale(0.92);
}

.filter-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.filter-modal.open {
    pointer-events: auto;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.filter-content {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 600px;
    /* Aligned with feed width */
    border-radius: 20px 20px 0 0;
    padding: 24px;
    position: relative;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.filter-modal.open .filter-content {
    transform: translateY(0);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-header h3 {
    margin: 0;
    font-family: var(--spinoza-font-serif);
    font-size: 1.25rem;
    color: var(--spinoza-text-primary);
}

.filter-header button {
    background: none;
    border: none;
    color: var(--spinoza-text-secondary);
    font-family: var(--spinoza-font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    padding: 12px 16px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    border-radius: 8px;
    text-align: left;
    font-family: var(--spinoza-font-sans);
    font-size: 1rem;
    color: var(--spinoza-text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-option:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.filter-option.active {
    background-color: rgba(120, 53, 15, 0.08);
    /* Light accent bg */
    border-color: var(--spinoza-accent);
    color: var(--spinoza-accent);
    font-weight: 700;
}

/* Bookmark Button in Card */
.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    /* Default inactive color */
    padding: 8px;
    transition: color 0.2s, transform 0.1s;
    line-height: 0;
}

.bookmark-btn:hover {
    color: #999;
}

.bookmark-btn.active {
    color: #FFB400;
    /* Gold/Yellow */
    transform: scale(1.1);
}

.bookmark-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.bookmark-btn.active svg {
    fill: currentColor;
    stroke: none;
}

/* Card Actions Group */
.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Recommended spacing */
}

/* Share Button in Card */
.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 8px;
    /* Touch target padding */
    transition: color 0.2s, transform 0.1s;
    line-height: 0;
    /* Margin removed in favor of gap */
}

.share-btn:hover {
    color: #999;
}

.share-btn:active {
    transform: scale(0.95);
    color: var(--spinoza-text-primary);
}

.share-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Feed */
.feed-container {
    max-width: var(--spinoza-max-width);
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Statement Card */
.statement-card {
    background-color: var(--spinoza-card-bg);
    margin-bottom: 40px;
    padding: 30px 40px;
    box-shadow: var(--spinoza-shadow);
    border-radius: var(--spinoza-radius);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.statement-meta {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 8px;
}

.statement-title {
    font-family: var(--spinoza-font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--spinoza-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.statement-id {
    font-family: var(--spinoza-font-sans);
    font-size: 0.75rem;
    color: #999;
}

.statement-content {
    font-size: 1.15rem;
    color: var(--spinoza-text-primary);
    text-align: justify;
}

.statement-content p {
    margin-top: 0;
}

/* Read More Logic */
.hidden-content {
    display: none;
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--spinoza-text-secondary);
    font-size: 1.05rem;
}

.hidden-content.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.read-more-btn {
    display: block;
    margin-top: 16px;
    background: none;
    border: none;
    font-family: var(--spinoza-font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--spinoza-accent);
    cursor: pointer;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

.read-more-btn:hover {
    opacity: 0.7;
}

/* Loading Sentinel */
.loading-sentinel {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--spinoza-font-sans);
    font-size: 0.9rem;
    color: #999;
}

/* Responsive */
@media (max-width: 600px) {
    .feed-container {
        padding: 0 16px 40px;
    }

    .statement-card {
        padding: 24px;
        margin-bottom: 24px;
    }

    .header-container h1 {
        font-size: 1.8rem;
    }
}