/* 
 * Merlin 8 - Dark Theme Design
 * Based on Merlin 6 with black background and white text
 * Font: Demos Next Pro
 */

/* ========================
   GLOBAL STYLES & RESET
   ======================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* M8 Dark Theme Colors */
    --m8-color-bg: #000000;
    --m8-color-text: #FFFFFF;
    --m8-color-text-secondary: #CCCCCC;
    --m8-color-border: rgba(255, 255, 255, 0.6);
    --m8-color-overlay: rgba(0, 0, 0, 0.5);
    --m8-color-card-bg: #1a1a1a;
    
    /* Spacing */
    --m8-container-padding: 20px;
    --m8-section-spacing: 100px;
    
    /* Typography */
    --m8-font-primary: 'demos-next', Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--m8-font-primary);
    background-color: var(--m8-color-bg);
    color: var(--m8-color-text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a:hover {
    color: inherit !important;
}

.m8-page-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--m8-color-bg);
}

.m8-section-container {
    width: 100%;
    padding-left: var(--m8-container-padding);
    padding-right: var(--m8-container-padding);
    margin: 0 auto;
}

/* Section Headers with Brackets */
.m8-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.m8-section-bracket {
    font-size: 23px;
    font-weight: 400;
    color: var(--m8-color-text);
}

