* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #C0C0C0;
    color: #222;
}

header {
    background-color: #e9eaec;
    color: #172033;
    padding: 45px 20px;
}

.header-content {
    max-width: 1200px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 25px;
}

.company-logo {
    width: 250px;
    height: auto;
    object-fit: contain;
}

header h1 {
    margin: 0;
    font-size: 38px;
}

header p {
    margin-top: 10px;
    color: #d7dce5;
}

main {
    max-width: 1200px;
    margin: auto;
    padding: 35px 20px;
}

.search-section {
    margin-bottom: 30px;
}

.search-section h2 {
    margin-bottom: 15px;
}

#searchBox {
    width: 100%;
    max-width: 600px;
    padding: 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 7px;
}

.billboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.billboard-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e2e2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.billboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.billboard-photo {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background-color: #ddd;
}

.billboard-info {
    padding: 20px;
}

.card-city {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #0b3b82;
    margin-bottom: 6px;
}

.billboard-info h3 {
    min-height: 2.4em;
    margin-top: 0;
    margin-bottom: 12px;

    color: #0b3b82;
    font-size: 22px;
    font-weight: 700;
}

.location {
    color: #555;
}

.details {
    line-height: 1.7;
}

.available {
    display: inline-block;
    background-color: #e3f5e8;
    color: #176b32;
    padding: 6px 10px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 12px;
    display: none;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background-color: #2563eb;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background-color: #174bb8;
}

/* -------------------------
   MAP
------------------------- */

.map-section {
    margin-bottom: 35px;
}

.map-section h2 {
    margin-bottom: 15px;
}

#map {
    width: 100%;
    height: 500px;

    border: 1px solid #aaa;
    border-radius: 10px;

    overflow: hidden;
}

.street-view-link {
    display: inline-block;
    padding: 8px 12px;
    background-color: #2563eb;
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.street-view-link:hover {
    background-color: #174bb8;
}


/* Keep View Billboard buttons aligned at bottom of cards */

.billboard-card {
    display: flex;
    flex-direction: column;
}

.billboard-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

/* -------------------------
   CARD SECTION ALIGNMENT
------------------------- */

/* ID - reserve 2 lines */
.billboard-info h3 {
    min-height: 2.4em;
    margin-bottom: 12px;
}

/* Address - reserve 2 lines */
.location {
    min-height: 2.8em;
    margin-bottom: 12px;
}

/* Display description - reserve 3 lines */
.display-description {
    min-height: 4.2em;
    margin-bottom: 12px;
}

/* Traffic - reserve 1 line */
.traffic {
    min-height: 1.4em;
}

/* -------------------------
   MAP HEADER / RESET MAP
------------------------- */

.map-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.map-header h2 {
    margin: 0;
}

.show-all-button {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.header-text h1 {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #172033;
}

.header-text p {
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.5;
    color: #4f5968;
}

.headline-accent {
    font-style: italic;
    font-weight: 500;
}

/* -------------------------
   MAP CITY CONTROLS
------------------------- */

.map-controls {
    margin-bottom: 15px;
}

.city-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-button {
    width: auto;
    padding: 9px 14px;
    font-size: 14px;
    white-space: nowrap;
}

/* -------------------------
   SELECTED CITY
------------------------- */

.billboard-card.city-highlight {
    border: 2px solid #0b3b82;
    box-shadow: 0 4px 14px rgba(11, 59, 130, 0.16);
}

.city-button.active-city {
    background-color: #0b3b82;
    font-weight: 700;
}

/* -------------------------
   MOBILE HEADER
------------------------- */

@media (max-width: 600px) {

    header {
        padding: 25px 15px;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .company-logo {
        width: 120px;
        max-width: 80%;
        height: auto;
    }

    header h1 {
        font-size: 28px;
    }

    header p {
        margin-bottom: 0;
    }

    .city-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px;

        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
}

    .city-button {
        flex: 0 0 auto;
}

    #map {
    height: 350px;
    }
}

.view-button,
.inquire-button {
    flex: 1;
}

.inquire-button {
    background-color: white;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.inquire-button:hover {
    background-color: #eaf0ff;
}

.popup-inquire-wrap {
    margin-top: 10px;
}

.popup-inquire {
    width: auto;
    padding: 8px 12px;
    font-size: 14px;
}

/* -------------------------
   FOOTER
------------------------- */

.site-footer {
    background-color: #e9eaec;
    text-align: center;
    padding: 40px 20px;
    margin-top: 20px;
}

.site-footer h2 {
    margin: 0 0 10px;
    color: #172033;
}

.site-footer a {
    color: #0b3b82;
    font-weight: 700;
}

.footer-inquire {
    width: auto;
    padding: 12px 28px;
    margin-top: 10px;
}

/* -------------------------
   INQUIRY FORM (DIALOG)
------------------------- */

#inquiryDialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    width: min(500px, 92vw);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#inquiryDialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

#inquiryForm {
    padding: 25px;
}

#inquiryForm h2 {
    margin: 0 0 5px;
    color: #0b3b82;
}

.inquiry-billboard {
    margin: 0 0 18px;
    color: #555;
    font-weight: 700;
}

#inquiryForm label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
}

#inquiryForm input,
#inquiryForm textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 10px;
    font-size: 16px;      /* 16px stops iPhones zooming in on focus */
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.hp {
    position: absolute !important;
    left: -9999px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.cancel-button {
    background-color: #888;
}

.cancel-button:hover {
    background-color: #666;
}

#inquiryStatus {
    margin: 12px 0 0;
    font-weight: 700;
    color: #0b3b82;
}

/* -------------------------
   CARD PHOTO
------------------------- */

.photo-button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    line-height: 0;
}

.photo-button:hover {
    background: none;
}

.photo-button:hover .billboard-photo {
    opacity: 0.92;
}

.photo-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 13px;
    line-height: 1.4;
}

.popup-photo {
    display: block;
    width: 220px;
    height: 130px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* -------------------------
   PHOTO VIEWER
------------------------- */

#photoDialog {
    width: min(900px, 95vw);
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #111;
    overflow: hidden;
}

#photoDialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

#photoMain {
    display: block;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    background: #000;
}

.photo-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    color: white;
}

.photo-nav button {
    width: auto;
    padding: 4px 18px;
    font-size: 26px;
    line-height: 1.2;
    background-color: #333;
}

.photo-nav button:hover {
    background-color: #555;
}

#photoClose {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    font-size: 24px;
    line-height: 1;
    z-index: 1;
}

/* -------------------------
   MOBILE MAP IMPROVEMENTS
------------------------- */

@media (max-width: 600px) {

    /* Taller map, but still leaves room above/below to scroll the page */
    #map {
        height: 60vh;
        min-height: 360px;
    }

    /* Compact popup: hide the long parts, keep the key info and buttons */
    .popup-photo,
    .popup-details {
        display: none;
    }

    .leaflet-popup-content {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Bigger, easier-to-tap zoom buttons */
    .leaflet-touch .leaflet-bar a {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 22px;
    }
}

.photo-accent {
    height: 6px;
    background: #0b3b82;
}