@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #F9FAFB;
    overflow-anchor: none;
    /* Prevent scroll jumps on refresh */
    /* Fallback for overscroll (matches main theme intent) */

    /* Hide Scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

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

/* Branded Selection */
::selection {
    background-color: #2563EB;
    /* Royal Blue */
    color: #FFFFFF;
}

:root {
    /* Modern Editorial Palette */
    /* Modern Editorial Palette */
    --voice-bg-color: transparent;
    /* Seamless integration */
    --voice-card-bg: #FFFFFF;

    /* Text Colors */
    --voice-text-primary: #111827;
    /* Gray-900: Sharper than pure black */
    --voice-text-secondary: #6B7280;
    /* Gray-500: Elegant secondary */
    --voice-text-accent: #2563EB;
    /* Royal Blue: Trustworthy & vibrant */

    /* Structure */
    --voice-max-width: 640px;
    /* Slightly wider for modern feel */
    --voice-radius: 16px;
    /* Softer, friendlier corners */

    /* Elevation (Soft Shadows) */
    --voice-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --voice-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --voice-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --voice-font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    --voice-heading-font: 'Roboto', sans-serif;
}

/* Quarto Overrides - Remove default spacing */
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;
}

/* Scoped Wrapper */
.glbt-voices-wrapper {
    background-color: var(--voice-bg-color);
    color: var(--voice-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-family: var(--voice-font-family);
    -webkit-font-smoothing: antialiased;
    /* Typography Polish */
    /* Typography Polish */
    font-feature-settings: "cv11", "ss01";
    /* Cleaner letters for Inter */
}

/* Headings */
.glbt-voices-wrapper h1,
.glbt-voices-wrapper h2,
.glbt-voices-wrapper h3 {
    font-family: var(--voice-heading-font);
}

/* Feed */
.feed-container {
    max-width: var(--voice-max-width);
    margin: 0 auto;
    padding: 8px 16px;
    min-height: 100vh;
}

/* Header */
.header-container {
    padding: 24px 0 8px;
    text-align: center;
    background-color: transparent;
}

.header-container h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--voice-text-primary);
    letter-spacing: -0.02em;
}

/* Post Card */
/* Post Card */
.post-card {
    background-color: var(--voice-card-bg);
    border-radius: var(--voice-radius);
    box-shadow: var(--voice-shadow);
    margin-bottom: 24px;
    /* More breathing room */
    overflow: hidden;
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* Increased definition for white-on-white */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform, opacity;
    /* Performance hint */
}

.post-card:active {
    transform: scale(0.98) translateY(0);
    /* Tactile press */
    transition-duration: 0.1s;
}

.post-card:hover {
    transform: translateY(-2px);
    /* Subtle lift */
    box-shadow: var(--voice-shadow-hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.post-header {
    padding: 20px 24px 12px;
    display: flex;
    align-items: center;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 14px;
    box-shadow: inset 0 0 0 1px rgba(29, 28, 28, 0.05);
    /* Initial Styling */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', var(--voice-heading-font);
}

.post-meta {
    display: flex;
    flex-direction: column;
}

.post-author {
    font-weight: 500;
    /* Slightly lighter than 600 */
    font-size: 1rem;
    color: var(--voice-text-primary);
    letter-spacing: -0.01em;
}

.post-date {
    font-size: 0.85rem;
    color: var(--voice-text-secondary);
    margin-top: 2px;
}

.post-content {
    padding: 12px 32px 32px;
    /* Generous padding */
    color: var(--voice-text-primary);
}

.post-content.truncated p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-content p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 1.0625rem;
    /* 17px - Sweet spot for readability */
    line-height: 1.7;
    /* Airy tone */
    letter-spacing: -0.01em;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--voice-primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 12px 8px;
    /* Larger hit area */
    margin: 4px -8px -8px;
    /* Negative margin to align visually but expand hit area */
    display: block;
    width: calc(100% + 16px);
    text-align: left;
    transition: color 0.2s, opacity 0.2s;
    letter-spacing: 0.01em;
    font-family: inherit;
    /* Modern Underline */
    text-decoration: underline;
    text-decoration-color: transparent;
    /* Top secret: animate color later */
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 0.2s ease, opacity 0.2s ease;
}

.read-more-btn:hover {
    background-color: transparent;
    opacity: 0.8;
    text-decoration-color: currentColor;
    /* Reveal underline on hover */
}

.post-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    padding: 8px 12px;
}

.action-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--voice-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-family: inherit;
}

.action-btn:active {
    background-color: rgba(0, 0, 0, 0.03);
    transform: scale(0.98);
}

/* Pull to Refresh */
.ptr-zone {
    height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 0;
    /* Removed static padding to prevent layout shift */
    background-color: var(--voice-bg-color);
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ptr-zone.refreshing {
    padding-bottom: 15px;
    /* Restored when active */
}

.ptr-icon {
    transition: transform 0.2s;
    width: 24px;
    height: 24px;
    color: var(--voice-text-secondary);
}

.ptr-text {
    font-size: 0.8rem;
    color: var(--voice-text-secondary);
    margin-top: 5px;
    font-weight: 500;
}

.ptr-zone.refreshing .ptr-icon {
    animation: spin 1s linear infinite;
}

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

/* Loading Sentinel */
.loading-sentinel {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading-sentinel.visible {
    opacity: 1;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    border-top-color: var(--voice-primary-color);
    animation: spin 0.8s ease-in-out infinite;
}

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

    .post-card {
        border-radius: 12px;
        margin-bottom: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .post-content {
        padding: 6px 20px 20px;
    }

    .post-header {
        padding: 16px 20px 10px;
    }
}

/* Filter UI */
.filter-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--voice-text-primary);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 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;
    /* Explicitly below content */
}

.filter-content {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    position: relative;
    z-index: 2;
    /* Explicitly above backdrop */
    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-size: 1.25rem;
}

.filter-header button {
    background: none;
    border: none;
    color: var(--voice-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--voice-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sort-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.radio-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--voice-text-primary);
}

#year-select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    font-family: inherit;
    background-color: #F9FAFB;
}

.apply-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--voice-text-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.apply-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}