/* MailPac locations page (app/Views/front_end/location_view.php). Loaded after site.css,
   which holds the tokens, page header, buttons, badges and pink band. */

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

/* ------------------------------------------------- page head (+ optional admin banner) */
.mp-pagehead--finder { padding-bottom: 132px; }
.mp-pagehead__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.mp-pagehead--art .mp-pagehead__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.mp-pagehead__art img { width: 100%; max-height: 240px; object-fit: contain; }

/* ------------------------------------------------- parish finder (overlaps the band) */
.mp-finder-wrap {
    position: relative;
    z-index: 3;
    margin-top: -92px;
}
.mp-finder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 28px;
    border-radius: var(--mp-radius);
    background: var(--mp-white);
    box-shadow: var(--mp-shadow-lg);
}
.mp-finder__field {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 420px;
    min-width: 0;
}
.mp-finder__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--mp-sky);
    color: var(--mp-blue);
}
.mp-finder__icon svg { width: 28px; height: 28px; }
.mp-finder__control { flex: 1; display: grid; gap: 6px; min-width: 0; max-width: 420px; }
.mp-finder .mp-select { cursor: pointer; }
.mp-finder__count {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--mp-sky);
    color: var(--mp-blue);
    font-size: 14px;
    font-weight: 600;
}

/* ------------------------------------------------- location cards */
.mp-loc-section { padding: 56px 0 96px; }
.mp-loc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.mp-loc {
    display: flex;
    flex-direction: column;
    border-radius: var(--mp-radius);
    background: var(--mp-white);
    border: 1px solid var(--mp-line);
    box-shadow: 0 6px 18px rgba(12, 62, 157, 0.06);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.mp-loc:hover { border-color: #B9C6E6; box-shadow: var(--mp-shadow); }
.mp-loc[hidden] { display: none; }

/* Line the cards of one row up: name, hours and directions start at the same height. */
@supports (grid-template-rows: subgrid) {
    .mp-loc {
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0;
    }
}

.mp-loc__head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 20px;
}
.mp-loc__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--mp-sky);
    color: var(--mp-blue);
    transition: background-color .18s ease, color .18s ease;
}
.mp-loc:hover .mp-loc__icon { background: var(--mp-pink); color: var(--mp-white); }
.mp-loc__icon svg { width: 24px; height: 24px; }
.mp-loc__name {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--mp-blue);
    overflow-wrap: anywhere;
}
.mp-loc__address { margin-top: 4px; font-size: 14px; color: var(--mp-muted); overflow-wrap: anywhere; }

.mp-loc__hours {
    flex: 1;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--mp-line);
}
.mp-loc__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mp-blue);
}
.mp-loc__label svg { width: 16px; height: 16px; color: var(--mp-pink); }
.mp-loc__nohours { font-size: 14px; color: var(--mp-muted); }

.mp-hours { display: grid; gap: 8px; margin: 0; }
.mp-hours__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    font-size: 14px;
}
.mp-hours dt { color: var(--mp-ink); font-weight: 500; }
.mp-hours dd { margin: 0; color: var(--mp-ink); text-align: right; font-variant-numeric: tabular-nums; }
.mp-hours__row.is-closed > dd:not(.mp-hours__note) { color: var(--mp-pink-600); font-weight: 600; }
.mp-hours dd.mp-hours__note {
    flex-basis: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--mp-pink-50);
    text-align: left;
}
.mp-hours__note-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: var(--mp-ink);
    white-space: pre-line;
}
.mp-hours__note-text.is-open { display: block; -webkit-line-clamp: unset; }
.mp-hours__more {
    margin-top: 4px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--mp-pink-600);
    font: 600 13px/1.4 "Poppins", sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.mp-loc__foot {
    padding: 14px 24px;
    border-top: 1px solid var(--mp-line);
    background: var(--mp-sky-2);
}
.mp-loc__dir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mp-blue);
    text-decoration: none;
}
.mp-loc__dir svg { width: 18px; height: 18px; transition: transform .18s ease; }
.mp-loc__dir:hover { color: var(--mp-pink-600); }
.mp-loc__dir:hover svg { transform: translateX(3px); }

/* ------------------------------------------------- empty states */
.mp-loc-empty {
    max-width: 560px;
    margin: 8px auto 0;
    padding: 44px 28px;
    border-radius: var(--mp-radius);
    border: 1px dashed #C9D3EA;
    background: var(--mp-sky-2);
    text-align: center;
}
.mp-loc-empty[hidden] { display: none; }
.mp-loc-empty__icon {
    display: inline-grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--mp-white);
    color: var(--mp-blue);
    box-shadow: 0 6px 18px rgba(12, 62, 157, 0.08);
}
.mp-loc-empty__icon svg { width: 28px; height: 28px; }
.mp-loc-empty h2 { font-size: 22px; font-weight: 600; color: var(--mp-blue); line-height: 1.3; }
.mp-loc-empty p { margin-top: 8px; color: var(--mp-muted); }
.mp-loc-empty .mp-btn { margin-top: 22px; }

/* ------------------------------------------------- closure notice dialog */
.mp-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: calc(100% - 48px);
    padding: 0;
    border: 0;
    border-radius: var(--mp-radius);
    background: var(--mp-white);
    color: var(--mp-ink);
    box-shadow: var(--mp-shadow-lg);
}
.mp-dialog::backdrop { background: rgba(6, 31, 82, 0.55); }
.mp-dialog__box { padding: 26px 28px 24px; }
.mp-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.mp-dialog__head h2 { font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--mp-blue); }
.mp-dialog__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: -6px -8px 0 0;
    border: 0;
    border-radius: 50%;
    background: var(--mp-sky);
    color: var(--mp-blue);
    cursor: pointer;
}
.mp-dialog__close:hover { background: var(--mp-pink); color: var(--mp-white); }
.mp-dialog__close svg { width: 20px; height: 20px; }
.mp-dialog__meta { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--mp-pink-600); }
.mp-dialog__text { margin-top: 14px; color: var(--mp-ink); white-space: pre-line; overflow-wrap: anywhere; }
.mp-dialog__actions { margin-top: 24px; text-align: right; }

/* ------------------------------------------------- responsive */
@media (max-width: 1080px) {
    .mp-loc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
    .mp-pagehead--finder { padding-bottom: 116px; }
    .mp-pagehead--art .mp-pagehead__grid { grid-template-columns: minmax(0, 1fr); }
    .mp-pagehead__art { display: none; }
}

@media (max-width: 700px) {
    .mp-loc-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .mp-loc-section { padding: 40px 0 72px; }
}

@media (max-width: 600px) {
    .mp-finder { padding: 20px 18px; }
    .mp-finder__field { flex-basis: 100%; gap: 14px; }
    .mp-finder__icon { width: 48px; height: 48px; border-radius: 14px; }
    .mp-finder__control { max-width: none; }
    .mp-loc__head { padding: 20px 18px 16px; }
    .mp-loc__hours { padding: 16px 18px 18px; }
    .mp-loc__foot { padding: 12px 18px; }
    .mp-dialog__box { padding: 22px 20px 20px; }
}
