/* ==========================================================================
   /blog — listing and article view (loaded only when $page === 'blog')
   Generated post covers, post cards, featured lead block, article footer,
   author box and the mobile table of contents.
   ========================================================================== */

/* ─── Generated cover: category gradient + dot grid + waves + glyph ───── */

.v4-post-cover {
    --c1: var(--v4-ink-900);
    --c2: var(--v4-teal-700);
    position: relative; overflow: hidden; isolation: isolate; flex-shrink: 0;
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, .10), transparent 60%),
        linear-gradient(135deg, var(--c1) 18%, var(--c2) 100%);
}
.v4-post-cover::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1.5px);
    background-size: 16px 16px;
    -webkit-mask-image: linear-gradient(115deg, transparent 25%, #000 80%);
    mask-image: linear-gradient(115deg, transparent 25%, #000 80%);
}
.v4-post-cover__wave { position: absolute; inset: auto 0 0 0; width: 100%; height: 55%; z-index: -1; }
.v4-post-cover__wave path:first-child { fill: rgba(255, 255, 255, .07); }
.v4-post-cover__wave path:last-child { fill: rgba(242, 179, 61, .16); }
main .v4-post-cover .v4-post-cover__icon {
    position: absolute; right: 8%; top: 46%; width: 30%; height: auto; aspect-ratio: 1;
    transform: translateY(-50%) rotate(-8deg); color: rgba(255, 255, 255, .22); stroke-width: 1.1;
    transition: transform .4s var(--v4-ease);
}
.v4-card--link:hover .v4-post-cover__icon { transform: translateY(-54%) rotate(-3deg) scale(1.04); }
.v4-post-cover__cat {
    position: absolute; top: 16px; left: 16px; max-width: calc(100% - 32px);
    padding: 5px 11px; border-radius: 999px; background: rgba(6, 19, 37, .5); border: 1px solid rgba(255, 255, 255, .2);
    color: #fff; font-size: .6875rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3;
}
.v4-post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.v4-post-cover[data-cat="risk-management"]        { --c2: #A16207; }
.v4-post-cover[data-cat="security-privacy"]       { --c2: #1D4ED8; }
.v4-post-cover[data-cat="industry-news"]          { --c2: #6D28D9; }
.v4-post-cover[data-cat="training-certification"] { --c2: #047857; }
.v4-post-cover[data-cat="technology"]             { --c2: #0E7490; }

/* ─── Post cards ───────────────────────────────────────────────────────── */

.v4-post-card { padding: 0; gap: 0; overflow: hidden; }
.v4-post-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; padding: clamp(20px, 2vw, 26px); }
.v4-post-card h3 { font-size: 1.125rem; line-height: 1.35; }
main .v4-post-card h3 a { color: var(--v4-text); transition: color .2s var(--v4-ease); }
main .v4-post-card:hover h3 a { color: var(--v4-teal-700); }
.v4-post-meta { font-size: .8125rem; font-weight: 600; color: var(--v4-text-3); }
.v4-post-card .v4-card__foot > span:first-child { min-width: 0; }
.v4-post-card .v4-card__kicker { margin-bottom: -4px !important; }

/* Compact row card (beside the featured article) */
.v4-post-card--row { flex-direction: row; }
.v4-post-card--row .v4-post-cover { aspect-ratio: auto; width: 38%; min-height: 100%; }
.v4-post-card--row .v4-post-cover__icon { width: 56%; right: 50%; transform: translate(50%, -50%) rotate(-8deg); }
.v4-card--link.v4-post-card--row:hover .v4-post-cover__icon { transform: translate(50%, -54%) rotate(-3deg) scale(1.04); }
.v4-post-card--row h3 { font-size: 1.0625rem; }
.v4-post-card--row .v4-post-cover__cat { display: none; }
.v4-post-feature .v4-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.v4-post-feature .v4-post-meta .v4-tag { margin-right: 4px; }

/* Featured lead: big card + two compact cards */
.v4-blog-lead { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.v4-blog-lead__side { display: grid; grid-auto-rows: 1fr; gap: 20px; }
.v4-post-feature .v4-post-cover { aspect-ratio: 2 / 1; }
.v4-post-feature .v4-post-cover__cat { top: 20px; left: 20px; }
.v4-post-feature .v4-post-card__body { gap: 12px; padding: clamp(22px, 2.4vw, 32px); }
.v4-post-feature h3 { font-family: var(--v4-font-display); font-weight: 600; font-size: clamp(1.5rem, 1vw + 1.1rem, 2rem); line-height: 1.15; letter-spacing: -0.02em; }
.v4-post-feature .v4-post-card__body > p { font-size: 1rem; }

/* ─── Listing: filter row ──────────────────────────────────────────────── */

.v4-blog-filter { gap: 6px; margin-bottom: 32px; }
.v4-blog-filter a { padding-inline: 13px; }
.v4-blog-more { justify-content: center; border-style: dashed; }
.v4-blog-empty-action { margin-top: 18px !important; }
.v4-blog-search-panel .v4-search { box-shadow: none; margin-top: 4px; }
.v4-blog-search-panel > p { margin-top: 14px !important; font-size: .875rem; color: rgba(255, 255, 255, .7); }

/* ─── Article view ─────────────────────────────────────────────────────── */

.v4-blog-article { min-width: 0; }
.v4-blog-cover-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--v4-r-lg); margin-bottom: 32px; }
.v4-blog-foot { display: grid; gap: 18px; max-width: 72ch; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--v4-line); }
.v4-blog-foot__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.v4-blog-foot__label { min-width: 52px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--v4-text-3); }
main .v4-blog-tags a.v4-tag { min-height: 34px; padding: 6px 12px; font-size: .8125rem; transition: background-color .2s var(--v4-ease), color .2s var(--v4-ease); }
main .v4-blog-tags a.v4-tag:hover { background: var(--v4-teal-50); color: var(--v4-teal-800); }
.v4-blog-share { display: flex; flex-wrap: wrap; gap: 8px; }

.v4-blog-aside { display: grid; gap: 20px; }
.v4-blog-author { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--v4-line); border-radius: var(--v4-r-lg); background: #fff; }
.v4-blog-author__who { display: flex; align-items: center; gap: 12px; }
.v4-blog-author .v4-avatar { grid-row: auto; flex-shrink: 0; width: 48px; height: 48px; }
.v4-blog-author__img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.v4-blog-author__label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--v4-text-3); }
.v4-blog-author strong { display: block; font-size: .9375rem; line-height: 1.35; }
.v4-blog-author > p { font-size: .875rem; color: var(--v4-text-3); }
.v4-blog-author__links { display: grid; padding-top: 6px; border-top: 1px solid var(--v4-line); }
.v4-blog-author__links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; font-weight: 700; font-size: .9063rem; }
.v4-blog-author__links li + li { border-top: 1px solid var(--v4-line); }