.m8-section-label {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: var(--m8-color-text);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* Followers Visibility Button - Editor Only */
.followers-visibility-btn {
    position: relative;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--m8-color-text);
    font-size: 12px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.followers-visibility-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Hidden state styling in editor mode */
.m8-section-header.followers-hidden {
    opacity: 0.4;
    position: relative;
}

.m8-section-header.followers-hidden::after {
    content: 'Hidden on published site';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #ffc107;
    white-space: nowrap;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.m8-section-header.followers-hidden .followers-visibility-btn {
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.5);
}

/* ========================
   MERLIN 8 - HERO LOCATION
   ======================== */

.m8-hero-location {
    position: absolute;
    mix-blend-mode: difference;
    bottom: 14%;
    left: 0;
    right: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 0px 20px;
}

/* Hide location when empty, show when has value */
.m8-hero-location:not(:has(.m8-hero-location-label[data-has-value="true"])):not(.editor-visible) {
    display: none;
}

/* In editor mode, always show location for editing */
body.editor-active .m8-hero-location {
    display: flex;
}

.m8-hero-location-bracket {
    font-size: 18px;
    font-weight: 500;
    color: #FDF7F1;
    mix-blend-mode: difference;
}

.m8-hero-location-label {
    color: #FDF7F1;
    text-align: center;
    font-family: Switzer, sans-serif;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    mix-blend-mode: difference;
}

/* ========================
   MERLIN 8 - HERO NAVIGATION
   ======================== */

.m8-hero-navigation {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 0px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Username in hero navigation */
.m8-hero-nav-left {
    display: flex;
    align-items: center;
}

.m8-hero-username {
    font-family: 'neue-haas-grotesk-display', Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #FFF8F1;
    letter-spacing: 0.02em;
    text-transform: none;
    transition: color 0.3s ease;
}

/* Remove mix-blend-mode when mobile menu is open */
.m8-hero-navigation.menu-open {
    mix-blend-mode: normal !important;
}

.m8-hero-navigation.top-20 {
    top: 20px;
}

/* In edit mode, change to absolute positioning */
body:not(.m8-subpage).editor-active .m8-hero-navigation {
    position: absolute;
    top: 60px;
}

.m8-nav-username {
    cursor: pointer;
    transition: opacity 0.4s ease;
    position: relative;
    opacity: 1;
    margin-right: auto;
}

.m8-nav-username:hover { 
    opacity: 0.8;
}

.m8-nav-username-text {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.2px;
    color: var(--m8-color-text);
}

/* Hide username/hero-name when menu is open */
body.m8-menu-open .m8-nav-username,
body.m8-menu-open .m8-hero-name-static {
    opacity: 0;
    pointer-events: none;
}

.m8-menu-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: filter 0.4s ease;
}

.m8-menu-btn svg {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.m8-menu-btn svg:first-child {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    pointer-events: auto;
}

.m8-menu-btn svg.m8-menu-btn-close {
    opacity: 0;
    transform: rotate(90deg) scale(0);
    pointer-events: none;
}

.m8-menu-btn:hover svg:first-child {
    transform: rotate(0deg) scale(1.05);
}

body.m8-menu-open .m8-menu-btn {
    filter: none;
}

body.m8-menu-open .m8-menu-btn svg:first-child {
    opacity: 0;
    transform: rotate(90deg) scale(0);
    pointer-events: none;
}

body.m8-menu-open .m8-menu-btn svg.m8-menu-btn-close {
    opacity: 1;
    transform: rotate(90deg) scale(1);
    pointer-events: auto;
}

body.m8-menu-open .m8-menu-btn svg.m8-menu-btn-close path {
    fill: var(--m8-color-text);
}

body.m8-menu-open .m8-menu-btn:hover svg.m8-menu-btn-close {
    transform: rotate(180deg) scale(1.05);
}

/* ========================
   MERLIN 8 - MOBILE MENU OVERLAY
   ======================== */

.m8-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

.m8-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========================
   MERLIN 8 - MOBILE MENU DRAWER
   ======================== */

.m8-mobile-menu {
    position: fixed;
    top: 60px;
    right: -440px;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: var(--m8-color-bg);
    z-index: 999;
    padding-top: 32px;
    overflow-y: auto;
    transition: right 0.4s ease;
    padding: 20px var(--m8-container-padding);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.m8-mobile-menu.active {
    right: 0;
}

.m8-menu-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 60px;
}

.m8-menu-section-link {
    display: block;
    text-decoration: none;
    color: var(--m8-color-text);
    transition: opacity 0.3s ease;
    position: relative;
    padding: 12px 0;
}

.m8-menu-section-link:hover {
    opacity: 0.6;
}

.m8-menu-section-text {
    font-family: var(--m8-font-primary);
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: 0.18px;
    text-transform: uppercase;
}

/* Services Accordion */
.m8-menu-section-accordion {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
    margin-left: -22px;
}

.m8-menu-accordion-toggle {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.m8-menu-accordion-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    order: -1;
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.m8-menu-accordion-icon::before,
.m8-menu-accordion-icon::after {
    content: '';
    position: absolute;
    background-color: var(--m8-color-text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.m8-menu-accordion-icon::before {
    width: 12px;
    height: 2px;
}

.m8-menu-accordion-icon::after {
    width: 2px;
    height: 12px;
    opacity: 0;
}

.m8-menu-accordion-icon.fa-minus::after {
    opacity: 0;
}

.m8-menu-accordion-icon.fa-plus::after {
    opacity: 1;
}

.m8-menu-accordion-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-left: 23.5px;
    margin-top: 0;
    padding-top: 24px;
}

.m8-menu-accordion-content.collapsed {
    height: 0;
    padding-top: 0;
}

.m8-menu-service-link {
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.16px;
    color: var(--m8-color-text-secondary);
    text-decoration: none;
    margin-bottom: 24px;
}

.m8-menu-service-link:last-child {
    margin-bottom: 0;
}

.m8-menu-service-link:hover {
    opacity: 0.6;
    color: var(--m8-color-text);
}

/* Language Toggle */
.m8-menu-language {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 40px;
    margin-top: auto;
}

.m8-language-toggle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.m8-language-toggle-item.disabled {
    opacity: 0.5;
}

body:not(.edit-mode-active) .m8-language-toggle-item.disabled {
    display: none !important;
}

.m8-language-toggle-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--m8-color-text);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.18px;
    transition: opacity 0.3s ease;
}

.m8-language-toggle-link:hover {
    opacity: 0.6;
}

.m8-language-icon {
    font-size: 22px;
    color: var(--m8-color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.m8-language-text {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.18px;
    color: var(--m8-color-text);
    text-transform: uppercase;
}

/* Prevent body scroll when menu is open */
body.m8-menu-open {
    overflow: hidden;
}

/* ========================
   HERO SECTION
   ======================== */

.m8-hero-section {
    position: relative;
    width: 100%;
    height: 100dvh;
    min-height: 700px;
    overflow: hidden;
    background-color: var(--m8-color-bg);
}

.m8-hero-media-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.m8-hero-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m8-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
}

/* Edit Cover Button - Main Page Hero */
.m2-edit-cover-btn {
    position: absolute;
    top: 170px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: #3b82f6;
    color: white;
    border: none;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.m2-edit-cover-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateX(-50%) scale(1.1);
}

.m8-hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-end;
    pointer-events: none;
    mix-blend-mode: difference;
}

/* Remove mix-blend-mode in edit mode */
body.editor-active .m8-hero-content {
    mix-blend-mode: normal;
}

.m8-hero-content * {
    pointer-events: auto;
}

/* Hero content is above media layer */

.m8-hero-instagram-handle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: var(--m8-container-padding);
    margin-bottom: 40px;
}

.m8-hero-instagram-icon {
    font-size: 18px;
    color: var(--m8-color-text);
}

.m8-hero-instagram-text {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--m8-color-text);
}

