/* Moara de Vânt - shared site styles.
   Home-page-only rules (top progress bar, chapter rail, section snapping)
   also live here, scoped via body.home-page / .home-scroll. */

:root {
    --night:   #15120E;
    --nightDk: #0D0B08;
    --bone:    #F2EBDC;
    --carmine: #CC3B30;
    --gold:    #D9A441;
    --smoke:   #A89C86;
    --ember:   #E86A3A;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    background: var(--night);
    color: var(--bone);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Brand-coloured thin scrollbar (Firefox + WebKit) */
html, body { scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background-color: rgba(217, 164, 65, .55);
    border-radius: 999px;
    transition: background-color .2s ease;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--gold); }

/* Editorial helpers */
.kicker {
    text-transform: uppercase;
    letter-spacing: .34em;
    font-weight: 700;
    font-size: .7rem;
}
.display {
    font-family: "Bricolage Grotesque", Georgia, serif;
    font-weight: 700;
    letter-spacing: -.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;                    /* reset UA <button> border (auth pages don't load Tailwind preflight) */
    border-radius: 9999px;
    padding: .75rem 2rem;            /* py-3 px-8 */
    font-size: .875rem;              /* text-sm */
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .2em;            /* tracking-[.2em] */
    white-space: nowrap;
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
    cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--night); }
.btn-primary:hover { background: var(--bone); }
.btn-outline {
    background: transparent;
    border: 1px solid rgba(217, 164, 65, .4);   /* gold/40 */
    color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--night); }
.btn-sm { padding: .5rem 1rem; font-size: .75rem; }   /* py-2 px-4, text-xs */
.btn-block { width: 100%; }

/* Card affordance pill - decorative, reacts to the card's group hover */
.card-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border-radius: 9999px;
    border: 1px solid rgba(217, 164, 65, .4);    /* gold/40 */
    padding: .375rem 1rem;           /* py-1.5 px-4 */
    font-size: .875rem;              /* text-sm */
    color: var(--gold);
    white-space: nowrap;
    transition: background-color .3s ease, color .3s ease;
}
.group:hover .card-cta { background: var(--gold); color: var(--night); }

/* Form fields (dark themed) */
.field {
    width: 100%;
    min-height: 3rem;
    background: rgba(21, 18, 14, .6);
    border: 1px solid rgba(242, 235, 220, .15);
    color: var(--bone);
    padding: .85rem 1rem;
    border-radius: .75rem;
    outline: none;
    transition: border-color .25s, background-color .25s;
}
.field::placeholder { color: rgba(168, 156, 134, .6); }
.field:focus {
    border-color: var(--gold);
    background: rgba(21, 18, 14, .75);
}

/* iOS Safari renders <input type="date"> taller than text inputs (native
   control intrinsic height + inner margins on the value). Strip the native
   appearance and its inner margins so the date row matches the other .field
   rows in height. */
input[type="date"].field {
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"].field::-webkit-date-and-time-value {
    text-align: left;
    margin: 0;
    padding: 0;
}
input[type="date"].field::-webkit-calendar-picker-indicator {
    margin: 0;
    opacity: .5;
}

/* Scrim gradients for keeping text readable over photos */
.scrim-b { background: linear-gradient(to top,
    rgba(13, 11, 8, .92), rgba(13, 11, 8, .35) 45%, rgba(13, 11, 8, .55)); }
.scrim-l { background: linear-gradient(to right,
    rgba(13, 11, 8, .85), rgba(13, 11, 8, .1) 60%, transparent); }
.scrim-r { background: linear-gradient(to left,
    rgba(13, 11, 8, .85), rgba(13, 11, 8, .1) 60%, transparent); }
.scrim-t { background: linear-gradient(to bottom,
    rgba(13, 11, 8, .92), rgba(13, 11, 8, .35) 45%, rgba(13, 11, 8, .55)); }

