/*
 * My Burrito Finder
 * Copyright 2016-2026 Andrew Hughes
 *
 * One stylesheet, mobile first. This replaces the old desktop.css/mobile.css
 * pair, which duplicated most of their rules and switched between them on a
 * hard 499px breakpoint — so tablets got the phone layout and nothing in
 * between ever laid out properly.
 */

/* ------------------------------------------------------------------ reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'PT Sans Narrow', 'Arial Narrow', Arial, sans-serif;
    font-weight: 700;
    color: #2b2b2b;
    background: #cccccc url("../img/listingBackground.jpg") no-repeat center;
    background-size: cover;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

p {
    margin: 0 0 0.35em;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

a {
    color: #007a1f;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------------- layout */

/*
 * Mobile: map on top, results beneath, each taking half the viewport.
 * The old build faked this with negative top offsets of up to -110vh, which
 * broke the moment a phone's toolbar changed the viewport height.
 */
.layout {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#map {
    flex: 0 0 50%;
    width: 100%;
    z-index: 1;
    background: #dddddd;
}

.listBox {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #cccccc url("../img/listingBackground.jpg") no-repeat center;
    background-size: cover;
}

@media (min-width: 700px) {
    /* Wide: map fills the space, results dock to the right. */
    .layout {
        flex-direction: row;
    }

    #map {
        flex: 1 1 auto;
        height: 100%;
    }

    .listBox {
        flex: 0 0 340px;
        height: 100%;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.25);
    }
}

@media (min-width: 1200px) {
    .listBox {
        flex-basis: 400px;
    }
}

/* -------------------------------------------------------------- top panel */

.topItem {
    background: #ffffff url("../img/helloBackground.png") no-repeat center;
    background-size: cover;
    border-bottom: 4px solid #c62828;
}

.topItemInner {
    padding: 14px 16px 16px;
    background: rgba(255, 255, 255, 0.86);
}

.mbfLogo {
    max-width: 210px;
    margin: 0 auto 12px;
}

#burritoForm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.formItem {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
}

#theArea {
    padding: 10px 12px;
    border: 2px solid #b5b5b5;
    border-radius: 4px;
    background: #ffffff;
    color: #2b2b2b;
}

#theArea:focus {
    outline: none;
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.25);
}

#burritoButton {
    padding: 11px 12px;
    border: none;
    border-radius: 4px;
    background: #c62828;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#burritoButton:hover:not(:disabled) {
    background: #a11d1d;
}

#burritoButton:focus-visible {
    outline: 3px solid #007a1f;
    outline-offset: 2px;
}

#burritoButton:disabled {
    background: #999999;
    cursor: progress;
}

/* ----------------------------------------------------- autocomplete */

.areaField {
    position: relative;
}

.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    border: 2px solid #c62828;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.suggestion {
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid #eeeeee;
    cursor: pointer;
    text-align: left;
}

.suggestion:last-child {
    border-bottom: none;
}

.suggestion:hover,
.suggestion.is-active {
    background: #fdeaea;
}

.suggestionLabel {
    display: block;
    font-size: 0.95rem;
    color: #c62828;
    line-height: 1.2;
}

.suggestionDetail {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: #666666;
}

.status {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #e8f5e9;
    color: #1b5e20;
}

.status.is-error {
    background: #ffebee;
    color: #b71c1c;
}

.badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.hughesWDLogo {
    flex: 0 1 45%;
}

.appLogo {
    flex: 0 1 32%;
}

/*
 * Credits sit below every listing rather than in the header panel. The
 * OpenStreetMap credit is a licence condition, so it must stay visible.
 */
