/* --- common.css: Shared styles for all tenants --- */

:root {
    --primary-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --serif-font: "Georgia", "Times New Roman", serif;
    
    --text-color: #333;
    --background-color: #f8f9fa;
    --accent-color: #007bff;
    --border-color: #dee2e6;
    --card-background: #ffffff;
}

/* --- Basic Reset & Defaults --- */
body {
    margin: 0;
    padding: 0; /* Padding moved to container or specific elements */
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

*, *:before, *:after {
    box-sizing: border-box;
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-background);
    padding: 2rem 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 2rem auto; /* Center the container and add vertical space */
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif-font);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    text-align: center;
}

p {
    margin-top: 0;
    margin-bottom: 1em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Text Element Styles --- */
.article-reference {
    text-align: center;
    font-style: italic;
    font-size: 1.1em;
    margin-top: -0.5em;
    margin-bottom: 1.5em;
    color: #6c757d;
}

.scripture-block {
    margin: 1.5em 3em;
    padding: 1em 1.5em;
    background-color: #e9ecef; /* A darker gray */
    border: 1px solid #ced4da;
    border-radius: 24px; /* Squircle approximation */
    text-align: left;
}

.scripture-audio {
    display: block;
    width: 100%;
    margin-bottom: 1em;
    border-radius: 12px;
}

.prayer-block {
    margin: 1.5em 3em;
    padding: 1em 1.5em;
    background-color: #e0f7fa; /* A colorful (light blue) background */
    border-radius: 24px; /* Squircle approximation */
    border: none; /* No border */
    text-align: left;
}

/* Figure Block Styles */
.figure-block {
    margin: 2em auto; /* Center the block and add vertical spacing */
    max-width: 100%;
    text-align: center; /* Center image and caption */
}

.figure-block img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.figure-caption {
    font-style: italic;
    font-size: 0.95em;
    color: #555;
    margin-top: 0.5em;
}

.figure-source {
    font-size: 0.85em;
    color: #777;
    margin-top: 0.2em;
}

.figure-source a {
    color: #777;
    text-decoration: underline;
}

.figure-source a:hover {
    color: var(--accent-color);
}

/* Hymn Block Styles */
.hymn-block {
    margin: 1.5em 3em;
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

/* Quote Block Styles */
.quote-block {
    margin: 1.5em 3em;
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

/* Blessing Block Styles */
.blessing-block {
    margin: 1.5em 3em;
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

/* Devotional Context Banner */
.devotional-context-banner {
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #cceeff; /* Light blue border */
    border-radius: 8px;
    padding: 1em 1.5em;
    margin-bottom: 2em; /* Space below the banner */
    text-align: center;
    font-style: italic;
    color: #336699;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.devotional-context-banner strong {
    font-weight: normal; /* Keep strong from being too bold */
    color: #003366;
}

.plain {
    /* This is the default paragraph style */
}

.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}

/* --- HTMX Loading Indicator Styles --- */
#load-more-trigger {
    min-height: 50px; /* Ensure the trigger div has a height */
    display: flex;
    justify-content: center;
    align-items: center;
}

#loading-indicator {
    color: #6c757d;
    font-style: italic;
    transition: opacity 0.3s ease-in-out;
}

#no-more-content {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

/* --- Responsive Styles for Mobile/Tablet --- */
@media (max-width: 768px) {
    /* Reduce container padding on smaller screens */
    .container {
        padding: 1rem 1rem;
    }

    /* Expand custom blocks to near full width with slight indent */
    .scripture-block,
    .prayer-block,
    .figure-block,
    .hymn-block,
    .quote-block,
    .blessing-block {
        margin-left: 0.75em;
        margin-right: 0.75em;
    }
}

/* --- Lightbox Styles --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: default;
    /* Animation */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    background-color: #fff;
}

.lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Make figure images show pointer cursor */
.figure-block img {
    cursor: pointer;
}