.m8-hero-name-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--m8-container-padding);
}

.m8-hero-name-box {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 30px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.m8-hero-name {
    font-size: 71px;
    font-weight: 400;
    letter-spacing: 1.42px;
    line-height: 1.32;
    text-align: center;
    color: var(--m8-color-text);
    text-transform: uppercase;
}

/* Hero Name Static */
.m8-hero-name-static {
    width: 100%;
    padding: 30px 20px;
    padding-bottom: 0;
    margin-bottom: 40%;
    background: transparent;
}

.m8-hero-name-text {
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -1px;
    line-height: 1.2;
    color: var(--m8-color-text);
    text-transform: uppercase;
    margin: 0;
}

/* Only apply nowrap when fixed */
.m8-hero-name-static.is-fixed {
    width: max-content;
}

.m8-hero-name-static.is-fixed .m8-hero-name-text {
    text-align: left;
    font-size: 20px;
}

/* ========================
   DESCRIPTION SECTION
   ======================== */

.m8-description-section {
    padding: var(--m8-section-spacing) 0;
    background-color: var(--m8-color-bg);
}

.m8-description-text {
    font-size: 33px;
    font-weight: 400;
    line-height: 1.32;
    color: var(--m8-color-text);
    max-width: 100%;
    text-align: center;
}

/* ========================
   CTA BUTTON SECTION
   ======================== */

.m8-cta-section {
    padding: var(--m8-section-spacing) 0;
    background-color: var(--m8-color-bg);
}

.m8-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 22px 40px;
    background: var(--m8-color-bg);
    border: 1px solid var(--m8-color-text);
    border-radius: 68px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.m8-cta-button:hover {
    background: var(--m8-color-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.m8-cta-text {
    font-size: 33px;
    font-weight: 500;
    letter-spacing: 0.33px;
    color: var(--m8-color-text);
    margin-right: 15px;
}

.m8-cta-button:hover .m8-cta-text {
    color: var(--m8-color-bg);
}

.m8-cta-icon {
    font-size: 24px;
    color: var(--m8-color-text);
}

.m8-cta-button:hover .m8-cta-icon {
    color: var(--m8-color-bg);
}

/* ========================
   NEW ANIMATED SVG CTA BUTTON
   ======================== */

.m8-svg-cta-section {
    padding: var(--m8-section-spacing) 0;
    background-color: var(--m8-color-bg);
}

.m8-svg-cta-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.m8-svg-cta-icon {
    width: 58px;
    height: 58px;
    cursor: pointer;
    transition: transform 0.3s ease;
    overflow: visible;
}

.m8-svg-cta-icon:hover {
    transform: scale(1.05);
}

.m8-svg-cta-text {
    font-family: var(--m8-font-primary);
    font-size: 33px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    letter-spacing: -3px;
    fill: var(--m8-color-text);
}

.m8-svg-letter {
    opacity: 0;
}

@media (max-width: 1280px) {
    .m8-svg-cta-icon {
        width: 48px;
        height: 48px;
    }
}

/* ========================
   PROJECTS SECTION
   ======================== */

.m8-projects-section {
    padding: var(--m8-section-spacing) 0;
    background-color: var(--m8-color-bg);
}

.m8-projects-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    margin-top: 30px;
}

.m8-projects-carousel {
    display: flex;
    gap: 16px;
    margin-left: -60px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 var(--m8-container-padding);
    cursor: grab;
    transition: margin-left 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
}

.m8-projects-carousel.scrolled {
    margin-left: 8px;
    margin-right: 8px;
}

.m8-projects-carousel::-webkit-scrollbar {
    display: none;
}

.m8-projects-carousel:active {
    cursor: grabbing;
}

.m8-project-card {
    position: relative;
    flex: 0 0 auto;
    width: 100vw;
    height: 100%;
    scroll-snap-align: start;
    border-radius: 4px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--m8-color-card-bg);
}

.m8-project-media {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.m8-project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--m8-color-card-bg);
    color: var(--m8-color-text-secondary);
}

