/**
 * ByDaniWP Dynamic Header - Frontend Styles
 * @since 1.0.0
 *
 * Two layout templates:
 * 1. Modern (Hero) — Full-width background image, centered overlay content
 * 2. Classic (Banner) — Side-by-side: image left, text right
 */

/* ============================================================================
   BASE / SHARED STYLES
   ============================================================================ */

.bydaniwp-dh {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.bydaniwp-dh *,
.bydaniwp-dh *::before,
.bydaniwp-dh *::after {
    box-sizing: border-box;
}

/* Width Modes */
.bydaniwp-dh--full {
    width: 100%;
}

.bydaniwp-dh--contained {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.bydaniwp-dh--custom {
    margin-left: auto;
    margin-right: auto;
}

/* Content Alignment */
.bydaniwp-dh__content--left {
    text-align: left;
}

.bydaniwp-dh__content--center {
    text-align: center;
}

.bydaniwp-dh__content--right {
    text-align: right;
}

/* Title */
.bydaniwp-dh__title {
    margin-bottom: 16px;
}

.bydaniwp-dh__title h1,
.bydaniwp-dh__title h2,
.bydaniwp-dh__title h3 {
    margin: 0;
    line-height: 1.2;
}

/* Description */
.bydaniwp-dh__description {
    margin-bottom: 24px;
    line-height: 1.6;
}

.bydaniwp-dh__description p {
    margin: 0 0 12px;
}

.bydaniwp-dh__description p:last-child {
    margin-bottom: 0;
}

/* CTA */
.bydaniwp-dh__cta {
    margin-top: 8px;
}

.bydaniwp-dh__cta a {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* ============================================================================
   TEMPLATE 1: MODERN (Hero)
   Full-screen-width background image with dark overlay and centered content.
   Scientific UX: High contrast, clear visual hierarchy, prominent CTA.
   ============================================================================ */

.bydaniwp-dh--modern {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background-color: #1a1a2e;
}

/* Background Image Layer */
.bydaniwp-dh--modern .bydaniwp-dh__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Mobile/Desktop bg layers — desktop visible by default */
.bydaniwp-dh__bg--mobile,
.bydaniwp-dh__bg--mobile-fallback {
    display: none;
}

/* Classic: mobile image hidden by default */
.bydaniwp-dh__image--mobile {
    display: none;
}

/* Overlay Layer */
.bydaniwp-dh--modern .bydaniwp-dh__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

/* Content Layer */
.bydaniwp-dh--modern .bydaniwp-dh__content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    width: 100%;
    padding: 60px 20px;
}

/* Modern Title Styling */
.bydaniwp-dh--modern .bydaniwp-dh__title h1,
.bydaniwp-dh--modern .bydaniwp-dh__title h2 {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bydaniwp-dh--modern .bydaniwp-dh__title h3 {
    font-size: clamp(22px, 4vw, 36px);
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Modern Description */
.bydaniwp-dh--modern .bydaniwp-dh__description {
    font-size: clamp(15px, 2vw, 18px);
    opacity: 0.92;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Modern CTA — Elevated button style */
.bydaniwp-dh--modern .bydaniwp-dh__cta a {
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    background-color: #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.02em;
    text-transform: none;
}

.bydaniwp-dh--modern .bydaniwp-dh__cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    background-color: #f0f0f0;
}

/* Subtle entrance animation */
.bydaniwp-dh--modern .bydaniwp-dh__content {
    animation: bydaniwp-dh-fade-up 0.8s ease-out;
}

@keyframes bydaniwp-dh-fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   TEMPLATE 2: CLASSIC (Banner)
   Split layout: Image on left, text content on right.
   Clean, editorial look with strong typographic hierarchy.
   ============================================================================ */

.bydaniwp-dh--classic {
    background-color: #f8f9fa;
}

.bydaniwp-dh--classic .bydaniwp-dh__inner {
    display: flex;
    align-items: stretch;
    min-height: 300px;
}

/* Image Column */
.bydaniwp-dh--classic .bydaniwp-dh__image-col {
    flex: 0 0 45%;
    max-width: 45%;
    overflow: hidden;
}

.bydaniwp-dh--classic .bydaniwp-dh__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text Column */
.bydaniwp-dh--classic .bydaniwp-dh__text-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 48px;
}

/* Classic Title */
.bydaniwp-dh--classic .bydaniwp-dh__title h1,
.bydaniwp-dh--classic .bydaniwp-dh__title h2 {
    font-size: clamp(24px, 3.5vw, 38px);
    font-weight: 700;
    color: inherit;
    line-height: 1.15;
    margin-bottom: 8px;
}

.bydaniwp-dh--classic .bydaniwp-dh__title h3 {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: inherit;
}

/* Classic Description */
.bydaniwp-dh--classic .bydaniwp-dh__description {
    font-size: clamp(14px, 1.5vw, 16px);
    line-height: 1.7;
    opacity: 0.85;
}

/* Classic CTA — Solid accent button */
.bydaniwp-dh--classic .bydaniwp-dh__cta a {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background-color: #13919b;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(19, 145, 155, 0.3);
}

.bydaniwp-dh--classic .bydaniwp-dh__cta a:hover {
    background-color: #0d737a;
    box-shadow: 0 4px 16px rgba(19, 145, 155, 0.4);
    transform: translateY(-1px);
}

/* Decorative accent line for Classic */
.bydaniwp-dh--classic .bydaniwp-dh__title::before {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background-color: #13919b;
    margin-bottom: 16px;
    border-radius: 2px;
}

.bydaniwp-dh--classic .bydaniwp-dh__content--center .bydaniwp-dh__title::before {
    margin-left: auto;
    margin-right: auto;
}

.bydaniwp-dh--classic .bydaniwp-dh__content--right .bydaniwp-dh__title::before {
    margin-left: auto;
}

/* ============================================================================
   SLIDER
   ============================================================================ */

.bydaniwp-dh-slider {
    position: relative;
    width: 100%;
}

.bydaniwp-dh-slider__track {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.bydaniwp-dh-slide {
    display: none;
    opacity: 0;
}

.bydaniwp-dh-slide--active {
    display: block;
    opacity: 1;
    position: relative;
}

/* Navigation Arrows */
.bydaniwp-dh-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 48px;
    width: 56px;
    height: 56px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    line-height: 1;
    padding: 0px 0px 9px 0px;
}

.bydaniwp-dh-slider__arrow:hover {
    background: rgba(0, 0, 0, 0.85);
}

.bydaniwp-dh-slider__arrow--prev {
    left: 20px;
}

.bydaniwp-dh-slider__arrow--next {
    right: 20px;
}

/* Pagination Dots */
.bydaniwp-dh-slider__dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 16px 0 8px;
    position: relative;
    z-index: 10;
}

.bydaniwp-dh-slider__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.bydaniwp-dh-slider__dot:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.bydaniwp-dh-slider__dot--active {
    background: var(--bydaniwp-dh-dot-active, #13919b);
    transform: scale(1.3);
    border-color: var(--bydaniwp-dh-dot-active, #13919b);
}

/* Pause/Play Button */
.bydaniwp-dh-slider__pause {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 15;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    backdrop-filter: blur(4px);
}

.bydaniwp-dh-slider__pause:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.bydaniwp-dh-slider__pause[data-playing="true"] .bydaniwp-dh-slider__pause-icon--play {
    display: none;
}

.bydaniwp-dh-slider__pause[data-playing="false"] .bydaniwp-dh-slider__pause-icon--pause {
    display: none;
}

.bydaniwp-dh-slider__pause-icon {
    pointer-events: none;
}

.bydaniwp-dh-slider__pause-icon--pause {
    font-size: 11px;
    letter-spacing: 2px;
}

.bydaniwp-dh-slider__pause-icon--play {
    font-size: 16px;
    margin-left: 2px;
}

/* Fixed Height Mode */
.bydaniwp-dh-slider--fixed-height .bydaniwp-dh-slider__track {
    height: var(--bydaniwp-dh-slider-height, auto);
}

.bydaniwp-dh-slider--fixed-height .bydaniwp-dh-slide {
    height: var(--bydaniwp-dh-slider-height, auto);
}

.bydaniwp-dh-slider--fixed-height .bydaniwp-dh-slide .bydaniwp-dh {
    height: 100%;
}

.bydaniwp-dh-slider--fixed-height .bydaniwp-dh--modern {
    min-height: 100%;
    height: 100%;
}

.bydaniwp-dh-slider--fixed-height .bydaniwp-dh--classic .bydaniwp-dh__inner {
    height: 100%;
}

/* ============================================================================
   SLIDE ANIMATIONS
   ============================================================================ */

/* --- Fade --- */
.bydaniwp-dh-anim--fade-in {
    animation: bydaniwp-dh-fade-in 0.6s ease forwards;
}

.bydaniwp-dh-anim--fade-out {
    animation: bydaniwp-dh-fade-out 0.6s ease forwards;
}

@keyframes bydaniwp-dh-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes bydaniwp-dh-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* --- Slide (horizontal) --- */
.bydaniwp-dh-anim--slide-enter-next {
    transform: translateX(100%);
    opacity: 1;
}

.bydaniwp-dh-anim--slide-enter-prev {
    transform: translateX(-100%);
    opacity: 1;
}

.bydaniwp-dh-anim--slide-exit-next {
    transform: translateX(0);
    opacity: 1;
}

.bydaniwp-dh-anim--slide-exit-prev {
    transform: translateX(0);
    opacity: 1;
}

.bydaniwp-dh-anim--slide-active {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bydaniwp-dh-anim--slide-active.bydaniwp-dh-anim--slide-enter-next,
.bydaniwp-dh-anim--slide-active:not(.bydaniwp-dh-anim--slide-enter-next):not(.bydaniwp-dh-anim--slide-enter-prev) {
    transform: translateX(0);
}

.bydaniwp-dh-anim--slide-active.bydaniwp-dh-anim--slide-exit-next {
    transform: translateX(-100%);
}

.bydaniwp-dh-anim--slide-active.bydaniwp-dh-anim--slide-exit-prev {
    transform: translateX(100%);
}

/* Slide needs both slides visible simultaneously */
.bydaniwp-dh-anim--slide-enter-next,
.bydaniwp-dh-anim--slide-enter-prev,
.bydaniwp-dh-anim--slide-exit-next,
.bydaniwp-dh-anim--slide-exit-prev {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: block;
}

/* --- Zoom --- */
.bydaniwp-dh-anim--zoom-in {
    animation: bydaniwp-dh-zoom-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.bydaniwp-dh-anim--zoom-out {
    animation: bydaniwp-dh-zoom-out 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bydaniwp-dh-zoom-in {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes bydaniwp-dh-zoom-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.15); }
}

/* --- Flip (3D) --- */
.bydaniwp-dh-anim--flip-container {
    perspective: 1200px;
}

.bydaniwp-dh-anim--flip-in {
    animation: bydaniwp-dh-flip-in 0.7s ease forwards;
    backface-visibility: hidden;
}

.bydaniwp-dh-anim--flip-out {
    animation: bydaniwp-dh-flip-out 0.7s ease forwards;
    backface-visibility: hidden;
}

@keyframes bydaniwp-dh-flip-in {
    from { opacity: 0; transform: rotateY(-90deg); }
    to   { opacity: 1; transform: rotateY(0deg); }
}

@keyframes bydaniwp-dh-flip-out {
    from { opacity: 1; transform: rotateY(0deg); }
    to   { opacity: 0; transform: rotateY(90deg); }
}

/* --- Cube (3D rotation) --- */
.bydaniwp-dh-anim--cube-container {
    perspective: 1000px;
    overflow: visible;
}

.bydaniwp-dh-anim--cube-out-next {
    animation: bydaniwp-dh-cube-out-next 0.7s ease forwards;
    transform-origin: right center;
}

.bydaniwp-dh-anim--cube-in-next {
    animation: bydaniwp-dh-cube-in-next 0.7s ease forwards;
    transform-origin: left center;
}

.bydaniwp-dh-anim--cube-out-prev {
    animation: bydaniwp-dh-cube-out-prev 0.7s ease forwards;
    transform-origin: left center;
}

.bydaniwp-dh-anim--cube-in-prev {
    animation: bydaniwp-dh-cube-in-prev 0.7s ease forwards;
    transform-origin: right center;
}

@keyframes bydaniwp-dh-cube-out-next {
    from { opacity: 1; transform: rotateY(0deg); }
    to   { opacity: 0.3; transform: rotateY(-90deg); }
}

@keyframes bydaniwp-dh-cube-in-next {
    from { opacity: 0.3; transform: rotateY(90deg); }
    to   { opacity: 1; transform: rotateY(0deg); }
}

@keyframes bydaniwp-dh-cube-out-prev {
    from { opacity: 1; transform: rotateY(0deg); }
    to   { opacity: 0.3; transform: rotateY(90deg); }
}

@keyframes bydaniwp-dh-cube-in-prev {
    from { opacity: 0.3; transform: rotateY(-90deg); }
    to   { opacity: 1; transform: rotateY(0deg); }
}

/* --- Ken Burns (zoom + pan fade) --- */
.bydaniwp-dh-anim--kenburns-in {
    animation: bydaniwp-dh-kenburns-in 0.6s ease forwards;
}

.bydaniwp-dh-anim--kenburns-out {
    animation: bydaniwp-dh-kenburns-out 0.6s ease forwards;
}

[data-animation="kenburns"] .bydaniwp-dh-slide--active .bydaniwp-dh__bg {
    animation: bydaniwp-dh-kenburns-bg 8s ease-in-out infinite alternate;
}

@keyframes bydaniwp-dh-kenburns-in {
    from { opacity: 0; transform: scale(1.05) translateX(-2%); }
    to   { opacity: 1; transform: scale(1) translateX(0); }
}

@keyframes bydaniwp-dh-kenburns-out {
    from { opacity: 1; transform: scale(1) translateX(0); }
    to   { opacity: 0; transform: scale(1.05) translateX(2%); }
}

@keyframes bydaniwp-dh-kenburns-bg {
    from { transform: scale(1) translate(0, 0); }
    to   { transform: scale(1.08) translate(-1.5%, -1%); }
}

/* Slides during animation need stacking */
.bydaniwp-dh-anim--fade-in,
.bydaniwp-dh-anim--fade-out,
.bydaniwp-dh-anim--zoom-in,
.bydaniwp-dh-anim--zoom-out,
.bydaniwp-dh-anim--flip-in,
.bydaniwp-dh-anim--flip-out,
.bydaniwp-dh-anim--cube-out-next,
.bydaniwp-dh-anim--cube-in-next,
.bydaniwp-dh-anim--cube-out-prev,
.bydaniwp-dh-anim--cube-in-prev,
.bydaniwp-dh-anim--kenburns-in,
.bydaniwp-dh-anim--kenburns-out {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: block;
}

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

@media (max-width: 768px) {
    /* Modern — reduce padding */
    .bydaniwp-dh--modern .bydaniwp-dh__content {
        padding: 40px 16px;
    }

    .bydaniwp-dh--modern .bydaniwp-dh__cta a {
        padding: 12px 28px;
        font-size: 14px;
    }

    /* Classic — stack vertically */
    .bydaniwp-dh--classic .bydaniwp-dh__inner {
        flex-direction: column;
    }

    .bydaniwp-dh--classic .bydaniwp-dh__image-col {
        flex: none;
        max-width: 100%;
        height: 220px;
    }

    .bydaniwp-dh--classic .bydaniwp-dh__text-col {
        padding: 24px 20px;
    }

    /* ── Mobile Image Swap ── */
    /* Hide desktop bg, show mobile bg */
    .bydaniwp-dh__bg--desktop {
        display: none;
    }

    /* Dedicated mobile image */
    .bydaniwp-dh--has-mobile-img .bydaniwp-dh__bg--mobile {
        display: block;
    }

    /* Smart fallback: creative crop for landscape desktop images */
    .bydaniwp-dh__bg--mobile-fallback {
        display: block;
        background-size: auto 100%;
        background-position: center center;
        background-repeat: no-repeat;
    }

    /* Classic: swap desktop/mobile image */
    .bydaniwp-dh--has-mobile-img .bydaniwp-dh__image--desktop {
        display: none;
    }

    .bydaniwp-dh--has-mobile-img .bydaniwp-dh__image--mobile {
        display: block;
    }

    /* Slider controls */
    .bydaniwp-dh-slider__arrow {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }

    .bydaniwp-dh-slider__arrow--prev {
        left: 10px;
        padding-right: 7px;
    }

    .bydaniwp-dh-slider__arrow--next {
        right: 10px;
        padding-left: 7px;
    }

    .bydaniwp-dh-slider__pause {
        width: 34px;
        height: 34px;
        top: 12px;
        left: 12px;
    }

    /* Slider dots smaller */
    .bydaniwp-dh-slider__dots {
        gap: 8px;
        padding: 12px 0 6px;
    }

    .bydaniwp-dh-slider__dot {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .bydaniwp-dh--modern {
        min-height: 320px;
    }

    .bydaniwp-dh--modern .bydaniwp-dh__content {
        padding: 30px 12px;
    }

    /* Modern: Titel + Description etwas kompakter */
    .bydaniwp-dh--modern .bydaniwp-dh__title h1,
    .bydaniwp-dh--modern .bydaniwp-dh__title h2 {
        font-size: clamp(22px, 7vw, 32px);
    }

    .bydaniwp-dh--modern .bydaniwp-dh__description {
        font-size: 14px;
    }

    .bydaniwp-dh--modern .bydaniwp-dh__cta a {
        padding: 10px 24px;
        font-size: 13px;
    }

    .bydaniwp-dh--classic .bydaniwp-dh__image-col {
        height: 180px;
    }

    .bydaniwp-dh--classic .bydaniwp-dh__text-col {
        padding: 20px 16px;
    }

    .bydaniwp-dh--classic .bydaniwp-dh__title h1,
    .bydaniwp-dh--classic .bydaniwp-dh__title h2 {
        font-size: clamp(20px, 6vw, 28px);
    }

    /* Slider arrows even smaller */
    .bydaniwp-dh-slider__arrow {
        width: 34px;
        height: 34px;
        font-size: 26px;
    }

    .bydaniwp-dh-slider__arrow--prev {
        left: 6px;
    }

    .bydaniwp-dh-slider__arrow--next {
        right: 6px;
    }
}
