/* Merlin 5 Subpage Styles */
.subpage-contact-form-section {
    background-color: #5d675b;
    width: 50%;
    padding: 135px 0px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    order: 2;
}

.subpage-contact-form-container {
    width: 100%;
}

.merlin5-subpage-body {
    font-family: 'Roboto Flex', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F3F1EF;
    color: #31443D;
    margin: 0;
    padding: 0;
}

.merlin5-subpage {
    width: 100%;
    min-height: 100vh;
}

/* Hero Section */
.merlin5-subpage-hero {
    width: 100%;
    height: 50vh;
    height: 50svh;
    position: relative;
    overflow: hidden;
}

.merlin5-subpage-hero-media {
    width: 100%;
    height: 100%;
}

.merlin5-subpage-hero-media img,
.merlin5-subpage-hero-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.merlin5-subpage-edit-hero-btn {
    position: absolute;
    top: 10rem;
    left: 50%;
    transform: translateX(-50%);
    height: 40px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.editor-active .merlin5-subpage-edit-hero-btn {
    display: flex !important;
}

/* Service Content Section */
.merlin5-service-section {
    padding: 60px 20px;
    background: #F3F1EF;
}

.merlin5-service-container {
    margin: 0 auto;
}

.merlin5-service-title {
    font-family: 'PT Serif', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 40px;
    line-height: 43px;
    color: #31443D;
    margin-bottom: 30px;
}

.merlin5-service-description {
    font-family: 'PT Serif', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 23.436px;
    color: #717171;
    margin-top: 24px;
}

/* Gallery Section */
/* Gallery Section (copied from Merlin 3) */
.merlin5-subpage-gallery {
    width: 100%;
    padding: 2rem 0px;
    background-color: #F3F1EF;
}

.merlin5-subpage-gallery-inner {
    max-width: 100%;
    margin: 0 auto;
}

.merlin5-subpage-gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    width: 100%;
}

/* Show header-right on mobile for subpage */
.merlin5-subpage-body .header-right {
    display: flex !important;
}

@media screen and (min-width: 1280px) {
    .merlin5-subpage-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Show header-right on tablet and desktop for subpage */
    .header-right {
        display: flex !important;
    }
}

.merlin5-subpage-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #D1DCCE;
    cursor: pointer;
}

.merlin5-subpage-gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.merlin5-subpage-gallery-item:hover .merlin5-subpage-gallery-media {
    transform: scale(1.05);
}

.merlin5-subpage-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(49, 68, 61, 0.3);
    font-size: 2rem;
    background-color: #D1DCCE;
    border: 2px dashed rgba(49, 68, 61, 0.2);
}

/* Gallery Overlay (Editor Mode) */
.merlin5-subpage-gallery-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: none;
    gap: 0.5rem;
    z-index: 10;
}

.editor-active .merlin5-subpage-gallery-item:hover .merlin5-subpage-gallery-overlay {
    display: flex;
}

@media (max-width: 1280px) {
    .editor-active .merlin5-subpage-gallery-overlay {
        display: flex !important;
    }
}

.merlin5-subpage-gallery-overlay .btn {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.merlin5-subpage-gallery-overlay .btn-secondary {
    background-color: #dc3545;
    border-color: #dc3545;
}

.merlin5-subpage-gallery-overlay .btn-secondary:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.merlin5-subpage-gallery-overlay .btn-secondary i {
    color: #fff;
}


/* Other Services Section */
.merlin5-other-services-section {
    padding: 60px 20px;
    background: #F3F1EF;
}

.merlin5-other-services-container {
    margin: 0 auto;
}

.merlin5-other-services-title {
    font-family: 'PT Serif', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 31.966px;
    line-height: 42.954px;
    color: #31443D;
    margin: 0 0 40px 0;
}

.merlin5-other-services-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.merlin5-service-card {
    background: #D1DCCE;
    border-radius: 16px;
    padding: 0;
    position: relative;
    height: 146px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    display: block;
}

.merlin5-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Service Edit Button (Editor Mode) */
.service-edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.merlin5-service-content {
    padding: 35px 15px;
    height: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.service-btn-wrapper {
    top: 72px;
    left: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    margin-top: 16px;
}

.merlin5-service-title {
    font-family: 'PT Serif', serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 100%;
    color: #31443D;
    margin: 0;
    flex: 1;
}

.service-btn {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.service-chevron {
    width: 12px;
    height: 12px;
    font-size: 12px;
    color: #31443D;
    transition: transform 0.3s ease;
}

/* Mobile Menu Accordion (Merlin 5 Colors) */
.merlin5-menu-accordion {
    width: 100%;
}

.merlin5-menu-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'PT Serif', serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 20.832px;
    color: #544f4c;
    text-decoration: none;
    padding: 8px 0;
    transition: all 0.3s ease;
    position: relative;
}

.merlin5-menu-accordion-toggle span {
    text-align: left;
}

.merlin5-accordion-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: #544f4c;
}

.merlin5-menu-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-left: 0;
}

.merlin5-menu-service-link {
    color: #544f4c;
    font-family: 'PT Serif', serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 110%;
    text-decoration: none;
    opacity: 0.8;
    display: block;
    padding: 8px 0;
    transition: opacity 0.2s ease;
}

