/* ===================================
   MERLIN 3 SUBPAGE STYLES
   Mobile-First Design
   =================================== */

/* Body */
.merlin3-subpage-body {
    background-color: #121212;
    color: #FFF8D7;
    font-family: Switzer, -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Main Container */
.merlin3-subpage {
    width: 100%;
    background-color: #141516;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   HEADER SECTION
   =================================== */
.merlin3-subpage-header {
    position: fixed;
    top: 0px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
    padding: 1rem 1.25rem;
    transition: z-index 0s;
}

/* When editor banner exists (preview or edit mode), adjust header position */
.editor-banner ~ * .merlin3-subpage-header,
body:has(.editor-banner) .merlin3-subpage-header {
    top: 60px;
}

/* When burger menu is open, increase z-index */
body.merlin3-menu-open .merlin3-subpage-header {
    z-index: 1000000;
}

/* ===================================
   HERO SECTION
   =================================== */
.merlin3-subpage-hero {
    width: 100%;
    height: 50vh;
    height: 50svh;
    position: relative;
    overflow: hidden;
}

.merlin3-subpage-hero-media {
    width: 100%;
    height: 100%;
    position: relative;
}

.merlin3-subpage-hero-video,
.merlin3-subpage-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.merlin3-subpage-hero-placeholder {
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 248, 215, 0.3);
    font-size: 3rem;
}

.merlin3-subpage-edit-hero-btn {
    position: absolute;
    top: 10rem;
    right: 1rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

/* ===================================
   CONTENT SECTION WITH ANIMATED DIVIDERS
   =================================== */
.merlin3-subpage-content {
    width: 100%;
    padding: 75px 1.25rem;
    background-color: #121212;
}

.merlin3-subpage-content-inner {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Animated Dividers - Matching main page bio-divider */
.merlin3-subpage-divider {
    display: block;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.merlin3-subpage-divider.merlin3-subpage-divider-visible {
    transform: scaleX(1);
    opacity: 1;
    margin-top: -10px;
}

/* Services Section Divider */
.services-divider {
    display: block;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    margin-bottom: 2rem;
}

.services-divider.services-divider-visible {
    transform: scaleX(1);
    opacity: 1;
}

/* Services Divider Line (Desktop) */
.services-divider-line {
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.services-divider-line.services-divider-line-visible {
    transform: scaleX(1);
    opacity: 1;
}

/* ===================================
   MOBILE MENU ACCORDION
   =================================== */
.merlin3-menu-accordion {
    width: 100%;
    padding-top: 40px;
}

.merlin3-menu-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: #FFF8D7;
    text-align: left;
    position: relative;
}

.merlin3-accordion-icon {
    font-size: 14px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin-right: 10px;
    opacity: 1;
}

.merlin3-menu-accordion.active .merlin3-accordion-icon {
    transform: rotate(180deg);
}

/* Fade out chevron when menu is closing */
body:not(.merlin3-menu-open) .merlin3-accordion-icon {
    opacity: 0;
}

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

/* Hide subpage header in desktop */
@media screen and (min-width: 1440px) {
    .merlin3-subpage-header {
        display: none;
    }
}

/* Desktop Burger Icon */
.merlin3-desktop-burger-icon {
    display: none; /* Hidden on mobile */
    position: fixed;
    top: 80px;
    right: 60px;
    z-index: 1000000;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
}

@media screen and (min-width: 1440px) {
    .merlin3-desktop-burger-icon {
        display: block;
    }
}

/* Desktop burger animation */
#merlin3-desktop-burgertop,
#merlin3-desktop-burgerbottom {
    transition: all 0.3s ease;
}

/* Desktop Menu Overlay */
.merlin3-desktop-menu-overlay {
    display: none; /* Hidden on mobile */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

@media screen and (min-width: 1440px) {
    .merlin3-desktop-menu-overlay {
        display: block;
    }
}

body.merlin3-desktop-menu-open .merlin3-desktop-menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop Menu */
.merlin3-desktop-menu {
    display: none; /* Hidden on mobile */
    position: fixed;
    top: 0;
    right: -600px; /* Start off-screen */
    width: 600px;
    height: 100%;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    transition: right 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
}

@media screen and (min-width: 1440px) {
    .merlin3-desktop-menu {
        display: block;
    }
}

/* Open state */
body.merlin3-desktop-menu-open .merlin3-desktop-menu {
    right: 0;
}

.merlin3-desktop-menu-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 100px 60px 60px;
    min-height: 100%;
}

.merlin3-desktop-menu-link {
    overflow: hidden;
    color: #FFF8D7;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "Zalando Sans SemiExpanded", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 27px;
    font-style: normal;
    font-weight: 250;
    line-height: 110%;
    text-decoration: none;
    padding: 20px 0;
    transition: opacity 0.3s ease;
    opacity: 0.8;
    display: block;
}

.merlin3-desktop-menu-link:hover {
    opacity: 1;
}

/* Desktop menu divider */
.merlin3-desktop-menu-divider {
    width: 100%;
    height: 1px;
    background: #FFF8D7;
    margin-top: 10px;
    opacity: 0.4;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.merlin3-desktop-menu-open .merlin3-desktop-menu-divider {
    transform: scaleX(1);
}

/* Desktop Accordion Styles */
.merlin3-desktop-menu-accordion {
    padding: 20px 0;
}

.merlin3-desktop-menu-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    overflow: hidden;
    color: #FFF8D7;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "Zalando Sans SemiExpanded", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 27px;
    font-style: normal;
    font-weight: 250;
    line-height: 110%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.merlin3-desktop-menu-accordion-toggle:hover {
    opacity: 1;
}

.merlin3-desktop-accordion-icon {
    font-size: 18px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.merlin3-desktop-menu-accordion.active .merlin3-desktop-accordion-icon {
    transform: rotate(180deg);
}

/* Fade out chevron when menu is closing */
body:not(.merlin3-desktop-menu-open) .merlin3-desktop-accordion-icon {
    opacity: 0;
}

.merlin3-desktop-menu-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.merlin3-desktop-menu-accordion.active .merlin3-desktop-menu-accordion-content {
    max-height: 800px;
    margin-top: 20px;
}

.merlin3-desktop-menu-service-link {
    overflow: hidden;
    color: #FFF8D7;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "Zalando Sans SemiExpanded", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 22px;
    font-style: normal;
    font-weight: 250;
    line-height: 110%;
    opacity: 0.7;
    display: block;
    padding: 10px 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.merlin3-desktop-menu-service-link:hover {
    opacity: 1;
}

/* Desktop Menu Language Toggle */
.merlin3-desktop-menu-language {
    margin-top: 40px;
    padding-top: 30px;
}

/* ==================== End Desktop Menu Styles ==================== */

/* Responsive padding for desktop */
/* Tablet - 768px to 1439px */
@media screen and (min-width: 768px) and (max-width: 1439px) {
    .merlin3-subpage {
        padding-left: 40px;
        padding-right: 40px;
    }
    
    /* Remove padding for contact section */
    .contact-section,
    .contact-desktop,
    .contact-desktop-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Remove padding for services section */
    .services-section {
        padding-left: 0;
        padding-right: 0;
    }
}

@media screen and (min-width: 1440px) {
    .merlin3-subpage {
        padding-left: 200px;
        padding-right: 200px;
    }
    
    /* Remove padding for contact section */
    .contact-section,
    .contact-desktop,
    .contact-desktop-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Remove padding for services section */
    .services-section {
        padding-left: 0;
        padding-right: 0;
    }
}

@media screen and (min-width: 1920px) {
    .merlin3-subpage {
        padding-left: 370px;
        padding-right: 370px;
    }
    
    /* Remove padding for contact section */
    .contact-section,
    .contact-desktop,
    .contact-desktop-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Remove padding for services section */
    .services-section {
        padding-left: 0;
        padding-right: 0;
    }
}

.merlin3-menu-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 20px;
}

.merlin3-menu-accordion.active .merlin3-menu-accordion-content {
    max-height: 500px;
}

.merlin3-menu-service-link {
    overflow: hidden;
    color: #FFF8D7;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "Zalando Sans SemiExpanded", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 250;
    line-height: 110%;
    opacity: 0.8;
    display: block;
    padding: 12px 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

/* Contact Divider (Mobile) - Matching main page */
.contact-divider {
    display: block;
    flex: 1;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.contact-divider.contact-divider-visible {
    transform: scaleX(1);
    opacity: 1;
}

/* Contact Divider Line (Desktop) - Matching main page */
.contact-divider-line {
    flex: 1;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-divider-line-visible {
    width: 100%;
}

/* Footer Divider - Matching main page */
.footer-divider {
    display: block;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.footer-divider.footer-divider-visible {
    transform: scaleX(1);
    opacity: 1;
}

/* Footer Content Divider - Matching main page */
.footer-content-divider {
    display: block;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 248, 215, 0.3);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    margin-top: 40px;
}

.footer-content-divider.footer-content-divider-visible {
    transform: scaleX(1);
    opacity: 1;
}

/* Title */
.merlin3-subpage-title {
    font-family: 'Zalando Sans SemiExpanded', 'Switzer', sans-serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    color: #FFF8D7;
    margin: 0;
    text-align: left;
}

/* Body Text */
.merlin3-subpage-body-text {
    font-family: 'Switzer', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 248, 215, 0.9);
    margin: 0;
}

.merlin3-subpage-body-text p {
    margin-bottom: 1rem;
}

.merlin3-subpage-body-text p:last-child {
    margin-bottom: 0;
}

/* ===================================
   CONTACT ME BUTTON (CTA) - Matching main page
   =================================== */
.merlin3-subpage-cta {
    width: 100%;
    padding: 2rem 1.25rem;
    background-color: #121212;
    display: flex;
    justify-content: center;
    align-items: center;
}

.merlin3-subpage-cta-inner {
    width: 100%;
    max-width: 100%;
}

/* Contact Me Button - Identical to main page */
#contactMeBtnSubpage {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 56px;
    background: transparent;
    border: 1px solid #FFF8D7;
    color: #FFF8D7;
    font-family: 'Switzer', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#contactMeBtnSubpage .contact-btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFF8D7;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

#contactMeBtnSubpage.btn-filling .contact-btn-bg {
    transform: scaleX(1);
}

#contactMeBtnSubpage.btn-filling {
    color: #121212;
}

#contactMeBtnSubpage .contact-btn-text {
    position: relative;
    z-index: 1;
}

/* Tablet contact button */
@media (min-width: 768px) and (max-width: 1439px) {
    #contactMeBtnSubpage {
        height: 56px;
        font-size: 16px;
    }
}

@media (min-width: 1440px) {
    #contactMeBtnSubpage {
        height: 64px;
        font-size: 18px;
    }
}

/* ===================================
   GALLERY SECTION (MAX 4 IMAGES)
   =================================== */
.merlin3-subpage-gallery {
    width: 100%;
    padding: 2rem 20px;
    background-color: #121212;
}

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

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

@media screen and (min-width: 768px) {
    .merlin3-subpage-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.merlin3-subpage-gallery-item {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: #1a1a1a;
    cursor: pointer;
}

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

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

.merlin3-subpage-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 248, 215, 0.3);
    font-size: 2rem;
    background-color: #1a1a1a;
    border: 2px dashed rgba(255, 248, 215, 0.2);
}

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

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

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

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

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

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

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

/* ===================================
   CONTACT & FOOTER SECTIONS
   Use existing styles from main page
   =================================== */
.merlin3-subpage-contact {
    background-color: #121212;
}

.merlin3-subpage-footer {
    background-color: #121212;
}

/* ===================================
   RESPONSIVE - TABLET
   =================================== */
@media (min-width: 768px) {
    .merlin3-subpage-header {
        padding: 1.25rem 2rem;
    }

    .merlin3-subpage-content {
        padding: 3rem 0px;
    }

    .merlin3-subpage-content-inner {
        gap: 2rem;
    }

    .merlin3-subpage-title {
        font-size: 2.5rem;
    }

    .merlin3-subpage-body-text {
        font-size: 1.125rem;
        line-height: 1.7;
    }

    .merlin3-subpage-cta {
        padding: 3rem 2rem;
    }

    .merlin3-subpage-contact-btn {
        font-size: 1.25rem;
        padding: 1.25rem 2.5rem;
    }

    .merlin3-subpage-gallery {
        padding: 3rem 0px;
    }

    .merlin3-subpage-gallery-grid {
        gap: 0.75rem;
    }
}

/* ===================================
   RESPONSIVE - DESKTOP
   =================================== */
@media (min-width: 1440px) {
    .merlin3-subpage-header {
        padding: 1.5rem 3rem;
    }

    .merlin3-subpage-hero {
        margin-top: 70px;
    }

    .merlin3-subpage-content {
        padding: 4rem 0px;
    }

    .merlin3-subpage-content-inner {
        gap: 2.5rem;
    }

    .merlin3-subpage-title {
        font-size: 3rem;
    }

    .merlin3-subpage-body-text {
        font-size: 1.25rem;
        line-height: 1.8;
    }

    .merlin3-subpage-cta {
        padding: 4rem 3rem;
    }

    .merlin3-subpage-contact-btn {
        font-size: 1.375rem;
        padding: 1.5rem 3rem;
    }

    .merlin3-subpage-gallery {
        padding: 4rem 0px;
    }

    .merlin3-subpage-gallery-grid {
        gap: 1rem;
    }
}

/* ===================================
   RESPONSIVE - LARGE DESKTOP
   =================================== */
@media (min-width: 1440px) {
    .merlin3-subpage-content {
        padding: 5rem 0px;
    }

    .merlin3-subpage-content-inner {
        gap: 3rem;
    }

    .merlin3-subpage-title {
        font-size: 3.5rem;
    }

    .merlin3-subpage-body-text {
        font-size: 1.375rem;
        line-height: 1.9;
    }

    .merlin3-subpage-cta {
        padding: 5rem 4rem;
    }

    .merlin3-subpage-contact-btn {
        font-size: 1.5rem;
        padding: 1.75rem 3.5rem;
    }

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

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

/* ===================================
   CONTACT ME BUTTON SECTION
   =================================== */
.contact-me-section {
    background-color: #121212;
}

.contact-me-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 120px;
}

/* Contact Me Button Styles */
.contact-me-button {
    position: relative;
    width: 155px;
    height: 155px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #fff8d7;
    color: #fff8d7;
    cursor: pointer;
    overflow: hidden;
    transition: none;
    /* GSAP will handle animation */
    z-index: 10;
    pointer-events: auto;
    /* Allow clicks */
    --button-fill: 0%;
}

.contact-me-button::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--button-fill, 0%);
    background-color: #fff8d7;
    transition: none;
    /* GSAP will handle animation */
    z-index: 0;
}

.contact-me-text {
    position: relative;
    font-family: 'Zalando Sans SemiExpanded', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 300;
    font-size: 22px;
    line-height: 26.62px;
    letter-spacing: 0;
    text-align: center;
    display: block;
    z-index: 2;
    transition: none;
    /* GSAP will handle animation */
}

.contact-me-button:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .contact-me-wrapper {
        padding-bottom: 80px;
    }
    
    .contact-me-button {
        width: 120px;
        height: 120px;
    }
    
    .contact-me-text {
        font-size: 18px;
        line-height: 22px;
    }
}


/* Hide editor elements by default */
.show-on-editor {
    display: none !important;
}

body.editor-active .show-on-editor {
    display: flex !important;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.slide-in-left {
    animation: slideInFromLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

