/* =====================================================================
   Strategic Advantages: two matching panels (homepage #strategic-advantages.sa)
   Left: the advantage cards (home-premium.css). Right: the NASR Ecosystem map
   (responsive.css). This file gives the left column the same panel as the map,
   makes both the same height, adds a gold light circling both borders, swaps the
   map's emoji for gold line icons and lights the map pillars in turn.
   Behaviour: assets/js/advantages-showcase.js
   ===================================================================== */

@property --sa-a {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

/* ---------- Shared panel (copied from the map so both match exactly) ---------- */
#strategic-advantages.sa .sa-panel {
    position: relative;
    isolation: isolate;
    border-radius: 28px;
    border: 1px solid rgba(197, 160, 57, 0.22);
    background:
        radial-gradient(420px 260px at 50% 50%, rgba(197, 160, 57, 0.12), transparent 70%),
        radial-gradient(500px 300px at 0% 0%, rgba(197, 160, 57, 0.10), transparent 70%),
        radial-gradient(500px 300px at 100% 100%, rgba(15, 23, 42, 0.06), transparent 70%),
        linear-gradient(160deg, #FCFAF6 0%, #F5F1E8 55%, #F1EDE4 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 30px 60px -40px rgba(15, 23, 42, 0.35);
    transition: box-shadow 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
#strategic-advantages.sa .sa-panel:hover {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 36px 70px -40px rgba(15, 23, 42, 0.45), 0 0 0 4px rgba(197, 160, 57, 0.07);
}
html.dark-mode #strategic-advantages.sa .sa-panel {
    border-color: rgba(197, 160, 57, 0.22);
    background:
        radial-gradient(420px 260px at 50% 50%, rgba(197, 160, 57, 0.12), transparent 70%),
        radial-gradient(500px 300px at 0% 0%, rgba(59, 130, 246, 0.12), transparent 70%),
        radial-gradient(500px 300px at 100% 100%, rgba(197, 160, 57, 0.08), transparent 70%),
        linear-gradient(160deg, #0E192D 0%, #0A1324 60%, #080F1C 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 60px -40px rgba(0, 0, 0, 0.8);
}

/* Lattice pattern + gold corner arcs on the list panel too (the map already has them) */
#strategic-advantages.sa .sa-panel--list::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M24 0L48 24L24 48L0 24Z' fill='none' stroke='%23C5A039' stroke-opacity='0.16' stroke-width='0.8'/%3E%3C/svg%3E");
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
    mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
}
#strategic-advantages.sa .sa-panel--list::after {
    content: '';
    position: absolute;
    inset: 14px;
    z-index: -1;
    pointer-events: none;
    border-radius: 20px;
    background:
        radial-gradient(circle at 0 0, transparent 46px, rgba(197, 160, 57, 0.35) 47px, transparent 48px) top left / 60px 60px no-repeat,
        radial-gradient(circle at 100% 100%, transparent 46px, rgba(197, 160, 57, 0.35) 47px, transparent 48px) bottom right / 60px 60px no-repeat;
}

/* Gold light travelling round both borders (the two run half a turn apart) */
#strategic-advantages .sa-ring {
    position: absolute;
    inset: -1px;
    z-index: 6;
    pointer-events: none;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(from var(--sa-a), transparent 0deg 250deg, rgba(197, 160, 57, 0.85) 300deg, #FFF3C4 325deg, rgba(197, 160, 57, 0.85) 345deg, transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: sa-spin 7s linear infinite;
}
#strategic-advantages .sa-panel--map .sa-ring { animation-delay: -3.5s; }
@keyframes sa-spin { to { --sa-a: 360deg; } }

/* ---------- Equal heights side by side ---------- */
@media (min-width: 768px) {
    #strategic-advantages.sa .grid.grid-2 { align-items: stretch !important; gap: 1.75rem; }
    #strategic-advantages.sa .services-3d-map.eco-map.sa-panel--map {
        aspect-ratio: auto;
        height: auto;
        min-height: 470px;
        align-self: stretch;
    }
}

/* ---------- List panel content ---------- */
#strategic-advantages.sa .sa-panel--list {
    display: flex;
    flex-direction: column;
    padding: 1.9rem 1.8rem 1.8rem;
}
#strategic-advantages .sa-eyebrow,
#strategic-advantages .sa-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: max-content;
    max-width: 100%;
    padding: 0.38rem 0.9rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #8A6A1C;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(197, 160, 57, 0.35);
    box-shadow: 0 6px 16px -10px rgba(197, 160, 57, 0.8);
}
html.dark-mode #strategic-advantages .sa-eyebrow,
html.dark-mode #strategic-advantages .sa-caption {
    color: #E7CF86;
    background: rgba(255, 255, 255, 0.05);
}
#strategic-advantages .sa-spark {
    width: 10px;
    height: 10px;
    background: #C9A438;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: sa-twinkle 2.4s ease-in-out infinite;
}
@keyframes sa-twinkle { 0%, 100% { transform: scale(0.8) rotate(0); opacity: 0.7; } 50% { transform: scale(1.25) rotate(90deg); opacity: 1; } }

#strategic-advantages.sa .sa-panel--list .section-title {
    margin: 0.85rem 0 0 !important;
    text-align: left;
}
#strategic-advantages.sa .sa-panel--list .section-title::after {
    left: 0;
    width: 72px;
    bottom: -6px;
}
#strategic-advantages .sa-sub {
    margin: 1.05rem 0 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--adv-text, #475569);
    max-width: 46ch;
}
#strategic-advantages.sa .sa-panel--list .benefits-list.adv-cards { margin-top: 1.3rem; flex: 1; align-content: space-between; }
#strategic-advantages.sa .benefits-list li.adv-card {
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
html.dark-mode #strategic-advantages.sa .benefits-list li.adv-card { background: rgba(18, 29, 51, 0.78); }