/* Hero slider (shared by /cazare/, /restaurant/, /stana/) */
.hero-slide { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.hero-slide.is-active { opacity: 1; pointer-events: auto; }
.hero-slide .hero-content { transform: translateY(24px); opacity: 0; transition: transform 1s ease .2s, opacity 1s ease .2s; }
.hero-slide.is-active .hero-content { transform: translateY(0); opacity: 1; }
#hero-slider .hero-arrow { opacity: 0; transition: opacity .3s ease, background-color .3s ease; }
#hero-slider:hover .hero-arrow { opacity: 1; }

/* Grain texture overlay (fixed; rendered by _partials/grain.html) */
.grain {
    position: fixed;
    inset: 0;
    z-index: 65;
    pointer-events: none;
    opacity: .06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Folk gold-band ornament strip */
.band {
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='14' viewBox='0 0 40 14'%3E%3Cg fill='none' stroke='%23D9A441' stroke-width='1.3'%3E%3Cpath d='M0 7 L10 1 L20 7 L10 13 Z'/%3E%3Cpath d='M20 7 L30 1 L40 7 L30 13 Z'/%3E%3C/g%3E%3Cpath d='M10 4 L13 7 L10 10 L7 7 Z' fill='%23CC3B30'/%3E%3Cpath d='M30 4 L33 7 L30 10 L27 7 Z' fill='%23CC3B30'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: auto 14px;
    opacity: .8;
}

/* Corner geometric ornaments */
.corner {
    position: absolute;
    width: 54px;
    height: 54px;
    border: 1.5px solid var(--gold);
    opacity: .5;
}
.corner.top-left     { border-right: 0; border-bottom: 0; }
.corner.top-right    { border-left:  0; border-bottom: 0; }
.corner.bottom-left  { border-right: 0; border-top:    0; }
.corner.bottom-right { border-left:  0; border-top:    0; }

/* Magnetic button base - JS adds inline translate transforms */
.magnetic { transition: transform .25s cubic-bezier(.16, 1, .3, 1); }

/* Entrance reveal */
.anim {
    opacity: 0;
    transform: translateY(42px);
    transition:
        opacity 1s cubic-bezier(.16, 1, .3, 1),
        transform 1s cubic-bezier(.16, 1, .3, 1);
}
.anim.in {
    opacity: 1;
    transform: none;
}
[data-anim-d="1"] { transition-delay: .12s; }
[data-anim-d="2"] { transition-delay: .24s; }
[data-anim-d="3"] { transition-delay: .36s; }
[data-anim-d="4"] { transition-delay: .48s; }
[data-anim-d="5"] { transition-delay: .60s; }

/* Clip-reveal for images (used inside .anim sections) */
.clip {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.1s cubic-bezier(.7, 0, .2, 1);
}
.clip.in { clip-path: inset(0 0 0% 0); }

/* Reservation modal */
.site-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 5vw;
    background: rgba(13, 11, 8, .7);
    backdrop-filter: blur(6px);
}
.site-modal.open { display: flex; }

/* Site header: transparent at top, frosted night-dk once scrolled */
.site-header {
    transition: background-color .35s ease, backdrop-filter .35s ease,
                border-color .35s ease, box-shadow .35s ease;
    border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    background-color: rgba(13, 11, 8, .84);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border-bottom-color: rgba(242, 235, 220, .10);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

/* Top progress bar: thin carmine-to-gold sliver above the header */
.page-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 70;
    background: linear-gradient(90deg, var(--carmine), var(--gold));
    pointer-events: none;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform .15s linear;
}

/* Chapter rail (home only): vertical scroll-spy on lg+ */
.chapter-rail {
    position: fixed;
    top: 50%;
    right: 26px;
    transform: translateY(-50%);
    z-index: 45;
    display: none;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 1024px) {
    body.home-page .chapter-rail { display: flex; }
}
.chapter-rail__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-decoration: none;
    cursor: pointer;
}
.chapter-rail__indicator {
    width: 9px;
    height: 9px;
    border: 1.5px solid var(--bone);
    background: transparent;
    opacity: .45;
    transform: rotate(45deg);
    transition: opacity .35s ease, background-color .35s ease, transform .35s ease, border-color .35s ease;
}
.chapter-rail__item:hover .chapter-rail__indicator,
.chapter-rail__item:focus-visible .chapter-rail__indicator {
    opacity: 1;
}
.chapter-rail__item[aria-current="true"] .chapter-rail__indicator {
    opacity: 1;
    background-color: var(--gold);
    border-color: var(--gold);
    transform: rotate(45deg) scale(1.35);
}
.chapter-rail__label {
    position: absolute;
    right: 22px;
    white-space: nowrap;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--bone);
    background: rgba(13, 11, 8, .7);
    padding: 3px 9px;
    border-radius: 999px;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.chapter-rail__item:hover .chapter-rail__label,
.chapter-rail__item:focus-visible .chapter-rail__label {
    opacity: 1;
    transform: none;
}

