/* Hero: full-viewport photo stage with the services strip pinned beneath it */
.hero {
    position: relative;
    min-height: 100vh; /* fallback for browsers without dvh support */
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.hero-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--navbar-height) 0 4.5rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* Dark scrim between the photo and the hero copy: an overall tint plus a
   heavier pool of shadow in the middle so the wordmark reads cleanly over
   the busy counter behind it. */
.hero-scrim {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 55% 50% at 50% 50%, rgba(10,10,10,0.65) 0%, rgba(10,10,10,0.30) 60%, rgba(10,10,10,0) 100%),
        linear-gradient(180deg, rgba(17,17,17,0.30) 0%, rgba(17,17,17,0.20) 50%, rgba(17,17,17,0.65) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
    max-width: 960px;
}

/* "EST. 2020" with a rule on each side */
.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: clamp(1rem, 1.6vw, 1.35rem);
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 0.6rem;
}

.hero-eyebrow::before,
.hero-eyebrow::after {
    content: '';
    width: clamp(2.5rem, 7vw, 6rem);
    height: 2px;
    background: var(--accent-primary);
}

/* Lightsaber ignition: before the text types in (home.js adds is-lit),
   each rule shoots outward from the text side -- fast start, hard
   deceleration into full length. is-armed is only set by JS, so without
   it the rules simply render at full length. */
