/* ============================================================
   DeLucio 360 — Styles
   ============================================================ */

/* Geomanist @font-face lives in delucio-360-fonts.css (enqueued as dl360-fonts). */

/* ── Plugin typography: one family for all copy & UI text ─── */
.dl360-wrapper,
.dl360-scroll-sync {
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
}

/* ── Wrapper & layout ─────────────────────────────────────── */
.dl360-wrapper {
    position: relative;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.dl360-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 4vw, 2.75rem);
}

/* --dl360-chart-scale: 1 = 100% (set inline from PHP / Elementor / shortcode) */
.dl360-chart-col {
    flex: 0 1 min(calc(520px * var(--dl360-chart-scale, 1)), calc(48% * var(--dl360-chart-scale, 1)));
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.dl360-detail-col {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 440px;
}

/* Stacked “slides” — same pulse keyframes / delays as node highlights.
   Grid overlap: row height follows the tallest item so long copy is not clipped. */
.dl360-detail-stack {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-items: start;
}

.dl360-detail-item {
    grid-area: 1 / 1;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    /* Must stay in sync with .dl360-node-inner::before — same name/duration/delay.
       Plateau width must stay < 100%/n (n=6) or multiple slides show at once. */
    animation: dl360-hl-pulse var(--pulse-dur, 8s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
    animation-fill-mode: both;
    text-align: left;
    align-self: start;
}

/* Detail column */
.dl360-detail-col {
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-weight: 400;
    text-align: left;
}

.dl360-detail-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0 0 0.85rem;
    padding: 0;
    text-align: left;
    font-weight: 400;
    line-height: 1.05;
    color: #000000;
    width: 100%;
}

/* Large numeral — above the heading, left-aligned */
.dl360-detail-num {
    display: block;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: clamp(47px, 8.1vw, 77px);
    font-weight: 200;
    line-height: 0.9;
    color: #000000;
}

/* Service name */
.dl360-detail-title-text {
    display: block;
    width: 100%;
    font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
    font-size: clamp(32px, 4.5vw, 46px);
    font-weight: 400;
    line-height: 1.15;
    color: #000000;
    letter-spacing: 0.01em;
    text-align: left;
}

.dl360-detail-desc {
    margin: 0;
    padding: 0;
    text-align: left;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: #000000;
}

.dl360-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Orbit rotation driven by scroll-sync JS (degrees, negative = CCW). */
    --dl360-orbit-rot: 0deg;
    --dl360-orbit-dur: 1.15s;
    --dl360-orbit-ease: cubic-bezier(0.16, 1, 0.25, 1);
}

/* Outer nodes rotate together; center hub stays fixed. */
.dl360-orbit {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: rotate(var(--dl360-orbit-rot, 0deg));
    transform-origin: 50% 50%;
    transition: transform var(--dl360-orbit-dur, 1.15s) var(--dl360-orbit-ease, cubic-bezier(0.16, 1, 0.25, 1));
    pointer-events: none;
}

.dl360-orbit .dl360-node {
    pointer-events: auto;
}

/* ── Center circle ──────────────────────────────────────────── */
.dl360-center {
    position: absolute;
    width: 28%;
    height: 28%;
    top:  36%;
    left: 36%;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(74, 112, 150, 0.38);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    overflow: visible;
}

/* Center hub: thin circular progress (pathLength=1 on circles) */
.dl360-center-progress-svg {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    pointer-events: none;
    z-index: 2;
    color: #4a7096;
}

.dl360-progress-bar {
    transition: stroke-dashoffset 0.75s cubic-bezier(0.16, 1, 0.25, 1);
}

/* Auto mode: fill ring once per cycle, repeat */
.dl360-container:not([data-dl360-scroll-chart]) .dl360-progress-bar {
    transition: none;
    animation: dl360-progress-loop var(--dl360-progress-dur, 12s) linear infinite;
}

@keyframes dl360-progress-loop {
    from { stroke-dashoffset: 1; }
    to { stroke-dashoffset: 0; }
}

/* Custom logo image inside center */
.dl360-logo-img {
    /* Padding clears the progress ring */
    padding: 24%;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    min-width: 0;
    min-height: 0;
    overflow: visible;
}

.dl360-logo-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    display: block;
    position: relative;
    z-index: 3;
}

/* Text logo inside center */
.dl360-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    z-index: 3;
    pointer-events: none;
    user-select: none;
}

.dl360-logo-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dl360-logo-dot {
    display: inline-block;
    width: 12%;         /* relative to center circle */
    height: 12%;
    min-width: 8px;
    min-height: 8px;
    max-width: 14px;
    max-height: 14px;
    border-radius: 50%;
    background: #1c3f5e;
    flex-shrink: 0;
}

