/* Hero Slider Block Styles */
.hero-slider-wrapper {
    position: relative;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    max-width: none !important;
    border: none !important;
    overflow: hidden;
}

/* Additional breakout styles */
.wp-block-cakeclub-hero-slider {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    max-width: none !important;
    border: none !important;
}

.wp-block-cakeclub-hero-slider.alignfull {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.hero-slider-container {
    position: relative;
    height: var(--slide-height, 500px);
    overflow: hidden;
}

.hero-slider-track {
    position: relative;
    height: 100%;
    width: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide-content {
    width: 100%;
    max-width: var(--wp--style--global--content-size, 1200px);
    margin: 0 auto;
    padding: 0 20px;
    z-index: 2;
    position: relative;
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 100%;
}

.hero-slide-text {
    flex: 0 0 var(--text-width, 50%);
    max-width: var(--text-width, 50%);
}

.hero-slide-text.text-left {
    text-align: left;
}

.hero-slide-text.text-center {
    text-align: center;
}

.hero-slide-text.text-right {
    text-align: right;
}

/* Text content container with max width control */
.hero-slide-text-container {
    width: 100%;
}

/* Horizontal alignment for text container */
.hero-slide-text-container.align-left {
    margin-left: 0;
    margin-right: auto;
}

.hero-slide-text-container.align-center {
    margin-left: auto;
    margin-right: auto;
}

.hero-slide-text-container.align-right {
    margin-left: auto;
    margin-right: 0;
}

.hero-slide-image {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100%;
    height: 100%;
}

.hero-slide-image img {
    /* width: 100%; */
    height: var(--slide-height, 500px);
    object-fit: fill;
    object-position: center;
}

/* Mobile image responsive display */
.hero-slide-image .desktop-image {
    display: block;
}

.hero-slide-image .mobile-image {
    display: none;
}

@media (max-width: 767px) {
    .hero-slide-image .desktop-image {
        display: none;
    }
    
    .hero-slide-image .mobile-image {
        display: block;
    }
}

.hero-slide-badge {
    position: absolute;
    z-index: 10;
    max-width: 120px;
    width: auto;
}

.hero-slide-badge.badge-top-right {
    top: 1.25rem;
    right: 1.25rem;
}

.hero-slide-badge.badge-bottom-right {
    bottom: 1.25rem;
    right: 1.25rem;
}

.hero-slide-badge img {
    width: 100%;
    height: auto;
    max-width: 120px;
}

/* Badge Animations */
.hero-slide-badge.badge-animation-fade-in {
    animation: badgeFadeIn 0.8s ease-out forwards;
}

.hero-slide-badge.badge-animation-bounce-in {
    animation: badgeBounceIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.hero-slide-badge.badge-animation-slide-in {
    animation: badgeSlideIn 0.6s ease-out forwards;
}

.hero-slide-badge.badge-animation-zoom-in {
    animation: badgeZoomIn 0.6s ease-out forwards;
}

/* Badge Animation Keyframes */
@keyframes badgeFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes badgeBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes badgeZoomIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-slide-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    margin-bottom: 10px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
}

.hero-slide-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 400;
}

.hero-slide-description {
    font-family: var(--font-body);
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Font size variations for description */
.hero-slide-description.font-size-small {
    font-size: var(--smallFontSize);
}

.hero-slide-description.font-size-base {
    font-size: var(--baseFontSize);
}

.hero-slide-description.font-size-medium {
    font-size: var(--mediumFontSize);
}

.hero-slide-description.font-size-large {
    font-size: 1.2rem; /* Keep current large size for backwards compatibility */
}

.hero-slide-actions {
    margin-top: 30px;
}

.hero-slide-button {
    display: inline-block;
    padding: 15px 30px;
    font-family: var(--font-body);
    font-size: var(--mediumFontSize);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
}

.hero-slide-button.rounded {
    border-radius: 6px;
}

.hero-slide-button.font-mindset {
    font-family: var(--font-heading);
}

.hero-slide-button.font-ptmono {
    font-family: var(--font-body);
}

.hero-slide-button.font-bntillsdale {
    font-family: 'BNTillsdale', serif;
    font-weight: 700;
}

.hero-slide-button:hover {
    background-color: var(--button-hover-bg, #7bb3a9) !important;
    color: var(--button-hover-text, #ffffff) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Navigation Controls */
.hero-slider-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

.hero-slider-prev,
.hero-slider-next {
    position: absolute;
    top: 0;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slider-prev {
    left: 20px;
}

.hero-slider-next {
    right: 20px;
}

.hero-slider-prev:hover,
.hero-slider-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.hero-slider-prev:focus,
.hero-slider-next:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Dots Navigation */
.hero-slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.hero-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-slider-dot.active,
.hero-slider-dot:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}

.hero-slider-dot:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-slide {
        height: var(--mobile-height, 400px);
    }
    
    .hero-slide-image img {
        height: var(--mobile-height, 400px);
    }
    
    /* When mobile height is set to auto, use content-based height */
    .hero-slider-wrapper[style*="--mobile-height: auto"] .hero-slide {
        height: auto;
        min-height: 400px;
    }
    
    .hero-slider-wrapper[style*="--mobile-height: auto"] .hero-slide-image img {
        height: auto;
        min-height: 400px;
    }
    
    .hero-slide-content {
        flex-direction: column;
        gap: 30px;
        padding: 40px 15px;
    }
    
    .hero-slide-text {
        flex: none;
        max-width: 100%;
        text-align: center;
        order: 2;
    }
    
    .hero-slide-image {
        flex: none;
        min-height: 250px;
        width: 100%;
        order: 1;
    }
    
    .hero-slide-image img {
        height: var(--mobile-height, 400px);
        max-height: none;
    }
    
    .hero-slide-title {
        font-size: 2.5rem;
    }
    
    .hero-slide-subtitle {
        font-size: 1rem;
    }
    
    .hero-slide-description {
        font-size: 1.1rem;
    }
    
    .hero-slider-prev,
    .hero-slider-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .hero-slider-prev {
        left: 10px;
    }
    
    .hero-slider-next {
        right: 10px;
    }
    
    .hero-slider-dots {
        bottom: 20px;
    }
    
    .hero-slide-badge {
        max-width: 80px;
    }
    
    .hero-slide-badge.badge-top-right {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .hero-slide-badge.badge-bottom-right {
        bottom: 0.75rem;
        right: 0.75rem;
    }
    
    .hero-slide-badge img {
        max-width: 80px;
    }
    
    .hero-slider-dot {
        width: 10px;
        height: 10px;
    }

    /* Padding inside the text box */
    .hero-slide-text {
        padding: 0 1rem 2rem 1rem !important; /* left/right 1rem, bottom 2rem */
    }
}

@media (max-width: 768px) {
    /* Force vertical stacking: image first, text second */
    .hero-slide-content {
        flex-direction: column !important; /* ensure column layout */
    }

    .hero-slide-image {
        order: 1 !important;
        width: 100% !important;
        flex: none !important;
    }

    .hero-slide-text {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        text-align: center !important;
    }

    /* Swap images */
    .hero-slide-image .desktop-image {
        display: none !important;
    }

    .hero-slide-image .mobile-image {
        display: block !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    /* Full-bleed image at top */
    .hero-slide-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .hero-slide-image {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important; /* breakout */
    }

    .hero-slide-image img {
        height: 380px !important;
        width: 100% !important;
        object-fit: cover !important;
        object-position: center;
    }
}

@media (max-width: 480px) {
    .hero-slide-title {
        font-size: 2rem;
    }
    
    .hero-slide-button {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* Visibility controls */
@media (max-width: 767px) {
    .hero-slider-wrapper.hide-on-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hero-slider-wrapper.hide-on-desktop {
        display: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
    
    .hero-slider-prev,
    .hero-slider-next,
    .hero-slider-dot {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-slider-prev,
    .hero-slider-next {
        background: black;
        border: 2px solid white;
    }
    
    .hero-slider-dot {
        border-color: white;
    }
    
    .hero-slider-dot.active {
        background: white;
    }
}

/* Editor Specific Styles */
.editor-slide-indicator {
    position: absolute;
    bottom: 10px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 4;
}

@media (max-width: 768px) {
    /* Let the overall slider grow with content */
    .hero-slider-container {
        height: auto !important;
        overflow: visible !important;
    }
    .hero-slider-track {
        height: auto !important;
    }
    .hero-slide {
        position: relative !important;
        height: auto !important;
    }

    /* Remove max-width and extra margin on text container */
    .hero-slide-text-container {
        max-width: none !important;
    }
    .hero-slide-text-container.align-left {
        margin-right: 0 !important;
    }
}