﻿:root {
    --mps-bg-top: #eff2f6;
    --mps-bg-bottom: #f7f9fb;
    --mps-bg: #f3f5f7;
    --mps-surface: #ffffff;
    --mps-text: #1c1f24;
    --mps-muted: #6f7782;
    --mps-border: #d9dee5;
    --mps-accent: #0a6ad8;
    --mps-radius: 14px;
    --mps-gap: 10px;
    --mps-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

* {
    box-sizing: border-box;
}

body.mps-body {
    margin: 0;
    background: linear-gradient(180deg, var(--mps-bg-top) 0%, var(--mps-bg-bottom) 100%);
    color: var(--mps-text);
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.mps-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--mps-border);
}

.mps-header-inner,
.mps-container {
    width: min(1600px, 96vw);
    margin: 0 auto;
}

.mps-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
}

.mps-brand {
    display: flex;
    align-items: center;
    gap: var(--mps-brand-gap, 10px);
    min-width: 0;
}

.custom-logo-link img {
    max-height: 36px;
    width: auto;
}

.mps-site-title,
.mps-text-logo {
    color: var(--mps-text);
    text-decoration: none;
}

.mps-site-title {
    color: var(--mps-site-title-color, var(--mps-text));
    font-family: var(--mps-site-title-font, "Segoe UI"), Tahoma, sans-serif;
    font-size: var(--mps-site-title-size, 1rem);
    font-weight: var(--mps-site-title-weight, 800);
    font-style: var(--mps-site-title-style, normal);
    text-transform: var(--mps-site-title-transform, none);
    letter-spacing: var(--mps-site-title-letter-spacing, 0);
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mps-site-title--solo {
    padding: 2px 0;
}

.mps-menu {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mps-menu a {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    color: #3e4651;
    text-decoration: none;
    font-size: calc(0.92rem + 2px);
}

.mps-menu a:hover {
    background: #edf3fb;
    color: #11498f;
}

.mps-main {
    padding: 12px 0 40px;
}

.mps-sections-wrap {
    display: grid;
    gap: 0;
}

.mps-fullwidth-widget {
    margin-bottom: 10px;
    background: var(--mps-surface);
    border-radius: var(--mps-radius);
    border: 1px solid var(--mps-border);
    box-shadow: var(--mps-shadow);
    padding: 14px;
    overflow: hidden; /* Prevent ad/media widgets from forcing horizontal scroll on mobile */
}

.mps-fullwidth-widget img {
    max-width: 100%;
    height: auto;
    display: block;
}

.mps-fullwidth-widget iframe,
.mps-fullwidth-widget video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.mps-layout-gap {
    width: 100%;
}

.mps-grid {
    display: grid;
    gap: var(--mps-gap);
}

/* Front page section layout: two 2x2 tables (left/right). */
.mps-tables {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--mps-gap);
}

.mps-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--mps-gap);
    aspect-ratio: 1 / 1;
    min-width: 0;
}

.mps-table > .mps-cell {
    min-width: 0;
    min-height: 0;
}

/* Inside fixed tables, let the grid define height; ignore intrinsic aspect ratios. */
.mps-table .mps-card--normal,
.mps-table .mps-card--top,
.mps-table .mps-card--weather,
.mps-table .mps-card--hero,
.mps-table .mps-card--feature,
.mps-table .mps-card--mega {
    aspect-ratio: auto;
}

.mps-grid.layout-1 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "a a b c"
        "d e f f";
}

.mps-grid.layout-2 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "a a b c"
        "d e f g";
}

.mps-grid.layout-3 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "a b c d"
        "e f g h";
}

.mps-grid.layout-4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-areas:
        "a a b c"
        "a a d e";
}

.mps-cell-a { grid-area: a; }
.mps-cell-b { grid-area: b; }
.mps-cell-c { grid-area: c; }
.mps-cell-d { grid-area: d; }
.mps-cell-e { grid-area: e; }
.mps-cell-f { grid-area: f; }
.mps-cell-g { grid-area: g; }
.mps-cell-h { grid-area: h; }

.mps-card {
    background: var(--mps-surface);
    border-radius: var(--mps-radius);
    border: 1px solid var(--mps-border);
    overflow: hidden;
    box-shadow: var(--mps-shadow);
    display: block;
    height: 100%;
}