.dl360-logo-brand {
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: clamp(7px, 1.4vw, 13px);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #1c3f5e;
    white-space: nowrap;
}

.dl360-logo-sub {
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: clamp(9px, 1.8vw, 17px);
    font-weight: 400;
    color: #4a7096;
    letter-spacing: 0.04em;
}

/* ── Outer nodes ────────────────────────────────────────────── */
.dl360-node {
    position: absolute;
    width: 22%;
    height: 22%;
    cursor: pointer;
    z-index: 2;
}

/* Clockwise positions (6 nodes, 60° apart); orbit radius 70% of prior (~36% → hub) */
.dl360-node-1 { left: 39%;    top: 13.8%; }
.dl360-node-2 { left: 60.84%; top: 26.4%; }
.dl360-node-3 { left: 60.84%; top: 51.6%; }
.dl360-node-4 { left: 39%;    top: 64.2%; }
.dl360-node-5 { left: 17.16%; top: 51.6%; }
.dl360-node-6 { left: 17.16%; top: 26.4%; }

/* Outer ring shell — no visible “donut” border (flat disc) */
.dl360-node-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    border: none;
    transition: none;
}

/* Inner disc — transparent; timed highlight uses ::before overlay only.
   Do not use overflow:hidden here: with orbit + counter-rotate, thin strokes were clipped
   at 12/6 o'clock (circular mask + subpixels). Highlight stays round via ::before border-radius. */
.dl360-node-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;   /* required so ::before is positioned within this circle */
    overflow: visible;
    box-sizing: border-box;
}

/* Highlight overlay — ONLY opacity is animated (100% browser-safe).
   The colour comes from --hl-color set as an inline style on .dl360-container,
   which CSS inheritance passes down to this pseudo-element automatically.
   Because we never animate background, the ring colour can never bleed through. */
.dl360-node-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--hl-color, #c5d9e8);
    opacity: 0;
    animation: dl360-hl-pulse var(--pulse-dur, 8s) ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
    animation-fill-mode: both;
    pointer-events: none;
    z-index: 0;
}

/* Narrow peak (< ~16.7% width) so six staggered nodes never stack. Curve starts
   early in the cycle so the first highlight + detail text appear soon after load. */
@keyframes dl360-hl-pulse {
    0%,  2% { opacity: 0; }
    5%,  11% { opacity: 1; }
    14%, 100% { opacity: 0; }
}

/* Icon — sits above the ::before highlight overlay via z-index.
   Scale + counter-rotate on one layer (no nested transforms) for sharp motion; --dl360-icon-scale from each .dl360-node. */
.dl360-icon {
    width: 69.6%;
    height: 69.6%;
    color: #4a7096;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    min-width: 0;
    min-height: 0;
    transform: scale(var(--dl360-icon-scale, 1)) rotate(calc(-1 * var(--dl360-orbit-rot, 0deg)));
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform var(--dl360-orbit-dur, 1.15s) var(--dl360-orbit-ease, cubic-bezier(0.16, 1, 0.25, 1));
}

.dl360-icon svg {
    overflow: visible;
}

.dl360-icon svg.dl360-node-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    flex-shrink: 0;
    shape-rendering: geometricPrecision;
}

/* Custom node images: sharp raster (no filter — filters blur during orbit). */
.dl360-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center center;
    display: block;
    flex-shrink: 0;
}

/* Custom photos only: no eased transform (avoids soft stepping), no dimming, no pulse wash. */
.dl360-node--raster .dl360-node-inner::before {
    display: none;
}

.dl360-icon--raster {
    transition: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

.dl360-icon--raster img {
    filter: none;
    opacity: 1;
    mix-blend-mode: normal;
}

.dl360-node:focus {
    outline: none;
}

.dl360-node:focus-visible .dl360-node-inner {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 112, 150, 0.45);
}

/* Full-screen popup only on small screens (wide layouts use the side column) */
@media (min-width: 768px) {
    .dl360-overlay {
        display: none !important;
    }
}

/* ── Popup overlay ──────────────────────────────────────────── */
.dl360-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 40, 60, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dl360-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Popup box */
.dl360-popup {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 36px 36px;
    max-width: 420px;
    width: 90%;
    position: relative;
    text-align: center;
    transform: translateY(18px) scale(0.96);
    transition: transform 0.25s ease;
}

.dl360-overlay.is-open .dl360-popup {
    transform: translateY(0) scale(1);
}

/* Close button */
.dl360-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #7a9ab5;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.dl360-close:hover {
    color: #1c3f5e;
}

