/**
 * O2H - Custom CSS
 *
 * Tailwind CSS CDN으로 처리할 수 없는 커스텀 스타일
 * @since 2026-04-09
 */

/* ─── Smooth Scroll ──────────────────────────────── */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Custom Scrollbar ───────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f2f2f6;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c8 #f2f2f6;
}

/* ─── Hide Scrollbar Utility ─────────────────────── */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ─── Skeleton Loading Shimmer ───────────────────── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-image {
    width: 100%;
    padding-bottom: 75%; /* 4:3 ratio */
}

.skeleton-circle {
    border-radius: 50%;
}

/* ─── Line Clamp ─────────────────────────────────── */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── KakaoTalk Floating Button Animation ────────── */
@keyframes kakao-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-4px);
    }
}

.kakao-float {
    animation: kakao-bounce 2s ease-in-out;
}

/* ─── Slider Dot Indicators ──────────────────────── */
.slider-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.slider-dot.active {
    width: 24px;
    border-radius: 4px;
    background-color: #ffffff;
}

/* Dark background variant */
.slider-dots--dark .slider-dot {
    background-color: #d1d5db;
}

.slider-dots--dark .slider-dot.active {
    background-color: #4D6FFF;
}

/* ─── Transition Utilities ───────────────────────── */
.transition-height {
    transition-property: height, max-height;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-transform-opacity {
    transition-property: transform, opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* ─── Fade In Animation ──────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out both;
}

.animate-fade-in-delay-1 {
    animation: fadeIn 0.5s ease-out 0.1s both;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.5s ease-out 0.2s both;
}

.animate-fade-in-delay-3 {
    animation: fadeIn 0.5s ease-out 0.3s both;
}

/* ─── Image Hover Zoom ───────────────────────────── */
.img-zoom-container {
    overflow: hidden;
}

.img-zoom-container img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-zoom-container:hover img {
    transform: scale(1.05);
}

/* ─── Overlay Gradient ───────────────────────────── */
.overlay-gradient-bottom {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        transparent 100%
    );
}

.overlay-gradient-full {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* ─── Alpine.js Cloak ────────────────────────────── */
[x-cloak] {
    display: none !important;
}

/* ─── Focus Visible ──────────────────────────────── */
:focus-visible {
    outline: 2px solid #4D6FFF;
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* ─── Print Styles ───────────────────────────────── */
@media print {
    header,
    footer,
    .kakao-float,
    .fixed,
    .sticky,
    nav[aria-label="Breadcrumb"] {
        display: none !important;
    }

    @page {
        margin: 2cm;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000 !important;
        background: #fff !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    a[href^="tel:"]:after,
    a[href^="mailto:"]:after,
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    h2, h3, h4 {
        page-break-after: avoid;
    }

    .shadow-sm,
    .shadow-lg,
    .shadow-card,
    .shadow-card-hover {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* ─── Safe Area (모바일 노치 대응) ───────────────── */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .fixed.bottom-6 {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}