.mps-card--normal,
.mps-card--top,
.mps-card--weather {
    aspect-ratio: 1 / 1;
}

.mps-card--hero,
.mps-card--feature {
    aspect-ratio: 2 / 1;
}

.mps-card--mega {
    aspect-ratio: 1 / 1;
}

.mps-widget-card {
    padding: 14px;
}

.mps-card-link {
    display: grid;
    grid-template-rows: 1fr auto;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.mps-card-media {
    width: 100%;
    height: 100%;
    background: #d7dce3;
    overflow: hidden;
}

.mps-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mps-card-media video,
.mps-card-media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mps-card-content {
    padding: 12px 14px;
    background: var(--mps-surface);
}

.mps-card-title {
    margin: 0;
    font-size: clamp(1rem, 1.8vw, 1.06rem);
    line-height: 1.3;
}

.mps-card--hero,
.mps-card--feature,
.mps-card--mega {
    position: relative;
    color: #fff;
}

.mps-card--hero .mps-card-link,
.mps-card--feature .mps-card-link,
.mps-card--mega .mps-card-link {
    display: block;
    position: relative;
    height: 100%;
}

.mps-card--hero .mps-card-media,
.mps-card--feature .mps-card-media,
.mps-card--mega .mps-card-media {
    position: absolute;
    inset: 0;
    height: 100%;
    aspect-ratio: auto;
}

.mps-card--hero .mps-card-content,
.mps-card--feature .mps-card-content,
.mps-card--mega .mps-card-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(3, 5, 8, 0.86), rgba(3, 5, 8, 0.2));
}

.mps-card--hero .mps-card-title,
.mps-card--feature .mps-card-title,
.mps-card--mega .mps-card-title {
    color: #fff;
}

.mps-card--widget-replacement {
    background: var(--mps-surface);
}

.mps-card--widget-replacement > * {
    height: 100%;
}

.mps-card--widget-replacement .widget {
    margin: 0;
    height: 100%;
}

.mps-card--widget-replacement img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mps-card--slider .mps-card-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.mps-card--slider .mps-card-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    z-index: 1;
}

.mps-card--slider .mps-card-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.mps-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(20, 24, 32, 0.64);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.mps-slider-nav--prev {
    left: 10px;
}

.mps-slider-nav--next {
    right: 10px;
}

.mps-slider-nav:hover {
    background: rgba(20, 24, 32, 0.82);
}

.mps-card--weather {
    color: var(--mps-text);
}

.mps-card--weather .mps-card-content {
    background: var(--mps-surface);
}

.mps-card--weather .mps-card-title {
    color: var(--mps-text);
}

.mps-load-more-wrap {
    display: grid;
    place-items: center;
    margin-top: 14px;
    gap: 8px;
}

.mps-load-more {
    border: 1px solid #1d6ed4;
    background: #1c75e8;
    color: #fff;
    min-width: 180px;
    padding: 11px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

.mps-load-more:hover {
    filter: brightness(1.04);
}

.mps-load-more[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.mps-load-more-msg {
    margin: 0;
    color: #425166;
    font-size: 0.9rem;
}

.mps-footer {
    margin-top: 22px;
    border-top: 1px solid var(--mps-border);
    color: #5a6370;
    background: #fff;
}

.mps-footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--mps-gap);
    padding: 18px 0 6px;
}

.mps-footer-widget {
    min-width: 0;
}

.mps-footer-title {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--mps-text);
}

.mps-footer-widget ul {
    margin: 0;
    padding-left: 18px;
}

.mps-footer-widget li {
    margin: 6px 0;
}

.mps-footer-copy {
    margin: 0;
    padding: 14px 0;
    font-size: 0.85rem;
}

.mps-single-post {
    background: var(--mps-surface);
    border: 1px solid var(--mps-border);
    border-radius: var(--mps-radius);
    padding: 18px;
    box-shadow: var(--mps-shadow);
}

.mps-single-title {
    margin: 0 0 14px;
}

