.newspaper_map_listing {
    --newspaper-map-bg: #07160d;
    --newspaper-map-panel: #17271b;
    --newspaper-map-panel-hover: #1e3324;
    --newspaper-map-border: rgba(220, 238, 214, 0.28);
    --newspaper-map-text: #f6f3ec;
    --newspaper-map-muted: #d8b66d;
    background: var(--newspaper-map-bg);
    border: 1px solid var(--newspaper-map-border);
    border-radius: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
    gap: 14px;
    padding: 20px;
    width: 100%;
}

.newspaper_listing_search {
    --newspaper-search-bg: #07160d;
    --newspaper-search-panel: rgba(246, 243, 236, 0.12);
    --newspaper-search-border: rgba(220, 238, 214, 0.28);
    --newspaper-search-text: #f6f3ec;
    --newspaper-search-muted: rgba(246, 243, 236, 0.72);
    align-items: center;
    background: var(--newspaper-search-bg);
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    width: 100%;
}

.newspaper_listing_search_field {
    align-items: center;
    background: var(--newspaper-search-panel);
    border: 1px solid var(--newspaper-search-border);
    border-radius: 999px;
    display: flex;
    flex: 1 1 auto;
    gap: 12px;
    min-height: 54px;
    padding: 0 22px;
}

.newspaper_listing_search_icon {
    color: #91d7ac;
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

.newspaper_listing_search_input {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--newspaper-search-text);
    flex: 1 1 auto;
    font: inherit;
    min-width: 0;
    outline: 0;
    padding: 0;
}

.newspaper_listing_search_input::placeholder {
    color: var(--newspaper-search-muted);
    opacity: 1;
}

.newspaper_listing_count {
    background: var(--newspaper-search-panel);
    border: 1px solid var(--newspaper-search-border);
    border-radius: 999px;
    color: var(--newspaper-search-text);
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 19px 22px;
    text-transform: uppercase;
}

.newspaper_listing_empty {
    background: rgba(246, 243, 236, 0.1);
    border: 1px solid var(--newspaper-map-border);
    border-radius: 12px;
    color: var(--newspaper-map-text);
    display: none;
    font-weight: 800;
    padding: 18px 16px;
}

.newspaper_map_canvas_wrap {
    background: #d9e5cf;
    border-radius: 18px;
    min-height: 650px;
    overflow: hidden;
    position: relative;
}

.newspaper_map_canvas {
    height: 100%;
    min-height: 480px;
    width: 100%;
}

.newspaper_map_fallback {
    align-items: center;
    color: #243224;
    display: none;
    font-weight: 700;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: absolute;
    text-align: center;
}

.newspaper_map_listing.no-map .newspaper_map_canvas,
.newspaper_map_listing.map-unavailable .newspaper_map_canvas {
    display: none;
}

.newspaper_map_listing.no-map .newspaper_map_fallback,
.newspaper_map_listing.map-unavailable .newspaper_map_fallback {
    display: flex;
}

.newspaper_map_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow: auto;
    padding: 2px;
}

