/* ============================================================
   Sub-page styles (Intelligence Advisory / Reporting / Monitoring /
   Research / Digital Footprinting / Operational Intelligence).

   Relies on styles.css for the base reset, navbar, mobile menu,
   theme toggle, CSS variables, and dark-mode overrides.
   ============================================================ */

/* Service hero — dark gradient banner at the top of each sub-page */
.service-hero {
    margin-top: 4rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    text-align: center;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.service-hero h1 {
    color: white;
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.service-hero .hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: #d1d5db;
    max-width: 48rem;
    margin: 0 auto;
}

/* Content section */
.content-section {
    padding: 2.5rem 0;
}

.content-section h2 {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.content-section p {
    text-align: justify;
    margin-bottom: 1rem;
    color: var(--text-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 48rem;
    margin: 0.5rem auto 0;
}

/* Benefits */
.benefits-section {
    background-color: var(--bg-light);
    padding: 3rem 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.benefit-card {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.25s ease;
    border: 1px solid transparent;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.benefit-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #dbeafe;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.benefit-card h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.benefit-card p {
    color: var(--text-gray);
}

/* CTA section — full-width on sub-pages (override main styles.css .cta-section) */
section.cta-section {
    margin-top: 0;
    border-radius: 0;
    padding: 3rem 1rem;
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
}

section.cta-section h2 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

section.cta-section p {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
}

/* Map (used on intelligence-monitoring.html) */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.content-text h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: left;
}

.content-text p {
    color: var(--text-gray);
    margin-bottom: 1rem;
    text-align: justify;
}

#map-demo-container {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

#leaflet-map {
    width: 100%;
    height: 100%;
}

.map-disclaimer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    text-align: center;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-white);
    color: var(--text-dark);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-tip {
    background: var(--bg-white);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup-content h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.leaflet-popup-content p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-gray);
}

@media (min-width: 992px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .service-hero {
        margin-top: 5rem;
        padding: 2.5rem 1rem;
    }
}

@media (max-width: 767px) {
    .service-hero {
        padding: 1.25rem 1rem;
    }

    section.cta-section {
        padding: 2.5rem 1rem;
    }

    .benefits-section,
    .content-section {
        padding: 2.5rem 0;
    }

    #map-demo-container {
        height: 360px;
    }
}

/* ============================================================
   Dark mode overrides for sub-page elements
   ============================================================ */

:root[data-theme="dark"] .service-hero {
    background: linear-gradient(135deg, #0b1220 0%, #050a14 100%);
}

:root[data-theme="dark"] .service-badge {
    background-color: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

:root[data-theme="dark"] .benefit-card {
    background-color: var(--surface-elevated);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .benefit-icon {
    background-color: var(--accent-soft);
    color: var(--accent-soft-text);
}

:root[data-theme="dark"] .benefit-card h3 {
    color: var(--text-dark);
}

:root[data-theme="dark"] .benefit-card p {
    color: var(--text-gray);
}

:root[data-theme="dark"] .content-section h2,
:root[data-theme="dark"] .section-header h2,
:root[data-theme="dark"] .content-text h2 {
    color: var(--text-dark);
}

:root[data-theme="dark"] .content-section p,
:root[data-theme="dark"] .content-text p,
:root[data-theme="dark"] .section-header p {
    color: var(--text-gray);
}

:root[data-theme="dark"] .benefits-section {
    background-color: var(--bg-light);
}

/* Leaflet popups in dark mode */
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip {
    background: var(--surface-elevated);
    color: var(--text-dark);
}

:root[data-theme="dark"] .leaflet-popup-content h4 {
    color: var(--text-dark);
    border-bottom-color: var(--border-color);
}

:root[data-theme="dark"] .leaflet-popup-content p {
    color: var(--text-gray);
}

:root[data-theme="dark"] #map-demo-container {
    border-color: var(--border-color);
}

/* Use Carto's dark tile layer instead of light when in dark mode.
   The base map uses an <img> URL we don't directly control here,
   but we can filter the tiles to make them blend better. */
:root[data-theme="dark"] .leaflet-tile-pane {
    filter: invert(0.92) hue-rotate(180deg) saturate(0.5) brightness(0.95);
}
