/* ═══════════════════════════════════════════════════════════ */
/* HOMEPAGE HEADINGS */
/* ═══════════════════════════════════════════════════════════ */

.every-journey-builds h2,
.how-it-works h2,
.what-can-you-report h2,
.something-bigger h2 {
    font-size: clamp(1.6rem, calc(1.6rem + 0.5vw), 2rem);
}

/* ═══════════════════════════════════════════════════════════ */
/* HERO SECTION HEADER */
/* ═══════════════════════════════════════════════════════════ */

.hero {
    background-image: url('../../images/content/hero.webp');
    background-position: 90% 100%;
    width: 100%;
    height: max(400px, calc(75vw + 55px));
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}

/* Cover title for small screens */
.cover-title-sm {
    position: absolute;
    top: calc(4vw);
    left: 0;
    width: fit-content;
    z-index: 10;
    background: rgba(204, 203, 201, 0.85);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
}

.cover-title-sm h2 {
    font-weight: 600;
    font-size: var(--font-size-hero);
    line-height: 1.3;
    letter-spacing: 0.03em;
    padding: 5px;
    margin: 0;
    color: var(--brand-primary-500);
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.6);
}

/* Hide medium/large titles on mobile */
.show-md, .show-lg {
    display: none;
}

#cover-text-call {
    background: color-mix(in srgb, var(--surface-card) 88%, transparent);
    color: var(--text-primary);
}

#cover-text-call h2,
#cover-text-call h3 {
    color: var(--brand-primary-500);
}

.hero-download-box h3 {
    color: var(--brand-primary-500);
    font-weight: 500;
    font-size: clamp(1.2rem, calc(1.2rem + 0.5vw), 1.6rem);
    padding-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}


/* ─────────────────────────────────────────────────────────── */
/* HERO MEDIA QUERIES */
/* ─────────────────────────────────────────────────────────── */

/* Hero title line-break helpers */
.hero-br-xs { display: none; }
.hero-br-not-xs { display: inline; }

@media screen and (max-width: 369px) {
  .hero-br-xs { display: inline; }
  .hero-br-not-xs { display: none; }
}

.hero-br-show-450 { display: none; }

@media screen and (min-width: 400px) {
  .hero-br-hide-450 { display: none; }
  .hero-br-show-450 { display: inline; }
}


@media screen and (max-width: 380px) {
  #hero-home {
    background-position: 92% 100%;
  }
}

@media screen and (min-width: 576px) {
    .hero {
        background-position: 88% 100%;
    }

    .cover-title-sm {
        display: inline-block;
        width: auto;
    }
}

/* SCREEN SIZE (< 768px - Mobile only) */
@media (max-width: 767px) {
    #cover-text-call {
        padding-left: clamp(8px, 3.75vw, 24px);
        padding-right: clamp(8px, 3.75vw, 24px);
        overflow: hidden;
    }

    .hero-download-box {
        background: color-mix(in srgb, var(--surface-card) 88%, transparent);
    }

    #cover-text-call {
        background: #faf6eb;
    }

    .show-sm.hero-download-box {
        background: linear-gradient(to bottom, #faf6eb 0%, #faf6eb 55%, white 100%);
        padding-bottom: 5rem;
    }

    .show-sm.hero-download-box {
        clip-path: inset(0 -50px -50px -50px);
        margin-bottom: 0;
    }

    .show-sm .d-flex a {
        flex: 0 0 auto;
    }
}