/* Popup icon — light tinted background, original icon colour */
.dl360-popup-icon-wrap {
    width: 72px;
    height: 72px;
    background: rgba(74, 112, 150, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: #4a7096;
}

.dl360-popup-icon-wrap svg.dl360-node-svg {
    width: 50px;
    height: 50px;
    transform-origin: center center;
    overflow: visible;
    shape-rendering: geometricPrecision;
}

.dl360-popup-icon-wrap .dl360-node-svg--planning { transform: scale(0.74); }
.dl360-popup-icon-wrap .dl360-node-svg--budget { transform: scale(0.78); }
.dl360-popup-icon-wrap .dl360-node-svg--documentation { transform: scale(0.82); }
.dl360-popup-icon-wrap .dl360-node-svg--safety { transform: scale(0.84); }
.dl360-popup-icon-wrap .dl360-node-svg--management { transform: scale(0.9); }
.dl360-popup-icon-wrap .dl360-node-svg--quality { transform: scale(0.93); }

.dl360-popup-icon-wrap img {
    width: 50px;
    height: 50px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Popup text */
.dl360-popup-title {
    margin: 0 0 12px;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1c3f5e;
}

.dl360-popup-desc {
    margin: 0;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #4a6070;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .dl360-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .dl360-chart-col {
        flex: 1 1 auto;
        max-width: min(520px, 100%);
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    .dl360-detail-col {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .dl360-detail-stack {
        max-width: 36rem;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .dl360-wrapper {
        max-width: 100%;
    }
    .dl360-popup {
        padding: 32px 24px 28px;
    }
}

/* ── Scroll-sync layout ([delucio_360_scroll]) ───────────────── */
.dl360-wrapper.dl360-wrapper--scroll-chart {
    max-width: none;
    margin: 0;
    width: 100%;
}

.dl360-scroll-sync {
    width: 100%;
    max-width: 1180px;
    margin-inline: auto;
    /* Active step sits at 12 o’clock: blue SVG + full-colour photo. Other five: black. */
    --dl360-scroll-node-icon-active: #2a5070;
    --dl360-scroll-node-icon-inactive: #000000;
    /* Multiplier on --dl360-icon-scale when the node is the active (top) step. */
    --dl360-scroll-active-icon-boost: 1.35;
    /* Inactive nodes: 15% smaller than base (0.85×). */
    --dl360-scroll-inactive-icon-boost: 0.85;
}

.dl360-scroll-sync__inner {
    display: grid;
    grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(1.25rem, 3.5vw, 2.75rem);
    align-items: start;
}

.dl360-scroll-sync__chart {
    position: sticky;
    top: clamp(0.5rem, 3vw, 4.5rem);
    align-self: start;
}

.dl360-scroll-sync .dl360-chart-col {
    flex: none;
    width: 100%;
    max-width: min(520px, 100%);
    margin-inline: auto;
}

/* Until the user scrolls: no orbit motion (avoids “auto rotate” on load / IO / resize). */
.dl360-scroll-sync[data-dl360-scroll-armed="0"] .dl360-container {
    transition: none !important;
}

.dl360-scroll-sync[data-dl360-scroll-armed="0"] .dl360-orbit {
    transition: none !important;
}

.dl360-scroll-sync[data-dl360-scroll-armed="0"] .dl360-icon {
    transition: none !important;
}

/* Hub: full faint CSS border = track; blue SVG stroke on top = progress (real circumference dashes, no pathLength). */
.dl360-scroll-sync .dl360-center {
    background: transparent !important;
    border: 2px solid rgba(74, 112, 150, 0.22);
    box-sizing: border-box;
    box-shadow: none !important;
    overflow: visible;
}

.dl360-scroll-sync .dl360-scroll-hub-ring {
    position: absolute;
    inset: -5%;
    width: 110%;
    height: 110%;
    pointer-events: none;
    /* Below the logo so the hub arc/arrow cannot cover the image. */
    z-index: 4;
    color: var(--dl360-scroll-hub-fill, #4a7096);
    transform: translateZ(0);
    shape-rendering: geometricPrecision;
    overflow: visible;
}

.dl360-scroll-sync .dl360-scroll-hub-arc {
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: butt;
    /* Dash offset driven by JS (eased rAF) together with the arrow group. */
    transition: none;
}

.dl360-scroll-sync[data-dl360-scroll-armed="0"] .dl360-scroll-hub-arc {
    transition: none !important;
}

.dl360-scroll-sync .dl360-scroll-hub-arrow-g {
    pointer-events: none;
}

.dl360-scroll-sync .dl360-scroll-hub-arrow-path {
    fill: var(--dl360-scroll-hub-fill, #4a7096);
    stroke: none;
}

/* Logo paints above hub SVG (arc + arrow) so the asset is never occluded. */
.dl360-scroll-sync .dl360-center .dl360-logo-img,
.dl360-scroll-sync .dl360-center .dl360-logo {
    position: relative;
    z-index: 9;
    background: transparent;
}

/* Scroll layout: orbit brings the current step to top — that node is blue / full photo; the other five are black. */
.dl360-scroll-sync .dl360-node-inner {
    overflow: visible;
}

.dl360-scroll-sync .dl360-node-inner::before {
    display: none;
}

.dl360-scroll-sync .dl360-node:not(.is-dl360-active) .dl360-icon {
    transform: scale(
            calc(var(--dl360-icon-scale, 1) * var(--dl360-scroll-inactive-icon-boost, 0.85))
        )
        rotate(calc(-1 * var(--dl360-orbit-rot, 0deg)));
}

.dl360-scroll-sync .dl360-node.is-dl360-active .dl360-icon {
    transform: scale(
            calc(var(--dl360-icon-scale, 1) * var(--dl360-scroll-active-icon-boost, 1.35))
        )
        rotate(calc(-1 * var(--dl360-orbit-rot, 0deg)));
}

.dl360-scroll-sync .dl360-node:not(.is-dl360-active) .dl360-icon,
.dl360-scroll-sync .dl360-node.is-dl360-active .dl360-icon {
    transition:
        transform var(--dl360-orbit-dur, 1.15s) var(--dl360-orbit-ease, cubic-bezier(0.16, 1, 0.25, 1)),
        color 0.35s ease,
        filter 0.35s ease;
}

.dl360-scroll-sync .dl360-icon:not(.dl360-icon--raster) {
    opacity: 1;
    color: var(--dl360-scroll-node-icon-inactive, #000000);
}

.dl360-scroll-sync .dl360-icon--raster {
    opacity: 1;
}

.dl360-scroll-sync .dl360-node:not(.is-dl360-active) .dl360-icon--raster img {
    filter: brightness(0);
    transition: filter 0.35s ease;
}

.dl360-scroll-sync .dl360-node.is-dl360-active .dl360-icon--raster img {
    filter: none;
    transition: filter 0.35s ease;
}

.dl360-scroll-sync .dl360-node.is-dl360-active .dl360-icon:not(.dl360-icon--raster) {
    color: var(--dl360-scroll-node-icon-active, #2a5070);
}

.dl360-scroll-sync__text {
    min-width: 0;
    /* Minimal runway so step 6 can scroll past the ~41vh reading line (node 6 sync); keep as small as possible. */
    padding-bottom: clamp(2rem, 16vh, 7.5rem);
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-weight: 400;
    color: #000000;
}

.dl360-scroll-step {
    padding-block: clamp(1.75rem, 6vh, 4rem);
    scroll-margin-top: clamp(4rem, 12vh, 7rem);
}

.dl360-scroll-step__num {
    display: block;
    margin: 0 0 0.35rem;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    /* Column 2 step numerals (~10% under prior clamp) */
    font-size: clamp(31px, 5.31vw, 56px);
    font-weight: 200;
    line-height: 0.95;
    color: #000000;
    opacity: 0.35;
    transition: opacity 0.35s ease;
}

.dl360-scroll-step.is-dl360-active .dl360-scroll-step__num {
    opacity: 1;
}

.dl360-scroll-step__title {
    margin: 0 0 1rem;
    font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
    font-size: clamp(28px, 3.8vw, 42px);
    font-weight: 400;
    line-height: 1.15;
    color: #000000;
    letter-spacing: 0.01em;
}

.dl360-scroll-step__body p {
    margin: 0 0 1rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.65;
    color: #000000;
}

.dl360-scroll-step__body p:last-child {
    margin-bottom: 0;
}

.dl360-scroll-after {
    margin: clamp(2rem, 6vh, 4rem) 0 1rem;
    padding: 0;
    border: none;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
    font-size: clamp(22px, 2.8vw, 30px);
    line-height: 1.35;
    color: #000000;
}

.dl360-scroll-after cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 1rem;
    font-style: normal;
    font-family: "Geomanist", geomanist, system-ui, sans-serif;
}

.dl360-scroll-after--note {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

@media (max-width: 767px) {
    .dl360-scroll-sync__inner {
        grid-template-columns: 1fr;
    }

    .dl360-scroll-sync__chart {
        position: relative;
        top: auto;
        margin-bottom: 0.5rem;
    }
}