/* ---------- Map: caption ---------- */
#strategic-advantages .sa-caption {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 4;
    transform: translateX(-50%);
    font-size: 0.64rem;
    white-space: nowrap;
}
#strategic-advantages .sa-dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C9A438;
}
#strategic-advantages .sa-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #C9A438;
    animation: sa-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes sa-ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.9); opacity: 0; } }

/* ---------- Map: gold line icons in place of emoji ---------- */
#strategic-advantages .sa-ico {
    width: 58%;
    height: 58%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}
#strategic-advantages .eco-map .service-node .node-icon { color: #E9D39A; text-shadow: none; }
#strategic-advantages .eco-map .core-node .node-icon { color: #9A7522; text-shadow: none; }
html.dark-mode body.dark-mode #strategic-advantages .eco-map .service-node .node-icon { color: #E9D39A; }
html.dark-mode body.dark-mode #strategic-advantages .eco-map .core-node .node-icon { color: #9A7522; }

/* ---------- Map: lit pillar (auto cycle, hover or focus) ---------- */
#strategic-advantages .eco-map .service-node.sa-lit {
    transform: translateY(-6px);
    border-color: rgba(233, 211, 154, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 26px 44px -18px rgba(11, 20, 36, 0.6),
        0 0 0 4px rgba(197, 160, 57, 0.16),
        0 0 40px -4px rgba(197, 160, 57, 0.6);
}
#strategic-advantages .eco-map .service-node .node-icon { position: relative; }
#strategic-advantages .eco-map .service-node .node-icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid rgba(233, 211, 154, 0.7);
    opacity: 0;
    pointer-events: none;
}
#strategic-advantages .eco-map .service-node.sa-lit .node-icon { transform: translateY(-2px) scale(1.08); }
#strategic-advantages .eco-map .service-node.sa-lit .node-icon::after { animation: sa-ring-out 1.6s ease-out infinite; }
@keyframes sa-ring-out { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
#strategic-advantages .eco-map .service-node.sa-lit .node-label { color: #F3D98B; }

/* the connector to the lit pillar glows */
#strategic-advantages .eco-map .eco-line { transition: stroke-width 0.4s ease, filter 0.4s ease; }
#strategic-advantages .eco-map .eco-line.sa-hot { stroke-width: 3; filter: drop-shadow(0 0 5px rgba(197, 160, 57, 0.9)); }
#strategic-advantages .eco-map .eco-flow.sa-hot { stroke-width: 4.5; opacity: 1; animation-duration: 1.2s; }

/* small icon animations when a pillar lights up */
#strategic-advantages .sa-bar { transform-box: fill-box; transform-origin: bottom; }
#strategic-advantages .sa-lit .sa-bar--1 { animation: sa-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
#strategic-advantages .sa-lit .sa-bar--2 { animation: sa-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards; }
#strategic-advantages .sa-lit .sa-bar--3 { animation: sa-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards; }
@keyframes sa-grow { from { transform: scaleY(0.15); } to { transform: scaleY(1); } }
#strategic-advantages .sa-tick { stroke-dasharray: 12; }
#strategic-advantages .sa-lit .sa-tick { animation: sa-draw 0.8s ease 0.1s backwards; }
@keyframes sa-draw { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
#strategic-advantages .sa-lit .sa-coin { transform-box: fill-box; transform-origin: center; animation: sa-flip 1s ease; }
@keyframes sa-flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0.2); } 100% { transform: scaleX(1); } }
#strategic-advantages .sa-lit .sa-tag { transform-origin: 30% 30%; animation: sa-swing 1s ease; }
@keyframes sa-swing { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-14deg); } 65% { transform: rotate(8deg); } }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
    #strategic-advantages.sa .grid.grid-2 { gap: 1.25rem; }
    #strategic-advantages.sa .sa-panel--list { padding: 1.4rem 1.05rem 1.2rem; border-radius: 22px; }
    #strategic-advantages.sa .sa-panel { border-radius: 22px; }
    #strategic-advantages .sa-eyebrow { font-size: 0.62rem; letter-spacing: 0.09em; }
    #strategic-advantages .sa-sub { font-size: 0.92rem; }
    #strategic-advantages .sa-caption { bottom: 10px; font-size: 0.58rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    #strategic-advantages .sa-ring,
    #strategic-advantages .sa-spark,
    #strategic-advantages .sa-dot::after { animation: none; }
    #strategic-advantages .sa-ring { opacity: 0.5; }
}

/* ---------- Dark mode colour restore ----------
   style.css forces every span in dark mode to grey with !important (weight 0,5,2),
   which hid the map's centre icon (grey on white). ":not(#sa-x)" only adds weight. */
html.dark-mode #strategic-advantages .sa-eyebrow:not(#sa-x),
html.dark-mode #strategic-advantages .sa-caption:not(#sa-x) { color: #E7CF86 !important; }
html.dark-mode #strategic-advantages .eco-map .service-node .node-icon:not(#sa-x) { color: #E9D39A !important; }
html.dark-mode #strategic-advantages .eco-map .core-node .node-icon:not(#sa-x) { color: #9A7522 !important; }
html.dark-mode #strategic-advantages .eco-map .service-node.sa-lit .node-label:not(#sa-x) { color: #F3D98B !important; }