.hero-eyebrow.is-armed::before,
.hero-eyebrow.is-armed::after {
    transform: scaleX(0);
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-eyebrow.is-armed::before { transform-origin: right center; }
.hero-eyebrow.is-armed::after { transform-origin: left center; }

.hero-eyebrow.is-armed.is-lit::before,
.hero-eyebrow.is-armed.is-lit::after {
    transform: scaleX(1);
}

.hero-title {
    font-weight: 400;
    line-height: 1;
    margin-bottom: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-word { display: block; }

.hero-merlins {
    font-family: 'Candles', var(--font-heading);
    font-size: clamp(2.8rem, 12.5vw, 9.5rem);
    letter-spacing: 0.02em;
    color: var(--accent-primary);
    text-shadow: 0 4px 0 rgba(0,0,0,0.55), 0 10px 40px rgba(0,0,0,0.6);
}

/* Silver "GARAGE" flanked by tapered rules */
.hero-garage {
    display: flex;
    align-items: center;
    gap: 0.35em;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    font-size: clamp(1.6rem, 7vw, 5.6rem);
    letter-spacing: 0.06em;
    margin-top: -0.05em;
}

.hero-garage__text {
    color: var(--text-secondary);
    text-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.hero-garage::before,
.hero-garage::after {
    content: '';
    width: 1.6em;
    height: 0.07em;
    min-height: 3px;
    background: var(--text-secondary);
}

.hero-garage::before { clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.hero-garage::after { clip-path: polygon(0 0, 100% 50%, 0 100%); }

.hero-subtitle {
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 600;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: #dcdcdc;
    margin-bottom: 2.6rem;
}

/* Equal-width buttons: every column is as wide as the widest label */
.hero-cta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
}

.hero-cta .btn {
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    /* Right padding trimmed by the letter-spacing, which trails the last
       letter, so the label sits optically centred */
    padding: 0.6rem calc(1.5rem - 0.18em) 0.6rem 1.5rem;
    border-radius: 2px;
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

/* Bosnian labels run longer ("TEHNIČKI SAVJETI" sets every column's width),
   so tighten the tracking and side padding to keep the row compact */
.hero-cta--bs .btn {
    padding: 0.6rem calc(1.1rem - 0.1em) 0.6rem 1.1rem;
    letter-spacing: 0.1em;
}

/* All three share one see-through style; the blur and text shadow keep
   the labels readable over bright parts of the photo */
.hero-cta .btn--ghost {
    border-color: rgba(255,255,255,0.75);
    color: #fff;
    background: rgba(10,10,10,0.3);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.hero-cta .btn--ghost:hover {
    border-color: var(--accent-primary);
    color: #fff;
}

/* Services strip along the bottom of the hero */
.hero-services {
    position: relative;
    z-index: 1;
    list-style: none;
    display: grid;
    /* minmax(0, 1fr) keeps all six columns equal regardless of label length,
       so the 3rd/4th divider lands dead centre under the scroll chevron */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 1.9rem max(1.5rem, calc((100% - 1440px) / 2 + 1.5rem));
    background: #0d0d0d;
    border-top: 1px solid rgba(255,102,0,0.35);
}

.hero-service {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    padding: 0.4rem 1rem;
}

.hero-service + .hero-service { border-left: 1px solid rgba(255,102,0,0.4); }

.hero-service__icon {
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-service__icon--dots {
    fill: var(--accent-primary);
    stroke: none;
}

.hero-service__label {
    font-family: 'Barlow Condensed', var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .hero-service { gap: 0.8rem; padding: 0.4rem 0.6rem; }
    .hero-service__icon { width: 2.2rem; height: 2.2rem; }
    .hero-service__label { font-size: 0.88rem; letter-spacing: 0.06em; }
}

@media (max-width: 1250px) {
    .hero-services { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 1.2rem; }
    .hero-service { justify-content: flex-start; }
    .hero-service:nth-child(3n+1) { border-left: none; }
}

/* Stack the hero buttons once three no longer fit side by side */
@media (max-width: 900px) {
    .hero-cta { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 640px) {
    /* Phones: the photo stage fills the whole first screen and the services
       strip sits below the fold, revealed on scroll (home.js) */
    .hero { min-height: 0; }
    .hero-stage {
        flex: none;
        min-height: 100vh; /* fallback for browsers without svh support */
        min-height: 100svh;
    }
    .hero-services { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 1.5rem 1rem; }
    .hero-service { gap: 0.75rem; padding: 0.4rem 0.75rem; }
    .hero-service:nth-child(3n+1) { border-left: 1px solid rgba(255,102,0,0.4); }
    .hero-service:nth-child(2n+1) { border-left: none; }
    .hero-service__icon { width: 2rem; height: 2rem; }
    .hero-service__label { font-size: 0.8rem; letter-spacing: 0.04em; white-space: normal; }
    .hero-bg { object-position: 30% center; }
    .hero-cta { gap: 0.75rem; }
    .hero-cta .btn { padding: 0.65rem calc(1.25rem - 0.18em) 0.65rem 1.25rem; font-size: 0.92rem; }
    .hero-eyebrow { gap: 1rem; }
    .hero-subtitle { letter-spacing: 0.3em; }
}

/* Tire-tread skid mark wipes in behind the label on hover */
.hero-cta .btn {
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.hero-cta .btn::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    -webkit-mask-image: url('/static/images/tire-tread.svg');
    mask-image: url('/static/images/tire-tread.svg');
    -webkit-mask-repeat: repeat-x;
    mask-repeat: repeat-x;
    -webkit-mask-size: auto 100%;
    mask-size: auto 100%;
    -webkit-mask-position: left center;
    mask-position: left center;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.hero-cta .btn--ghost::before { background: var(--accent-primary); }

/* Driven by JS (home.js), not :hover directly -- the fill and the wipe-out
   need different clip-path targets so the wipe-out recedes toward the right
   (left-to-right) instead of mirroring the fill-in in reverse. */
.hero-cta .btn.is-filled::before { clip-path: inset(0 0 0 0); }
.hero-cta .btn.is-unfilling::before { clip-path: inset(0 0 0 100%); }

.hero-scroll-indicator {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: block;
    padding: 0.75rem;
    /* Vertical only: a horizontal negative margin would pull the
       left:50%/translateX(-50%) centring 0.75rem off to the left */
    margin: -0.75rem 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hero-scroll-indicator:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.scroll-chevron {
    display: block;
    overflow: visible;
}

/* Only pulses once the reveal has fully finished drawing -- JS adds this
   class on ignite-complete and strips it the instant a retract starts. */
.scroll-chevron.is-glowing {
    animation: scroll-chevron-pulse 1.8s ease-in-out infinite;
}

/* The tip is the V's center vertex -- it fades in in place first, then
   each arm (below) draws itself outward from that same point to its
   wingtip. */
.chevron-tip {
    fill: var(--accent-primary);
}

.chevron-arm {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 4.2;
    stroke-linecap: round;
}

@keyframes scroll-chevron-pulse {
    0%, 100% {
        filter:
            drop-shadow(0 0 6px rgba(255, 102, 0, 0.85))
            drop-shadow(0 0 16px rgba(255, 102, 0, 0.55));
    }
    50% {
        filter:
            drop-shadow(0 0 10px rgba(255, 102, 0, 1))
            drop-shadow(0 0 26px rgba(255, 102, 0, 0.85));
    }
}


/* Gallery strip: an endless filmstrip of the shop gallery. Tiles share one
   height and keep their photo's own width, so mixed aspect ratios never get
   cropped. Without JS (or with reduced motion) it's a plain scrollable row;
   home.js adds .is-looping when it takes over and animates the track. */
/* Kept to the content width (.container) rather than bleeding edge to edge */
.gallery-strip {
    --strip-height: clamp(180px, 20vw, 280px);
    --strip-gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem 0;
}

.gallery-strip__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.gallery-strip__track {
    display: flex;
    width: max-content;
    padding: 0 1.5rem;
}

/* padding-right matches the gap so back-to-back copies of the set (home.js)
   are spaced exactly like the tiles within one */
.gallery-strip__set {
    display: flex;
    gap: var(--strip-gap);
    padding-right: var(--strip-gap);
}

.gallery-strip__item {
    flex: none;
    display: block;
    height: var(--strip-height);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-tertiary);
    scroll-snap-align: center;
}

.gallery-strip__item img {
    display: block;
    height: 100%;
    width: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.5s ease, opacity 0.25s ease;
}

.gallery-strip__item:hover img {
    transform: scale(1.04);
    opacity: 0.92;
}

/* overflow: clip (not hidden) so nothing can scroll the viewport underneath
   the GSAP transform; pan-y keeps vertical page scrolling on touch while
   horizontal drags go to home.js */
.gallery-strip__viewport.is-looping {
    overflow: hidden;
    overflow: clip;
    scroll-snap-type: none;
    touch-action: pan-y;
    cursor: grab;
}

.gallery-strip__viewport.is-looping .gallery-strip__track { padding: 0; }
.gallery-strip__viewport.is-dragging { cursor: grabbing; }

@media (max-width: 640px) {
    .gallery-strip { --strip-height: 180px; --strip-gap: 0.5rem; padding: 3rem 1rem 0; }
    .gallery-strip__viewport {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
        mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
    }
}

/* Posts section */
.posts-section {
    padding: 5rem 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
}

.post-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
    cursor: pointer;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.post-card__image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card__image img { transform: scale(1.05); }

.post-card__body { padding: 1.5rem; }

.post-card__date {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.5rem;
}

.post-card__title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.post-card__excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card--more {
    align-items: center;
    justify-content: center;
    min-height: 100%;
    border-style: dashed;
}

.post-card--more:hover {
    background: var(--bg-tertiary, rgba(245, 166, 35, 0.06));
}

.post-card__body--more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    flex: 1;
}

.post-card__more-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
    text-align: center;
}
