/* v2 blog (index, category, post). Loaded after landing-v2.css and pages-v2.css, only on
   resources/views/blog-v2; uses their tokens and lv2- classes. Every rule is scoped under .lv2. */

/* Index: topic filter */
.lv2 .lv2-blog { padding-top: clamp(32px, 4vw, 56px); }
.lv2 .lv2-topics { margin-bottom: clamp(28px, 3.5vw, 44px); }
.lv2 .lv2-topics ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; list-style: none; }
.lv2 .lv2-topics a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border-radius: 50px;
    background: #fff;
    border: 1px solid var(--lv2-line);
    color: #000;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.lv2 .lv2-topics a:hover { border-color: var(--lv2-purple); color: var(--lv2-deep); }
.lv2 .lv2-topics a[aria-current="page"] { background: var(--lv2-purple); border-color: var(--lv2-purple); color: #fff; }
.lv2 .lv2-topics a[aria-current="page"]:hover { background: var(--lv2-deep); border-color: var(--lv2-deep); }

/* Post cards */
.lv2 .lv2-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.lv2 .lv2-pcard {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--lv2-line);
    overflow: hidden;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.lv2 .lv2-pcard:hover { border-color: var(--lv2-line-purple); box-shadow: 0 16px 40px rgba(95, 88, 188, 0.12); }
.lv2 .lv2-pcard:has(a:focus-visible) { outline: 3px solid var(--lv2-deep); outline-offset: 3px; }
.lv2 .lv2-pcard__media { aspect-ratio: 16 / 9; background: var(--lv2-light); overflow: hidden; }
.lv2 .lv2-pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.lv2 .lv2-pcard:hover .lv2-pcard__media img { transform: scale(1.03); }
.lv2 .lv2-pcard__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 22px 22px; }
.lv2 .lv2-pcard__cat { order: -1; }
.lv2 .lv2-pcard__cat {
    padding: 2px 10px;
    border-radius: 50px;
    background: var(--lv2-light);
    color: var(--lv2-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.6;
    text-transform: uppercase;
}
.lv2 .lv2-pcard__title { font-size: 20px; line-height: 1.3; }
.lv2 .lv2-pcard__title a { color: #000; text-decoration: none; }
.lv2 .lv2-pcard__title a::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.lv2 .lv2-pcard__title a:hover { color: var(--lv2-deep); }
.lv2 .lv2-pcard__title a:focus-visible { outline: none; }
.lv2 .lv2-pcard__excerpt {
    font-size: 15px;
    line-height: 1.55;
    color: var(--lv2-gray);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
.lv2 .lv2-pcard__meta { margin-top: auto; padding-top: 4px; font-size: 14px; color: var(--lv2-gray); }

/* Index: empty state */
.lv2 .lv2-bempty {
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(32px, 5vw, 56px) clamp(20px, 4vw, 40px);
    border-radius: 20px;
    background: var(--lv2-light);
    border: 1px solid var(--lv2-line-purple);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.lv2 .lv2-bempty__title { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; }
.lv2 .lv2-bempty .lv2-btn { margin-top: 8px; }

/* Index: pagination */
.lv2 .lv2-pager {
    margin-top: clamp(36px, 4vw, 56px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.lv2 .lv2-pager__pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; list-style: none; }
.lv2 .lv2-pager__num,
.lv2 .lv2-pager__step {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 50px;
    border: 1px solid var(--lv2-line);
    background: #fff;
    color: #000;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}
.lv2 .lv2-pager__step { padding: 0 16px; }
.lv2 a.lv2-pager__num:hover,
.lv2 a.lv2-pager__step:hover { border-color: var(--lv2-purple); color: var(--lv2-deep); }
.lv2 .lv2-pager__num.is-current { background: var(--lv2-purple); border-color: var(--lv2-purple); color: #fff; }
.lv2 .lv2-pager__gap { min-width: 24px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--lv2-gray); }
/* Narrow screens: arrows only, the words stay for screen readers. */
@media (max-width: 479px) {
    .lv2 .lv2-pager__step { padding: 0; }
    .lv2 .lv2-pager__step span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Post: header band */
.lv2 .lv2-phead { background: var(--lv2-light); padding: clamp(24px, 4vw, 48px) var(--lv2-gutter) clamp(36px, 5vw, 64px); }
.lv2 .lv2-phead--cover { padding-bottom: clamp(96px, 14vw, 200px); }
/* Same 68ch column as the article body below (.lv2-prose, 17px). */
.lv2 .lv2-phead__inner { max-width: 68ch; font-size: 17px; margin: 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.lv2 .lv2-crumbs { width: 100%; font-size: 14px; }
.lv2 .lv2-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; padding: 0; list-style: none; }
.lv2 .lv2-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.lv2 .lv2-crumbs li + li::before { content: '›'; padding: 0 8px; color: var(--lv2-gray); }
.lv2 .lv2-crumbs a { min-height: 44px; display: inline-flex; align-items: center; color: var(--lv2-gray); font-weight: 500; text-decoration: none; }
.lv2 .lv2-crumbs a:hover { color: var(--lv2-deep); text-decoration: underline; }
.lv2 .lv2-crumbs li:last-child { flex: 1 1 0; }
.lv2 .lv2-crumbs [aria-current="page"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #000; font-weight: 500; }
/* On phones the post title is right below, so the breadcrumb stops at the category. */
@media (max-width: 599px) {
    .lv2 .lv2-crumbs li:last-child { display: none; }
}
.lv2 .lv2-phead__cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.lv2 .lv2-phead__cats a { min-height: 36px; text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; font-weight: 700; }
.lv2 .lv2-phead__cats a:hover { border-color: var(--lv2-purple); }
.lv2 .lv2-phead__h1 { font-size: clamp(32px, 4.2vw, 52px); line-height: 1.1; overflow-wrap: break-word; }
.lv2 .lv2-phead__lead { max-width: 680px; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.55; }
.lv2 .lv2-phead__lead > * + * { margin-top: 0.6em; }
.lv2 .lv2-phead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; color: var(--lv2-gray); }
/* The dot travels with the item after it, so a wrapped line never ends on a dot. */
.lv2 .lv2-phead__meta > * + *::before { content: '·'; content: '·' / ''; margin-right: 10px; }

/* Post: cover image, pulled up into the header band */
.lv2 .lv2-cover { max-width: 1040px; margin: clamp(-180px, -12vw, -80px) auto 0; padding: 0 var(--lv2-gutter); }
.lv2 .lv2-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: clamp(12px, 2vw, 20px);
    background: var(--lv2-bg-mid);
    box-shadow: 0 24px 56px rgba(95, 88, 188, 0.16);
}
.lv2 .lv2-post__body { padding-top: clamp(32px, 5vw, 64px); }

/* Post: article body. Base prose (68ch, h2/h3, lists) comes from .lv2-prose in pages-v2.css. */
.lv2 .lv2-article { overflow-wrap: break-word; }
.lv2 .lv2-article h4,
.lv2 .lv2-article h5,
.lv2 .lv2-article h6 { margin: 1.4em 0 0; font-size: 17px; font-weight: 700; line-height: 1.35; }
.lv2 .lv2-article > :first-child { margin-top: 0; }
.lv2 .lv2-article a { color: var(--lv2-deep); text-decoration: underline; text-decoration-color: rgba(95, 88, 188, 0.35); text-underline-offset: 3px; }
.lv2 .lv2-article a:hover { text-decoration-color: currentColor; }
.lv2 .lv2-article strong, .lv2 .lv2-article b { font-weight: 700; }
.lv2 .lv2-article li::marker { color: var(--lv2-purple); }
.lv2 .lv2-article li > ul, .lv2 .lv2-article li > ol { margin-top: 0.5em; }
.lv2 .lv2-article img { height: auto; border-radius: 12px; }
.lv2 .lv2-article figure { margin: 1.6em 0 0; }
.lv2 .lv2-article figcaption { margin-top: 8px; font-size: 14px; color: var(--lv2-gray); }
.lv2 .lv2-article iframe, .lv2 .lv2-article video { max-width: 100%; border: 0; border-radius: 12px; }
.lv2 .lv2-article blockquote {
    margin: 1.6em 0 0;
    padding: 16px 20px;
    border-left: 4px solid var(--lv2-purple);
    border-radius: 0 12px 12px 0;
    background: var(--lv2-light);
    font-size: 17px;
}
.lv2 .lv2-article blockquote > * + * { margin-top: 0.6em; }
.lv2 .lv2-article hr { margin: 2em 0; border: 0; border-top: 1px solid var(--lv2-line); }
.lv2 .lv2-article code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--lv2-bg-mid);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    overflow-wrap: anywhere;
}
.lv2 .lv2-article pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 16px 18px;
    border-radius: 12px;
    background: #14102a;
    color: #f3f2fc;
    font-size: 14px;
    line-height: 1.6;
}
.lv2 .lv2-article pre code { padding: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }
.lv2 .lv2-article__table { max-width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid var(--lv2-line); }
.lv2 .lv2-article__table:focus-visible { outline: 3px solid var(--lv2-deep); outline-offset: 3px; }
.lv2 .lv2-article table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.lv2 .lv2-article th,
.lv2 .lv2-article td { padding: 10px 14px; text-align: left; vertical-align: top; }
.lv2 .lv2-article th { background: var(--lv2-bg); font-weight: 600; white-space: nowrap; }
.lv2 .lv2-article tr + tr td,
.lv2 .lv2-article thead + tbody tr td { border-top: 1px solid var(--lv2-line); }
.lv2 .lv2-post__back { max-width: 68ch; margin: clamp(32px, 4vw, 48px) auto 0; padding-top: 24px; border-top: 1px solid var(--lv2-line); }
.lv2 .lv2-post__back a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.lv2 .lv2-post__back a:hover { text-decoration: underline; }

/* Post: related reading */
.lv2 .lv2-related { background: var(--lv2-bg); border-top: 1px solid var(--lv2-line); }
.lv2 .lv2-related__title { margin-bottom: clamp(24px, 3vw, 36px); font-size: clamp(26px, 2.8vw, 36px); }
.lv2 .lv2-related .lv2-pcard__title { font-size: 19px; }

@media (prefers-reduced-motion: reduce) {
    .lv2 .lv2-pcard:hover .lv2-pcard__media img { transform: none; }
}
