/*
 * UMMS Post Template — structural layout only.
 * Fonts, colours and base typography are inherited from the active theme.
 * Only layout, spacing and UMMS-specific UI elements (hero, category chips,
 * meta row, reading-time, tags, footer badge) are defined here.
 */

/* ── Box model ─────────────────────────────────────────────────── */
.umms-post-wrap *,
.umms-post-wrap *::before,
.umms-post-wrap *::after {
    box-sizing: border-box;
}

/* ── Outer wrapper ─────────────────────────────────────────────── */
.umms-post-wrap {
    --umms-radius: 0.5rem;
    /* Respect the active theme's content width (set via theme.json on block
       themes); fall back to a comfortable reading width for classic themes
       that don't define these custom properties. */
    --umms-container: var(--wp--style--global--content-size, 42rem);
    --umms-container-wide: var(--wp--style--global--wide-size, 64rem);
    margin-bottom: 4rem;
}

/* ── Container ─────────────────────────────────────────────────── */
.umms-post-container {
    max-width: var(--umms-container);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
}

.umms-post-container--full {
    max-width: var(--umms-container-wide);
}

/* ── Category chips ────────────────────────────────────────────── */
.umms-post-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.umms-post-cat {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid currentColor;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.umms-post-cat:hover {
    opacity: 1;
    text-decoration: none;
}

/* ── Title ─────────────────────────────────────────────────────── */
.umms-post-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem;
    letter-spacing: -0.01em;
}

/* ── Meta row ──────────────────────────────────────────────────── */
.umms-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    opacity: 0.65;
    margin-bottom: 1.5rem;
}

.umms-post-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.umms-post-meta__icon {
    width: 0.9375rem;
    height: 0.9375rem;
    flex-shrink: 0;
}

/* ── Divider ───────────────────────────────────────────────────── */
.umms-post-divider {
    height: 1px;
    background: currentColor;
    opacity: 0.12;
    margin-bottom: 2rem;
}

/* ── Body content ──────────────────────────────────────────────── */
.umms-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--umms-radius);
    margin: 1rem 0;
}

/* Hide the byline paragraph injected by UMMS push — the template renders
   author from WP meta in the meta row above instead. */
.umms-post-content .wp-byline {
    display: none;
}

/* ── Post navigation ───────────────────────────────────────────────
   Arrow + title only (no "Previous"/"Next" text) — direction is carried
   via aria-label on the link for screen readers. All colours derive from
   currentColor (the theme's own text colour) via color-mix() so the block
   adapts automatically to light/dark themes — no hardcoded hex. */
.umms-post-nav {
    display: flex;
    margin-top: 3rem;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.umms-post-nav__item {
    flex: 1;
    min-width: 0;
}

.umms-post-nav__item--next {
    border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.umms-post-nav__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 1.25rem 1rem;
    color: currentColor;
    text-decoration: none;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.umms-post-nav__link:hover,
.umms-post-nav__link:focus-visible {
    background-color: color-mix(in srgb, currentColor 6%, transparent);
    text-decoration: none;
}

.umms-post-nav__item--next .umms-post-nav__link {
    justify-content: flex-end;
    text-align: right;
}

.umms-post-nav__arrow {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.umms-post-nav__item--prev:hover .umms-post-nav__arrow,
.umms-post-nav__item--prev .umms-post-nav__link:focus-visible .umms-post-nav__arrow {
    opacity: 1;
    transform: translateX(-4px);
}

.umms-post-nav__item--next:hover .umms-post-nav__arrow,
.umms-post-nav__item--next .umms-post-nav__link:focus-visible .umms-post-nav__arrow {
    opacity: 1;
    transform: translateX(4px);
}

.umms-post-nav__title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .umms-post-container {
        padding: 1.5rem 1rem;
    }

    .umms-post-meta {
        gap: 0.625rem;
    }

    .umms-post-meta__reading-time {
        display: none;
    }

    .umms-post-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
