﻿@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../../../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Regular.ttf') format('truetype'), url('../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../../../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Medium.ttf') format('truetype'), url('../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../../../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-SemiBold.ttf') format('truetype'), url('../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    src: url('../../../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Light.ttf') format('truetype'), url('../fonts/IBMPlex/alfont_com_IBMPlexSansArabic-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
}
:root {
    /* Unified identity of the Madinah Region Municipality (the colours of
     assets/logo.svg). Change --icon-color here to recolour every icon. */
    --identity-teal-dark: #007167;
    --identity-teal: #00958A;
    --identity-green: #6ABF4B;
    --identity-grey: #9D9D9C;
    --icon-color: var(--identity-teal-dark);
    /* Brand */
    --green-primary: #0E6B50;
    --green-dark: #0A4F3B;
    --green-open: #1fb388;
    --teal-dark: #11514B;
    --navy: #0F2747;
    --text: #2B2F36;
    --text-muted: #5B6270;
    --gold: #F2C14E;
    --choice-title: #2A64B8; /* titles of the "What do you want to do?" cards */
    /* Surfaces */
    --page-bg: #FFFFFF;
    --white: #FFFFFF;
    --muted-bg: #F9FAFB; /* neutral grey, so it does not clash with --card-bg */
    --card-bg: #F2F8F7; /* every card: hero cards, choices, steps, "why".
                         A 5% tint of --identity-teal-dark, the icon colour. */
    --border: #E3E8EE;
    --border-strong: #C9D3DD;
    --map-canvas-bg: #E9EEF2;
    --suggestion-active-bg: #EEF6F1;
    --rent-banner-start: #F3F7FC;
    --rent-banner-end: #EAF1F9;
    --rating-start: #FBE7D3;
    --rating-end: #FDF3E9;
    /* Text on dark backgrounds (hero, map) */
    --on-dark-muted: rgba(255, 255, 255, 0.8);
    /* Hero: shade over the photo, and the fallback if the photo fails to load */
    --hero-shade: rgba(10, 45, 60, 0.92);
    --hero-shade-even: rgba(10, 45, 60, 0.85);
    --hero-fallback-start: #2C4A60;
    --hero-fallback-end: #10293D;
    --period-bg: rgba(6, 55, 58, 0.72);
    --period-border: rgba(255, 255, 255, 0.35);
    /* Map box */
    --map-box-start: #0D4A4A;
    --map-box-end: #123B52;
    /* Map status colors */
    --legend-green: #1E9E5A;
    --legend-orange: #F59E0B;
    --legend-red: #DC2626;
    --legend-blue: #0d6efd;
    /* Radii */
    --radius-sm: 0.5rem;
    --radius-md: 0.625rem;
    --radius-lg: 0.875rem;
    --radius-pill: 999px;
    /* Shadows */
    --shadow-header: 0 1px 3px rgba(15, 39, 71, 0.07);
    --shadow-card: 0 1px 3px rgba(15, 39, 71, 0.06);
    --shadow-card-hover: 0 10px 24px rgba(15, 39, 71, 0.12);
    --shadow-float: 0 4px 14px rgba(15, 39, 71, 0.16);
    /* Spacing scale: gaps and section padding come from these. */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    --grid-gap: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
    /* Layout. --content-max is the widest the content gets (the design's
     1408px); the side padding is added on top of it. */
    --content-max: 104rem;
    --container-pad: clamp(1rem, 4vw, 5rem);
    --header-height: 3.5rem;
    --touch: 2.75rem; /* 44px, the smallest comfortable touch target */
}

/* ==========================================================================
   2. Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    overflow-wrap: break-word; /* long words wrap instead of overflowing */
}

h1,
h2,
h3,
p {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font: inherit;
    color: inherit;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}