/* SCREEN SIZE (768px - Tablet) */
@media screen and (min-width: 768px) {

    .hero {
        height: 700px;
    }

    #hero-header {
        position: relative;
        display: grid;
        grid-template-rows: auto;
        z-index: 1;
        margin-bottom: 4rem;
    }

    #hero-home {
        padding: 0;
        position: relative;
        background-position: 85% 100%;
    }

    #hero-panel {
        position: absolute;
        top: 50%;
        left: 4vw;
        width: calc(60vw - 100px);
        max-width: 500px;
        display: flex;
        flex-direction: column;
        gap: 40px;
        z-index: 10;
        transform: translateY(calc(round(-50%, 1px))) translateZ(0);
    }

    #cover-text-call {
        background: color-mix(in srgb, var(--surface-card) 88%, transparent);
        border: none;
        border-radius: var(--radius-lg);
        color: var(--text-primary);
    }

    #cover-text-call .accent-outline-btn {
        display: none;
    }

    #cover-text-call h2,
    #cover-text-call h3 {
        color: var(--brand-primary-500);
    }

    .cover-text {
        border-radius: var(--radius-lg);
        padding: var(--spacing-md);
        z-index: 10;
    }

    .cover-text h2 {
        padding: 0.75rem var(--spacing-md);
    }

    .cover-text p {
        margin-bottom: 0;
    }

    .cover-text p:last-of-type {
        margin-bottom: 0.75rem;
    }

    .cover-title-sm {
        display: none;
    }

    .cover-title-md {
        font-weight: 600;
    }

    #home-title-md {
        display: block;
        font-size: clamp(1.2rem, calc(1.2rem + .5vw), 1.75rem);
    }

    .show-md {
        display: block;
    }

    .hero-download-box {
        background: linear-gradient(to bottom, color-mix(in srgb, var(--accent-gold-tint-100) 50%, white), var(--surface-background));
        padding: var(--spacing-xl);
    }

    .show-sm {
        display: none;
    }

    #hero-download-lg {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        background: color-mix(in srgb, var(--surface-card) 88%, transparent);
        border: none;
        border-radius: var(--radius-lg);
        padding: 15px 8px;
        row-gap: 12px;
        column-gap: 24px;
    }

    #hero-download-lg h3 {
        width: 100%;
        text-align: center;
    }

    #hero-download-lg a {
        display: flex;
        align-items: center;
    }

    #hero-download-lg img {
        width: auto;
        height: 44px;
        max-width: 100%;
        object-fit: contain;
    }

    #hero-social {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-md);
        width: fit-content;
        align-self: center;
        background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0) 70%);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(3px);
        border-radius: var(--radius-lg);
        padding: 0px 0px;
    }

    #hero-social p {
        margin: 0;
        font-family: 'Bitter', serif;
        font-weight: 600;
        font-size: 1.2rem;
        color: var(--text-primary);
    }

    #hero-social a {
        font-size: 1.6rem;
        padding: 0.6rem 0.4rem;
        color: var(--brand-primary-500);
        line-height: 1;
    }

    #hero-social a:hover {
        color: var(--brand-primary-600);
    }

}

@media screen and (min-width: 934px) {
    .hero {
        height: 900px;
    }

    #hero-panel {
        width: 43vw;
        max-width: 500px;
    }
}

/* SCREEN SIZE (992px - Large screens) */
@media screen and (min-width: 992px) {
    #hero-home {
        background-position: 80% 100%;
    }

    /* Gradually shift panel right from ~40px at 992px to ~180px at 1400px */
    #hero-panel {
        left: calc(34.3vw - 300px);
    }

    .show-lg {
        display: block;
    }
}

/* SCREEN SIZE (1200px - Wide screens) */
@media screen and (min-width: 1200px) {

    #hero-panel {
        gap: clamp(40px, 5vw, 80px);
    }
    #hero-home {
        background-size: 100% auto;
        height: auto;
        aspect-ratio: 4 / 3;
    }
}


@media screen and (min-width: 1400px) {
    #hero-panel {
        left: 180px;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* SECTION 1: WHAT IS THE MOBILITY MAPPER BRISTOL PILOT? */
/* ═══════════════════════════════════════════════════════════ */

#every-journey-builds-container {
    max-width: 825px;

}

.bristol-pilot-map img {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

.every-journey-builds .container-fluid {
    padding: 0;
    margin-left: auto;
    margin-right: auto;
}

.every-journey-builds .every-journey-builds-text-box {
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════ */
/* SECTION 2: HOW IT WORKS (Mobile-first base) */
/* ═══════════════════════════════════════════════════════════ */

/* Base styles for images on mobile */
.how-it-works-image img {
    width: 100%;
    height: auto;
}

.how-it-works {
    position: relative;
    isolation: isolate;
    margin-top: 50px;
    margin-bottom: 0;
    padding-top: 40px;
    padding-bottom: 50px;
}

.how-it-works::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--accent-gold-tint-100) 50%, white);
}

.how-it-works .card-title {
    font-size: 1.2rem;
}

.how-it-works-card-box {
    display: flex;
    justify-content: center;
}

.how-it-works-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    max-width: 620px;
}

