/* ==================================================
   HOME PAGE SPECIFIC STYLES
   Scoped exclusively to .page-home
================================================== */

.page-home {
    /* Scoped references to global DIGI06 tokens */
    --h-gold: #9FDBF5;
    --h-gold-light: #9FDBF5;
    --h-green: #9FDBF5;
    --h-green-light: #9FDBF5;
    --h-green-dark: #9FDBF5;
    --h-heading: #000000;
    --h-border: #9FDBF5;
    --h-bg-main: #FFFFFF;
    --h-bg-alt: #FFFFFF;
    --h-white: #FFFFFF;
}

/* ==================================================
   1. HERO BALANCE & HEADING OVERRIDE
================================================== */
/* Forces a natural 2-4 line wrap without hardcoded BR tags */
.page-home .hero-heading {
    max-width: 13ch; /* Carefully tuned for 'Power your brand with Digital Precision' */
    font-size: clamp(3rem, 5.2vw, 6rem);
    line-height: 1.1;
    margin-bottom: 24px;
}

.page-home .hero-layout {
    display: flex;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.page-home .hero-content {
    flex: 0 0 45%;
    max-width: 45%;
    display: flex;
    align-items: center;
    padding: 0 4vw 0 var(--gutter);
}

.page-home .hero-visual {
    flex: 0 0 55%;
    max-width: 55%;
    position: relative;
    padding: 20px 20px 20px 0;
}

/* ==================================================
   2. GLOBAL REACH MAP COMPOSITION
================================================== */
.page-home .global-reach {
    padding: 80px 0;
    background-color: #FFFFFF;
    overflow: hidden;
}
@media (max-width: 992px) {
    .page-home .global-reach {
        padding: 65px 0;
    }
}
@media (max-width: 768px) {
    .page-home .global-reach {
        padding: 55px 0;
    }
}

.page-home .global-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.8fr) 1.2fr;
    gap: 60px;
    align-items: center;
}

.page-home .global-reach-header {
    margin-bottom: 30px;
}

.page-home .global-reach-header .section-title {
    margin-bottom: 0;
}

/* ==================================================
   3. INTERACTIVE MAP STYLING
================================================== */
.page-home .map-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block !important; /* Overrides legacy responsive display: none */
}

.page-home .map-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Base Countries */
.page-home .country-base {
    fill: var(--h-white);
    stroke: var(--h-border);
    stroke-width: 0.5;
    transition: fill 0.3s ease;
}

/* Active Countries */
.page-home .country-active {
    fill: rgba(122, 176, 71, 0.15); /* Light green tint */
    stroke: var(--h-green);
    stroke-width: 0.8;
    transition: fill 0.4s ease, stroke-width 0.4s ease;
    cursor: pointer;
}

.page-home .country-active:hover {
    fill: rgba(122, 176, 71, 0.3);
    stroke-width: 1.2;
}

/* Connection Lines */
.page-home .route-line {
    fill: none;
    stroke: var(--h-gold);
    stroke-width: 1.5;
    stroke-dasharray: 4 8; /* Creates dotted flow effect */
    opacity: 0.4;
    stroke-linecap: round;
}

/* Hub Dots */
.page-home .hub-core {
    fill: var(--h-green-dark);
    pointer-events: none;
}

.page-home .hub-pulse {
    fill: none;
    stroke: var(--h-green);
    stroke-width: 1.5;
    transform-origin: center;
    pointer-events: none;
}

.page-home .hub-hit-area {
    fill: transparent;
    cursor: pointer;
}

.page-home .hub-marker {
    cursor: pointer;
}

.page-home .hub-marker:hover .hub-core {
    fill: var(--h-gold);
    transform: scale(1.3);
    transition: all 0.3s ease;
}

/* ==================================================
   4. HTML OVERLAYS (FLAGS & TOOLTIPS)
================================================== */
.page-home .map-html-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Flag Markers */
.page-home .flag-marker {
    position: absolute;
    transform: translate(-50%, -150%);
    width: 28px;
    height: 20px;
    background: var(--h-white);
    border: 1px solid var(--h-gold);
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 4px 10px rgba(92, 69, 38, 0.15);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
    z-index: 10;
}

.page-home .flag-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.page-home .flag-marker:hover,
.page-home .flag-marker:focus-visible {
    transform: translate(-50%, -160%) scale(1.15);
    box-shadow: 0 8px 20px rgba(107, 156, 61, 0.25);
    border-color: var(--h-green);
    outline: none;
    z-index: 20;
}

/* Premium Tooltip */
.page-home .premium-tooltip {
    position: absolute;
    background: var(--h-white);
    border: 1px solid var(--h-border);
    box-shadow: 0 15px 35px rgba(42, 42, 42, 0.08);
    border-radius: 8px;
    padding: 16px 20px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    min-width: 180px;
    text-align: center;
}

.page-home .premium-tooltip.active {
    opacity: 1;
    transform: translate(-50%, -10px);
    pointer-events: auto;
}

.page-home .tooltip-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.page-home .tooltip-flag img {
    width: 30px;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-home .tooltip-title {
    font-family: 'Fraunces', serif;
    color: var(--h-heading);
    font-size: 1.1rem;
    margin: 0;
}

.page-home .tooltip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--h-green-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding-top: 12px;
    border-top: 1px solid var(--h-border);
    transition: color 0.3s ease;
}

.page-home .tooltip-btn:hover {
    color: var(--h-gold);
}

/* ==================================================
   5. RESPONSIVE DESIGN (HOME ONLY)
================================================== */

@media (max-width: 1200px) {
    .page-home .hero-heading { font-size: clamp(3rem, 4.5vw, 4.5rem); }
}

@media (max-width: 992px) {
    /* Stack Hero on Tablet */
    .page-home .hero { height: auto; min-height: auto; padding-top: calc(var(--nav-height) + 40px); padding-bottom: 60px; }
    .page-home .hero-layout { flex-direction: column; }
    .page-home .hero-content { flex: none; max-width: 100%; padding: 0 var(--gutter) 60px; text-align: center; }
    .page-home .hero-heading { max-width: 100%; margin: 0 auto 24px; }
    .page-home .hero-desc { margin: 0 auto 40px; }
    .page-home .hero-buttons { justify-content: center; }
    .page-home .hero-visual { flex: none; max-width: 100%; padding: 0 var(--gutter); height: 500px; }

    /* Stack Global Reach */
    .page-home .global-layout { grid-template-columns: 1fr; gap: 40px; }
    .page-home .global-content { text-align: center; }
    .page-home .global-desc { margin: 0 auto 30px; }
    .page-home .global-stats { justify-content: center; }
}

@media (max-width: 768px) {
    .page-home .hero-heading {
        font-size: clamp(2rem, 5.5vw, 2.5rem);
        line-height: 1.15;
        max-width: 100%;
    }
    /* Map adjusts to 4/3 */
    .page-home .map-container { aspect-ratio: 4 / 3; min-height: 350px; }
    .page-home .flag-marker { width: 20px; height: 14px; padding: 1px; transform: translate(-50%, -100%); }
    .page-home .flag-marker:hover, .page-home .flag-marker:focus-visible { transform: translate(-50%, -120%) scale(1.2); }
}

@media (max-width: 480px) {
    .page-home .hero-heading {
        font-size: clamp(1.65rem, 6.8vw, 2.1rem);
        line-height: 1.2;
        letter-spacing: -0.01em;
        max-width: 100%;
        margin-bottom: 18px;
    }
}