/* ==========================================================================
   Mittal Builders — Blog & News editorial skin
   SCOPE: every rule in this file is namespaced under .mb-editorial.
   Used only by: blog.php, blog-detailed.php, news-media.php, news-detailed.php
   Do not add any selector here that is not prefixed with .mb-editorial
   ========================================================================== */

.mb-editorial {
    --mb-charcoal: #5b5b5b;
    --mb-charcoal-dark: #474747;
    --mb-navy: #08234D;
    --mb-gold: #AB8C47;
    --mb-gold-dark: #937639;
    --mb-white: #ffffff;
    --mb-bg: #f7f6f3;
    --mb-border: #e6e2da;
    --mb-muted: #6b6b6b;
    --mb-shadow-sm: 0 2px 14px rgba(8, 35, 77, .06);
    --mb-shadow-md: 0 22px 45px -20px rgba(8, 35, 77, .28);
    --mb-radius-lg: 16px;
    --mb-radius-md: 10px;
    --mb-radius-sm: 6px;
    --mb-ease: cubic-bezier(.22, .61, .36, 1);

    background: var(--mb-bg);
    font-family: 'Lato', sans-serif;
    padding: 8px 0 8px;
}

.mb-editorial a { text-decoration: none; }

.mb-editorial a:focus-visible,
.mb-editorial button:focus-visible {
    outline: 2px solid var(--mb-gold-dark);
    outline-offset: 3px;
}

/* -------------------------------------------------- Section shell -------------------------------------------------- */

.mb-editorial .mb-section {
    padding: 56px 0 76px;
}

.mb-editorial .mb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mb-gold-dark);
    margin-bottom: 10px;
}

.mb-editorial .mb-results-count {
    font-size: .82rem;
    color: var(--mb-muted);
    margin-bottom: 26px;
}

/* -------------------------------------------------- Card grid -------------------------------------------------- */

.mb-editorial .mb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 26px;
}

.mb-editorial .mb-card {
    background: var(--mb-white);
    border: 1px solid var(--mb-border);
    border-radius: var(--mb-radius-lg);
    overflow: hidden;
    box-shadow: var(--mb-shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .45s var(--mb-ease), box-shadow .45s var(--mb-ease), border-color .45s var(--mb-ease);
    animation: mbFadeUp .6s var(--mb-ease) backwards;
}

.mb-editorial .mb-grid .mb-card:nth-child(1) { animation-delay: .02s; }
.mb-editorial .mb-grid .mb-card:nth-child(2) { animation-delay: .08s; }
.mb-editorial .mb-grid .mb-card:nth-child(3) { animation-delay: .14s; }
.mb-editorial .mb-grid .mb-card:nth-child(4) { animation-delay: .2s; }
.mb-editorial .mb-grid .mb-card:nth-child(5) { animation-delay: .26s; }
.mb-editorial .mb-grid .mb-card:nth-child(6) { animation-delay: .32s; }

.mb-editorial .mb-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--mb-shadow-md);
    border-color: rgba(171, 140, 71, .45);
}

/* When the final card is alone in the last row (odd total count),
   center it and span the row instead of leaving an empty grid cell. */
.mb-editorial .mb-grid > .mb-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

.mb-editorial .mb-card-media {
    position: relative;
    overflow: hidden;
    background: #f1efe9;
    line-height: 0;
}

.mb-editorial .mb-card-media img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s var(--mb-ease);
}

.mb-editorial .mb-card:hover .mb-card-media img {
    transform: scale(1.03);
}

.mb-editorial .mb-card-media-fallback {
    width: 100%;
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1efe9, #e6e2da);
    color: var(--mb-gold-dark);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.mb-editorial .mb-card-body {
    padding: 24px 26px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mb-editorial .mb-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: .72rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--mb-muted);
    font-weight: 700;
    margin-bottom: 12px;
}

.mb-editorial .mb-meta i { color: var(--mb-gold); margin-right: 5px; }