.m8-project-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ========================
   ABOUT SECTION
   ======================== */

.m8-about-section {
    padding: 40px 0;
    background-color: var(--m8-color-bg);
}

.m8-about-content {
    margin-top: 30px;
}

.m8-about-text {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.32;
    letter-spacing: 0.28px;
    color: var(--m8-color-text);
    margin-bottom: 40px;
}

.m8-about-profile-image {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.m8-about-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================
   SERVICES SECTION
   ======================== */

.m8-services-section {
    padding-top: 80px;
    background-color: var(--m8-color-bg);
}

.m8-services-list {
    margin-top: 30px;
}

.m8-service-featured {
    position: relative;
    width: 100%;
    height: 247px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.m8-service-featured-image {
    width: 100%;
    height: 100%;
}

.m8-service-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.m8-service-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--m8-color-card-bg);
    color: var(--m8-color-text);
}

.m8-service-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

.m8-service-featured-info {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
}

.m8-service-featured-icon {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m8-color-text);
    font-size: 16px;
}

.m8-service-featured-title {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.28px;
    color: var(--m8-color-text);
}

.m8-service-item {
    margin-bottom: 20px;
}

.m8-service-item-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
}

.m8-service-item-title {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0.32px;
    color: var(--m8-color-text);
}

.m8-service-item-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m8-color-text);
    font-size: 20px;
}

.m8-service-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
}

/* Services Grid */
.m8-services-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 60px;
}

/* Featured Service Card (with image) */
.m8-service-card {
    position: relative;
    height: auto;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--m8-color-card-bg);
}

.m8-service-card-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.m8-service-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.m8-service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m8-service-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.m8-service-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
}

.m8-service-icon {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.m8-service-icon i {
    font-size: 16px;
    color: var(--m8-color-text);
}

.m8-service-title {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.28px;
    line-height: 28px;
    color: var(--m8-color-text);
    margin: 0;
    text-transform: uppercase;
}

@media (max-width: 767px) {
    .m8-service-card.clicked {
        transform: scale(0.98);
        transition: transform 0.2s ease;
    }
}

@media (min-width: 1280px) {
    .m8-service-card-link:hover .m8-service-image {
        transform: scale(1.05);
        transition: transform 0.4s ease;
    }
}

/* ========================
   TESTIMONIALS SECTION
   ======================== */

.m8-testimonials-section {
    padding: 40px 0;
    padding-bottom: 120px;
    background: var(--m8-color-bg);
}

.m8-testimonials-section .m8-section-header {
    margin-bottom: 36px;
    justify-content: center;
}

.m8-testimonials-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.m8-testimonials-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    width: 100%;
}

.m8-testimonials-carousel::-webkit-scrollbar {
    display: none;
}

.m8-testimonials-carousel:active {
    cursor: grabbing;
}

.m8-testimonial-card {
    flex: 0 0 auto;
    width: 100vw;
    min-height: 192px;
    padding: 24px 50px;
    background: var(--m8-color-bg);
    border-radius: 4px;
    scroll-snap-align: start;
}