.newspaper_map_item {
    background: var(--newspaper-map-panel);
    border: 1px solid var(--newspaper-map-border);
    border-radius: 12px;
    color: var(--newspaper-map-text);
    display: block;
    padding: 18px 16px;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.newspaper_map_item:hover,
.newspaper_map_item:focus,
.newspaper_map_item.is-active {
    background: var(--newspaper-map-panel-hover);
    border-color: rgba(216, 182, 109, 0.72);
    color: var(--newspaper-map-text);
    text-decoration: none;
    transform: translateY(-1px);
}

.newspaper_map_region {
    color: var(--newspaper-map-muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.2;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.newspaper_map_name {
    color: var(--newspaper-map-text);
    display: block;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.18;
}

.newspaper_map_infowindow {
    background: linear-gradient(145deg, rgba(20, 54, 27, 0.98), rgba(12, 42, 20, 0.98));
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    color: var(--newspaper-map-text);
    font-family: inherit;
    max-width: 320px;
    min-width: 260px;
    padding: 24px 22px;
}

.newspaper_map_tooltip {
    background: #f6f3ec;
    border: 1px solid rgba(7, 22, 13, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    color: #07160d;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    max-width: 240px;
    padding: 8px 11px;
    text-align: center;
}

.newspaper_map_infowindow strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 16px;
}

.newspaper_map_infowindow span {
    color: var(--newspaper-map-muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.2;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.newspaper_map_infowindow p {
    color: rgba(246, 243, 236, 0.82);
    display: -webkit-box;
    font-size: 15px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-height: 1.45;
    margin: 0 0 24px;
    overflow: hidden;
}

.newspaper_map_infowindow a {
    border: 0;
    box-shadow: none;
    color: var(--newspaper-map-muted);
    display: inline-block;
    font-weight: 800;
    outline: 0;
    text-decoration: none;
}

.newspaper_map_infowindow a:hover,
.newspaper_map_infowindow a:focus {
    border: 0;
    box-shadow: none;
    color: #f2d89a;
    outline: 0;
    text-decoration: none;
}

.newspaper_map_listing .gm-style .gm-style-iw-c {
    background: transparent;
    border-radius: 18px;
    box-shadow: none;
    padding: 0;
}

.newspaper_map_listing .gm-style .gm-style-iw-d {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
}

.newspaper_map_listing .gm-style .gm-style-iw-tc {
    display: none !important;
}

.newspaper_map_listing .gm-style .gm-ui-hover-effect {
    display: block !important;
    opacity: 1;
    right: 4px !important;
    top: 4px !important;
}

.newspaper_map_listing .gm-style .gm-ui-hover-effect span {
    background-color: #f6f3ec;
}

/* Stop site button styles from breaking Google Maps controls. */
.newspaper_map_listing .gm-style button,
.newspaper_map_listing .gm-style input,
.newspaper_map_listing .gm-style label,
.newspaper_map_listing .gm-style select,
.newspaper_map_listing .gm-style textarea {
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.newspaper_map_listing .gm-style button {
    border-radius: 0;
    box-shadow: none;
    height: auto;
    line-height: normal;
    min-height: 0;
    padding: 0;
}

.single_newspaper .newspaper_detail_title {
    border-bottom: 5px solid var(--mr-color-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.single_newspaper .newspaper_detail_title h1 {
    margin: 0;
}

.newspaper_detail_header.has_media {
    align-items: start;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
}

.newspaper_detail_intro,
.newspaper_detail_media {
    min-width: 0;
}

.newspaper_detail_media {
    height: 100%;
    position: relative;
}

.newspaper_detail_media .thumb {
    display: block;
    height: 100%;
    overflow: hidden;
    position: absolute;
    text-decoration: none;
}

.newspaper_detail_media img {
    display: block;
    height: auto;
    width: 100%;
}

.newspaper_detail_media .media_overlay {
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.newspaper_detail_meta {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.5rem 0;
    padding: 0;
}

.newspaper_detail_meta > div {
    background: #2b543c;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    padding: 1rem;
}

.newspaper_detail_meta dt {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 0.35rem;
    opacity: 0.7;
    text-transform: uppercase;
}

.newspaper_detail_meta dd {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.newspaper_detail_links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 3em;
    margin-top: 2.25rem;
}

.newspaper_detail_link {
    align-items: center;
    border: 1px solid var(--mr-color-secondary-tint);
    border-radius: 999px;
    color: var(--mr-color-secondary-tint);
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    padding: 0.75rem 1rem;
    text-decoration: none;
}

.newspaper_detail_link span {
    margin-left: 0.5em;
}

.newspaper_detail_link:hover,
.newspaper_detail_link:focus {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.newspaper_detail_media .thumb img {
    display: block;
    height: auto;
    transition: transform 220ms ease;
    width: 100%;
}

.newspaper_detail_media .media_overlay {
    align-items: center;
    background: rgba(43, 84, 60, 0);
    color: #fff;
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 220ms ease, background-color 220ms ease;
}

.newspaper_detail_media .media_overlay::before {
    background-color: currentColor;
    content: '';
    display: inline-block;
    height: 3rem;
    -webkit-mask: url('https://static.mrwebsites.ca/icon/fa/solid/magnifying-glass.svg') no-repeat center / contain;
    mask: url('https://static.mrwebsites.ca/icon/fa/solid/magnifying-glass.svg') no-repeat center / contain;
    width: 3rem;
}

.newspaper_detail_media .thumb:hover img,
.newspaper_detail_media .thumb:focus-visible img {
    transform: scale(1.05);
}

.newspaper_detail_media .thumb:hover .media_overlay,
.newspaper_detail_media .thumb:focus-visible .media_overlay {
    background: rgba(43, 84, 60, 0.55);
    opacity: 1;
}

@media (max-width: 991px) {
    .newspaper_detail_header.has_media {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .newspaper_listing_search {
        align-items: stretch;
        flex-direction: column;
    }

    .newspaper_listing_count {
        text-align: center;
    }

    .newspaper_map_listing {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .newspaper_map_canvas_wrap,
    .newspaper_map_canvas {
        min-height: 340px;
    }

    .newspaper_map_list {
        max-height: none;
    }
}

@media (max-width: 700px) {
    .newspaper_detail_meta {
        grid-template-columns: 1fr;
    }

    .newspaper_detail_link {
        width: 100%;
    }
}

/* Per-instance display preferences; filtering still updates map markers. */
.newspaper_map_listing.no-side-listing { grid-template-columns: minmax(0, 1fr); }
.newspaper_map_list[hidden], .newspaper_directory[hidden] { display: none; }
.newspaper_detail_media.static-image { align-self: start; height: auto; }
.newspaper_detail_media.static-image img { width: 100%; height: auto; object-fit: contain; }
.newspaper_detail_media.uncropped-image { align-self: start; height: auto; }
.newspaper_detail_media.uncropped-image .thumb { position: relative; height: auto; width: 100%; }
.newspaper_detail_media.uncropped-image img { height: auto; max-height: none; object-fit: contain; }

/* Optional mutually exclusive map/listing views. */
.newspaper_map_listing[data-newspaper-view] { grid-template-columns:minmax(0,1fr); padding-block:20px; row-gap:20px; }
.newspaper_map_listing [role="tabpanel"][hidden] { display:none !important; }
.newspaper_view_tabs { grid-column:1 / -1; justify-self:center; display:inline-flex; width:fit-content; max-width:100%; gap:0; padding:4px; border:1px solid var(--newspaper-map-border); border-radius:999px; background:var(--newspaper-map-panel); }
.newspaper_view_tabs [role="tab"] { flex:1 1 0; width:auto; min-width:100px; min-height:44px; margin:0; padding:.65rem 1.5rem; border:0; border-radius:999px; background:transparent; color:var(--newspaper-map-text); font:inherit; font-weight:700; cursor:pointer; }
.newspaper_view_tabs [role="tab"][aria-selected="true"] { background:var(--mr-color-secondary); border-color:var(--mr-color-secondary); color:var(--mr-color-secondary-contrast); }
.newspaper_view_tabs [role="tab"]:focus-visible { outline:2px solid var(--mr-color-secondary); outline-offset:3px; }
.newspaper_view_tabs [role="tab"]:disabled { opacity:.5; cursor:default; }
