/**
 * Mpala Editorial Helper — front-end shortcode styling
 * Built per Editorial Brief V5 §3 (locked tokens) and §6 (single-story system).
 *
 * Tokens used:
 *   --mpala-cream:    #E1DDD3
 *   --mpala-brown:    #BC5C39
 *   --mpala-navy:     #384360
 *   --mpala-charcoal: #2F3A3A
 *   --mpala-text:     #1A1A1A
 *   --mpala-grey-300: #D4D4D4
 *   --mpala-grey-500: #737373
 *   --mpala-gold:     #E3B23C
 */

:root {
    --meh-cream: #E1DDD3;
    --meh-brown: #BC5C39;
    --meh-navy: #384360;
    --meh-charcoal: #2F3A3A;
    --meh-text: #1A1A1A;
    --meh-grey-300: #D4D4D4;
    --meh-grey-500: #737373;
    --meh-gold: #E3B23C;
    --meh-radius-card: 12px;
    --meh-radius-pill: 999px;
    --meh-font: 'Ubuntu', system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   Context label  — [mpala_context_label]
   ========================================================================== */
.meh-context-label {
    display: inline-block;
    font-family: var(--meh-font);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--meh-brown);
    text-decoration: none;
    margin-bottom: 12px;
}
.meh-context-label:hover { color: var(--meh-charcoal); text-decoration: underline; }

/* ==========================================================================
   Meta row — [mpala_meta_row]
   ========================================================================== */
.meh-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    font-family: var(--meh-font);
    font-size: 14px;
    color: var(--meh-charcoal);
    margin: 0 0 24px;
}
.meh-meta__pill {
    display: inline-block;
    background: var(--meh-brown);
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--meh-radius-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    text-decoration: none;
}
.meh-meta__pill:hover { background: var(--meh-charcoal); color: #fff; }
.meh-meta__date { font-weight: 500; }
.meh-meta__sep { color: var(--meh-grey-500); }
.meh-meta__byline a { color: inherit; }

/* ==========================================================================
   Media block — [mpala_media_block]
   ========================================================================== */
.meh-media {
    width: 100%;
    margin: 0 0 28px;
    border-radius: var(--meh-radius-card);
    overflow: hidden;
    background: var(--meh-cream);
}
.meh-media__img,
.meh-media img { display: block; width: 100%; height: auto; }
.meh-media--video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.meh-media__poster {
    display: block; width: 100%; height: 100%;
    border: 0; padding: 0; cursor: pointer; background: transparent; position: relative;
}
.meh-media__poster img { object-fit: cover; width: 100%; height: 100%; }
.meh-media__play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 76px; height: 76px; border-radius: 50%;
    background: rgba(47, 58, 58, 0.85); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; line-height: 1; padding-left: 6px;
    transition: background 0.2s ease;
}
.meh-media__poster:hover .meh-media__play { background: var(--meh-brown); }
.meh-media__embed { width: 100%; aspect-ratio: 16 / 9; }
.meh-media__embed iframe { width: 100%; height: 100%; border: 0; }

/* ==========================================================================
   Related rail — [mpala_related_rail]
   White card on cream page base, per brief §3 calm interior + mockup direction.
   ========================================================================== */
.meh-rail-related {
    background: #FFFFFF;
    border-radius: var(--meh-radius-card);
    padding: 22px 24px;
    font-family: var(--meh-font);
    box-shadow: 0 2px 8px rgba(47, 58, 58, 0.06);
}
.meh-rail-related__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--meh-navy);
    margin: 0 0 14px;
}
.meh-rail-related__list { list-style: none; padding: 0; margin: 0; }
.meh-rail-related__item + .meh-rail-related__item {
    border-top: 1px solid var(--meh-grey-300);
    padding-top: 14px;
    margin-top: 14px;
}
.meh-rail-related__link { display: flex; gap: 12px; text-decoration: none; color: var(--meh-text); }
.meh-rail-related__thumb {
    flex: 0 0 72px;
    width: 72px; height: 72px;
    border-radius: 8px; overflow: hidden;
}
.meh-rail-related__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meh-rail-related__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meh-rail-related__cat {
    font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--meh-brown); text-transform: uppercase;
}
.meh-rail-related__heading {
    font-size: 14px; font-weight: 700;
    color: var(--meh-navy); line-height: 1.35;
}
.meh-rail-related__link:hover .meh-rail-related__heading { color: var(--meh-brown); }
.meh-rail-related__date { font-size: 12px; color: var(--meh-grey-500); }

