/* Global Perspective Section */

/* 
 * POINTER-EVENTS SOLUTION FOR PIXEL-PERFECT CURSOR BEHAVIOR
 * ========================================================
 * 
 * Problem: Previously, SVGs were loaded as <img> tags, causing cursor:pointer
 * to appear over entire rectangular bounding boxes, including transparent areas.
 * 
 * Solution: Inline SVGs with pointer-events control
 * 1. SVG files are loaded via PHP file_get_contents() and output inline
 * 2. Container divs have pointer-events:none (don't capture mouse events)
 * 3. SVG elements themselves have pointer-events:none 
 * 4. Individual <path> elements inside SVGs have pointer-events:auto and cursor:pointer
 *    (applied via inline style in PHP template)
 * 
 * Result: cursor:pointer appears ONLY when hovering over visible/painted pixels
 * of the SVG shapes (pie slices), not over transparent rectangular bounds.
 * 
 * Browser support: Excellent - pointer-events on SVG is supported in all modern browsers
 * (Chrome, Firefox, Safari, Edge). No fallback needed.
 * 
 * Tooltip behavior: Unchanged - .hover-segment divs still handle tooltip display
 * via existing JavaScript event listeners (mouseenter, click, touch).
 */

.global-perspective-section {
    width: 100%;
    padding: 0 120px;
}