.listFooter {
    padding: 14px 16px 22px;
    border-top: 1px solid #d8d8d8;
    background: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.attribution {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 400;
    color: #5a5a5a;
}

.siteLinks {
    margin: 6px 0 0;
    font-size: 0.72rem;
    font-weight: 400;
}

/* --------------------------------------------------------------- listings */

.burritoListing {
    padding: 12px 16px;
    border-bottom: 1px solid #d8d8d8;
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.burritoListing:hover,
.burritoListing:focus-visible {
    background: #ffffff;
    outline: none;
    border-left: 5px solid #007a1f;
    padding-left: 11px;
}

.listItemBox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.listingInfo {
    flex: 1 1 auto;
    min-width: 0;
}

.storeImg {
    flex: 0 0 84px;
    width: 84px;
    border-radius: 4px;
    overflow: hidden;
}

.storeImg img {
    width: 84px;
    height: 84px;
    object-fit: cover;
}

.listingName {
    font-size: 1.1rem;
    color: #c62828;
    line-height: 1.2;
}

.listingAddress,
.listingHours {
    font-weight: 400;
    font-size: 0.88rem;
    color: #444444;
}

.listingDistance {
    font-size: 0.85rem;
    color: #007a1f;
}

.listingPhone {
    font-size: 0.88rem;
}

.listingPhone a {
    text-decoration: none;
}

.listingRating {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.85rem;
}

.ratingValue {
    padding: 1px 7px;
    border-radius: 3px;
    background: #007a1f;
    color: #ffffff;
}

.ratingScale,
.ratingPrice {
    color: #555555;
}

/* Foursquare's terms require its contribution to be credited where shown. */
.ratingSource {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8a8a;
}

.listingLinks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 400;
}

/* ---------------------------------------------------------------- popups */

.burritoInfo {
    text-align: center;
    min-width: 150px;
}

.popupName {
    font-size: 1.05rem;
    color: #c62828;
}

.popupHint {
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    color: #777777;
}

/* The "find burritos here?" offer, shown where the visitor clicks the map. */
.searchHere {
    text-align: center;
    min-width: 160px;
}

.searchHereTitle {
    font-size: 1rem;
    color: #c62828;
}

.searchHereCoords {
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    color: #777777;
}

.searchHereButton {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: #007a1f;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.searchHereButton:hover {
    background: #005c17;
}

.searchHereButton:focus-visible {
    outline: 3px solid #c62828;
    outline-offset: 2px;
}

.userLoc {
    font-size: 1rem;
    font-weight: 700;
}

/* ------------------------------------------------------------ welcome mat */

.cover {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.cover.is-hidden {
    display: none;
}

.helloBox {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 26px 24px;
    border-radius: 8px;
    background: #ffffff url("../img/helloBackground.png") no-repeat center;
    background-size: cover;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.dismissCover {
    position: absolute;
    top: 6px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 1.9rem;
    line-height: 1;
    color: #c62828;
    cursor: pointer;
}

.dismissCover:focus-visible {
    outline: 3px solid #007a1f;
    outline-offset: 2px;
}

.helloTitle {
    margin: 0 0 12px;
    font-size: 2.3rem;
    color: #c62828;
}

.helloTag {
    color: #00701a;
    font-size: 1rem;
}

.helloTag p {
    margin-bottom: 0.6em;
}

.helloFine {
    margin-top: 14px;
    font-size: 0.8rem;
    font-weight: 400;
    color: #555555;
}

/* ------------------------------------------------- document pages */

/*
 * Standalone content pages such as the privacy policy. The app layout above
 * is a fixed full-height split; these pages are ordinary scrolling documents,
 * so the body rules are relaxed for them.
 */
.docPage {
    height: auto;
    font-weight: 400;
    background: #f4f1ea url("../img/listingBackground.jpg") repeat;
    color: #2b2b2b;
}

.doc {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 22px 60px;
    background: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
}

.doc h1 {
    margin: 0 0 4px;
    font-size: 2.2rem;
    color: #c62828;
}

.doc h2 {
    margin: 34px 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #eeeeee;
    font-size: 1.3rem;
    color: #c62828;
}

.doc p {
    margin: 0 0 12px;
}

.doc ul {
    margin: 0 0 12px;
    padding-left: 22px;
    list-style: disc;
}

.doc li {
    margin-bottom: 6px;
}

.doc a {
    color: #007a1f;
}

.doc code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #eceff1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
}

.docMeta {
    margin-bottom: 22px;
    font-size: 0.85rem;
    color: #777777;
}

.docBack {
    font-size: 0.9rem;
}

.docSummary {
    margin: 22px 0 8px;
    padding: 16px 18px;
    border-left: 5px solid #007a1f;
    background: #f1f8f2;
}

.docSummary h2 {
    margin-top: 0;
    border-bottom: none;
    color: #00701a;
}

.docSummary p:last-child {
    margin-bottom: 0;
}

/* Wide tables must scroll inside themselves, never widen the page. */
.docTable {
    display: block;
    width: 100%;
    overflow-x: auto;
    margin: 0 0 16px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.docTable th,
.docTable td {
    padding: 8px 10px;
    border: 1px solid #dddddd;
    text-align: left;
    vertical-align: top;
}

.docTable th {
    background: #f5f5f5;
    font-weight: 700;
}

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