/* Phone mockup bezel — original 300px dimensions from phone_mockup/index.html */
.phone-mockup {
    position: relative;
    width: 65%;
    max-width: 300px;
    height: auto;
    background: linear-gradient(160deg, #686868 0%, #555555 40%, #484848 100%);
    border-radius: 20px;
    padding: 7px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.phone-mockup .btn-vol-up,
.phone-mockup .btn-vol-down,
.phone-mockup .btn-power {
    position: absolute;
    right: -3px;
    width: 3px;
    background: #484848;
    border-radius: 0 2px 2px 0;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.phone-mockup .btn-vol-up  { top: 55px; height: 21px; }
.phone-mockup .btn-vol-down { top: 82px; height: 21px; }
.phone-mockup .btn-power   { top: 116px; height: 29px; }

.phone-mockup .spen-slot {
    position: absolute;
    bottom: 6px;
    left: 18px;
    width: 5px;
    height: 44px;
    background: linear-gradient(to bottom, #111 0%, #222 50%, #111 100%);
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.04);
}

.phone-mockup .spen-slot::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 6px;
    background: #333;
    border-radius: 0 0 3px 3px;
}

.phone-mockup .phone-inner {
    width: 100%;
    aspect-ratio: 9 / 19;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background-image: url('../../images/content/bristol_network_yellow.webp');
    background-size: cover;
    background-position: center;
}

.phone-mockup .phone-map-icons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    z-index: 5;
    pointer-events: none;
    width: 65%;
}

.phone-mockup .phone-map-icons img {
    height: auto;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 1px 4px rgba(255, 255, 255, 0.9));
}

.phone-mockup .phone-map-icons img:nth-child(1) { width: 32%; }
.phone-mockup .phone-map-icons img:nth-child(2) { width: 40%; }
.phone-mockup .phone-map-icons img:nth-child(3) { width: 48%; }

.phone-mockup .punch-hole {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    background: #000;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

.phone-mockup .phone-inner img.screenshot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ═══════════════════════════════════════════════════════════ */
/* SECTION 3: REPORT BARRIERS */
/* ═══════════════════════════════════════════════════════════ */

.what-can-you-report > p {
    font-size: clamp(1rem, calc(0.9rem + 0.5vw), 1.25rem);
}

.what-can-you-report {
    background: var(--surface-background);
    margin-top: var(--spacing-3xl);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.barrier-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: center;
    border-radius: var(--radius-md);
    background-color: var(--surface-subtle, #F2F2F2);
    text-align: center;
    height: 100%;
    box-shadow: var(--shadow-medium);
    padding-bottom: 0.75rem;
}

/* Barrier images – responsive with consistent aspect ratio */
.barrier-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background-color: var(--surface-background);
    box-shadow: var(--shadow-small);
    transition: transform 0.2s ease;
}

.barrier-item .barrier-image:hover {
    transform: scale(1.05);
}

.barrier-item h3 {
    font-size: clamp(0.95rem, calc(0.7rem + 0.8vw), 1.2rem);
    color: var(--brand-primary-500, #111111);
    margin: 0 var(--spacing-sm);
    font-weight: 500;
    padding: 0 var(--spacing-sm);
    line-height: 1.3;
    margin-bottom: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barrier-grid-container {
    padding: 0 var(--spacing-md);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════ */
/* SECTION 4: SOMETHING BIGGER */
/* ═══════════════════════════════════════════════════════════ */

.something-bigger {
    position: relative;
    isolation: isolate;
    margin-top: 40px;
    padding-bottom: 70px;
}

#something-bigger-content {
    max-width: 700px;
    padding-top: 50px;
    margin-left: auto;
    margin-right: auto;
}

.something-bigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--brand-primary-tint-100) 50%, white);
}

.something-bigger img {
    width: 100%;
    mix-blend-mode: multiply;
}

/* ═══════════════════════════════════════════════════════════ */
/* CTA CONTAINER */
/* ═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════ */
/* MEDIA QUERIES */
/* ═══════════════════════════════════════════════════════════ */


/* SCREEN SIZE - X-SMALL (<375px) */
@media (max-width: 374.98px) {
    .how-it-works-image {
        padding: var(--spacing-md) var(--spacing-xl);
        margin-bottom: 0 !important;
    }
}