.merlin5-menu-service-link:hover {
    opacity: 1;
    color: #544f4c;
}

/* ==================== Desktop Styles ==================== */

@media screen and (min-width: 1280px) {
    /* Desktop menu animation and transitions for subpage */
    .mobile-menu {
        position: fixed !important;
        width: 450px !important;
        right: -450px !important;
        transition: right 0.4s ease !important;
        display: block !important;
    }
    
    .mobile-menu.active {
        right: 0 !important;
    }
    
    .menu-overlay {
        display: block !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .menu-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Desktop menu font sizes for subpage */
    .menu-link {
        font-size: 28px;
    }
    
    .merlin5-menu-accordion-toggle {
        font-size: 28px;
        padding: 24px 0px;
    }
    
    .merlin5-menu-service-link {
        font-size: 22px;
    }
    
    .merlin5-accordion-icon {
        font-size: 28px;
    }
    
    /* Adjust menu container padding for wider menu */
    .menu-container {
        padding: 32px;
    }
    
    /* Remove gap from menu-pages */
    .menu-pages {
        gap: 0;
    }
    
    /* Menu link padding */
    .menu-pages .menu-link {
        padding: 24px 0;
    }
    
    /* Language toggle font sizes */
    .menu-language .menu-link.language-toggle-link,
    .menu-language .language-toggle-link {
        font-size: 28px;
    }
    
    .menu-language .ri-global-line.language-icon {
        font-size: 28px;
    }
}

/* Content Wrapper - Desktop Padding */
@media screen and (min-width: 1280px) {
    .merlin5-subpage-content-wrapper {
        padding-left: 64px;
        padding-right: 64px;
    }
}

@media screen and (min-width: 1280px) {
    .merlin5-subpage-content-wrapper {
        padding-left: 190px;
        padding-right: 190px;
    }
}

/* Contact Form Section - Specific for Merlin 5 Subpage */
@media screen and (min-width: 1280px) {
    .merlin5-subpage-contact-form-section {
        padding-right: 64px;
    }
}

@media screen and (min-width: 1280px) {
    .merlin5-subpage-contact-form-section {
        padding-right: 190px;
    }
}

@media screen and (min-width: 1280px) {
    .merlin5-subpage-gallery {
        padding: 3rem 0px;
    }

    .merlin5-subpage-gallery-grid {
        gap: 0.75rem;
    }
    
    .merlin5-service-section {
        padding: 80px 0px;
    }
    
    .merlin5-other-services-section {
        padding: 80px 0px;
    }
}

@media screen and (min-width: 1280px) {
    .merlin5-subpage-hero {
        height: 60vh;
        height: 60svh;
    }
    
    .merlin5-service-section {
        padding: 100px 0px;
    }
    
    .merlin5-service-title {
        font-size: 48px;
        line-height: 52px;
    }
    
    .merlin5-service-description {
        font-size: 20px;
        line-height: 26px;
    }
    
    .merlin5-other-services-section {
        padding: 100px 0px;
    }
    
    .merlin5-subpage-gallery {
        padding: 4rem 0px;
    }

    .merlin5-subpage-gallery-grid {
        gap: 1rem;
    }
    
    /* Show "Read more" text on desktop */
    .merlin5-service-link span {
        display: inline; /* Show text on desktop */
    }
    
    /* Update services grid alignment for desktop */
    .merlin5-other-services-grid {
        display: flex;
        gap: 16px;
        padding: 0 200px;
        overflow-x: auto;
        flex-wrap: wrap;
        flex-direction: row;
        scroll-behavior: smooth;
        justify-content: center;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .merlin5-other-services-grid::-webkit-scrollbar {
        display: none;
    }
    
    .merlin5-service-card {
        flex: 0 0 268px;
        width: 268px;
        height: 200px !important;
    }
    
    /* Hide service button on desktop */
    .service-btn {
        display: none;
    }
}

@media screen and (min-width: 1280px) {
    .merlin5-service-section {
        padding: 120px 0px;
    }
    
    .merlin5-other-services-section {
        padding: 120px 0px;
    }

    .merlin5-subpage-gallery {
        padding: 5rem 0px;
    }

    .merlin5-subpage-gallery-grid {
        gap: 1.5rem;
    }
}

@media screen and (min-width: 1920px) {
    .merlin5-service-section {
        padding: 140px 0px;
    }
    
    .merlin5-other-services-section {
        padding: 140px 0px;
    }
}

/* Editor Mode Styles */
.editor-active .merlin5-service-title[contenteditable="true"],
.editor-active .merlin5-service-description[contenteditable="true"] {
    outline: 2px dashed rgba(49, 68, 61, 0.3);
    outline-offset: 4px;
    border-radius: 4px;
    min-height: 24px;
}

.editor-active .merlin5-service-title[contenteditable="true"]:focus,
.editor-active .merlin5-service-description[contenteditable="true"]:focus {
    outline: 2px solid #31443D;
}

/* Placeholder styles */
[data-placeholder]:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
    opacity: 0.6;
}

.editor-active [data-placeholder]:empty:before {
    opacity: 1;
}

/* Spinner animation for service cards */
@keyframes merlin5-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