.mps-single-media {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #d7dce3;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.mps-single-media img,
.mps-single-media video,
.mps-single-media iframe {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Featured image on single: keep original aspect ratio (no crop). */
.mps-single-media img {
    aspect-ratio: auto;
    object-fit: contain;
    height: auto;
}

.mps-single-content {
    line-height: 1.65;
}

@media (min-width: 900px) {
    /* Single post: wrap text around in-content images, aligned right. */
    body.single .mps-single-content::after {
        content: "";
        display: block;
        clear: both;
    }

    body.single .mps-single-content img {
        max-width: 100%;
        height: auto;
    }

    body.single .mps-single-content figure.wp-block-image {
        float: right;
        margin: 0 0 14px 16px;
        width: min(820px, 100%);
        max-width: 820px;
    }

    body.single .mps-single-content figure.wp-block-image img {
        display: block;
        width: 100%;
        height: auto;
    }

    body.single .mps-single-content p > img,
    body.single .mps-single-content a > img {
        float: right;
        margin: 0 0 14px 16px;
        width: min(820px, 100%);
        max-width: 820px;
        display: block;
    }

    /* Don't break galleries: keep gallery layout intact and avoid floats. */
    body.single .mps-single-content figure.wp-block-gallery {
        clear: both;
    }

    body.single .mps-single-content figure.wp-block-gallery figure.wp-block-image {
        float: none;
        width: auto;
        max-width: 100%;
        margin: 0;
    }
}

.mps-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: var(--mps-gap);
    align-items: start;
}

.mps-content-layout.mps-no-sidebar {
    grid-template-columns: 1fr;
}

.mps-content-layout.mps-sidebar-left {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
}

.mps-content-main {
    min-width: 0;
}

.mps-sidebar {
    min-width: 0;
}

.mps-sidebar-widget {
    background: var(--mps-surface);
    border-radius: var(--mps-radius);
    border: 1px solid var(--mps-border);
    box-shadow: var(--mps-shadow);
    padding: 14px;
    margin-bottom: var(--mps-gap);
}

.mps-sidebar-title {
    margin: 0 0 10px;
    font-size: 1rem;
}

@media (max-width: 1160px) {
    .mps-grid.layout-3 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "a a"
            "b c"
            "d e"
            "f g"
            "h h";
    }

    .mps-grid.layout-4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "a a"
            "a a"
            "b c"
            "d e";
    }

    .mps-grid.layout-2 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "a a"
            "b c"
            "d e"
            "f g";
    }

    .mps-grid.layout-1 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "a a"
            "b c"
            "d e"
            "f f";
    }
}

@media (max-width: 760px) {
    .mps-content-layout,
    .mps-content-layout.mps-sidebar-left {
        grid-template-columns: 1fr;
    }

    .mps-tables {
        grid-template-columns: 1fr;
    }

    .mps-header-inner {
        flex-wrap: wrap;
        justify-content: center;
        padding: 8px 0;
    }

    .mps-nav {
        width: 100%;
        overflow: auto;
    }

    .mps-menu {
        width: max-content;
        padding-bottom: 5px;
    }

    .mps-news-section .mps-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-areas: none !important;
        grid-auto-flow: row !important;
    }

    .mps-news-section .mps-grid > .mps-cell {
        grid-area: auto !important;
        min-width: 0;
    }

    .mps-news-section .mps-card {
        min-width: 0;
    }

    /* Front page: 1x1 cards (mps-card--normal) should prioritize the image. */
    #mps-sections-wrap .mps-card--normal .mps-card-content {
        padding: 5px 8px 7px; /* 3-5px top gap from image + minimal overall padding */
    }

    #mps-sections-wrap .mps-card--normal .mps-card-title {
        line-height: 1.08;
        /* Prefer condensed faces when available; otherwise, gently compress. */
        font-family: "Arial Narrow", "Segoe UI", Tahoma, sans-serif;
        font-stretch: condensed;
        letter-spacing: -0.02em;
        font-size: 0.95rem;

        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .mps-footer-widgets {
        grid-template-columns: 1fr;
        padding-top: 14px;
    }
}

/* Phones/tablets: force stacking even if the layout viewport is widened by some overflow/zoom. */
@media (hover: none) and (pointer: coarse) {
    .mps-tables {
        grid-template-columns: 1fr;
    }
}