.mb-editorial .mb-meta .mb-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--mb-border);
    display: inline-block;
}

.mb-editorial .mb-card-title {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 1.24rem;
    line-height: 1.36;
    color: var(--mb-navy);
    margin-bottom: 12px;
    letter-spacing: -.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mb-editorial .mb-card-title a { color: inherit; transition: color .3s; }
.mb-editorial .mb-card:hover .mb-card-title a { color: var(--mb-gold-dark); }

.mb-editorial .mb-card-excerpt {
    font-size: .92rem;
    line-height: 1.72;
    color: var(--mb-charcoal-dark);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.mb-editorial .mb-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mb-gold);
    color: var(--mb-white) !important;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid var(--mb-gold);
    transition: background .35s var(--mb-ease), border-color .35s var(--mb-ease), transform .35s var(--mb-ease);
    margin-top: auto;
}

.mb-editorial .mb-btn:hover {
    background: var(--mb-navy);
    border-color: var(--mb-navy);
    color: #fff !important;
    transform: translateX(2px);
}

.mb-editorial .mb-btn i { transition: transform .3s var(--mb-ease); }
.mb-editorial .mb-btn:hover i { transform: translateX(3px); }

.mb-editorial .mb-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--mb-muted);
    background: var(--mb-white);
    border: 1px solid var(--mb-border);
    border-radius: var(--mb-radius-lg);
}

/* -------------------------------------------------- Sidebar -------------------------------------------------- */

.mb-editorial .mb-sidebar { position: sticky; top: 120px; }

.mb-editorial .mb-side-box {
    background: var(--mb-white);
    border: 1px solid var(--mb-border);
    border-radius: var(--mb-radius-lg);
    padding: 28px 26px;
    margin-bottom: 26px;
    box-shadow: var(--mb-shadow-sm);
}

.mb-editorial .mb-side-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mb-navy);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-bottom: 14px;
    margin-bottom: 16px;
    position: relative;
}

.mb-editorial .mb-side-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36px;
    height: 2px;
    background: var(--mb-gold);
}

.mb-editorial .mb-side-list { list-style: none; margin: 0; padding: 0; }

.mb-editorial .mb-side-list a {
    display: block;
    color: var(--mb-charcoal-dark);
    font-size: .89rem;
    line-height: 1.5;
    font-weight: 600;
    padding: 14px 0;
    border-bottom: 1px solid var(--mb-border);
    transition: color .3s, padding-left .3s;
}

.mb-editorial .mb-side-list li:first-child a { padding-top: 0; }
.mb-editorial .mb-side-list li:last-child a { border-bottom: none; padding-bottom: 0; }
.mb-editorial .mb-side-list a:hover { color: var(--mb-gold-dark); padding-left: 4px; }

.mb-editorial .mb-recent-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--mb-border);
    align-items: center;
}

.mb-editorial .mb-recent-item:first-child { padding-top: 0; }
.mb-editorial .mb-recent-item:last-child { border-bottom: none; padding-bottom: 0; }

.mb-editorial .mb-recent-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: var(--mb-radius-sm);
    overflow: hidden;
    background: #ece9e3;
}

.mb-editorial .mb-recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--mb-ease);
}

.mb-editorial .mb-recent-item:hover .mb-recent-thumb img { transform: scale(1.08); }

.mb-editorial .mb-recent-title {
    font-size: .87rem;
    font-weight: 600;
    line-height: 1.42;
    color: var(--mb-navy);
    transition: color .3s;
}

.mb-editorial .mb-recent-item:hover .mb-recent-title { color: var(--mb-gold-dark); }

/* -------------------------------------------------- Pagination -------------------------------------------------- */

.mb-editorial .mb-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 50px 0 0;
}

.mb-editorial .mb-pagination .page-link {
    min-width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--mb-border);
    color: var(--mb-charcoal-dark);
    background: var(--mb-white);
    font-size: .84rem;
    font-weight: 600;
    padding: 0 16px;
    transition: all .3s var(--mb-ease);
}