/* Mobile nav overlay */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    background: var(--nightDk);
}
.mobile-nav.open { display: flex; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .anim {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .clip { clip-path: none !important; }
    .magnetic { transition: none !important; }
}

/* Gallery marquee (paired rows scrolling in opposite directions) */
.marquee-stack { width: 100%; }
.marquee-track {
    overflow: hidden;
    width: 100%;
}
.marquee-track[data-direction="right"] {
    display: flex;
    justify-content: flex-end;
}
.marquee-row {
    display: flex;
    gap: 1.25rem;
    width: max-content;
    will-change: transform;
}
.marquee-track[data-direction="left"] .marquee-row {
    animation: marquee-left 40s linear infinite;
}
.marquee-track[data-direction="right"] .marquee-row {
    animation: marquee-right 40s linear infinite;
}
.marquee-stack:hover .marquee-row {
    animation-play-state: paused;
}
.marquee-item {
    flex: 0 0 auto;
    width: clamp(180px, 22vw, 340px);
    aspect-ratio: 3 / 2;
    border-radius: 1rem;
    overflow: hidden;
}
.marquee-item picture {
    display: block;
    width: 100%;
    height: 100%;
}
.marquee-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@keyframes marquee-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes marquee-right {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track[data-direction="left"] .marquee-row,
    .marquee-track[data-direction="right"] .marquee-row {
        animation: none;
    }
}

/* Story slider: cross-fade scenes */
.story-stage { width: 100%; height: 100%; }
.story-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
    will-change: opacity;
}
.story-slide[data-active] {
    opacity: 1;
    pointer-events: auto;
}
.story-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(242, 235, 220, .55);
    transition: background-color .25s ease, transform .25s ease, border-color .25s ease;
}
.story-dot[aria-current="true"] {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.25);
}
.story-dot:hover { border-color: var(--bone); }
.story-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--bone);
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: .5;
    line-height: 1;
    transition: opacity .25s ease, transform .25s ease;
}
.story-arrow:hover,
.story-arrow:focus-visible { opacity: 1; }
.story-arrow--prev { left: 14px; }
.story-arrow--next { right: 14px; }
.story-arrow--prev:hover,
.story-arrow--prev:focus-visible { transform: translateY(-50%) translateX(-3px); }
.story-arrow--next:hover,
.story-arrow--next:focus-visible { transform: translateY(-50%) translateX(3px); }
@media (min-width: 640px) {
    .story-arrow--prev { left: 24px; }
    .story-arrow--next { right: 24px; }
}
/* Keep the right arrow clear of the chapter rail (fixed at right:26px, shown >=1024px). */
@media (min-width: 1024px) {
    .story-arrow--next { right: 76px; }
}
@media (prefers-reduced-motion: reduce) {
    .story-slide { transition: none; }
    .story-arrow { transition: opacity .25s ease; }
    .story-arrow--prev:hover, .story-arrow--prev:focus-visible,
    .story-arrow--next:hover, .story-arrow--next:focus-visible { transform: translateY(-50%); }
}

/* Smooth scroll (Lenis). Scrolling happens on the window for every page,
   including home; JS attaches Lenis + lenis-snap section snapping there. */
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-smooth iframe {
    pointer-events: none;
}

/* Shared thumbnail-grid gallery used by /cazare/, /restaurant/ etc. Uniform
   4:3 crops (see _pic_gallery_thumb.html); clicking opens the PhotoSwipe
   lightbox initialised in base.html. */
.page-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (min-width: 640px) { .page-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery-thumb picture { display: contents; }
.gallery-thumb img { transition: transform .5s ease; }
.gallery-thumb:hover img { transform: scale(1.04); }

/* Rich text (TinyMCE / HTMLField output) rendered via Tailwind Typography.
   `prose prose-invert prose-brand` is applied on the wrapping element; this
   block re-themes the inverted prose palette to the Moara tokens. Loaded
   after tailwind.css (base.html), so these overrides win. */
.prose-brand {
    --tw-prose-invert-body: rgba(242, 235, 220, .80);
    --tw-prose-invert-headings: var(--bone);
    --tw-prose-invert-lead: rgba(242, 235, 220, .80);
    --tw-prose-invert-bold: var(--bone);
    --tw-prose-invert-bullets: var(--gold);
    --tw-prose-invert-counters: var(--gold);
    --tw-prose-invert-links: var(--gold);
    --tw-prose-invert-quotes: rgba(242, 235, 220, .80);
    --tw-prose-invert-quote-borders: var(--gold);
    --tw-prose-invert-hr: rgba(168, 156, 134, .30);
}
.prose-brand :is(h2, h3) { font-family: "Bricolage Grotesque", Georgia, serif; }
.prose-brand a { text-underline-offset: 2px; }
