/* =========================================================
   Nur-Dent — custom styles (only what utilities cannot do)
   ========================================================= */

/* ---------- Scrolling: smooth, no overscroll bounce ---------- */
html {
    scroll-padding-top: 5.5rem;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}
body {
    overscroll-behavior: none;
}
html.native-smooth {
    scroll-behavior: smooth;
}
html.lenis,
html.lenis body {
    height: auto;
}
.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis.lenis-stopped {
    overflow: hidden;
}
.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* ---------- Scrollbar in the clinic navy ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: hsl(var(--muted));
}
::-webkit-scrollbar-thumb {
    background: hsl(var(--foreground) / 0.45);
    border: 2px solid hsl(var(--muted));
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--foreground) / 0.8);
}
@supports not selector(::-webkit-scrollbar) {
    html {
        scrollbar-width: thin;
        scrollbar-color: hsl(var(--foreground) / 0.45) hsl(var(--muted));
    }
}

/* ---------- Scroll progress line ---------- */
#scroll-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 2px;
    z-index: 70;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: hsl(var(--primary));
    pointer-events: none;
}

/* ---------- Basics ---------- */
::selection {
    background: hsl(var(--accent) / 0.35);
}
:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 3px;
}

/* ---------- Header: hides while reading down, returns when scrolling up ---------- */
.site-header {
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.2s ease;
}
.site-header.is-scrolled {
    border-bottom-color: hsl(var(--border));
}
.site-header.is-hidden {
    transform: translateY(-100%);
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0;
    color: hsl(var(--foreground) / 0.72);
    transition: color 0.2s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    height: 2px;
    background: hsl(var(--primary));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}
.nav-link:hover,
.nav-link[aria-current='page'] {
    color: hsl(var(--foreground));
}
.nav-link:hover::after,
.nav-link[aria-current='page']::after {
    transform: scaleX(1);
}

.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--foreground) / 0.8);
}
.mobile-link[aria-current='page'] {
    color: hsl(var(--foreground));
    font-weight: 600;
}
.mobile-link[aria-current='page']::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: hsl(var(--primary));
}

.lang-btn {
    padding: 0.45rem 0.3rem;
    color: hsl(var(--muted-foreground));
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 9px;
    transition: color 0.25s ease, text-decoration-color 0.3s ease, text-underline-offset 0.3s ease;
}
.lang-btn:hover {
    color: hsl(var(--foreground));
}
.lang-btn[aria-pressed='true'] {
    color: hsl(var(--foreground));
    text-decoration-color: hsl(var(--primary));
    text-underline-offset: 5px;
}

/* ---------- Language switch: words fade out, change, and fade back in ---------- */
html.lang-anim [data-mk],
html.lang-anim #reviews-list,
html.lang-anim #reviews-total,
html.lang-anim #gallery-grid,
html.lang-anim #photo-strip-list,
html.lang-anim [data-photo-caption] {
    transition: opacity 0.18s ease, filter 0.18s ease !important;
}
html.lang-out [data-mk],
html.lang-out [data-mk-ph],
html.lang-out #reviews-list,
html.lang-out #reviews-total,
html.lang-out #gallery-grid,
html.lang-out #photo-strip-list,
html.lang-out [data-photo-caption] {
    opacity: 0 !important;
    filter: blur(3px);
}

/* Sections reached from a link don't need a focus ring */
[tabindex='-1']:focus {
    outline: none;
}

/* ---------- Brand mark: the round tooth sign cut from the clinic logo ---------- */
.brand-mark {
    position: relative;
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 999px;
    background: hsl(var(--primary));
}
.brand-mark img {
    position: absolute;
    max-width: none;
    width: 270%;
    height: auto;
    left: -84.6%;
    top: -35.5%;
}

/* ---------- The swoosh from the logo and the storefront sign ---------- */
.wave-clip {
    clip-path: url(#nd-wave);
}
.wave-line {
    animation: nd-wipe 1.6s 0.2s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes nd-wipe {
    from {
        clip-path: inset(-40% 100% -40% 0);
    }
    to {
        clip-path: inset(-40% 0 -40% 0);
    }
}

/* ---------- Photos that change on every visit ---------- */
.photo-slot {
    transition: opacity 0.45s ease;
}
.photo-slot.is-swapping {
    opacity: 0;
}

/* ---------- Treatment index on the services page ---------- */
.toc-link {
    display: block;
    padding: 0.55rem 0 0.55rem 1rem;
    border-left: 2px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    transition: color 0.2s ease, border-color 0.2s ease;
}
.toc-link:hover {
    color: hsl(var(--foreground));
}
.toc-link[aria-current] {
    color: hsl(var(--foreground));
    border-left-color: hsl(var(--primary));
    font-weight: 600;
}

/* ---------- Gallery filters ---------- */
.filter-btn[aria-pressed='true'] {
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    border-color: hsl(var(--foreground));
}

/* ---------- Gallery: a few photos get more room ---------- */
#gallery-grid[data-count='1'] {
    grid-template-columns: minmax(0, 1fr);
    max-width: 56rem;
}
#gallery-grid[data-count='1'] img {
    aspect-ratio: 3 / 2;
}
@media (min-width: 640px) {
    #gallery-grid[data-count='2'] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- FAQ accordion ---------- */
details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}
.faq-icon {
    transition: transform 0.3s ease, background-color 0.2s ease, color 0.2s ease;
}
details[open] .faq-icon {
    transform: rotate(45deg);
    background: hsl(var(--foreground));
    color: hsl(var(--background));
}

/* ---------- Lightbox ---------- */
dialog::backdrop {
    background: hsl(var(--foreground) / 0.92);
}

/* ---------- Scroll reveal (hidden only once the script runs) ---------- */
.reveal-init {
    opacity: 0;
    transform: translateY(18px);
}
.reveal-init.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    html.native-smooth {
        scroll-behavior: auto;
    }
    .site-header,
    .photo-slot,
    .nav-link::after,
    .faq-icon {
        transition: none;
    }
    .wave-line {
        animation: none;
    }
    .reveal-init {
        opacity: 1;
        transform: none;
    }
}