.mb-editorial .mb-pagination .page-item.active .page-link {
    background: var(--mb-gold);
    border-color: var(--mb-gold);
    color: #fff;
}

.mb-editorial .mb-pagination .page-link:hover {
    border-color: var(--mb-gold);
    color: var(--mb-gold-dark);
}

.mb-editorial .mb-pagination .page-item span.page-link {
    border: none;
    background: transparent;
}

/* -------------------------------------------------- Breadcrumb (detail pages) -------------------------------------------------- */

.mb-editorial .mb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--mb-muted);
    text-transform: uppercase;
    margin-bottom: 26px;
}

.mb-editorial .mb-breadcrumb a { color: var(--mb-charcoal-dark); transition: color .3s; }
.mb-editorial .mb-breadcrumb a:hover { color: var(--mb-gold-dark); }
.mb-editorial .mb-breadcrumb .mb-crumb-sep { color: var(--mb-border); font-size: .7rem; }
.mb-editorial .mb-breadcrumb .mb-crumb-current {
    color: var(--mb-navy);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -------------------------------------------------- Article header -------------------------------------------------- */

.mb-editorial .mb-article-title {
    font-family: 'Lato', sans-serif;
    font-weight: 800;
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    line-height: 1.24;
    letter-spacing: -.015em;
    color: var(--mb-navy);
    margin-bottom: 22px;
}

.mb-editorial .mb-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding-bottom: 26px;
    margin-bottom: 34px;
    border-bottom: 1px solid var(--mb-border);
    font-size: .82rem;
    color: var(--mb-muted);
    font-weight: 600;
}

.mb-editorial .mb-article-meta .mb-meta-item { display: flex; align-items: center; gap: 7px; }
.mb-editorial .mb-article-meta i { color: var(--mb-gold); }

.mb-editorial .mb-article-media {
    border-radius: var(--mb-radius-lg);
    overflow: hidden;
    box-shadow: var(--mb-shadow-md);
    border: 1px solid var(--mb-border);
    margin-bottom: 42px;
}

.mb-editorial .mb-article-media img { width: 100%; height: auto; display: block; }

/* -------------------------------------------------- Prose -------------------------------------------------- */

.mb-editorial .mb-prose {
    font-size: 1.04rem;
    line-height: 1.85;
    color: var(--mb-charcoal-dark);
}

.mb-editorial .mb-prose h1,
.mb-editorial .mb-prose h2,
.mb-editorial .mb-prose h3,
.mb-editorial .mb-prose h4 {
    font-weight: 800;
    color: var(--mb-navy);
    line-height: 1.32;
    letter-spacing: -.01em;
    margin: 1.85em 0 .75em;
}

.mb-editorial .mb-prose h2 { font-size: 1.55rem; }
.mb-editorial .mb-prose h3 { font-size: 1.26rem; }
.mb-editorial .mb-prose p { margin-bottom: 1.4em; }
.mb-editorial .mb-prose ul,
.mb-editorial .mb-prose ol { margin: 0 0 1.4em 1.3em; padding-left: .5em; }
.mb-editorial .mb-prose li { margin-bottom: .5em; }
.mb-editorial .mb-prose a { color: var(--mb-gold-dark); text-decoration: underline; text-underline-offset: 3px; }
.mb-editorial .mb-prose a:hover { color: var(--mb-navy); }

.mb-editorial .mb-prose blockquote {
    margin: 2em 0;
    padding: 20px 26px;
    background: #faf8f4;
    border-left: 3px solid var(--mb-gold);
    font-style: italic;
    color: var(--mb-navy);
    border-radius: 0 var(--mb-radius-sm) var(--mb-radius-sm) 0;
}

.mb-editorial .mb-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--mb-radius-md);
    margin: 1.6em 0;
}

.mb-editorial .mb-prose strong { color: var(--mb-navy); }

