/* ============================================
   Tour Booking — Custom Styles (Non-Tailwind)
   Animations, hero positioning, card effects
   ============================================
   NOTE: @theme and @custom-variant live in
   base.html <style type="text/tailwindcss">
   because the browser CDN only processes
   inline style tags.
   ============================================ */

/* --- Global --- */
html {
    scroll-behavior: smooth;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* z-index ensures dropdown appears above following sections */
    z-index: 20;
}

.hero-section picture {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.hero-section .hero-overlay {
    z-index: 1;
}

.hero-section .hero-content {
    position: relative;
    z-index: 2;
}

.hero-section picture img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 768px) {
    .hero-section picture img {
        object-position: center 30%;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    /* Middle stop lifted so the headline zone always has enough contrast —
       the gradient keyword used to melt into bright foliage. */
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.65) 100%
    );
}

/* Hero copy readability on photo backgrounds */
.hero-content h1,
.hero-content p {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

/* bg-clip-text glyphs ignore text-shadow (it bleeds through the transparent
   fill) — drop-shadow filters the rendered gradient glyphs instead. */
.hero-keyword {
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.65));
}

/* --- Tour Card Image Zoom --- */
.tour-card-img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover .tour-card-img {
    transform: scale(1.07);
}

/* --- Destination Card Image Zoom --- */
.dest-card-img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.group:hover .dest-card-img {
    transform: scale(1.08);
}

/* --- Animations --- */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-delay-100 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-200 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-300 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-400 { animation-delay: 0.4s; opacity: 0; }

/* --- Dark Mode Toggle Button --- */
.theme-toggle {
    position: relative;
    width: 3rem;
    height: 1.625rem;
    border-radius: 9999px;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease;
}

.theme-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.theme-toggle-knob.toggled {
    transform: translateX(1.375rem);
}

/* --- HTMX loading indicator --- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
}

/* --- Smooth scroll offset for fixed navbar --- */
:target {
    scroll-margin-top: 5rem;
}

/* --- Feature card glow on hover (dark mode) --- */
.dark .feature-glow:hover {
    box-shadow: 0 0 30px -5px oklch(0.58 0.19 250 / 0.25);
}

/* --- Horizontal Tour Card (Listing Page) --- */
.tour-h-card {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .tour-h-card {
        grid-template-columns: 320px 1fr;
    }
}

@media (min-width: 1024px) {
    .tour-h-card {
        grid-template-columns: 380px 1fr;
    }
}

.tour-h-card-img {
    aspect-ratio: 16 / 10;
}

@media (min-width: 640px) {
    .tour-h-card-img {
        aspect-ratio: auto;
        height: 100%;
    }
}

/* --- Sidebar Scrollbar --- */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: oklch(0.8 0 0) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: oklch(0.8 0 0);
    border-radius: 9999px;
}

.dark .sidebar-scroll {
    scrollbar-color: oklch(0.35 0 0) transparent;
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: oklch(0.35 0 0);
}

/* --- Performance: Defer rendering for below-fold homepage sections ---
   content-visibility: auto tells the browser to skip layout/paint work
   for off-screen content until the user scrolls near it.
   contain-intrinsic-size prevents layout shift from collapsed heights.
   IMPORTANT: Only apply to sections that are NEVER in the initial viewport. */
#recommended-section,
#bestseller-section,
#destinations-section,
#pois-section,
#blog-section,
#reviews-section,
#why-us-section {
    content-visibility: auto;
    contain-intrinsic-size: auto none auto 600px;
}
/* --- Rich text (.prose) ---------------------------------------------------
   Handwritten replacement for the Tailwind typography plugin, which is NOT
   compiled into output.css (blog/destination/POI/legal body text rendered as
   an unstyled wall of text). Scoped to .prose wrappers already present in the
   templates; the prose-* modifier utilities in class lists stay inert. */
.prose {
    color: #4b5563;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: #111827;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.prose h1 { font-size: 1.875rem; margin: 1.5em 0 0.6em; }
.prose h2 { font-size: 1.5rem;   margin: 1.5em 0 0.6em; }
.prose h3 { font-size: 1.25rem;  margin: 1.4em 0 0.5em; }
.prose h4 { font-size: 1.125rem; margin: 1.3em 0 0.5em; }

.prose p { margin: 1.05em 0; }

.prose a {
    color: oklch(0.52 0.2 22);
    font-weight: 600;
    text-decoration: none;
}

.prose a:hover { text-decoration: underline; }

.prose strong { color: #111827; font-weight: 700; }

.prose ul,
.prose ol {
    margin: 1.05em 0;
    padding-left: 1.5rem;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.45em 0; }
.prose li::marker { color: #9ca3af; }

.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1.4em 0;
    font-style: italic;
    color: #6b7280;
}

.prose img {
    border-radius: 1rem;
    margin: 1.6em 0;
    max-width: 100%;
    height: auto;
}

.prose hr {
    border-color: #e5e7eb;
    margin: 2.5em 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    margin: 1.4em 0;
}

.prose th,
.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.prose th { background: #f9fafb; font-weight: 700; }

.dark .prose { color: #9ca3af; }

.dark .prose h1,
.dark .prose h2,
.dark .prose h3,
.dark .prose h4,
.dark .prose strong { color: #f9fafb; }

.dark .prose a { color: oklch(0.76 0.15 22); }

.dark .prose blockquote {
    border-color: #374151;
    color: #9ca3af;
}

.dark .prose li::marker { color: #6b7280; }

.dark .prose th,
.dark .prose td { border-color: #374151; }

.dark .prose th { background: #111827; }