input {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--green-primary);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* Centred, capped at --content-max, with fluid side padding. */
.container {
    width: 100%;
    max-width: calc(var(--content-max) + 2 * var(--container-pad));
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ==========================================================================
   3. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: var(--touch);
    padding-inline: 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 700;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn--primary {
    background: var(--teal-dark);
    color: var(--white);
}

    .btn--primary:hover, .btn--outline:hover {
        transform: translateY(-0.1875rem);
        box-shadow: var(--shadow-card-hover);
        border-color: var(--green-primary);
    }

.btn--outline {
    background: var(--white);
    border-color: var(--border-strong);
    color: var(--navy);
}

    .btn--outline:hover {
        color: var(--green-primary);
    }

.btn--wide {
    width: min(100%, 27rem);
}

/* ==========================================================================
   4. Header
   ========================================================================== */

.header {
    background: var(--white);
    box-shadow: var(--shadow-header);
}

/* Phones and tablets: logo and menu button on one row; the menu opens as a
   full-width row underneath, in the page flow, so it pushes the content
   down instead of covering it. */
.header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: var(--header-height);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    /*order: 1;*/
}

.brand__logo {
    width: 2.25rem;
    height: 2.25rem;
}
.brand__names {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.brand__name-ar {
    color: var(--navy);
    font-size: 0.8125rem;
    font-weight: 700;
}

/* 11px floor: 0.625rem alone would be 10px on phones and 8.75px on small
   laptops, too small to read. */
.brand__name-en {
    color: var(--text-muted);
    font-size: max(0.625rem, 11px);
    font-weight: 400;
}

.nav-toggle {
    display: grid;
    place-items: center;
    width: var(--touch);
    height: var(--touch);
    margin-inline-start: auto;
    color: var(--navy);
    font-size: 1.375rem;
}

.nav {
    display: none;
    flex-basis: 100%;
}

    .nav.is-open {
        display: block;
    }

.nav__list {
    display: flex;
    flex-direction: column;
    padding-block: var(--space-xs);
}

.nav__link {
    display: flex;
    align-items: center;
    min-height: var(--touch);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

    .nav__link:hover {
        color: var(--green-primary);
    }

.nav__link--active {
    color: var(--green-primary);
    border-bottom-color: var(--green-primary);
    font-weight: 700;
}

/* Desktop: logo | links | an empty column as wide as the logo's, so the
   links sit in the middle of the page. */
@media (min-width: 64em) {
    .header__inner {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        min-height: 3rem;
    }

    .nav-toggle {
        display: none;
    }

    .nav {
        display: block;
    }

    .nav__list {
        flex-direction: row;
        gap: clamp(1.25rem, 2.6vw, 2.75rem);
        padding-block: 0;
    }

    .nav__link {
        min-height: 0;
        padding-block: var(--space-2xs);
        border-bottom: 2px solid transparent;
    }

    .nav__link--active {
        border-bottom-color: var(--green-primary);
    }
}

/* ==========================================================================
   5. Hero
   ========================================================================== */

/* Layers, top to bottom: a fade into the page colour behind the cards,
   the shade that keeps the text readable, the photo, and a fallback colour
   if the photo fails to load. The height comes from the content, so
   nothing is ever cut off. */
.hero {
    --hero-overlay: linear-gradient(var(--hero-shade-even), var(--hero-shade-even));
    background-image: linear-gradient(to bottom, transparent 62%, var(--page-bg) 94%), var(--hero-overlay), url("../assets/hero-header.jpeg"), linear-gradient(to right, var(--hero-fallback-start), var(--hero-fallback-end));
    background-size: cover;
    background-position: center 60%;
    color: var(--white);
    padding-top: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
}

/* From 1024px the text takes the left side and the mosque shows on the
   right, so only the left is darkened ("to left" ends dark on the left). */
@media (min-width: 64em) {
    .hero {
        --hero-overlay: linear-gradient(to right, transparent 30%, var(--hero-shade) 70%);
    }
}

/* At most 42rem wide, pushed to the end (left) side. On narrower screens it
   simply fills the width. */
.hero__content {
    max-width: 47rem;
    /*margin-inline-start: auto;*/
}

.hero__title {
    font-size: clamp(1.75rem, 1rem + 3.2vw, 3.5rem);
    font-weight: 800;
    line-height: 1.25;
}

.hero__tagline {
    margin-top: var(--space-sm);
    font-size: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    font-weight: 500;
}

/* Registration period card */
.period-card {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    margin-top: var(--space-md);
    padding: 1.125rem clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--period-border);
    border-radius: var(--radius-md);
    background: var(--period-bg);
    backdrop-filter: blur(4px);
}

.period-card__icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
    font-size: 1.75rem;
}

