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

:root {
    --primary: #FFD700;
    --secondary: #FFF9E5;
    --accent: #FF8C00;
    --text: #4A4A4A;
}

/* Base Adjustments */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* 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, main > section, main > div, footer, .pl-6, .px-6 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .p-8 {
        padding: 2rem 10px !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);
}

.image-wrapper-unique-2 { /* About */
    border-radius: 20px;
    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: 0 50% 0 50%;
    overflow: hidden;
    border-bottom: 15px solid var(--accent);
}

.image-wrapper-unique-6 { /* Message */
    border-radius: 100px 20px 100px 20px;
    overflow: hidden;
}

/* --- 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;
    gap: 25px; /* Slightly wider gap */
    animation: marquee 35s linear infinite; /* Slightly slower for organic feel */
    width: max-content;
    align-items: center; /* Center-align varied heights */
}

.marquee-item {
    width: 320px;
    height: 220px;
    flex-shrink: 0;
    border-radius: 20px; /* 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);
}

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

/* Size Variations for organic look */
.marquee-item:nth-child(4n+1) { 
    width: 450px; 
    height: 300px; 
}
.marquee-item:nth-child(4n+2) { 
    width: 240px; 
    height: 180px; 
}
.marquee-item:nth-child(4n+3) { 
    width: 350px; 
    height: 240px; 
}
.marquee-item:nth-child(4n+4) { 
    width: 280px; 
    height: 220px; 
}


@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 10px)); } /* Half of the total width including gaps */
}

/* --- Premium Entrance Animations --- */
.fade-in-up, .reveal-left, .reveal-right, .scale-in {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up { transform: translateY(50px); }
.reveal-left { transform: translateX(-50px); }
.reveal-right { transform: translateX(50px); }
.scale-in { transform: scale(0.9); }

.fade-in-up.visible, .reveal-left.visible, .reveal-right.visible, .scale-in.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Stagger Helpers */
.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; }

/* --- 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.8rem;
        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;
    }
}

