/* Decorative pieces that are easier in plain CSS (Tailwind handles the rest). */

/* Red angled block behind the top-bar socials */
.topbar-social::before {
    content: '';
    position: absolute;
    inset: 0 -100vw 0 0;
    background: var(--accent);
    transform: skewX(-28deg);
    transform-origin: bottom left;
}

/* Angled button corner (wrench cut) */
.btn-angle { clip-path: polygon(0 0, 100% 0, 100% 70%, calc(100% - 12px) 100%, 0 100%); }

/* Nav underline */
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: -2px;
    height: 3px;
    background: var(--accent);
    transition: all .3s ease;
}
.nav-link:hover::after, .nav-link.is-active::after { left: 14px; right: 14px; }

.footer-title::after, .widget-title::after,
.footer-title::before, .widget-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    height: 3px;
    background: var(--accent);
}
.footer-title::after, .widget-title::after { left: 0; width: 40px; }
.footer-title::before, .widget-title::before { left: 46px; width: 10px; }

/* Diagonal stripes pattern used on CTA bands */
.cta-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-55deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 22px);
}
.cta-band::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 9999px;
    border: 30px solid rgba(255, 255, 255, .1);
}

/* Logo-style roundel ring (navy/blue quarters) */
.roundel {
    background: conic-gradient(var(--royal) 0 25%, #fff 0 50%, var(--royal) 0 75%, #fff 0);
    border-radius: 9999px;
}
.ring-dashed { border: 2px dashed color-mix(in oklab, var(--accent) 60%, white); border-radius: 9999px; }

/* Inner page hero */
.page-hero { background-color: var(--color-brand-950, #071a46); }
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, color-mix(in oklab, var(--brand) 55%, black) 30%, color-mix(in oklab, var(--brand) 70%, transparent) 70%, transparent);
    z-index: 1;
}
.page-hero .hero-stripe {
    position: absolute;
    right: -10%;
    top: 0;
    bottom: 0;
    width: 45%;
    background: repeating-linear-gradient(-60deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 26px);
    z-index: 1;
}

/* Hero slider */
.hero-swiper .swiper-slide .slide-anim > * { opacity: 0; transform: translateY(40px); transition: all .9s cubic-bezier(.2, .7, .2, 1); }
.hero-swiper .swiper-slide-active .slide-anim > * { opacity: 1; transform: none; }
.hero-swiper .swiper-slide-active .slide-anim > *:nth-child(2) { transition-delay: .15s; }
.hero-swiper .swiper-slide-active .slide-anim > *:nth-child(3) { transition-delay: .3s; }
.hero-swiper .swiper-slide-active .slide-anim > *:nth-child(4) { transition-delay: .45s; }
.hero-swiper .swiper-slide .slide-car { opacity: 0; transform: translateX(120px); transition: all 1.1s cubic-bezier(.2, .7, .2, 1) .3s; }
.hero-swiper .swiper-slide-active .slide-car { opacity: 1; transform: none; }
.hero-swiper .swiper-slide .slide-bg { transform: scale(1.12); transition: transform 7s ease-out; }
.hero-swiper .swiper-slide-active .slide-bg { transform: scale(1); }
.hero-swiper .swiper-pagination-bullet { width: 12px; height: 12px; background: #fff; opacity: .45; transition: all .3s; }
.hero-swiper .swiper-pagination-bullet-active { width: 34px; border-radius: 6px; background: var(--accent); opacity: 1; }
.hero-heading span, .section-title span { color: var(--accent); }

.testimonial-swiper .swiper-pagination-bullet-active, .brand-swiper .swiper-pagination-bullet-active { background: var(--accent); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
    .hero-swiper .swiper-slide .slide-anim > *, .hero-swiper .swiper-slide .slide-car { opacity: 1; transform: none; }
}

/* Service card bottom bar */
.svc-card::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 0;
    background: var(--accent);
    transition: width .45s ease;
}
.svc-card:hover::after { width: 100%; }

/* Brand roundel hover spin */
.brand-ring { transition: transform .8s ease; }
.group:hover .brand-ring { transform: rotate(180deg); }

/* FAQ accordion marker */
.faq-item[open] .faq-icon { transform: rotate(45deg); background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------------------
   Gallery filter: photos glide to their new place (same-page View Transition).
   html.vt-gallery is set only while the filter changes, so page navigation keeps its own effect.
--------------------------------------------------------------------------- */
html.vt-gallery::view-transition-old(root),
html.vt-gallery::view-transition-new(root) { animation: none; }
html.vt-gallery::view-transition-group(*) { animation-duration: .55s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
html.vt-gallery::view-transition-old(*),
html.vt-gallery::view-transition-new(*) { height: 100%; object-fit: cover; }
html.vt-gallery::view-transition-new(*):only-child { animation: vt-photo-in .5s cubic-bezier(.22, 1, .36, 1) both; }
html.vt-gallery::view-transition-old(*):only-child { animation: vt-photo-out .28s ease-in both; }
@keyframes vt-photo-in { from { opacity: 0; transform: scale(.92); } }
@keyframes vt-photo-out { to { opacity: 0; transform: scale(.92); } }

/* Fallback (browsers without View Transitions): fade the grid out, swap, fade back in with a stagger */
.gallery-grid { transition: opacity .2s ease, transform .2s ease; }
.gallery-grid.is-switching { opacity: 0; transform: translateY(8px); }
.gallery-grid .g-enter { animation: g-enter .45s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--n, 0) * 40ms); }
@keyframes g-enter { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* Before & After slider */
.ba-slider { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.ba-slider .ba-before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ba-slider .ba-handle { left: var(--pos, 50%); }
.ba-slider.is-animating .ba-before { transition: clip-path .6s cubic-bezier(.22, 1, .36, 1); }
.ba-slider.is-animating .ba-handle { transition: left .6s cubic-bezier(.22, 1, .36, 1); }

@media (prefers-reduced-motion: reduce) {
    .gallery-grid, .gallery-grid .g-enter { transition: none; animation: none; }
}

/* ---------------------------------------------------------------------------
   Arabic (RTL) mirrors of the decorative pieces above
--------------------------------------------------------------------------- */
[dir="rtl"] .topbar-social::before { inset: 0 0 0 -100vw; transform: skewX(28deg); transform-origin: bottom right; }
[dir="rtl"] .btn-angle { clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 70%); }
[dir="rtl"] .footer-title::after, [dir="rtl"] .widget-title::after { left: auto; right: 0; }
[dir="rtl"] .footer-title::before, [dir="rtl"] .widget-title::before { left: auto; right: 46px; }
[dir="rtl"] .cta-band::before { background: repeating-linear-gradient(55deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 22px); }
[dir="rtl"] .cta-band::after { right: auto; left: -60px; }
[dir="rtl"] .page-hero::before { background: linear-gradient(-100deg, color-mix(in oklab, var(--brand) 55%, black) 30%, color-mix(in oklab, var(--brand) 70%, transparent) 70%, transparent); }
[dir="rtl"] .page-hero .hero-stripe { right: auto; left: -10%; background: repeating-linear-gradient(60deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 26px); }
[dir="rtl"] .hero-swiper .swiper-slide .slide-car { transform: translateX(-120px); }
[dir="rtl"] .hero-swiper .swiper-slide-active .slide-car { transform: none; }
[dir="rtl"] .svc-card::after { left: auto; right: 0; }