/* Mobile table of contents (the aside TOC is hidden below 960px) */
.v4-blog-toc-m { display: none; }

@media (max-width: 960px) {
    .v4-blog-lead { grid-template-columns: minmax(0, 1fr); }
    .v4-blog-lead__side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
    .v4-blog-toc-m { display: block; margin-bottom: 28px; border: 1px solid var(--v4-line); border-radius: var(--v4-r-lg); background: var(--v4-tint); }
    .v4-blog-toc-m summary {
        display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 18px;
        cursor: pointer; list-style: none; font-weight: 700; color: var(--v4-text);
    }
    .v4-blog-toc-m summary::-webkit-details-marker { display: none; }
    .v4-blog-toc-m summary::after {
        content: ""; width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s var(--v4-ease);
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1E3C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 18px no-repeat;
    }
    .v4-blog-toc-m[open] summary::after { transform: rotate(180deg); }
    .v4-blog-toc-m .v4-toc { padding: 0 10px 12px; border: 0; background: none; }
}
@media (max-width: 640px) {
    .v4-blog-lead__side { grid-template-columns: minmax(0, 1fr); }
    .v4-post-card--row { flex-direction: column; }
    .v4-post-card--row .v4-post-cover { width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
    .v4-post-card--row .v4-post-cover__icon { width: 30%; right: 8%; transform: translateY(-50%) rotate(-8deg); }
    .v4-post-card--row .v4-post-cover__cat { display: block; }
    .v4-post-card--row .v4-card__kicker { display: none; }
    .v4-post-feature .v4-post-cover { aspect-ratio: 16 / 9; }
    /* Category pills scroll sideways instead of stacking four rows deep. */
    .v4-blog-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--v4-gutter) * -1); padding: 2px var(--v4-gutter) 6px; margin-bottom: 24px; }
    .v4-blog-filter::-webkit-scrollbar { display: none; }
    .v4-blog-filter a { flex-shrink: 0; white-space: nowrap; }
    .v4-blog-foot__label { width: 100%; }
}