.period-card__body {
    min-width: 0;
}

.period-card__label {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.period-card__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2xs) clamp(1rem, 4vw, 2.5rem);
}

.period-card__duration {
    color: var(--gold);
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
    font-weight: 800;
    line-height: 1.3;
}

.period-card__dates {
    font-size: 0.9375rem;
    font-weight: 500;
}

.period-card__text {
    margin-top: var(--space-2xs);
    color: var(--on-dark-muted);
    font-size: 0.8125rem;
    line-height: 1.7;
}

/* Hero cards: stacked on phones and tablets, three in a row from 1024px. */
.hero-cards {
    display: grid;
    gap: var(--grid-gap);
    margin-top: var(--space-md);
    padding-bottom: var(--space-sm);
    color: var(--text);
}

@media (min-width: 64em) {
    .hero-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* The whole card is the link: icon at the start, text beside it. The icon,
   padding and gap shrink with the screen so the text keeps room. */
.hero-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(0.75rem, 1.5vw, 1.5rem);
    height: 100%;
    padding: var(--space-md) clamp(1rem, 1.8vw, 1.75rem);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.hero-card__icon {
    margin-top: var(--space-xs);
    color: var(--icon-color);
    font-size: clamp(2.75rem, 4vw, 4rem);
}

/* Audience label above the title: plain text, no background. */
.hero-card__tag {
    display: block;
    color: var(--identity-teal-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.hero-card__title {
    margin-top: var(--space-xs);
    color: var(--navy);
    font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
    font-weight: 800;
    line-height: 1.4;
}

.hero-card__text {
    margin-top: var(--space-2xs);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Shared by the hero cards and the choice cards (section 6): the whole
   card is clickable, so it lifts on hover..hero-card:hover, */

.choice:hover {
    transform: translateY(-0.1875rem);
    box-shadow: var(--shadow-card-hover);
}

/* ==========================================================================
   6. Sections + "What do you want to do?" choices
   ========================================================================== */

.section {
    padding-block: var(--space-lg);
}

.section--muted {
    background: var(--muted-bg);
}

.section--tight {
    padding-block: var(--space-md);
}

.section--last {
    padding-bottom: calc(var(--space-lg) + var(--space-xs));
}

.section-head {
    margin-bottom: var(--space-md);
    text-align: center;
}

.section-head__title {
    color: var(--navy);
    font-size: clamp(1.375rem, 1rem + 1.2vw, 1.875rem);
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
}

.section-head__subtitle {
    margin-top: var(--space-2xs);
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Four cards: one per row on small phones, two from 480px, four from 1024px.
   The "why" cards in section 10 share these columns. */
.choices,
.why {
    display: grid;
}

@media (min-width: 30em) {
    .choices,
    .why {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 64em) {
    .choices{
    grid-template-columns: repeat(5, minmax(0, 1fr));

    }
    .why {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.choices {
    gap: clamp(1rem, 2vw, 1.75rem);
}

.choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    /*background: var(--card-bg);*/
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.choice__icon {
    color: var(--icon-color);
    font-size: 2.5rem;
}

.choice__title {
    margin-top: 0.875rem;
    color: var(--choice-title);
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
    font-weight: 800;
    line-height: 1.5;
}

.choice__text {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.choice-warning {
    background: #FDF1E6;
}

.choice-primary {
    background: #EAF2FB;
}

.choice-green {
    background: #EEF6F1;
}

.choice-danger {
    background: #f8d7da;
}

.choice-warning span, .choice-warning i {
    color: #8A3A12;
}

.choice-primary span, .choice-primary i {
    color: #1b4a94;
}
.choice-green span, .choice-green i {
    color: #0A4F3B;
}
.choice-danger span, .choice-danger i {
    color: #58151c;
}
    /* ==========================================================================
   7. Requirements
   ========================================================================== */
    /* Intro above the steps; from 1200px the intro sits beside them. */
    .req {
        display: grid;
        gap: var(--space-lg);
        align-items: center;
        padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
        border-radius: var(--radius-lg);
        background: var(--white);
        box-shadow: var(--shadow-card);
    }

@media (min-width: 75em) {
    .req {
        grid-template-columns: 34fr 66fr;
    }
}

.req + .req {
    margin-top: var(--space-md);
}

.req__title {
    color: var(--navy);
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.45;
}

.req__num {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-inline-end: var(--space-sm);
    border-radius: 50%;
    background: var(--identity-teal-dark);
    color: var(--white);
    font-size: 1.0625rem;
    vertical-align: 0.25rem;
}

.req__text {
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.8;
}

/* The three steps and the two arrows between them share one grid. The
   arrows are the list's own ::before and ::after, placed in the rows (phones)
   or columns (768px and up) between the steps, so they never overlap them. */
.steps {
    display: grid;
    gap: var(--space-sm);
}

    .steps::before,
    .steps::after {
        content: "\f063"; /* Font Awesome arrow-down */
        place-self: center;
        color: var(--text-muted);
        font: var(--fa-font-solid);
        font-size: 0.9375rem;
    }

    .steps > :nth-child(1) {
        grid-row: 1;
    }

    .steps::before {
        grid-row: 2;
    }

    .steps > :nth-child(2) {
        grid-row: 3;
    }

    .steps::after {
        grid-row: 4;
    }

    .steps > :nth-child(3) {
        grid-row: 5;
    }

@media (min-width: 48em) {
    .steps {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    }

        .steps::before,
        .steps::after {
            content: "\f060"; /* Font Awesome arrow-left: toward the next step in RTL */
        }

        .steps > :nth-child(1) {
            grid-area: 1 / 1;
        }

        .steps::before {
            grid-area: 1 / 2;
        }

        .steps > :nth-child(2) {
            grid-area: 1 / 3;
        }

        .steps::after {
            grid-area: 1 / 4;
        }

        .steps > :nth-child(3) {
            grid-area: 1 / 5;
        }
}

/* Every step looks the same in both lists. The number badge is pulled up by
   a negative margin so it sits across the card's top edge; margin-top on the
   card keeps room for it. */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 12.5rem;
    margin-top: 0.75rem;
    padding: 2rem 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.step__num {
    display: grid;
    place-items: center;
    align-self: flex-end;
    width: 1.75rem;
    height: 1.75rem;
    margin: -2.75rem 0.25rem 1rem;
    border-radius: 50%;
    background: var(--identity-teal-dark);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 700;
}

.step__icon {
    color: var(--icon-color);
    font-size: 2.25rem;
}

.step__title {
    margin-top: 0.875rem;
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.7;
}

    .step__title strong {
        color: var(--navy);
        font-weight: 800;
    }

.step__text {
    margin-top: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* ==========================================================================
   8. Map: spans the full screen width (a client request), so it is the one
      section outside .container.
   ========================================================================== */

.map-box {
    display: flex;
    flex-direction: column;
    padding: 1rem 0.625rem 0.625rem;
    background: linear-gradient(135deg, var(--map-box-start), var(--map-box-end));
    color: var(--white);
}

.map-box__head {
    padding-bottom: 0.625rem;
    text-align: center;
}

.map-box__title {
    font-size: clamp(1.25rem, 0.8rem + 1.4vw, 1.75rem);
    font-weight: 800;
    line-height: 1.3;
}

.map-box__subtitle {
    color: var(--on-dark-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* The map, the legend and the search share one grid: the map spans all three
   rows, the legend sits in the top row and the search in the bottom row, so
   the two never overlap and the box grows instead of squeezing them.
   The height follows the screen height, within sensible limits. */
.map-box__canvas-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    min-height: clamp(21rem, 60vh, 36rem);
    border-radius: var(--radius-sm);
    background: var(--white);
}

/* z-index 0 keeps whatever the map library draws inside its own layer,
   under the legend and search. */
.map-canvas {
    grid-area: 1 / 1 / -1 / -1;
    z-index: 0;
    border-radius: var(--radius-sm);
    background: var(--map-canvas-bg);
}

/* Legend: top-right corner of the map (justify-self: start is right in RTL). */
.map-legend {
    grid-area: 1 / 1;
    justify-self: start;
    align-self: start;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin: 0.625rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow-float);
}

.map-legend__item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    width: 100%;
    padding: 0.0625rem;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    transition: opacity 0.2s ease;
}

    .map-legend__item:hover {
        color: var(--navy);
    }

    .map-legend__item[aria-pressed="false"] {
        opacity: 0.4;
    }

/* Touch screens: taller rows so each legend filter is easy to tap. */
@media (hover: none) {
    .map-legend__item {
        padding-block: 0.375rem;
    }
}

.map-legend__dot {
    width: 0.625rem;
    height: 0.625rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--dot-color);
}

.map-legend__item[aria-pressed="false"] .map-legend__dot {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--dot-color);
}

.map-legend__dot--compliant {
    --dot-color: var(--legend-green);
}

.map-legend__dot--in-progress {
    --dot-color: var(--legend-orange);
}

.map-legend__dot--non-compliant {
    --dot-color: var(--legend-red);
}

.map-verified {
    --dot-color: var(--legend-blue);
}

/* Search: full width along the bottom on phones, bottom-left corner from
   480px. position: relative only anchors the suggestions dropdown. */
.map-search {
    grid-area: 3 / 1;
    align-self: end;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    min-height: 2.5rem;
    margin: 0.625rem 0.75rem;
    padding-inline: 0.75rem 0.125rem;
    border-radius: var(--radius-pill);
    background: var(--white);
    box-shadow: var(--shadow-float);
}

@media (min-width: 30em) {
    .map-search {
        justify-self: end;
        width: min(18.75rem, 100% - 1.25rem);
        margin: 0.625rem;
    }
}

.map-search__input {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 0.8125rem;
}

    .map-search__input::placeholder {
        color: var(--text-muted);
    }

    /* The browser's own clear button would sit next to our .map-search__clear. */
    .map-search__input::-webkit-search-cancel-button {
        display: none;
    }

    .map-search__input:focus {
        outline: none;
    }

.map-search:focus-within {
    box-shadow: var(--shadow-float), 0 0 0 2px var(--green-primary);
}

/* Small glyphs inside round 2.25rem hit areas. */
.map-search__clear,
.map-search__submit {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
}

.map-search__clear {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

    /* Keeps the [hidden] attribute winning over the display rule above. */
    .map-search__clear[hidden] {
        display: none;
    }

    .map-search__clear:hover {
        color: var(--navy);
    }

.map-search__submit {
    color: var(--navy);
    font-size: 1rem;
}

    .map-search__submit:hover {
        color: var(--green-primary);
    }

/* Suggestions dropdown, filled by renderSuggestions() in js/main.js.
   It floats over the map, so absolute positioning is right here. */
.map-search__suggestions {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.375rem);
    z-index: 5;
    max-height: 11.25rem;
    overflow-y: auto;
    padding: var(--space-2xs);
    border-radius: var(--radius-sm);
    background: var(--white);
    box-shadow: var(--shadow-float);
}

.map-search__suggestion {
    padding: var(--space-xs) 0.625rem;
    border-radius: 0.375rem;
    color: var(--text);
    font-size: 0.8125rem;
    cursor: pointer;
}

    .map-search__suggestion:hover,
    .map-search__suggestion.is-active {
        background: var(--suggestion-active-bg);
        color: var(--navy);
    }

/* ==========================================================================
   9. Rental banner
   ========================================================================== */

/* Picture above the text on phones, beside it from 768px. */
.rent-banner {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: 1.5rem clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--radius-lg);
    background: linear-gradient(to left, var(--rent-banner-start), var(--rent-banner-end));
}

@media (min-width: 48em) {
    .rent-banner {
        flex-direction: row;
        align-items: center;
        gap: var(--space-lg);
    }
}

.rent-banner__body {
    flex: 1;
    min-width: 0;
}

.rent-banner__title {
    color: var(--navy);
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.4;
}

.rent-banner__text {
    margin-top: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.8;
}

.rent-banner__body .btn {
    width: min(100%, 19rem);
    margin-top: 1rem;
}

/* Shop-and-document illustration (assets/lease-check-illustration.svg,
   2:1). order: -1 puts it above the text on phones; from 768px it goes back
   to the end (left) side. The width shrinks with the screen and the height
   follows from the ratio, so it never overflows or stretches. */
.rent-banner__art {
    order: -1;
    align-self: center;
    flex-shrink: 0;
    width: min(100%, 22rem);
    aspect-ratio: 2 / 1;
}

@media (min-width: 48em) {
    .rent-banner__art {
        order: 0;
        width: clamp(16rem, 28vw, 22rem);
    }
}

/* ==========================================================================
   10. Why it matters + timeline
   ========================================================================== */

/* Columns come from the .choices rules in section 6. */
.why {
    gap: var(--grid-gap);
    margin-top: 1rem;
}

.why__item {
    padding: var(--space-md) 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    text-align: center;
}

.why__icon {
    color: var(--icon-color);
    font-size: 2rem;
}

.why__title {
    margin-top: 0.625rem;
    color: var(--navy);
    font-size: 1.0625rem;
    font-weight: 800;
}

.why__text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Stacked on phones; from 768px three points on one line. Each item is a
   small grid (line | icon | line), so the lines of neighbouring items join
   into one continuous line between the icons. */
.timeline {
    display: grid;
    gap: var(--space-md);
    max-width: 64rem;
    margin: var(--space-md) auto 0;
}

/* align-content: start keeps the icon row at the top when a neighbour's
   longer text makes this item taller, so the three icons stay in line. */
.timeline__item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    align-content: start;
    text-align: center;
}

.timeline__icon {
    grid-column: 2;
    color: var(--icon-color);
    font-size: 1.5rem;
}

.timeline__date,
.timeline__text {
    grid-column: 1 / -1;
    padding-inline: 1rem;
}

.timeline__date {
    margin-top: var(--space-sm);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 800;
}

.timeline__text {
    margin-top: var(--space-2xs);
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.7;
}

@media (min-width: 48em) {
    .timeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    /* ::before is the start (right) half of the line, ::after the end half. */
    .timeline__item::before,
    .timeline__item::after {
        content: "";
        grid-row: 1;
        height: 2px;
        background: var(--border-strong);
    }

    .timeline__item::before {
        grid-column: 1;
        margin-inline-end: var(--space-sm);
    }

    .timeline__item::after {
        grid-column: 3;
        margin-inline-start: var(--space-sm);
    }

    /* No line before the first point or after the last one. */
    .timeline__item:first-child::before,
    .timeline__item:last-child::after {
        visibility: hidden;
    }

    .timeline__icon {
        grid-row: 1;
    }
}

/* ==========================================================================
   11. Classification + sign approval
   ========================================================================== */

/* One card per row, side by side from 1024px. */
.promo-row {
    display: grid;
    gap: var(--grid-gap);
}

@media (min-width: 64em) {
    .promo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Both cards: photo above the text on phones, beside it from 640px (on the
   right for the classification card, on the left for the sign card). */
.promo {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* clips the photo to the card's rounded corners */
    border-radius: var(--radius-lg);
}

@media (min-width: 40em) {
    .promo {
        flex-direction: row;
    }
}

.promo--rating {
    background: linear-gradient(to left, var(--rating-start), var(--rating-end));
}

.promo--sign {
    border: 1px solid var(--border);
    background: var(--white);
}

.promo__body {
    flex: 1;
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
}

.promo__title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--navy);
    font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
    font-weight: 800;
    line-height: 1.4;
}

.promo__lead {
    margin-top: var(--space-sm);
    color: var(--navy);
    font-size: 1rem;
    font-weight: 800;
}

.promo__text {
    margin-top: var(--space-xs);
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.8;
}

.promo__body > .btn,
.promo__actions {
    margin-top: var(--space-md);
}

.promo__star {
    flex-shrink: 0;
    color: var(--icon-color);
    font-size: 2.5rem;
}

.promo__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

    /* Side by side when there is room, one per row when there is not. */
    .promo__actions .btn {
        flex: 1 1 9rem;
        padding-inline: var(--space-sm);
        font-size: 0.875rem;
        white-space: nowrap;
    }

.promo__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: var(--touch);
    margin-top: var(--space-2xs);
    color: var(--navy);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

    .promo__link:hover {
        color: var(--green-primary);
    }

/* On phones the photo frame keeps a 16:9 ratio; from 640px it takes a third
   of the card and the full card height. */
.promo__media {
    order: -1;
    display: grid;
    aspect-ratio: 16 / 9;
}

@media (min-width: 40em) {
    .promo__media {
        order: 0;
        flex: 0 0 34%;
        aspect-ratio: auto;
    }
}

/* The mask fades the photo into the white card on the text side: toward the
   bottom on phones, toward the right (the text in RTL) from 640px. */
.promo__image {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: 30% center;
    -webkit-mask-image: linear-gradient(to top, transparent, #000 35%);
    mask-image: linear-gradient(to top, transparent, #000 35%);
}

/* Keep the rating sign (right side of the photo) in the frame. */
.promo--rating .promo__image {
    object-position: 70% center;
}

@media (min-width: 40em) {
    .promo__image {
        -webkit-mask-image: linear-gradient(to left, transparent, #000 35%);
        mask-image: linear-gradient(to left, transparent, #000 35%);
    }

    /* The classification photo sits on the right, so it fades toward the left. */
    .promo--rating .promo__image {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 35%);
        mask-image: linear-gradient(to right, transparent, #000 35%);
    }
}
.popup {
    display: none;
    position: fixed;
    z-index: 1050;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    direction: rtl;
}

.popup-content {
    background: #fff;
    padding: 1.3rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-in-out;
}
.popup-title {
    font-size: 1.3rem;
    text-align: right;
    margin-bottom: 1rem;
    color: #333;
}

.popup-input {
    width: 90%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.3s;
}

    .popup-input:focus {
        border-color: #198754; /* Bootstrap success color */
    }

.popup-button {
    background-color: #198754;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .popup-button:hover {
        background-color: #157347;
    }

.close-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

    .close-btn:hover {
        color: #000;
    }

.border-top {
    border-top: 1px solid #e5e5e5;
}

.footer {
    position: absolute;
    /*bottom: 0;*/
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

    .footer div img {
        float: left;
        width: 200px;
    }

.esri-feature-content p {
    margin: 0 0 0.3em !important;
    font-size: 0.75rem !important;
    font-weight: 500;
    line-height: 1.3;
}

    .esri-feature-content p b {
        font-size: medium;
    }
.esri-popup__main-container {
    width: 280px !important;
    max-width: 280px !important;
}

#go-balady, .go-shop {
    margin-top: -12%;
}

.btn .text-sm {
    font-size: 0.7rem !important;
}