:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Merriweather', Georgia, Cambria, "Times New Roman", Times, serif;

    --color-bg: #ffffff;
    --color-text: #292929;
    --color-text-light: #757575;
    --color-primary: #1a8917;
    /* Medium green-ish */
    --color-accent: #000000;
    --color-border: #e6e6e6;
    --color-bg-secondary: #f9f9f9;

    --spacing-unit: 8px;
    --container-width: 700px;
    /* Reading width */
}

body {
    font-family: var(--font-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5em;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary);
}

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

/* Header */
header {
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    margin-bottom: 20px;
    /* Reduced from 40px */
}



.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    /* Wider for header */
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

/* Navigation Menu */
.menu-container {
    position: relative;
    /* To anchor absolute dropdown */
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 45px;
    height: 45px;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    min-width: 150px;
    /* Narrower */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 10px;
}

.menu-dropdown.show {
    display: block;
}

.menu-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    display: block;
    /* Override flex from previous nav ul */
}

.menu-dropdown li {
    display: block;
}

.menu-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--color-text-light);
    /* Match meta color */
    font-family: var(--font-sans);
    /* Match meta font */
    font-size: 1.05rem;
    /* Match meta size */
    text-transform: uppercase;
    /* Match meta style */
    letter-spacing: 0.5px;
    /* Match meta spacing */
    text-decoration: none;
    transition: all 0.2s;
}

.menu-dropdown a:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
}

/* Filters */
.filters-section {
    background-color: var(--color-bg-secondary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--color-border);
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Specific width for date range to prevent breaking */
.filter-group:has(.date-inputs) {
    grid-column: span 2;
    /* Span 2 columns if space allows */
    min-width: 300px;
}

@media (max-width: 768px) {
    .filter-group:has(.date-inputs) {
        grid-column: span 1;
    }
}

.filter-group label {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-light);
    text-transform: uppercase;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"] {
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    height: 38px;
}

.date-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-inputs input {
    flex: 1;
    /* Allow inputs to shrink/grow */
    min-width: 0;
    /* Prevent overflow */
}

.filter-actions {
    display: flex;
    gap: 10px;
    /* Align with the bottom of other inputs */
    height: 38px;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
    padding: 0 20px;
    height: 100%;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    white-space: nowrap;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-light);
    padding: 0 20px;
    height: 100%;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.results-count {
    margin-bottom: 20px;
    font-family: var(--font-sans);
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* Sermon List (Home) */
.sermon-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Reduced from 40px */
}

.sermon-card {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 20px;
    /* Reduced from 40px */
}

.sermon-card:last-child {
    border-bottom: none;
}

.sermon-meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    /* Slightly smaller */
    color: var(--color-text-light);
    margin-bottom: 4px;
    /* Reduced */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sermon-title {
    font-size: 1.5rem;
    /* Slightly smaller for list view */
    margin-top: 0;
    margin-bottom: 5px;
    /* Reduced */
}

.sermon-excerpt {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* Sermon Detail */
.sermon-header {
    margin-bottom: 20px;
    /* Reduced from 40px */
    text-align: center;
    border-bottom: none;
    /* Remove the extra line inherited from global header */
    padding-bottom: 0;
    /* Reduce padding inherited from global header */
}

.sermon-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.sermon-header .sermon-meta {
    justify-content: center;
    display: flex;
    gap: 15px;
    align-items: center;
}

.sermon-meta-primary {
    font-size: 1.05rem;
    /* Only affect the date/preacher line */
}

.sermon-external-link {
    color: var(--color-text-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sermon-external-link:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.sermon-separator {
    margin: 1rem auto;
    border: 0;
    border-top: 1px solid var(--color-border);
    max-width: 100px;
}

.sermon-content {
    font-size: 1.2rem;
    /* Larger reading text */
}

.sermon-intro {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.sermon-content h1,
.sermon-content h2 {
    margin-top: 2em;
}

.sermon-content p {
    margin-bottom: 1.5em;
}

.sermon-content ul,
.sermon-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

/* Search */
.search-bar {
    margin-bottom: 40px;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    font-family: var(--font-sans);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.search-button {
    padding: 10px 20px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-sans);
}

/* Footer */
footer {
    border-top: 1px solid var(--color-border);
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

/* Tabbed Interface Styles */
.tabs-container {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.tabs-nav {
    display: flex;
    justify-content: center;
    /* Center the pills */
    border-bottom: none;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-button {
    padding: 8px 16px;
    border: none;
    background-color: #f3f4f6;
    /* Light grey background */
    border-radius: 20px;
    /* Pill shape */
    font-size: 0.9rem;
    /* Smaller text */
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.tab-button.active {
    background-color: var(--color-accent);
    /* Active color (black/dark per theme) */
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive adjustments for tabs */
@media (max-width: 640px) {
    .tab-button {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}