/* SCREEN SIZE - SMALL (>480px) */
@media (min-width: 480px) {
    .barrier-grid-container {
        padding: 0 var(--spacing-xl);
    }
}

/* SCREEN SIZE - SMALL (>576px) */
@media screen and (min-width: 576px) {
    .how-it-works-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* SCREEN SIZE - MEDIUM (≥ 768px) */
@media screen and (min-width: 768px) {
    /* CSS Grid so the text column alone sets row height; no circular flex dependency */
    #every-journey-builds-container {
        display: grid;
        grid-template-columns: 7fr 5fr;
        column-gap: 1.5rem;
        align-items: stretch;
    }

    #every-journey-builds-container > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .every-journey-builds .col-md-5 {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .every-journey-builds .bristol-pilot-map {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .every-journey-builds .bristol-pilot-map > div {
        padding: 0 !important;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .every-journey-builds .bristol-pilot-map img.every-journey-mockup {
        height: 100%;
        max-height: 340px;
        max-width: none;
        width: auto;
        display: block;
        margin: 0;
    }

    /* Phone fills grid track height; width derives from aspect-ratio.
       phone-mockup is a flex item in the row-flex parent (.bristol-pilot-map > div),
       so height: 100% is definite (from grid track) and width auto = height * 9/19. */
    .every-journey-builds .phone-mockup {
        height: 100%;
        max-height: 300px;
        width: auto;
        aspect-ratio: 9 / 16;
        max-width: none;
        display: block;
    }

    .every-journey-builds .phone-mockup .phone-inner {
        height: 100%;
        width: 100%;
        aspect-ratio: unset;
        flex: unset;
        min-height: unset;
        background: transparent;
        z-index: 1;
    }

    /* Map rendered behind phone-inner (screen area) so the phone device sits in front */
    .every-journey-builds .phone-mockup::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 6px;
        right: 6px;
        bottom: 7px;
        background-image: url('../../images/content/bristol_network_yellow.webp');
        background-size: cover;
        background-position: center;
        border-radius: 18px;
        z-index: 0;
    }

    /* Image is square */
    .every-journey-builds .bristol-pilot-map img:not(.screenshot) {
        display: block;
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        object-position: center center;
    }

    /* Phone icons: reset the map-img sizing that also matches these icons */
    .every-journey-builds .phone-mockup .phone-map-icons img {
        aspect-ratio: unset;
        object-fit: unset;
    }

    .every-journey-builds .phone-mockup .phone-map-icons img:nth-child(1) { width: 32%; }
    .every-journey-builds .phone-mockup .phone-map-icons img:nth-child(2) { width: 40%; }
    .every-journey-builds .phone-mockup .phone-map-icons img:nth-child(3) { width: 48%; }
}

/* SCREEN SIZE - LARGE (>992px) */
@media (min-width: 992px) {
    .every-journey-builds {
        padding-top: clamp(20px, max(5vw, calc(50vw - 472.5px)), 128px);
        padding-bottom: clamp(20px, max(5vw, calc(50vw - 472.5px)), 128px);
    }

    .barrier-grid-container {
        padding: 0 var(--spacing-2xl);
    }

    .something-bigger img {
        max-width: 70%;
    }

}

/* SCREEN SIZE - X-LARGE (> 1400px) */
@media (min-width: 1400px) {
    .something-bigger img {
        max-height: 550px;
        width: auto;
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* ACCESSIBILITY & UTILITIES (Global – applies to all sections) */
/* ═══════════════════════════════════════════════════════════ */

/**
 * Focus states for hero content
 */
.hero-heading-box a:focus-visible,
.hero-paragraph-box .btn:focus-visible,
.hero-paragraph-box a:focus-visible,
.hero-download-box a:focus-visible {
    outline: 3px solid var(--focus-ring, #2B208C);
    outline-offset: 2px;
}

/**
 * High contrast mode support
 */
@media (prefers-contrast: more) {
    .hero-heading-box,
    .hero-paragraph-box,
    .hero-download-box {
        border: 2px solid var(--border-default, #C9C9C9);
    }

    .barrier-item {
        border: 2px solid var(--border-default, #C9C9C9);
    }
    
    .barrier-image {
        border: 2px solid var(--border-strong, #8F8F8F);
    }
}


/**
 * Reduced motion support
 */
@media (prefers-reduced-motion: reduce) {
    .barrier-image {
        transition: none;
    }
}