@media (min-width: 1280px) {
    .m8-testimonial-card {
        width: 350px;
    }
}

.m8-testimonial-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.m8-testimonial-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.m8-testimonial-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--m8-color-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m8-color-text-secondary);
}

.m8-testimonial-author-name {
    font-size: 16px;
    font-weight: 400;
    color: var(--m8-color-text-secondary);
    text-align: center;
}

.m8-testimonial-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    color: var(--m8-color-text);
}

/* Testimonials Dots */
.m8-testimonials-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
    padding: 0 var(--m8-container-padding);
}

.m8-testimonials-dots .dot {
    width: 7px;
    height: 7px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.m8-testimonials-dots .dot.active {
    background-color: var(--m8-color-text);
}

/* ========================
   GALLERY SECTION
   ======================== */

.m8-gallery-section {
    padding: var(--m8-section-spacing) 0 0;
    background-color: var(--m8-color-bg);
}

.m8-gallery-section .m8-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 8px;
    width: 100%;
    padding: 0;
}

.m8-gallery-section .m8-gallery-item {
    position: relative;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 2 !important;
    overflow: hidden;
    background: var(--m8-color-card-bg);
    grid-row: auto !important;
    grid-column: auto !important;
}

.m8-gallery-section .m8-gallery-item:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
    aspect-ratio: 1 / 1 !important;
}

.m8-gallery-section .m8-gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m8-gallery-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--m8-color-card-bg);
    color: var(--m8-color-text-secondary);
}

.m8-gallery-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ========================
   CONTACT SECTION
   ======================== */

.m8-contact-section {
    position: relative;
    padding: var(--m8-section-spacing) 0;
    margin-top: var(--m8-section-spacing);
    background-color: var(--m8-color-bg);
}

.m8-contact-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.m8-contact-background-video,
.m8-contact-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.m8-contact-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.m8-contact-section .m8-section-container {
    position: relative;
    z-index: 1;
}

.m8-contact-section .m8-section-header {
    margin-bottom: 40px;
}

.m8-contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.m8-form-group {
    width: 100%;
}

.m8-form-input {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px;
    font-family: var(--m8-font-primary);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.36px;
    color: var(--m8-color-text);
    outline: none;
    transition: all 0.3s ease;
}

.m8-form-input::placeholder {
    color: var(--m8-color-text-secondary);
}

.m8-form-input:focus {
    border-color: var(--m8-color-text) !important;
}

.m8-form-textarea {
    resize: vertical;
    min-height: 127px;
}

