/* Custom Styles for K&M Yu Visiting Nursing Station - Refined Phase */

:root {
    --primary: #5AB2C6;
    /* Soft Blue */
    --secondary: #F0F9FB;
    /* Light Blue */
    --accent: #5EBF98;
    /* Mint Green */
    --text: #4A4A4A;
    /* Dark Gray */
}

/* Base Adjustments */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Fix for iOS Safari background-attachment: fixed bug causing extreme zoom */
@supports (-webkit-touch-callout: none) {
    body {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center top !important;
    }
}

@media (max-width: 1024px) {
    body {
        background-attachment: scroll !important;
    }
}

/* Global Section Padding (70px top/bottom) */
.section-padding {
    padding-top: 70px;
    padding-bottom: 70px;
}

/* SP side padding adjustments */
@media (max-width: 767px) {

    .px-4,
    .container,
    .pl-6,
    .px-6 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .p-8 {
        padding: 2rem 10px !important;
    }

    .gap-8 {
        gap: 20px !important;
    }
}

/* Typography refinement */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    letter-spacing: 0.08em;
}

/* --- Image Wrapper Styles (Unique for each section) --- */

.image-wrapper-unique-1 {
    /* TV */
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    overflow: hidden;
    box-shadow: 20px 20px 0px var(--primary);
    animation: wave-blob 8s ease-in-out infinite alternate;
}

.image-wrapper-unique-2 {
    /* About */
    border-radius: 80px;
    transform: rotate(-2deg);
    overflow: hidden;
    border: 8px solid white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.image-wrapper-unique-5 {
    /* Service (Now Unified) */
    border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%;
    overflow: hidden;
    border-bottom: 15px solid var(--accent);
    animation: wave-blob 10s ease-in-out infinite alternate-reverse;
}

.image-wrapper-unique-6 {
    /* Message */
    border-radius: 60% 40% 40% 60% / 50% 50% 50% 50%;
    overflow: hidden;
    animation: wave-blob 12s ease-in-out infinite alternate;
}

/* --- Infinite Marquee Gallery --- */
.marquee-container {
    width: 100%;
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 20px;
    padding: 60px 0;
    /* Increased padding for varied sizes */
}

.marquee-track {
    display: flex;
    animation: marquee 35s linear infinite;
    /* Never pause! */
    width: max-content;
    align-items: center;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.marquee-content {
    display: flex;
    gap: 25px;
    padding-right: 25px;
    /* Ensures consistent gap between the two duplicated contents */
}

.marquee-item {
    width: 500px;
    height: 440px;
    flex-shrink: 0;
    border-radius: 32px;
    /* Slightly softer corners */
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 4px solid white;
}

@media (max-width: 767px) {
    .marquee-item {
        width: 320px;
        height: 280px;
    }
}

.marquee-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
}


@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes wave-blob {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* --- Premium Entrance Animations --- */
.fade-in-up,
.fade-in-down,
.reveal-left,
.reveal-right,
.scale-in,
.zoom-in,
.zoom-out-reveal {
    opacity: 0;
    will-change: transform, opacity;
    transition:
        opacity 1.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1),
        clip-path 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up {
    transform: translateY(60px);
}

.fade-in-down {
    transform: translateY(-60px);
}

.reveal-left {
    transform: translateX(-80px);
}

.reveal-right {
    transform: translateX(80px);
}

.scale-in {
    transform: scale(0.85);
}

.zoom-in {
    transform: scale(1.15);
}

.zoom-out-reveal {
    transform: scale(1.1);
    clip-path: inset(10% 10% 10% 10%);
}

.visible {
    opacity: 1 !important;
    transform: translateY(0) translateX(0) scale(1) !important;
    clip-path: inset(-100%) !important;
}

/* Stagger Helpers (Deep) */
.stagger-delay-1 {
    transition-delay: 0.1s;
}

.stagger-delay-2 {
    transition-delay: 0.2s;
}

.stagger-delay-3 {
    transition-delay: 0.3s;
}

.stagger-delay-4 {
    transition-delay: 0.4s;
}

.stagger-delay-5 {
    transition-delay: 0.5s;
}

.stagger-delay-6 {
    transition-delay: 0.6s;
}

.stagger-delay-7 {
    transition-delay: 0.7s;
}

.stagger-delay-8 {
    transition-delay: 0.8s;
}

.stagger-delay-9 {
    transition-delay: 0.9s;
}

.stagger-delay-10 {
    transition-delay: 1.0s;
}

/* --- Fancybox Customization for Center Alignment --- */
.fancybox__container {
    --fancybox-color: #fff;
    --fancybox-bg: rgba(0, 0, 0, 0.9);
}

/* Ensure only one close button and it's prominent */
.fancybox__toolbar {
    padding: 20px;
}

.fancybox__nav {
    --fancybox-nav-width: 50px;
}

/* Micro-interactions */
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Footer & Other */
header.scrolled {
    height: 70px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

#scrollTop {
    transition: all 0.3s;
}

/* --- Hero Animations & Styles --- */
@keyframes ken-burns-dynamic {
    0% {
        transform: scale(1) translate(0, 0);
    }

    50% {
        transform: scale(1.1) translate(1%, 1%);
    }

    100% {
        transform: scale(1.05) translate(-1%, 0);
    }
}

.fvSwiper .swiper-slide-active img {
    animation: ken-burns-dynamic 12s ease-in-out infinite alternate;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-ken-burns {
    animation: ken-burns 15s ease-out forwards;
}

.animate-fade-in {
    animation: fade-in 1s ease-out forwards;
}

.animate-fade-in-up {
    animation: fade-in-up 1s ease-out forwards;
}

@keyframes shine {
    100% {
        transform: translateX(100%);
    }
}

.animate-shine {
    animation: shine 3.5s infinite linear;
}

#fv {
    background-color: #fff;
}

@media (max-width: 767px) {
    #fv h2 {
        font-size: 1.6rem;
        line-height: 1.4;
    }

    #fv p {
        font-size: 1rem;
    }
}

