/**
 * Qing Blog Head widget styles.
 *
 * The journal banner: a full-bleed photograph, a wash over it, and the
 * eyebrow / serif headline / lede stack on top. Ported from the static
 * journal page (.blogHead / .blogHead__media / .blogHead__lede) with the
 * classes namespaced to .qing-blogHead.
 *
 * Every control writes a CSS custom property on the wrapper, and this file
 * declares the same properties as its own defaults, so an untouched control
 * falls back to the static page value rather than to nothing.
 *
 * Two things the static page got wrong are fixed here rather than ported:
 *
 *  - <figure> keeps the browser default margin (1em 40px). On the absolutely
 *    positioned media box that margin pulled all four edges inward and the
 *    section background showed through as a dark frame. The reset below
 *    zeroes it.
 *  - The wash was the same weight top and bottom, so the type sat on whatever
 *    the photograph happened to be doing behind it. It is weighted to the
 *    centre instead: darkest where the words are, lighter at the edges.
 */

.qing-blogHead {
    /* ---- Defaults, overridden by the controls ---- */
    --qing-bh-gold: #b3946f;
    --qing-bh-ink-deep: #23201d;
    --qing-bh-display: Georgia, "Songti SC", "SimSun", serif;

    --qing-bh-min-h: 520px;
    --qing-bh-pad-block: 96px;
    --qing-bh-pad-inline: 24px;
    --qing-bh-wrap: 1200px;
    --qing-bh-lede-max: 640px;

    /* Wash strength. Two stops: the centre where the type sits, and the
       edges where the photograph should still read. */
    --qing-bh-veil-core: 0.74;
    --qing-bh-veil-edge: 0.22;

    --qing-bh-focus: 42%;

    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: var(--qing-bh-min-h);
    padding-block: var(--qing-bh-pad-block);
    overflow: hidden;
    /* Shows while the photograph loads, and stands in for it when no image
       has been chosen at all. */
    background-color: var(--qing-bh-ink-deep);
    color: #fff;
    text-align: center;
}

.qing-blogHead *,
.qing-blogHead *::before,
.qing-blogHead *::after {
    box-sizing: inherit;
}

/* ---- Media ----
   A real <img> rather than a background: it is fetched with the page, takes
   an alt attribute, and can carry loading/decoding hints. */
.qing-blogHead__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* The dark frame. See the file header. */
    margin: 0;
}

/* Scoped under .qing-blogHead so this reaches (0,2,1). Elementor's
   frontend.css loads later and carries `.elementor img { height: auto }` at
   (0,1,1) -- at a plain (0,1,1) here that reset would win the tie and the
   banner image would collapse to its intrinsic height. */
.qing-blogHead .qing-blogHead__media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    /* Keeps the upper part of the frame when the box is wider than it is
       tall, which is the usual case for a banner. */
    object-position: center var(--qing-bh-focus);
}

/* ---- Wash ----
   An ellipse over a vertical gradient: the ellipse buys contrast where the
   type is, the linear pass keeps the top and bottom edges from going pale
   against the header and the content below. */
.qing-blogHead__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(
            ellipse 72% 64% at 50% 50%,
            rgba(28, 25, 23, var(--qing-bh-veil-core)),
            rgba(28, 25, 23, calc(var(--qing-bh-veil-core) * 0.46)) 72%,
            rgba(28, 25, 23, var(--qing-bh-veil-edge))
        ),
        linear-gradient(
            to bottom,
            rgba(28, 25, 23, 0.42),
            rgba(28, 25, 23, 0.16) 42%,
            rgba(28, 25, 23, 0.52)
        );
}

/* ---- Content ---- */
.qing-blogHead__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--qing-bh-wrap);
    margin-inline: auto;
    padding-inline: var(--qing-bh-pad-inline);
}

.qing-blogHead__eyebrow {
    display: block;
    margin: 0 0 20px;
    color: var(--qing-bh-gold);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    /* Small caps over a photograph lose their edges without this. */
    text-shadow: 0 1px 10px rgba(20, 18, 16, 0.6);
}

/* The serif display face at normal weight -- bolding it is the usual way
   this banner goes wrong. */
.qing-blogHead__title {
    margin: 0;
    color: #fff;
    font-family: var(--qing-bh-display);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: -0.01em;
    /* Thin serif strokes break up over a busy photograph; the shadow holds
       the letter shapes together without darkening the image further. */
    text-shadow: 0 2px 18px rgba(20, 18, 16, 0.55);
}

/* Not italic: the accent phrase is coloured, not slanted. */
.qing-blogHead__title em,
.qing-blogHead__title i {
    color: var(--qing-bh-gold);
    font-style: normal;
}

.qing-blogHead--italicAccent .qing-blogHead__title em,
.qing-blogHead--italicAccent .qing-blogHead__title i {
    font-style: italic;
}

.qing-blogHead__lede {
    max-width: var(--qing-bh-lede-max);
    margin: 22px auto 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.75;
    text-shadow: 0 1px 12px rgba(20, 18, 16, 0.55);
}

/* ---- Rule ----
   The short centred rule the other page heads use. */
.qing-blogHead__rule {
    width: 64px;
    height: 1px;
    margin: 28px auto 0;
    border: 0;
    background: rgba(255, 255, 255, 0.42);
}

/* ---- Alignment variants ---- */
.qing-blogHead--left {
    text-align: left;
}

.qing-blogHead--left .qing-blogHead__lede,
.qing-blogHead--left .qing-blogHead__rule {
    margin-inline: 0;
}

.qing-blogHead--right {
    text-align: right;
}

.qing-blogHead--right .qing-blogHead__lede,
.qing-blogHead--right .qing-blogHead__rule {
    margin-inline: auto 0;
}

/* ---- Responsive ---- */
@media (max-width: 1023px) {

    .qing-blogHead {
        --qing-bh-pad-block: 72px;
    }
}

@media (max-width: 640px) {

    .qing-blogHead {
        --qing-bh-min-h: 340px;
        --qing-bh-pad-block: 56px;
        --qing-bh-pad-inline: 18px;
    }

    /* A tight ellipse on a narrow box darkens the middle and leaves the
       corners bright. A plain vertical wash is steadier at this width. */
    .qing-blogHead__veil {
        background: linear-gradient(
            to bottom,
            rgba(28, 25, 23, 0.58),
            rgba(28, 25, 23, 0.46) 45%,
            rgba(28, 25, 23, 0.62)
        );
    }

    .qing-blogHead__lede {
        max-width: none;
    }
}