/* ==========================================================================
   Related grid — [mpala_related_grid]
   WHITE band sitting on the cream page base, so it reads as a distinct
   section. White cards inside (with shadow) read as panels on the white band.
   ========================================================================== */
.meh-related-grid {
    background: #FFFFFF;
    padding: clamp(40px, 5vw, 72px) 0;
    margin-top: 56px;
    /* Allow this section to span full viewport width even when nested inside
       a max-width wrapper (Theme Builder containers). */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.meh-related-grid__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.meh-related-grid__title {
    font-family: var(--meh-font);
    font-weight: 700;
    color: var(--meh-navy);
    text-align: center;
    margin: 0 0 32px;
    font-size: clamp(24px, 3vw, 32px);
}
.meh-related-grid__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    align-items: stretch;
}
.meh-related-grid__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--meh-radius-card);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(47, 58, 58, 0.08);
}
.meh-related-grid__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--meh-cream);
}
.meh-related-grid__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meh-related-grid__body {
    padding: 18px 20px 22px;
    display: flex; flex-direction: column; gap: 10px; flex: 1 1 auto;
}
.meh-related-grid__cat {
    font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--meh-brown); text-transform: uppercase;
}
.meh-related-grid__heading {
    font-family: var(--meh-font);
    font-size: 18px; font-weight: 700; line-height: 1.3;
    color: var(--meh-navy); margin: 0;
}
.meh-related-grid__heading a { color: inherit; text-decoration: none; }
.meh-related-grid__heading a:hover { color: var(--meh-brown); }
.meh-related-grid__meta { font-size: 12px; color: var(--meh-grey-500); margin: 0; }
.meh-related-grid__excerpt {
    font-size: 14px; color: var(--meh-text); margin: 0;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.meh-related-grid__more {
    font-size: 13px; font-weight: 700; color: var(--meh-brown); text-decoration: none;
    margin-top: auto;
}
.meh-related-grid__more:hover { color: var(--meh-charcoal); }

/* ==========================================================================
   Prev / Next — [mpala_prev_next]
   ========================================================================== */
.meh-prevnext {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--meh-grey-300);
    font-family: var(--meh-font);
}
.meh-prevnext__link,
.meh-prevnext__placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--meh-grey-300);
    border-radius: var(--meh-radius-card);
    text-decoration: none;
    color: var(--meh-text);
    min-height: 64px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.meh-prevnext__placeholder { background: transparent; border-color: transparent; }
.meh-prevnext__link:hover { border-color: var(--meh-brown); background: #fdf6f1; }
.meh-prevnext__link--next { text-align: right; }
.meh-prevnext__dir {
    font-size: 12px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--meh-brown); text-transform: uppercase;
}
.meh-prevnext__title {
    font-size: 14px; font-weight: 700; color: var(--meh-navy);
}
@media (max-width: 600px) {
    .meh-prevnext { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Research sidebar — [mpala_research_sidebar]
   ========================================================================== */
.meh-research-sidebar {
    background: #FFFFFF;
    border-radius: var(--meh-radius-card);
    padding: 22px 22px 24px;
    font-family: var(--meh-font);
    box-shadow: 0 2px 8px rgba(47, 58, 58, 0.06);
}
.meh-research-sidebar__title {
    font-size: 18px; font-weight: 700;
    color: var(--meh-navy);
    margin: 0 0 16px;
}
.meh-research-sidebar__list { margin: 0; padding: 0; }
.meh-research-sidebar__row {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 0;
    border-top: 1px solid var(--meh-grey-300);
}
.meh-research-sidebar__row:first-child { border-top: 0; padding-top: 0; }
.meh-research-sidebar__label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
    color: var(--meh-grey-500); text-transform: uppercase;
}
.meh-research-sidebar__value {
    font-size: 15px; font-weight: 500;
    color: var(--meh-brown); margin: 0;
}

/* ==========================================================================
   Active nav indicator (brief §13)
   ========================================================================== */
.current-menu-item > a,
.current-menu-ancestor > a {
    color: var(--meh-brown) !important;
}
