@tailwind base;
@tailwind components;
@tailwind utilities;

/* HTMX Loading States for AI Search */
.htmx-indicator {
    display: none;
}

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

.htmx-request input[type="search"] {
    opacity: 0.7;
}

.htmx-request .search-icon {
    opacity: 0.5;
}


@font-face {
    font-family: Caveat;
    src: url("/static/fonts/Caveat/Caveat-VariableFont_wght.7519ccd6f7c0.ttf");
    font-display: swap;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: Caveat;
}

.custom-font {
    font-family: Caveat;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #7c3aed;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: .75rem 1rem;
    background: white;
    color: #312e81;
}
.skip-link:focus { top: 1rem; }
.site-masthead {
    background: #9f2210;
    border-radius: 0 0 1.5rem 1.5rem;
    margin-bottom: .75rem;
    box-shadow: 0 5px 16px rgba(94, 28, 16, .16);
}
.site-brand {
    font-family: Caveat, cursive;
    font-size: clamp(2.1rem, 10vw, 3rem);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}
.site-header-authenticated .site-brand {
    font-size: clamp(1.4rem, calc(10vw - .6rem), 3rem);
}
.site-header {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .75rem .5rem;
}
.site-logo { flex: 0 0 40px; }
.site-logo img { width: 40px; height: 40px; margin: 0; }
.site-action { flex: 0 0 44px; }
.site-action a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}
.site-action svg, .site-action img {
    display: block;
    width: 32px;
    height: 32px;
    max-width: 100%;
    margin: 0;
}
.site-account img { border-radius: .5rem; object-fit: cover; }
@media (min-width: 640px) {
    .site-header { padding: .75rem 1rem; }
    .site-logo { flex-basis: 56px; }
    .site-logo img { width: 56px; height: 56px; }
}
.site-masthead a:focus-visible {
    outline-color: #fde68a;
}
.discovery-map { background: #faf9ff; }
#discovery-panel { background: #faf9ff; }
#discovery-panel:not([open]) { padding-top: .25rem; padding-bottom: .25rem; }
#discovery-panel > summary { font-size: 1rem; line-height: 44px; }
#discovery-toolbar { color: #334155; align-items: flex-end; }
.style-filter { position: relative; max-width: 100%; }
.selected-style-names { overflow-wrap: anywhere; }
.selected-style-names > span + span::before { content: ', '; }
.style-options {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    z-index: 40;
    width: min(22rem, calc(100vw - 4rem));
    padding: .75rem;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 41, 59, .15);
}
.style-option { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .25rem; border-radius: .35rem; }
.style-option:hover { background: #f5f3ff; }
.style-option input, #style-filter-form > label input[type="checkbox"] { accent-color: #7c3aed; width: 1rem; height: 1rem; flex-shrink: 0; }
.style-event-count { margin-left: auto; padding-left: .5rem; color: #64748b; font-size: .75rem; font-variant-numeric: tabular-nums; }
#style-chips a[aria-current="true"] { background: #ede9fe; border-color: #8b5cf6; color: #5b21b6; }
@media (min-width: 1024px) {
    body.discovery-shell { width: calc(100% - 3rem); max-width: 72rem; }
    .discovery-shell .site-header { padding: 1rem 1.5rem; }
    .discovery-shell .site-brand { font-size: 3.5rem; }
    .discovery-shell .site-logo, .discovery-shell .site-action { flex-basis: 56px; }
    .discovery-shell .site-action a { width: 56px; height: 56px; }
    .discovery-shell #search-results { max-width: 56rem; margin-inline: auto; }
    .discovery-shell #discovery-panel { margin-inline: 1rem; }
    .discovery-shell #discovery-toolbar { gap: .75rem; }
    .discovery-shell #discovery-toolbar summary { font-size: 1rem; }
}
.discovery-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem;
    padding: .35rem .5rem .65rem;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font: 600 .875rem/1.3 system-ui, sans-serif;
}
.discovery-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .5rem .75rem;
    border-radius: 999px;
    color: #fff7ed;
    text-decoration: none;
}
.discovery-nav a:hover { background: rgba(255, 255, 255, .14); }
.discovery-nav a[aria-current="page"] {
    background: #fff7ed;
    color: #8c1d10;
}
.event-detail-viewport h1, .event-detail-viewport h2 {
    font-family: system-ui, sans-serif;
}
.compact-results h2 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.compact-results h3 { margin: 0; font-size: .875rem; line-height: 1.4; }
.event-compact {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .25rem;
    margin: 0 1rem;
    padding: .5rem 0;
    border-bottom: 1px solid #e2e8f0;
    font: 400 .8125rem/1.35 system-ui, sans-serif;
}
.event-compact-content { min-width: 0; }
.event-compact-save a, .event-compact-save form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
}
.event-compact-save svg { width: 22px; height: 22px; }
.event-compact-meta { display: flex; flex-wrap: wrap; gap: .15rem .5rem; color: #475569; font-size: .75rem; }
.event-compact-title { display: block; margin: .15rem 0; color: #1e293b; font-size: .9375rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; text-decoration: none; }
.event-compact-title:hover { color: #9f2210; text-decoration: underline; }
.event-compact-tags { display: flex; flex-wrap: wrap; gap: .2rem .35rem; font-size: .6875rem; color: #991b1b; }
.event-compact-tags span { padding: 0 .35rem; border-radius: 999px; background: #fee2e2; }
.event-compact-tags .event-compact-type { color: #115e59; background: #ccfbf1; }
@media (min-width: 640px) {
    .event-compact { margin: 0; }
}
.event-detail-viewport p { margin-top: .25rem; margin-bottom: .25rem; }
.event-detail-viewport h1 { margin: .5rem 0; }

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

/* Background image styles — use ::before pseudo-element to avoid
   the Chrome bug where background-attachment:fixed breaks when
   overflow-x:hidden is also set on <html>. */
html.bg-dance-image {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

html.bg-dance-image::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: var(--hero-bg, url("/static/images/ardian-lumi-6Woj_wozqmA-unsplash.138b0ce79647.jpg"));
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

html.bg-dance-image::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15vh;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5));
    pointer-events: none;
    z-index: -1;
}

.htmx-indicator {
    opacity: 0;
    z-index: 0;
    transition: opacity 500ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
    z-index: 3;

}

.htmx-request.htmx-indicator {
    opacity: 1;
    z-index: 3;
}

.transition-land {
    transition: transform 0.3s ease-in-out;
    animation: shrink-down 0.5s ease-out;
}

.transition-rise {
    transition: transform 0.3s ease-in-out;
    animation: rise-up 0.5s ease-out;
}

@keyframes shrink-down {
    0% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes rise-up {
    0% {
        transform: translateY(100%);
    }

    100% {
        transform: translateY(0%);
    }
}