/* --- Recruit Table --- */

.recruit-table th {
    white-space: nowrap;
}

@media (max-width: 767px) {

    .recruit-table thead,
    .recruit-table tbody,
    .recruit-table th,
    .recruit-table td,
    .recruit-table tr {
        display: block;
    }

    .recruit-table tr {
        border-bottom: 2px solid var(--secondary);
    }

    .recruit-table th {
        padding-top: 20px !important;
        padding-bottom: 10px !important;
        background-color: var(--secondary);
        color: var(--accent);
    }

    .recruit-table td {
        padding-top: 10px !important;
        padding-bottom: 20px !important;
    }
}

/* Right-click prevent notice */
body {
    -webkit-touch-callout: none;
    user-select: none;
}

.selectable {
    user-select: text;
}

/* PC/Desktop Padding Override */
@media (min-width: 768px) {
    .md\:py-0 {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }

    .md\:text-4xl {
        font-size: 2.25rem;
        line-height: 3.5rem !important;
    }
}

@media (min-width: 1024px) {
    .lg\:text-6xl {
        font-size: 3.50rem !important;
        line-height: 1.3;
    }

    .lg\:text-3xl {
        font-size: 1.7rem !important;
        line-height: 2.25rem !important;
    }

    .lg\:text-\[48px\] {
        font-size: 40px !important;
    }

    .lg\:px-8 {
        padding-left: 0rem !important;
        padding-right: 2rem !important;
    }

    .lg\:h-\[550px\] {
        height: 699px !important;
    }

    .lg\:gap-12 {
        gap: 2rem !important;
    }
}

@media (min-width: 768px) {
    .md\:p-10 {
        padding: 2rem !important;
    }
}

.bg-accent\/90 {
    background-color: rgb(94 191 152 / 50%);
}

/* Global p font-size */
p {
    font-size: 14px;
}

@media (min-width: 768px) {
    p {
        font-size: 16px;
    }
}

/* SP specific padding overrides */
@media (max-width: 767px) {
    .pr-10 {
        padding-right: 0.5rem !important;
    }

    .pl-8 {
        padding-left: 10px !important;
    }

    .px-3 {
        padding-left: 0px !important;
        padding-right: 0px !important;
    }

    .p-6 {
        padding: 30px 10px !important;
    }

    .mt-20 {
        margin-top: 3rem !important;
    }
}