/**
 * Marthoma Church Theme - Main Theme Styles
 *
 * @package MarthomaChurch
 */

/* Layout Variables */
:root {
    --marthoma-container-width: 1140px;
    --marthoma-section-padding: 80px;
    --marthoma-widget-spacing: 20px;
    --marthoma-large-gap: 70px;
    --marthoma-medium-gap: 40px;
    --marthoma-small-gap: 20px;
}

/* Base Body Styles */
body {
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Container */
.container,
.site-main,
.page-content {
    max-width: var(--marthoma-container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Full Width */
.container-fluid {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Section Spacing */
.section {
    padding: var(--marthoma-section-padding) 0;
}

.section--small {
    padding: 40px 0;
}

.section--large {
    padding: 105px 0;
}

.section--no-top {
    padding-top: 0;
}

.section--no-bottom {
    padding-bottom: 0;
}

/* Section Backgrounds */
.section--light {
    background-color: var(--marthoma-light-gray, #F5F5F5);
}

.section--dark {
    background-color: var(--marthoma-dark-navy, #072538);
    color: #ffffff;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
    color: #ffffff;
}

.section--dark p {
    color: rgba(255, 255, 255, 0.8);
}

.section--gradient {
    background: linear-gradient(135deg, var(--marthoma-dark-navy, #072538), var(--marthoma-dark-navy-alt, #04141E));
}

/* Widget Spacing */
.elementor-widget {
    margin-bottom: var(--marthoma-widget-spacing);
}

.elementor-widget:last-child {
    margin-bottom: 0;
}

/* Page Structure */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    min-height: calc(100vh - 200px);
}

/* Entry Content */
.entry-title {
    margin-bottom: 20px;
}

.page-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--marthoma-light-gray, #F5F5F5);
}

.page-content {
    margin-bottom: 40px;
}

/* Entry Meta */
.entry-meta {
    font-size: var(--marthoma-font-size-small, 14px);
    color: var(--marthoma-secondary, #54595F);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.entry-meta a {
    color: var(--marthoma-button, #375EFB);
}

.entry-meta a:hover {
    text-decoration: underline;
}

/* Post Tags */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--marthoma-light-gray, #F5F5F5);
}

.tag-links a {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px;
    background: var(--marthoma-light-gray, #F5F5F5);
    border-radius: 3px;
    font-size: 0.875rem;
    color: var(--marthoma-secondary, #54595F);
    transition: all 0.3s ease;
}

.tag-links a:hover {
    background: var(--marthoma-button, #375EFB);
    color: #ffffff;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col {
    flex: 1;
    padding-left: 15px;
    padding-right: 15px;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }

.gap-sm { gap: var(--marthoma-small-gap); }
.gap-md { gap: var(--marthoma-medium-gap); }
.gap-lg { gap: var(--marthoma-large-gap); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 10px; }
.pt-2 { padding-top: 20px; }
.pt-3 { padding-top: 30px; }
.pt-4 { padding-top: 40px; }
.pt-5 { padding-top: 50px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 10px; }
.pb-2 { padding-bottom: 20px; }
.pb-3 { padding-bottom: 30px; }
.pb-4 { padding-bottom: 40px; }
.pb-5 { padding-bottom: 50px; }

/* Image Utilities */
.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.img-contain {
    object-fit: contain;
}

/* Background Utilities */
.bg-primary { background-color: var(--marthoma-primary, #000000); }
.bg-secondary { background-color: var(--marthoma-secondary, #54595F); }
.bg-accent { background-color: var(--marthoma-accent, #5251FF); }
.bg-light { background-color: var(--marthoma-light-gray, #F5F5F5); }
.bg-dark { background-color: var(--marthoma-dark-navy, #072538); }
.bg-white { background-color: #ffffff; }

/* Text Color Utilities */
.text-primary { color: var(--marthoma-primary, #000000); }
.text-secondary { color: var(--marthoma-secondary, #54595F); }
.text-accent { color: var(--marthoma-accent, #5251FF); }
.text-muted { color: var(--marthoma-text, #7A7A7A); }
.text-white { color: #ffffff; }

/* Dividers */
.divider {
    height: 1px;
    background-color: var(--marthoma-light-gray, #F5F5F5);
    margin: 30px 0;
}

.divider--dark {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--marthoma-button, #375EFB);
    z-index: 99999;
    transition: width 0.1s ease;
}

/* Back to Top Button - Modern Style */
#back-to-top,
.back-to-top,
button.back-to-top,
body .back-to-top {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    left: auto !important;
    width: 50px !important;
    height: 50px !important;
    background: linear-gradient(135deg, #375EFB 0%, #5251FF 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(55, 94, 251, 0.4) !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#back-to-top::before,
.back-to-top::before,
button.back-to-top::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, #5251FF 0%, #375EFB 100%) !important;
    opacity: 0;
    transition: opacity 0.3s ease !important;
    border-radius: 50% !important;
}

#back-to-top:hover::before,
.back-to-top:hover::before,
button.back-to-top:hover::before {
    opacity: 1;
}

#back-to-top:hover,
.back-to-top:hover,
button.back-to-top:hover {
    transform: translateY(-5px) scale(1) !important;
    box-shadow: 0 8px 30px rgba(55, 94, 251, 0.5) !important;
}

#back-to-top:active,
.back-to-top:active,
button.back-to-top:active {
    transform: translateY(-2px) scale(0.95) !important;
}

#back-to-top.visible,
.back-to-top.visible,
button.back-to-top.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

#back-to-top svg,
.back-to-top svg,
button.back-to-top svg {
    width: 24px !important;
    height: 24px !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.3s ease !important;
    fill: #ffffff !important;
}

#back-to-top svg path,
.back-to-top svg path,
button.back-to-top svg path {
    fill: #ffffff !important;
}

#back-to-top:hover svg,
.back-to-top:hover svg,
button.back-to-top:hover svg {
    transform: translateY(-3px);
    animation: bounce-arrow 0.6s ease infinite;
}

@keyframes bounce-arrow {
    0%, 100% {
        transform: translateY(-3px);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #back-to-top,
    .back-to-top,
    button.back-to-top,
    body .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 45px !important;
        height: 45px !important;
    }

    #back-to-top svg,
    .back-to-top svg,
    button.back-to-top svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Selection Color */
::selection {
    background-color: var(--marthoma-button, #375EFB);
    color: #ffffff;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --marthoma-section-padding: 60px;
        --marthoma-large-gap: 50px;
    }

    .container,
    .site-main {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    :root {
        --marthoma-section-padding: 50px;
        --marthoma-large-gap: 40px;
        --marthoma-medium-gap: 30px;
    }

    .container,
    .site-main {
        padding-left: 15px;
        padding-right: 15px;
    }

    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .col {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Stack columns on mobile */
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .d-md-none { display: none; }
    .d-md-block { display: block; }
}

@media (max-width: 480px) {
    :root {
        --marthoma-section-padding: 40px;
        --marthoma-widget-spacing: 15px;
    }

    .page-header {
        margin-bottom: 30px;
    }
}

/* =====================
   ELEMENTOR LIBRARY EDITING - FULL WIDTH
   ===================== */

/* Only remove container restrictions when EDITING Elementor Library templates */
body.single-elementor_library .site-main,
body.single-elementor_library .site-content,
body.single-elementor_library .entry-content.container,
body.single-elementor_library #content,
body.single-elementor_library #main {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Hide entry header only when editing Elementor library items */
body.single-elementor_library .entry-header {
    display: none !important;
}