.global-perspective-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.global-perspective-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* Text Content */
.global-perspective-text {
    flex: 1 0 450px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.global-perspective-title {
    font-family: 'IvyOra Display', serif;
    font-weight: 500;
    font-style: italic;
    font-size: 32px;
    line-height: normal;
    color: #005b68;
    margin: 0;
}

.global-perspective-title strong {
    font-weight: 700;
    font-style: normal;
}

.global-perspective-title em {
    font-weight: 500;
    font-style: italic;
}

.global-perspective-intro,
.global-perspective-expandable {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: normal;
    color: #403936;
}

.global-perspective-intro p,
.global-perspective-expandable p {
    margin: 0 0 16px 0;
}

.global-perspective-list,
.pillars-list {
    list-style: disc;
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.global-perspective-list li,
.pillars-list li {
    margin-bottom: 8px;
}

.global-perspective-list li:last-child,
.pillars-list li:last-child {
    margin-bottom: 0;
}

.global-perspective-list strong,
.pillars-list strong {
    font-weight: 700;
}

.pillars-title {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: normal;
    color: #403936;
    margin: 0;
}

.pillars-title p {
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: normal;
    color: #403936;
}

.global-perspective-expandable {
    display: none;
}

.global-perspective-expandable.expanded {
    display: block;
}

.read-more-link {
    color: #ed6a59;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: normal;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
}

.read-more-link:hover {
    text-decoration: underline;
}

/* Visible toggle placed before expandable content */
.read-more-toggle {
    display: inline-block;
    color: #ed6a59;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: normal;
    text-decoration: none;
    margin-top: 8px;
}

.read-more-toggle:hover {
    text-decoration: underline;
}

/* Circular Diagram Container */
.global-perspective-diagram {
    flex-shrink: 0;
    width: 514px;
    height: 610px;
    position: relative;
}

.circular-diagram {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 
 * OUTER RING LAYERS
 * Container: 610.214px x 610.214px positioned at left: -96.57px, top: 0
 * The inner div is rotated 90deg
 * Each SVG is positioned within using pixel offsets calculated from percentages
 *
 * NOTE: SVGs are now inlined for pixel-perfect pointer-events
 * The .svg-inline-wrapper maintains positioning, while <path> elements inside
 * have pointer-events:auto for cursor:pointer only over visible pixels
 */
.outer-ring-layer {
    position: absolute;
    left: -96.57px;
    top: 0;
    width: 610.214px;
    height: 610.214px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* SVG inline wrapper - inherits rotation and positioning */
.outer-ring-layer .svg-inline-wrapper {
    width: 610.214px;
    height: 610.214px;
    position: relative;
    transform: rotate(90deg);
    pointer-events: none;
    /* Container doesn't capture events */
}

/* Inline SVG elements maintain absolute positioning */
.outer-ring-layer svg {
    position: absolute;
    display: block;
    pointer-events: none;
    /* SVG element itself doesn't capture */
}

/* SVG paths have pointer-events enabled via inline style */
/* This is set in PHP: style="pointer-events:auto; cursor:pointer;" */
/* Paths will show cursor:pointer only over visible pixels */

.outer-ring-layer img {
    position: absolute;
    display: block;
}

/* Calculate pixel positions from percentages for 610.214px container */
/* Segment 1: inset 52.8% 68.45% 16.27% 0.31% */
.outer-ring-1 svg,
.outer-ring-1 img {
    top: 322.19px;
    /* 52.8% of 610.214 */
    left: 1.89px;
    /* 0.31% of 610.214 */
    right: 417.69px;
    /* 68.45% of 610.214 */
    bottom: 99.28px;
    /* 16.27% of 610.214 */
    width: calc(100% - 1.89px - 417.69px);
    height: calc(100% - 322.19px - 99.28px);
}

/* Segment 2: inset 24.49% 71.5% 45.36% 0 */
.outer-ring-2 svg,
.outer-ring-2 img {
    top: 149.44px;
    left: 0;
    right: 436.3px;
    bottom: 276.79px;
    width: calc(100% - 0px - 436.3px);
    height: calc(100% - 149.44px - 276.79px);
}

/* Segment 3: inset 3.32% 58.95% 63.62% 8.08% */
.outer-ring-3 svg,
.outer-ring-3 img {
    top: 20.26px;
    left: 49.31px;
    right: 359.72px;
    bottom: 388.22px;
    width: calc(100% - 49.31px - 359.72px);
    height: calc(100% - 20.26px - 388.22px);
}

/* Segment 4: inset 0 34.41% 73.75% 34.69% */
.outer-ring-4 svg,
.outer-ring-4 img {
    top: 0;
    left: 211.7px;
    right: 210px;
    bottom: 450.03px;
    width: calc(100% - 211.7px - 210px);
    height: calc(100% - 0px - 450.03px);
}

/* Segment 5: inset 3.25% 8.17% 63.7% 58.87% */
.outer-ring-5 svg,
.outer-ring-5 img {
    top: 19.83px;
    left: 359.23px;
    right: 49.85px;
    bottom: 388.71px;
    width: calc(100% - 359.23px - 49.85px);
    height: calc(100% - 19.83px - 388.71px);
}

/* Segment 6: inset 24.33% 0 45.55% 71.45% */
.outer-ring-6 svg,
.outer-ring-6 img {
    top: 148.47px;
    left: 436px;
    right: 0;
    bottom: 277.95px;
    width: calc(100% - 436px - 0px);
    height: calc(100% - 148.47px - 277.95px);
}

/* Segment 7: inset 52.81% 0.32% 16.25% 68.45% */
.outer-ring-7 svg,
.outer-ring-7 img {
    top: 322.25px;
    left: 417.69px;
    right: 1.95px;
    bottom: 99.16px;
    width: calc(100% - 417.69px - 1.95px);
    height: calc(100% - 322.25px - 99.16px);
}

/* 
 * INNER RING LAYERS
 * Container: 281.029px x 281.029px positioned at left: 68.02px, top: 164.59px
 * The inner div is rotated 90deg
 *
 * NOTE: SVGs are now inlined for pixel-perfect pointer-events
 */
.inner-ring-layer {
    position: absolute;
    left: 68.02px;
    top: 164.59px;
    width: 281.029px;
    height: 281.029px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.inner-ring-layer .svg-inline-wrapper {
    width: 281.029px;
    height: 281.029px;
    position: relative;
    transform: rotate(90deg);
    pointer-events: none;
}

.inner-ring-layer svg {
    position: absolute;
    display: block;
    pointer-events: none;
}

.inner-ring-layer img {
    position: absolute;
    display: block;
}

/* Calculate pixel positions from percentages for 281.029px container */
/* Inner Segment 1: inset 53.36% 72.14% 16.27% 0.31% */
.inner-ring-1 svg,
.inner-ring-1 img {
    top: 149.95px;
    left: 0.87px;
    right: 202.71px;
    bottom: 45.72px;
    width: calc(100% - 0.87px - 202.71px);
    height: calc(100% - 149.95px - 45.72px);
}

/* Inner Segment 2: inset 24.49% 75.8% 45.36% 0 */
.inner-ring-2 svg,
.inner-ring-2 img {
    top: 68.82px;
    left: 0;
    right: 213.02px;
    bottom: 127.47px;
    width: calc(100% - 0px - 213.02px);
    height: calc(100% - 68.82px - 127.47px);
}

/* Inner Segment 3: inset 3.32% 60.74% 66.35% 8.08% */
.inner-ring-3 svg,
.inner-ring-3 img {
    top: 9.33px;
    left: 22.71px;
    right: 170.69px;
    bottom: 186.45px;
    width: calc(100% - 22.71px - 170.69px);
    height: calc(100% - 9.33px - 186.45px);
}

/* Inner Segment 4: inset 0 34.41% 78.5% 34.69% */
.inner-ring-4 svg,
.inner-ring-4 img {
    top: 0;
    left: 97.5px;
    right: 96.71px;
    bottom: 220.61px;
    width: calc(100% - 97.5px - 96.71px);
    height: calc(100% - 0px - 220.61px);
}

/* Inner Segment 5: inset 3.25% 8.17% 66.44% 60.64% */
.inner-ring-5 svg,
.inner-ring-5 img {
    top: 9.13px;
    left: 170.4px;
    right: 22.96px;
    bottom: 186.7px;
    width: calc(100% - 170.4px - 22.96px);
    height: calc(100% - 9.13px - 186.7px);
}

/* Inner Segment 6: inset 24.33% 0 45.55% 75.74% */
.inner-ring-6 svg,
.inner-ring-6 img {
    top: 68.37px;
    left: 212.85px;
    right: 0;
    bottom: 128px;
    width: calc(100% - 212.85px - 0px);
    height: calc(100% - 68.37px - 128px);
}

/* Inner Segment 7: inset 53.37% 0.32% 16.25% 72.14% */
.inner-ring-7 svg,
.inner-ring-7 img {
    top: 149.98px;
    left: 202.71px;
    right: 0.9px;
    bottom: 45.67px;
    width: calc(100% - 202.71px - 0.9px);
    height: calc(100% - 149.98px - 45.67px);
}

/* Text Labels - Positioned around the circle */
.segment-label {
    position: absolute;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 15.812px;
    line-height: normal;
    color: #403936;
    pointer-events: none;
}

.label-1 {
    left: 63.35px;
    top: 66.84px;
    width: 114.28px;
}

.label-2 {
    left: 199.19px;
    top: 46px;
    width: 122.905px;
}

.label-3 {
    left: 338.63px;
    top: 131.53px;
    width: 103.499px;
}

.label-4 {
    left: 402.59px;
    top: 274.2px;
    width: 70.437px;
}

.label-5 {
    left: 334.31px;
    top: 412.56px;
    width: 105.655px;
}

.label-6 {
    left: 215px;
    top: 501.68px;
    width: 103.499px;
}

.label-7 {
    left: 67.66px;
    top: 480.84px;
    width: 106.374px;
}

/* Number Labels - Positioned in inner circle */
.segment-number {
    position: absolute;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 24.899px;
    line-height: normal;
    color: #fdf5f1;
    pointer-events: none;
}

.number-1 {
    left: 155.35px;
    top: 188.31px;
}

.number-2 {
    left: 226.5px;
    top: 179.69px;
}

.number-3 {
    left: 287.96px;
    top: 218.5px;
}

.number-4 {
    left: 310.23px;
    top: 287.5px;
}

.number-5 {
    left: 287.6px;
    top: 360.81px;
}

.number-6 {
    left: 222.91px;
    top: 396.75px;
}

.number-7 {
    left: 155.35px;
    top: 390.28px;
}

/* Center Text */
.diagram-center-text {
    position: absolute;
    left: 77px;
    top: 265.22px;
    width: 198.374px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 20.52px;
    line-height: normal;
    color: #403936;
    text-align: left;
    pointer-events: none;
    z-index: 10;
}

/* Interactive Hover Segments */
/* Interactive hover areas - positioned over segments to display tooltips */
/* Note: Tooltips are triggered by SVG path hover (via JS), not by hovering these divs */
/* These divs remain for tooltip positioning and click/touch accessibility */
.hover-segment {
    position: absolute;
    cursor: default;
    /* Changed from pointer - cursor comes from SVG paths */
    z-index: 20;
    pointer-events: none;
    /* Don't interfere with SVG path hover detection */
}

/* Tooltips */
.segment-tooltip {
    display: none;
    position: absolute;
    background: #ffffff;
    border: 1px solid #005b68;
    border-radius: 20px;
    padding: 16px;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 280px;
    max-width: 350px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* Show tooltip when a segment has the `open` class (triggered by SVG path hover via JS) */
.hover-segment.open .segment-tooltip {
    display: flex !important;
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    z-index: 1000;
}

.tooltip-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

.tooltip-number {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 24.899px;
    line-height: normal;
    color: #005b68;
    flex-shrink: 0;
}

/* Tooltip number colors matching inner-ring decorative colors */
.hover-segment.segment-1 .segment-tooltip .tooltip-number,
.hover-segment.segment-3 .segment-tooltip .tooltip-number,
.hover-segment.segment-5 .segment-tooltip .tooltip-number,
.hover-segment.segment-7 .segment-tooltip .tooltip-number {
    color: #ed6a59;
}

.hover-segment.segment-2 .segment-tooltip .tooltip-number,
.hover-segment.segment-6 .segment-tooltip .tooltip-number {
    color: #005b68;
}

.hover-segment.segment-4 .segment-tooltip .tooltip-number {
    color: #403936;
}

/* Match the tooltip border color to the tooltip number color for visual consistency */
.hover-segment.segment-1 .segment-tooltip,
.hover-segment.segment-3 .segment-tooltip,
.hover-segment.segment-5 .segment-tooltip,
.hover-segment.segment-7 .segment-tooltip {
    border-color: #ed6a59;
}

.hover-segment.segment-2 .segment-tooltip,
.hover-segment.segment-6 .segment-tooltip {
    border-color: #005b68;
}

.hover-segment.segment-4 .segment-tooltip {
    border-color: #403936;
}

.tooltip-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: normal;
    color: #403936;
    flex: 1;
}

.tooltip-description {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: normal;
    color: #403936;
    margin: 0;
}

/* Hover segment positions - Cover each pie slice area */
.hover-segment.segment-1 {
    left: 0px;
    top: 0px;
    width: 180px;
    height: 180px;
}

.hover-segment.segment-2 {
    left: 181px;
    top: 0px;
    width: 150px;
    height: 180px;
}

.hover-segment.segment-3 {
    left: 307px;
    top: 72px;
    width: 170px;
    height: 180px;
}

.hover-segment.segment-4 {
    left: 344px;
    top: 220px;
    width: 170px;
    height: 150px;
}

.hover-segment.segment-5 {
    left: 315px;
    top: 362px;
    width: 170px;
    height: 180px;
}

.hover-segment.segment-6 {
    left: 191px;
    top: 431px;
    width: 150px;
    height: 180px;
}

.hover-segment.segment-7 {
    left: 10px;
    top: 408px;
    width: 180px;
    height: 200px;
}

/* Tooltip positions */
.segment-1 .segment-tooltip {
    left: -100px;
    top: -50px;
}

.segment-2 .segment-tooltip {
    left: 0;
    top: -80px;
}

.segment-3 .segment-tooltip {
    right: -170px;
    top: -30px;
}

.segment-4 .segment-tooltip {
    right: -125px;
    top: 0;
}

.segment-5 .segment-tooltip {
    right: -150px;
    bottom: -30px;
}

.segment-6 .segment-tooltip {
    left: 0;
    bottom: -80px;
}

.segment-7 .segment-tooltip {
    left: -100px;
    bottom: -50px;
}

/* Footer Text */
.global-perspective-footer {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: normal;
    color: #403936;
    margin: 0;
}

/* Responsive Design - Between 1200px and 1500px - Fix tooltip overflow */
@media (min-width: 1201px) and (max-width: 1500px) {
    /* Adjust right-positioned tooltips to prevent horizontal overflow */
    .segment-3 .segment-tooltip {
        right: -120px;
        /* Reduced from -170px */
    }

    .segment-4 .segment-tooltip {
        right: -80px;
        /* Reduced from -125px */
    }

    .segment-5 .segment-tooltip {
        right: -100px;
        /* Reduced from -150px */
    }
}

/* Responsive Design - Below 1200px */
@media (max-width: 1200px) {
    .global-perspective-section {
        padding: 0 60px;
        overflow-x: hidden; /* Prevent tooltip overflow causing horizontal scroll */
    }

    .global-perspective-content {
        gap: 32px;
    }

    .global-perspective-text {
        flex: 1 0 400px;
    }

    .global-perspective-diagram {
        width: 450px;
        height: 534px;
        align-self: center;
        transform: scale(0.875);
        margin: 0 auto;
        transform-origin: top center;
    }

    /* Reposition right-side tooltips to left to prevent overflow */
    .segment-3 .segment-tooltip {
        right: auto;
        left: -260px;
    }

    .segment-4 .segment-tooltip {
        right: auto;
        left: -260px;
    }

    .segment-5 .segment-tooltip {
        right: auto;
        left: -260px;
    }
}

/* Mobile View - Below 768px */
@media (max-width: 767px) {
    .global-perspective-section {
        padding: 0 24px;
        overflow-x: hidden;
    }

    .global-perspective-content {
        flex-direction: column;
        gap: 40px;
        margin-bottom: 40px;
        overflow: visible;
    }

    .global-perspective-text {
        flex: none;
        min-width: 100%;
    }

    .global-perspective-title {
        font-size: 24px;
    }

    /* 
     * Mobile diagram scaling approach:
     * Original diagram: 514px × 610px
     * For 320px viewport with 32px total padding = 288px available
     * Scale factor: 288 / 514 = 0.56
     * Visible dimensions: 514 * 0.56 = 288px width, 610 * 0.56 = 342px height
     */
    .global-perspective-diagram {
        /* Container sized to show the scaled diagram */
        width: 288px;
        height: 342px;
        align-self: center;
        overflow: visible; /* Allow tooltips to show */
        position: relative;
        margin: 0 auto;
    }

    .circular-diagram {
        /* Original dimensions kept, but scaled down */
        width: 514px;
        height: 610px;
        position: absolute;
        top: 0;
        left: 0;
        /* Scale to fit 288px container from 514px original */
        transform: scale(0.65);
        transform-origin: top left;
    }

    /* Mobile tooltips: fixed position for reliable display */
    .segment-tooltip {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        min-width: auto !important;
        max-width: calc(100vw - 32px) !important;
        width: calc(100vw - 32px) !important;
        z-index: 1000;
    }

    /* Override individual segment tooltip positioning for mobile */
    .segment-1 .segment-tooltip,
    .segment-2 .segment-tooltip,
    .segment-3 .segment-tooltip,
    .segment-4 .segment-tooltip,
    .segment-5 .segment-tooltip,
    .segment-6 .segment-tooltip,
    .segment-7 .segment-tooltip {
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
    }

    /* All elements keep original positions - transform scale handles sizing */
}
