/* ==========================================================================
   Dolina Wkry — theme stylesheet
   Complements Tailwind utilities with project-specific design primitives
   and nature-inspired animations.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Base reset / font smoothing
   -------------------------------------------------------------------------- */
:root {
    --dw-ease-soft:  cubic-bezier(.22, 1, .36, 1);
    --dw-ease-swing: cubic-bezier(.34, 1.56, .64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Native Material Symbols weight variation (kept from prototype) */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --------------------------------------------------------------------------
   2. Utility components
   -------------------------------------------------------------------------- */

/* "Glass" panels used in hero buttons and map overlays */
.glass-card {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Ambient editorial shadow — soft glow, never hard */
.editorial-shadow {
    box-shadow: 0 0 32px 0 rgba(25, 28, 26, 0.06);
}

/* Skip-link for keyboard users (a11y) */
.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    clip: auto;
    width: auto;
    height: auto;
    padding: .75rem 1.25rem;
    background: #154212;
    color: #fff;
    border-radius: 9999px;
    z-index: 100;
}

/* --------------------------------------------------------------------------
   3. Mega menu (desktop + mobile)
   -------------------------------------------------------------------------- */

.dw-mega-menu {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(25, 28, 26, 0.20);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dw-mega-menu[aria-hidden="false"] {
    display: flex;
    animation: dw-fade-in .25s var(--dw-ease-soft);
}

.dw-mega-menu__card {
    animation: dw-scale-in .35s var(--dw-ease-swing);
}

@keyframes dw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes dw-scale-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* Prevent scroll leak while menu is open */
body.dw-menu-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Scroll-triggered reveal animations
   Applied to elements with [data-reveal] — toggled by JS via IntersectionObserver.
   -------------------------------------------------------------------------- */

[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity .9s var(--dw-ease-soft),
        transform .9s var(--dw-ease-soft);
    will-change: opacity, transform;
}

[data-reveal="fade"]  { transform: none; }
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Staggered children (add to parent, child indexes 1..n take .1s increments) */
[data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity .8s var(--dw-ease-soft),
        transform .8s var(--dw-ease-soft);
}
[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: .00s; opacity: 1; transform: none; }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: .10s; opacity: 1; transform: none; }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: .20s; opacity: 1; transform: none; }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: .30s; opacity: 1; transform: none; }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: .40s; opacity: 1; transform: none; }
[data-reveal-stagger].is-visible > *:nth-child(n+6) { transition-delay: .50s; opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   5. Hero — floating leaves
   A handful of SVG <use> leaves drifting diagonally across the hero.
   -------------------------------------------------------------------------- */

.dw-leaves {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.dw-leaf {
    position: absolute;
    top: -10%;
    width: 28px;
    height: 28px;
    color: rgba(188, 240, 174, 0.85);
    opacity: 0;
    animation: dw-leaf-fall linear infinite;
    will-change: transform, opacity;
    filter: drop-shadow(0 2px 4px rgba(21, 66, 18, .25));
}

@keyframes dw-leaf-fall {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    10%  { opacity: .9; }
    100% { transform: translate3d(var(--dw-leaf-dx, 120px), 110vh, 0) rotate(var(--dw-leaf-rot, 540deg)); opacity: 0; }
}

/* --------------------------------------------------------------------------
   6. Hero parallax
   Background image gets a subtle Y-translate via JS-managed CSS var.
   -------------------------------------------------------------------------- */

.dw-parallax {
    transform: translate3d(0, var(--dw-parallax-y, 0px), 0);
    transition: transform .08s linear;
    will-change: transform;
}

/* --------------------------------------------------------------------------
   7. River wave divider
   Thin animated SVG divider evoking moving water between sections.
   -------------------------------------------------------------------------- */

.dw-river {
    position: relative;
    height: 80px;
    overflow: hidden;
    pointer-events: none;
}
.dw-river svg {
    position: absolute;
    left: 0; top: 0;
    width: 200%;
    height: 100%;
    animation: dw-river-flow 22s linear infinite;
}
@keyframes dw-river-flow {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   8. Interactive map + pins
   -------------------------------------------------------------------------- */

.dw-map {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 2rem;
    overflow: hidden;
    background: #ecefea;
    box-shadow: 0 0 32px 0 rgba(25, 28, 26, 0.06);
}

.dw-map__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .85;
    mix-blend-mode: multiply;
}

.dw-pin-layer {
    position: absolute;
    inset: 0;
    padding: 2rem;
    pointer-events: none;
}

.dw-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.dw-pin__marker {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(25, 28, 26, 0.18);
    transition: transform .25s var(--dw-ease-swing);
    position: relative;
}

.dw-pin__marker::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 9999px;
    background: currentColor;
    opacity: .25;
    animation: dw-pin-pulse 2.4s ease-out infinite;
}

@keyframes dw-pin-pulse {
    0%   { transform: scale(.85); opacity: .35; }
    80%  { transform: scale(1.8);  opacity: 0;   }
    100% { transform: scale(1.8);  opacity: 0;   }
}

.dw-pin:hover .dw-pin__marker,
.dw-pin:focus-within .dw-pin__marker {
    transform: scale(1.1);
}

.dw-pin__bubble {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 16rem;
    padding: 1rem;
    background: rgba(247, 250, 245, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 0 32px 0 rgba(25, 28, 26, 0.10);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity .25s var(--dw-ease-soft),
        transform .25s var(--dw-ease-soft);
    z-index: 10;
}

.dw-pin__bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 14px;
    height: 14px;
    background: inherit;
    transform: translate(-50%, -50%) rotate(45deg);
}

.dw-pin:hover .dw-pin__bubble,
.dw-pin:focus-within .dw-pin__bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dw-pin__thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: .75rem;
    object-fit: cover;
    margin-bottom: .5rem;
    display: block;
}

