/* Subpage Layout & Container Formatting */
.subpage {
    background-color: var(--cream-bg, #f9f7f2);
    padding: 48px 0 64px;
    min-height: calc(100vh - 350px);
}

.subpage .container {
    background: #ffffff;
    border-radius: var(--radius-md, 16px);
    padding: 44px 48px;
    box-shadow: 0 8px 30px rgba(18, 55, 42, 0.06);
    border: 1px solid rgba(18, 55, 42, 0.08);
}

@media (max-width: 768px) {
    .subpage {
        padding: 24px 0 40px;
    }
    .subpage .container {
        padding: 24px 20px;
        border-radius: 12px;
    }
}

.block-item {
    margin-bottom: 2rem;
}

.block-item:last-child {
    margin-bottom: 0;
}

.section-heading {
    font-family: var(--font-serif, 'Italiana', Georgia, serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary, #12372a);
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

/* Rich Text, TipTap & Paragraph Spacing Fixes */
.rich-text,
.tiptap-content,
.content-text {
    font-family: var(--font-sans, 'DM Sans', sans-serif);
    font-size: 1.06rem;
    line-height: 1.85;
    color: #2b3832;
}

.rich-text p,
.tiptap-content p,
.content-text p {
    margin-bottom: 1.5rem;
    font-size: 1.06rem;
    line-height: 1.85;
    color: #2b3832;
}

.rich-text p:last-child,
.tiptap-content p:last-child,
.content-text p:last-child {
    margin-bottom: 0;
}

.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4,
.tiptap-content h1, .tiptap-content h2, .tiptap-content h3, .tiptap-content h4,
.content-text h1, .content-text h2, .content-text h3, .content-text h4 {
    font-family: var(--font-serif, 'Italiana', Georgia, serif);
    color: var(--primary, #12372a);
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.popup-image img,
.block-item img.img-fluid,
.tiptap-content img {
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(18, 55, 42, 0.08);
    margin: 0.5rem 0 1.5rem;
    max-height: 520px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.popup-image img:hover {
    transform: scale(1.01);
    box-shadow: 0 12px 32px rgba(18, 55, 42, 0.12);
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 1.5rem;
}

/* Grid System Helper for Subpages */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.col-md-6, .col-md-4, .col-md-3, .col-md-12 {
    padding-left: 12px;
    padding-right: 12px;
}

.col-md-6 { width: 50%; }
.col-md-4 { width: 33.333333%; }
.col-md-3 { width: 25%; }
.col-md-12 { width: 100%; }

@media (max-width: 768px) {
    .col-md-6, .col-md-4, .col-md-3 {
        width: 100%;
    }
}

.py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Accordion Custom Styles */
.accordion-button {
    width: 100%;
    background-color: var(--primary, #12372a);
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
}

.accordion-button:focus {
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-dark, #0b241b);
    color: white;
}

.accordion-body {
    background-color: #f8f9fa;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Tabs Custom Styles */
.nav-tabs .nav-link {
    background-color: var(--primary, #12372a);
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link.active {
    background-color: var(--accent-gold, #cfa85e);
    color: #12372a;
}

.nav-tabs .nav-link:hover {
    background-color: var(--accent-gold, #cfa85e);
    color: #12372a;
}

.tab-content {
    background-color: #f8f9fa;
    padding: 24px;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tab-pane {
    white-space: normal !important;
    overflow-x: hidden !important;
}

/* -------------------------------------------------------------
 * Magnific Popup Lightbox - Modern & Premium Overlay Styling
 * ------------------------------------------------------------- */
.mfp-bg {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999 !important;
    overflow: hidden;
    position: fixed;
    background: rgba(6, 20, 15, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    opacity: 0.96 !important;
}

.mfp-wrap {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000 !important;
    position: fixed;
    outline: none !important;
    -webkit-backface-visibility: hidden;
}

.mfp-container {
    text-align: center;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    padding: 20px 40px;
    box-sizing: border-box;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mfp-content {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 auto;
    text-align: left;
    z-index: 1000001;
    max-width: 92vw;
}

.mfp-figure {
    line-height: 0;
    margin: 0;
    position: relative;
}

.mfp-figure figure {
    margin: 0;
}

img.mfp-img {
    width: auto;
    max-width: 90vw !important;
    height: auto;
    max-height: 84vh !important;
    display: block;
    line-height: 0;
    box-sizing: border-box;
    padding: 0;
    margin: 0 auto;
    border-radius: 14px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(207, 168, 94, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    object-fit: contain;
}

.mfp-bottom-bar {
    margin-top: 12px;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mfp-title {
    color: #ffffff !important;
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.mfp-counter {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    color: #dfb762 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(223, 183, 98, 0.3);
}

.mfp-close {
    width: 44px !important;
    height: 44px !important;
    line-height: 40px !important;
    position: fixed !important;
    right: 24px !important;
    top: 24px !important;
    text-decoration: none !important;
    text-align: center !important;
    opacity: 0.9 !important;
    padding: 0 !important;
    color: #ffffff !important;
    font-style: normal !important;
    font-size: 28px !important;
    font-family: Arial, sans-serif !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    z-index: 1000005 !important;
}

.mfp-close:hover {
    opacity: 1 !important;
    background: rgba(207, 168, 94, 0.9) !important;
    color: #081a13 !important;
    transform: scale(1.1);
    border-color: #dfb762 !important;
}

.mfp-arrow {
    position: fixed !important;
    opacity: 0.85 !important;
    margin: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    width: 50px !important;
    height: 50px !important;
    -webkit-tap-highlight-color: transparent;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    color: #ffffff !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
    z-index: 1000004 !important;
}

.mfp-arrow:hover {
    opacity: 1 !important;
    background: rgba(207, 168, 94, 0.9) !important;
    color: #081a13 !important;
    border-color: #dfb762 !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.mfp-arrow-left {
    left: 24px !important;
}

.mfp-arrow-right {
    right: 24px !important;
}