/* ============================================================
   MXUber blog & content pages — imagery & surface layer
   Styles /blogs index (.blog-list-section / .mx-posts) and the
   article pages (.blog-details-section / .mx-article). Loaded
   AFTER front-style.scss via layouts/style.blade.php.
   All colors via --mx-* vars (mx-tokens.css) so dark mode
   inverts cleanly; photo scrims and on-photo pills stay ink.
   ============================================================ */

/* ---------- 1. index header ---------- */
.blog-list-section { background: var(--mx-bg); }
.mx-blogindex__head {
    max-width: 720px;
    margin-bottom: 44px;
}
.mx-blogindex__title {
    font-family: var(--mx-font-display, 'Inter Tight', Inter, sans-serif);
    font-size: clamp(32px, 3.8vw, 40px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--mx-ink);
    margin: 0 0 12px;
    text-wrap: balance;
}
.mx-blogindex__sub {
    font-size: 17px;
    line-height: 1.6;
    color: var(--mx-ink-2);
    margin: 0;
}

/* ---------- 2. index cards — photo 16px, Inter Tight 22px,
   hairline meta row, hover = border darken only ---------- */
.mx-posts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.mx-post {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mx-border);
    border-radius: 16px;
    padding: 14px;
    background: var(--mx-surface);
    text-decoration: none;
    transition: border-color .2s ease;
}
.mx-post:hover { border-color: var(--mx-ink); }
.mx-post__media {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--mx-surface-2);
    margin-bottom: 16px;
}
.mx-post__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.16, 1, .3, 1);
}
.mx-post:hover .mx-post__media img { transform: scale(1.04); }
.mx-post__title {
    font-family: var(--mx-font-display, 'Inter Tight', Inter, sans-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--mx-ink);
    margin: 0 0 10px;
}
.mx-post__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--mx-border);
    font-size: 13px;
    font-weight: 550;
    color: var(--mx-ink-3);
}
.mx-post__meta i { font-size: 14px; }
.mx-post__desc {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--mx-ink-2);
    margin: 10px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mx-posts__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 48px 0;
    text-align: center;
    font-size: 15px;
    color: var(--mx-ink-2);
    border: 1px dashed var(--mx-border-2);
    border-radius: 16px;
}

/* featured = first card, full-width horizontal split */
.mx-posts .mx-post:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 28px;
    align-items: center;
}
.mx-posts .mx-post:first-child .mx-post__media {
    flex: 0 0 48%;
    aspect-ratio: auto;
    min-height: 280px;
    margin-bottom: 0;
}
.mx-posts .mx-post:first-child .mx-post__body {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.mx-posts .mx-post:first-child .mx-post__title {
    font-size: clamp(24px, 2.4vw, 30px);
}

@media (max-width: 767.98px) {
    .mx-posts { grid-template-columns: 1fr; }
    .mx-posts .mx-post:first-child { flex-direction: column; }
    .mx-posts .mx-post:first-child .mx-post__media {
        flex: none;
        width: 100%;
        min-height: 200px;
        aspect-ratio: 16 / 10;
    }
    .mx-posts .mx-post:first-child .mx-post__body { padding-right: 0; }
}

/* ---------- 3. article hero + body images (blog + static pages) ---------- */
.blog-details-section .mx-article__hero,
.page-details-section .mx-article__hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin: 30px 0 8px;
}
.blog-details-section .mx-article__hero img,
.page-details-section .mx-article__hero img {
    border-radius: 0;
    aspect-ratio: 21 / 9;
}
/* gradient at the bottom grounds the hero for title readability
   when the title scrolls over it, and adds depth regardless */
.blog-details-section .mx-article__hero::after,
.page-details-section .mx-article__hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 42%;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0), rgba(10, 10, 10, 0.38));
    pointer-events: none;
}
.mx-article__body img {
    border-radius: 16px;
}
html:not([data-theme="dark"]) .mx-article__body img {
    box-shadow: 0 18px 40px -22px rgba(10, 10, 10, 0.28);
}

/* ---------- 4. sidebar — sticky column of card tiles ---------- */
.blog-sidebar-box {
    position: sticky;
    top: 108px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.blog-sidebar-box > div + div { margin-top: 0; } /* gaps now via flex gap */
.blog-sidebar-box .category-list-box,
.blog-sidebar-box .recent-post-box,
.blog-sidebar-box .tags-list-box {
    background: var(--mx-surface-2);
    border: 1px solid var(--mx-border); /* hairline */
    border-radius: 16px;
    padding: 4px 18px 18px;
}
.blog-sidebar-box .recent-image {
    border-radius: 10px;
    overflow: hidden;
}

/* ---------- 5. index tags — gray pill default, ink pill on hover ---------- */
.blog-sidebar-box .tags-list li a {
    background: var(--mx-surface);
    border: 1px solid var(--mx-border);
    color: var(--mx-ink-2);
    font-weight: 550;
    border-radius: 99px;
    transition: background .2s ease, color .2s ease,
                border-color .2s ease, transform .2s ease;
}
.blog-sidebar-box .tags-list li a:hover {
    background: var(--mx-accent);
    border-color: var(--mx-accent);
    color: var(--mx-on-accent);
    font-weight: 550;
    transform: translateY(-1px);
}
.blog-sidebar-box .tags-list li a.active {
    background: var(--mx-accent);
    border-color: var(--mx-accent);
    color: var(--mx-on-accent);
}