/* ------------------------- Inline editor images (size + alignment classes from Quill) ------------------------- */
/* Written by the blog content editor's floating size/align toolbar; see blog-admin/assets/js/blog-editor.js */

.mb-editorial .mb-prose img.image-small { width: 30%; }
.mb-editorial .mb-prose img.image-medium { width: 50%; }
.mb-editorial .mb-prose img.image-large { width: 75%; }
.mb-editorial .mb-prose img.image-full { width: 100%; }

.mb-editorial .mb-prose img.image-left { float: left; margin: 0 1.4em 1em 0; }
.mb-editorial .mb-prose img.image-center { display: block; float: none; margin-left: auto; margin-right: auto; }
.mb-editorial .mb-prose img.image-right { float: right; margin: 0 0 1em 1.4em; }

/* ------------------------- Inline editor videos (YouTube/Vimeo embeds) ------------------------- */

.mb-editorial .mb-prose iframe.ql-video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--mb-radius-md);
    margin: 1.6em 0;
}

.mb-editorial .mb-prose iframe.ql-video.video-small { max-width: 560px; }
.mb-editorial .mb-prose iframe.ql-video.video-medium { max-width: 720px; }
.mb-editorial .mb-prose iframe.ql-video.video-large { max-width: 900px; }
.mb-editorial .mb-prose iframe.ql-video.video-full { max-width: 100%; }

.mb-editorial .mb-prose iframe.ql-video.video-left { margin-left: 0; margin-right: auto; }
.mb-editorial .mb-prose iframe.ql-video.video-center { margin-left: auto; margin-right: auto; }
.mb-editorial .mb-prose iframe.ql-video.video-right { margin-left: auto; margin-right: 0; }

@media (max-width: 576px) {
    .mb-editorial .mb-prose img.image-small,
    .mb-editorial .mb-prose img.image-medium,
    .mb-editorial .mb-prose img.image-large {
        width: 100%;
        float: none;
        margin-left: 0;
        margin-right: 0;
    }

    .mb-editorial .mb-prose iframe.ql-video.video-small,
    .mb-editorial .mb-prose iframe.ql-video.video-medium,
    .mb-editorial .mb-prose iframe.ql-video.video-large {
        max-width: 100%;
    }
}

/* -------------------------------------------------- Share row -------------------------------------------------- */

.mb-editorial .mb-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 46px 0 8px;
    padding-top: 28px;
    border-top: 1px solid var(--mb-border);
}

.mb-editorial .mb-share-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mb-muted);
    width: 100%;
    margin-bottom: 14px;
}

.mb-editorial .mb-share-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.mb-editorial .mb-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--mb-border);
    color: var(--mb-charcoal-dark);
    font-size: .78rem;
    font-weight: 600;
    background: #fff;
    transition: all .3s var(--mb-ease);
    cursor: pointer;
}

.mb-editorial .mb-share-btn:hover {
    border-color: var(--mb-gold);
    color: var(--mb-navy);
    transform: translateY(-2px);
    box-shadow: var(--mb-shadow-sm);
}

/* -------------------------------------------------- Motion -------------------------------------------------- */

@keyframes mbFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .mb-editorial .mb-card { animation: none; }
    .mb-editorial .mb-card,
    .mb-editorial .mb-card-media img,
    .mb-editorial .mb-recent-thumb img { transition: none; }
}

/* -------------------------------------------------- Responsive -------------------------------------------------- */

@media (max-width: 991.98px) {
    .mb-editorial .mb-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
    .mb-editorial .mb-sidebar { position: static; margin-top: 40px; }
}

@media (max-width: 767.98px) {
    .mb-editorial .mb-section { padding: 40px 0 56px; }
    .mb-editorial .mb-grid { grid-template-columns: 1fr; gap: 24px; }
    .mb-editorial .mb-card-body { padding: 20px 20px 22px; }
    .mb-editorial .mb-article-title { font-size: 1.6rem; }
    .mb-editorial .mb-article-meta { gap: 14px; }
}