.dw-pin__title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: .875rem;
    line-height: 1.2;
    margin: 0 0 .25rem;
}

.dw-pin__desc {
    font-size: .75rem;
    line-height: 1.45;
    color: #42493e;
    margin: 0;
}

/* Color variants — match Material Design 3 roles from Tailwind config */
.dw-pin--primary   .dw-pin__marker { background:#154212; color:#ffffff; }
.dw-pin--primary   .dw-pin__title  { color:#154212; }
.dw-pin--secondary .dw-pin__marker { background:#2a6676; color:#ffffff; }
.dw-pin--secondary .dw-pin__title  { color:#2a6676; }
.dw-pin--tertiary  .dw-pin__marker { background:#553112; color:#ffffff; }
.dw-pin--tertiary  .dw-pin__title  { color:#553112; }

/* --------------------------------------------------------------------------
   9. Respect prefers-reduced-motion
   -------------------------------------------------------------------------- */

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

    .dw-leaf { display: none; }
    .dw-parallax { transform: none !important; }
    .dw-pin__marker::before { display: none; }
    [data-reveal] { opacity: 1; transform: none; }
    [data-reveal-stagger] > * { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   10. Floating "Kup Bilet" pill (brief requirement)
   -------------------------------------------------------------------------- */

.dw-float-ticket {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 55; /* below the mega menu (60) but above everything else */
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.25rem;
    background: #154212;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: .95rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(21, 66, 18, .35), 0 0 0 4px rgba(255, 255, 255, .6);
    transition:
        transform .25s var(--dw-ease-swing),
        box-shadow .25s var(--dw-ease-soft);
    animation: dw-float-idle 3.2s var(--dw-ease-soft) infinite;
}

.dw-float-ticket:hover,
.dw-float-ticket:focus-visible {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 14px 36px rgba(21, 66, 18, .45), 0 0 0 4px rgba(188, 240, 174, .85);
    outline: none;
}

@keyframes dw-float-idle {
    0%, 100% { transform: translateY(0);    }
    50%      { transform: translateY(-4px); }
}

/* Hide label on very small screens — the icon alone suffices */
@media (max-width: 480px) {
    .dw-float-ticket__label { display: none; }
    .dw-float-ticket        { padding: .875rem; }
}

body.dw-menu-open .dw-float-ticket {
    display: none; /* get out of the way when menu is open */
}

/* --------------------------------------------------------------------------
   11. Attraction one-pager — info icons bar + gallery
   -------------------------------------------------------------------------- */

.dw-info-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.dw-info-chip {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    background: #f1f4ef;
    border-radius: 1rem;
}

.dw-info-chip__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: #bcf0ae;
    color: #154212;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dw-info-chip__label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #42493e;
}

.dw-info-chip__value {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #191c1a;
}

.dw-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.dw-gallery__item {
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
    overflow: hidden;
    background: #e6e9e4;
    cursor: zoom-in;
    transition: transform .3s var(--dw-ease-soft);
}

.dw-gallery__item:hover { transform: scale(1.02); }

.dw-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s var(--dw-ease-soft);
}

.dw-gallery__item:hover img { transform: scale(1.08); }

/* --------------------------------------------------------------------------
   12. Groups form — progressive step flow (Typeform-style)
   -------------------------------------------------------------------------- */

.dw-groups-form {
    max-width: 720px;
    margin: 0 auto;
}

.dw-groups-form__progress {
    display: flex;
    gap: .5rem;
    margin-bottom: 2rem;
}

.dw-groups-form__progress-bar {
    flex: 1;
    height: 4px;
    background: #e0e3df;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.dw-groups-form__progress-bar.is-complete {
    background: #154212;
}
.dw-groups-form__progress-bar.is-active {
    background: linear-gradient(90deg, #154212 50%, #e0e3df 50%);
}

.dw-groups-form__step {
    display: none;
    animation: dw-step-in .4s var(--dw-ease-soft);
}

.dw-groups-form__step.is-active {
    display: block;
}

@keyframes dw-step-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.dw-groups-form__question {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.15;
    color: #154212;
    margin: 0 0 .5rem;
}

.dw-groups-form__hint {
    color: #42493e;
    font-size: 1rem;
    margin: 0 0 1.5rem;
}

.dw-groups-form__input,
.dw-groups-form__textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: #f1f4ef;
    border: 2px solid transparent;
    border-radius: 1rem;
    font-size: 1.125rem;
    color: #191c1a;
    font-family: inherit;
    transition: border-color .2s var(--dw-ease-soft), background-color .2s var(--dw-ease-soft);
}

.dw-groups-form__input:focus,
.dw-groups-form__textarea:focus {
    outline: none;
    border-color: #154212;
    background: #ffffff;
}

.dw-groups-form__textarea { min-height: 8rem; resize: vertical; }

.dw-groups-form__attractions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.dw-groups-form__attraction-option {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.dw-groups-form__attraction-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dw-groups-form__attraction-option-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    background: #ffffff;
    border: 2px solid #e0e3df;
    border-radius: 1rem;
    text-align: center;
    transition: border-color .2s var(--dw-ease-soft), transform .2s var(--dw-ease-soft);
}

.dw-groups-form__attraction-option:hover .dw-groups-form__attraction-option-body {
    border-color: #a1d494;
    transform: translateY(-2px);
}

.dw-groups-form__attraction-option input:checked + .dw-groups-form__attraction-option-body {
    border-color: #154212;
    background: #bcf0ae;
}

.dw-groups-form__attraction-option input:focus-visible + .dw-groups-form__attraction-option-body {
    outline: 3px solid #154212;
    outline-offset: 2px;
}

.dw-groups-form__actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.dw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .875rem 2rem;
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: transform .2s var(--dw-ease-swing), opacity .2s var(--dw-ease-soft);
}

.dw-btn:hover  { transform: translateY(-2px); }
.dw-btn:active { transform: translateY(0); }
.dw-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.dw-btn--primary   { background: #154212; color: #ffffff; }
.dw-btn--secondary { background: transparent; color: #154212; }

.dw-groups-form__success,
.dw-groups-form__error {
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}
.dw-groups-form__success { background: #bcf0ae; color: #154212; }
.dw-groups-form__error   { background: #ffdad6; color: #93000a; }