.m8-form-submit {
    width: 100%;
    padding: 16px;
    background: var(--m8-color-text);
    border: 1px solid var(--m8-color-text);
    border-radius: 12px;
    font-family: var(--m8-font-primary);
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.48px;
    color: var(--m8-color-bg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.m8-form-submit:hover {
    background: transparent;
    color: var(--m8-color-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.m8-contact-tools {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.m8-contact-tool {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--m8-color-text);
    padding: 8px !important;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--m8-color-text);
}

.m8-contact-tool svg {
    width: 50px;
    height: 50px;
    fill: var(--m8-color-text);
}

.m8-contact-tool:hover {
    transform: scale(1.1);
    background: var(--m8-color-text);
    color: var(--m8-color-bg);
}

.m8-contact-tool:hover svg {
    fill: var(--m8-color-bg);
}

/* ========================
   FOOTER SECTION
   ======================== */

.m8-footer-section {
    padding: 60px 0 40px;
    background: var(--m8-color-bg);
}

.m8-footer-name {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.22px;
    color: var(--m8-color-text);
    margin-bottom: 30px;
}

.m8-footer-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.m8-footer-text {
    font-size: 18px;
    font-weight: 400;
    color: var(--m8-color-text);
}

.m8-footer-social {
    display: flex;
    gap: 20px;
}

.m8-footer-social-link {
    width: 40px;
    height: 40px;
    display: flex;
    color: var(--m8-color-text);
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.m8-footer-social-link:hover {
    color: var(--m8-color-text-secondary);
    transform: scale(1.2);
}

/* ========================
   EDITOR STYLES
   ======================== */

.show-on-editor {
    display: none;
}

.editable-text-field:empty:not([data-has-value="true"]):before {
    content: attr(data-placeholder);
    color: rgba(255, 255, 255, 0.3);
}

.m8-editable-container,
.editable-container {
    position: relative;
}

/* ========================
   RESPONSIVE DESIGN
   ======================== */

@media (min-width: 1280px) {
    :root {
        --m8-container-padding: 60px;
        --m8-section-spacing: 80px;
    }
    
    /* Hero name static - reduced margin on desktop */
    .m8-hero-name-static {
        margin-bottom: 20%;
    }
    
    .m8-hero-media-container {
        padding-left: 64px;
        padding-right: 64px;
        height: auto;
    }
    
    .m8-hero-content {
        padding-left: 0px;
        padding-right: 0px;
    }
    
    .m8-hero-name {
        font-size: 110px;
    }
    
    /* m8-hero-name-text uses clamp() - no override needed */
    
    .m8-description-section {
        width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .m8-description-text {
        font-size: 36px;
        text-align: center;
    }
    
    .m8-cta-button {
        max-width: 400px;
    }
    
    .m8-about-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .m8-about-title {
        text-align: center;
    }
    
    .m8-about-profile-container {
        display: flex;
        justify-content: center;
        margin-bottom: 40px;
    }
    
    .m8-about-text {
        width: 100%;
        margin-bottom: 0;
    }
    
    .m8-about-profile-image {
        width: 200px;
        height: 200px;
        margin-top: 32px;
    }
    
    .m8-projects-section {
        padding-left: 64px;
        padding-right: 64px;
    }
    
    .m8-project-card {
        width: 560px;
        height: 840px;
    }
    
    .m8-section-header {
        justify-content: center;
    }
    
    .m8-section-label {
        font-size: 22px;
    }
    
    .m8-about-section,
    .m8-services-section,
    .m8-testimonials-section,
    .m8-contact-section,
    .m8-footer-section {
        padding-left: 64px;
        padding-right: 64px;
    }

    .m8-about-text { 
        font-size: 30px;
    }
    
    .m8-service-featured {
        height: 320px;
    }
    
    .m8-testimonials-carousel {
        justify-content: center;
    }
    
    .m8-testimonial-card {
        width: 350px;
        flex-shrink: 0;
    }
    
    .m8-gallery-section {
        padding-left: 64px;
        padding-right: 64px;
    }
    
    .m8-gallery-grid {
        gap: 40px;
    }
    
    .m8-contact-section .m8-section-container {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .m8-contact-form {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .m8-footer-section .m8-footer-content {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }
    
    .m8-footer-social {
        display: flex;
        justify-content: center;
    }

    /* Description Section - Desktop */
    .m8-description-section {
        padding-top: 50px;
    }

    /* Section Container - Desktop */
    .m8-section-container {
        padding-left: 0;
        padding-right: 0;
        text-align: center;
    }

    /* Services Section - Desktop */
    .m8-services-section {
        padding-top: 120px;
    }

    /* Service Card - Desktop */
    .m8-service-card {
        aspect-ratio: 4 / 1;
    }

    /* Services Grid - Desktop */
    .m8-services-grid {
        padding-bottom: 100px;
    }

    /* Testimonials Section Header - Desktop */
    .m8-testimonials-section .m8-section-header {
        margin-bottom: 60px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    :root {
        --m8-container-padding: 80px;
    }
    
    .m8-hero-media-container {
        padding-left: 200px;
        padding-right: 200px;
        height: auto;
    }
    
    .m8-hero-content {
        padding-left: 0px;
        padding-right: 0px;
    }
    
    .m8-hero-name {
        font-size: 130px;
    }
    
    /* m8-hero-name-text uses clamp() - no override needed */
    
    .m8-description-text {
        font-size: 36px;
    }
    
    .m8-projects-section {
        padding-left: 200px;
        padding-right: 200px;
    }
    
    .m8-about-section,
    .m8-services-section,
    .m8-testimonials-section,
    .m8-contact-section,
    .m8-footer-section {
        padding-left: 200px;
        padding-right: 200px;
    }
    
    .m8-gallery-section {
        padding-left: 200px;
        padding-right: 200px;
    }
}

/* Extra Large Desktop */
@media (min-width: 1920px) {
    .m8-hero-media-container {
        padding-left: 365px;
        padding-right: 365px;
        height: auto;
    }
    
    .m8-hero-content {
        padding-left: 0px;
        padding-right: 0px;
    }
    
    .m8-projects-section {
        padding-left: 365px;
        padding-right: 365px;
    }
    
    .m8-about-section,
    .m8-services-section,
    .m8-testimonials-section,
    .m8-contact-section,
    .m8-footer-section {
        padding-left: 365px;
        padding-right: 365px;
    }
    
    .m8-gallery-section {
        padding-left: 365px;
        padding-right: 365px;
    }
}

/* Tablet - Edit Cover Button */
@media (min-width: 1280px) {
    .m2-edit-cover-btn {
        top: 100px;
        right: 40px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* Desktop - Edit Cover Button */
@media (min-width: 1280px) {
    .m2-edit-cover-btn {
        top: 120px;
        right: 80px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}

/* Large Desktop - Edit Cover Button */
@media (min-width: 1280px) {
    .m2-edit-cover-btn {
        right: 160px;
    }
}

/* Extra Large Desktop - Edit Cover Button */
@media (min-width: 1920px) {
    .m2-edit-cover-btn {
        right: 365px;
    }
}

/* Print Styles */
@media print {
    .m2-edit-cover-btn,
    .show-on-editor {
        display: none !important;
    }
}

/* ========================
   MERLIN 8 - SUBPAGE STYLES
   ======================== */

.m8-subpage-body {
    font-family: var(--m8-font-primary);
    background-color: var(--m8-color-bg);
    color: var(--m8-color-text);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subpage Hero Section */
.m8-subpage-hero {
    position: relative;
    width: 100%;
    height: 41vh;
    margin-top: 130px;
    overflow: hidden;
    background-color: var(--m8-color-bg);
}

.m8-subpage-nav {
    position: fixed !important;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 16px var(--m8-container-padding);
    background: var(--m8-color-bg);
}

/* Published site (online=true) - nav at top */
.m8-subpage-nav.top-0 {
    top: 0;
}

.m8-subpage-cover-media {
    position: relative;
    width: 100%;
    height: 41vh;
    overflow: hidden;
}

.m8-subpage-cover-image,
.m8-subpage-cover-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.editor-active .m8-subpage-cover-image,
body.editor-active .m8-subpage-cover-video {
    cursor: pointer;
}


.m8-edit-subpage-cover-btn {
    position: absolute;
    top: 170px;
    right: var(--m8-container-padding);
    z-index: 100;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.m8-edit-subpage-cover-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

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

.m8-subpage-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--m8-color-card-bg);
    color: var(--m8-color-text-secondary);
}

.m8-subpage-cover-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.m8-subpage-cover-placeholder p {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.7;
}

/* Tablet Styles */
@media (min-width: 1280px) {
    .m8-subpage-nav {
        padding: 30px 40px;
    }
    
    .m8-edit-subpage-cover-btn {
        top: 100px;
        right: 40px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* Desktop Styles */
@media (min-width: 1280px) {
    .m8-subpage-hero {
        height: 50vh;
    }

    .m8-subpage-cover-media {
        height: 50vh;
    }
    
    .m8-subpage-nav {
        padding: 40px;
    }
    
    .m8-edit-subpage-cover-btn {
        top: 120px;
        right: 80px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}

/* Large Desktop */
@media (min-width: 1280px) {
    .m8-subpage-nav {
        padding: 40px;
    }
    .m8-edit-subpage-cover-btn {
        right: 160px;
    }
}

/* Extra Large Desktop */
@media (min-width: 1920px) {
    .m8-subpage-nav {
        padding: 40px;
    }
    
    .m8-edit-subpage-cover-btn {
        right: 365px;
    }
}

/* ========================
   SUBPAGE - SUMMARY SECTION
   ======================== */

.m8-subpage-summary-section {
    padding: 40px 0;
    background-color: var(--m8-color-bg);
}

.m8-subpage-title-header {
    margin-bottom: 40px;
}

.m8-subpage-title-header .m8-section-label {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.18px;
    text-transform: uppercase;
    color: var(--m8-color-text);
}

.m8-subpage-summary-content {
    margin-top: 30px;
}

.m8-subpage-summary-text {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.32;
    letter-spacing: 0.28px;
    color: var(--m8-color-text);
    text-align: left;
    word-break: break-word;
}

@media (min-width: 1280px) {
    .m8-subpage-title-header {
        justify-content: center;
    }
    
    .m8-subpage-summary-text {
        font-size: 26px;
    }
}

@media (min-width: 1280px) {
    .m8-subpage-summary-section {
        padding-left: 80px;
        padding-right: 80px;
    }
    
    .m8-subpage-title-header {
        justify-content: center;
    }
    
    .m8-subpage-summary-text {
        font-size: 30px;
        max-width: 900px;
        margin: 0 auto;
    }
}

@media (min-width: 1280px) {
    .m8-subpage-summary-section {
        padding-left: 200px;
        padding-right: 200px;
    }
}

@media (min-width: 1920px) {
    .m8-subpage-summary-section {
        padding-left: 365px;
        padding-right: 365px;
    }
}

/* ========================
   SUBPAGE - GALLERY SECTION
   ======================== */

.m8-subpage-gallery {
    width: 100%;
    padding: 2rem 20px;
    background-color: var(--m8-color-bg);
}

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

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

.m8-subpage-gallery-item {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background-color: var(--m8-color-card-bg);
    cursor: pointer;
}

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

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

.m8-subpage-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 2rem;
    background-color: var(--m8-color-card-bg);
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.m8-subpage-gallery-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: none;
    gap: 0.5rem;
    z-index: 10;
}

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

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

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

.m8-subpage-gallery-overlay .btn-primary {
    background: #007bff;
    color: white;
}

.m8-subpage-gallery-overlay .btn-primary:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.m8-subpage-gallery-overlay .btn-secondary {
    background: #dc3545;
    color: white;
}

.m8-subpage-gallery-overlay .btn-secondary:hover {
    background: #c82333;
    transform: scale(1.1);
}

@media (min-width: 1280px) {
    .m8-subpage-gallery {
        padding: 3rem 0px;
    }
    
    .m8-subpage-gallery-grid {
        gap: 0.75rem;
    }
}

@media (min-width: 1280px) {
    .m8-subpage-gallery {
        padding: 4rem 0px;
    }
    
    .m8-subpage-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1280px) {
    .m8-subpage-gallery {
        padding: 5rem 0px;
    }
    
    .m8-subpage-gallery-grid {
        gap: 1.5rem;
    }
}

/* Service Action Buttons */
.m8-service-action-buttons {
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
}

.m8-cta-button:hover .m8-service-action-buttons {
    opacity: 1 !important;
}

.m8-service-action-btn {
    transition: all 0.2s ease, transform 0.1s ease !important;
}

.m8-service-action-btn:hover {
    background-color: #0056b3 !important;
    transform: scale(1.05);
}

.m8-service-action-btn:active {
    transform: scale(0.92) !important;
}

/* Service Icon Click Animation */
.m8-service-icon {
    transition: transform 0.2s ease-out;
}

.m8-service-icon.m8-service-icon-clicked {
    transform: translateX(8px);
}

/* ===== Visibility Toggle Styles ===== */
.field-content-wrapper {
    display: block;
}

.field-hidden {
    display: none !important;
}

body.editor-active .field-content-wrapper.field-hidden {
    display: block !important;
    opacity: 0.4;
}

.m8-contact-visibility-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.m8-contact-visibility-btn:hover {
    opacity: 0.8;
}

.show-on-editor {
    display: none !important;
}

body.editor-active .show-on-editor {
    gap: 6px;
    align-items: center;
}

.m8-footer-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

