/**
 * Links Directory – blog extras
 * Loaded after links-directory-premium.css on blog category archives and
 * single blog posts. Everything is scoped under `.ld` / `.ld--blog` and kept
 * at low specificity so the Blog Design settings can override it.
 */

/* ==========================================================================
   1. Category archive: featured card, card meta
   ========================================================================== */
.ld .ld-featured { margin-bottom: var(--lx-gap); }

.ld .ld-card--post .ld-card__meta { justify-content: flex-start; flex-wrap: wrap; row-gap: 4px; }
.ld .ld-card--post .ld-card__date { margin-left: auto; font-size: .75rem; color: var(--lx-muted); white-space: nowrap; }

.ld .ld-card--post .ld-card__foot { gap: 12px; }
.ld .ld-card__byline {
    min-width: 0;
    overflow: hidden;
    font-size: .75rem;
    color: var(--lx-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}
.ld .ld-dot { margin: 0 3px; }

.ld .ld-card__flag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--lx-accent);
    border-radius: 999px;
}

.ld .ld-card--featured .ld-card__title {
    font-size: clamp(1.4rem, 1.05rem + 1.1vw, 2.1rem);
    font-weight: 750;
    line-height: 1.18;
    letter-spacing: -.02em;
}
.ld .ld-card--featured .ld-card__excerpt { margin-top: 12px; font-size: 1rem; -webkit-line-clamp: 4; }

@media (min-width: 800px) {
    .ld .ld-card--featured {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }
    .ld .ld-card--featured .ld-card__media { aspect-ratio: auto; min-height: 320px; height: 100%; }
    .ld .ld-card--featured .ld-card__body { justify-content: center; padding: 30px 34px; }
    .ld .ld-card--featured .ld-card__foot { margin-top: 22px; padding-top: 0; }
}

/* ==========================================================================
   2. Single post: header, hero image, layout
   ========================================================================== */
.ld.ld--single.ld--blog .ld__container { max-width: 1200px; }

.ld .ld-post-head { max-width: 860px; margin: 0 auto 32px; text-align: center; }
.ld .ld-post-head .ld-badges { justify-content: center; }
.ld .ld-post-head .ld-entry__title { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
.ld .ld-lede--post { max-width: 720px; margin: 18px auto 0; font-size: 1.1875rem; line-height: 1.6; color: var(--lx-ink-2); }

.ld .ld-facts--post { justify-content: center; margin-top: 20px; }
.ld .ld-facts--post .ld-facts__item + .ld-facts__item::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .45;
}
.ld .ld-facts__author a { font-weight: 600; color: var(--lx-ink); }
.ld .ld-facts__author a:hover { color: var(--lx-accent); }
.ld .ld-facts__avatar { width: 32px; height: 32px; border-radius: 50%; }

.ld .ld-post-hero { margin: 0 0 44px; }
.ld .ld-post-hero .ld-media--hero { aspect-ratio: 16 / 10; }
@media (min-width: 800px) {
    .ld .ld-post-hero .ld-media--hero { aspect-ratio: 21 / 9; }
}

.ld .ld-post {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}
.ld .ld-post--no-aside { grid-template-columns: minmax(0, 1fr); }
.ld .ld-post--no-aside .ld-post__main { max-width: 820px; margin: 0 auto; width: 100%; }
.ld .ld-post__main { min-width: 0; }
.ld .ld-post__aside { position: sticky; top: var(--lx-sticky-top); }

.ld.ld--blog .ld-entry__content { max-width: 760px; margin-top: 0; }
.ld .ld-post--no-aside .ld-entry__content { max-width: none; }

@media (max-width: 1099px) {
    .ld .ld-post,
    .ld .ld-post--no-aside { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .ld .ld-post__aside { position: static; }
    .ld .ld-post__aside .ld-minilist { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 4px 16px; }
}
@media (max-width: 799px) {
    .ld .ld-post-head { margin-bottom: 22px; }
    .ld .ld-post-hero { margin-bottom: 28px; }
    .ld .ld-post__aside .ld-minilist { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   3. Article typography
   ========================================================================== */
.ld.ld--blog .ld-prose { margin-top: 0; font-size: 1.0625rem; line-height: 1.8; }
.ld.ld--blog .ld-prose > * + * { margin-top: 1.2em; }
.ld.ld--blog .ld-prose h2 { margin-top: 1.9em; font-size: 1.6rem; line-height: 1.25; letter-spacing: -.015em; }
.ld.ld--blog .ld-prose h3 { margin-top: 1.7em; font-size: 1.3rem; line-height: 1.3; }
.ld.ld--blog .ld-prose h4,
.ld.ld--blog .ld-prose h5,
.ld.ld--blog .ld-prose h6 { margin-top: 1.5em; font-family: inherit; font-size: 1.1rem; font-weight: 700; color: var(--lx-ink); }
.ld.ld--blog .ld-prose strong { color: var(--lx-ink); }

.ld.ld--blog .ld-prose blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 4px 0 4px 22px;
    font-size: 1.125rem;
    font-style: italic;
    color: var(--lx-ink);
    border-left: 4px solid var(--lx-accent);
}
.ld.ld--blog .ld-prose blockquote cite { display: block; margin-top: 8px; font-size: .875rem; font-style: normal; color: var(--lx-muted); }

.ld.ld--blog .ld-prose pre {
    padding: 16px 18px;
    overflow-x: auto;
    font-size: .875rem;
    line-height: 1.6;
    color: #e2e8f0;
    background: #0f172a;
    border-radius: var(--lx-r-sm);
}
.ld.ld--blog .ld-prose :not(pre) > code {
    padding: 2px 6px;
    font-size: .9em;
    background: var(--lx-bg);
    border: 1px solid var(--lx-line);
    border-radius: 6px;
}

.ld.ld--blog .ld-prose figure { margin-left: 0; margin-right: 0; max-width: 100%; }
.ld.ld--blog .ld-prose figcaption { margin-top: 8px; font-size: .8125rem; text-align: center; color: var(--lx-muted); }
.ld.ld--blog .ld-prose img,
.ld.ld--blog .ld-prose video,
.ld.ld--blog .ld-prose iframe { max-width: 100%; }
.ld.ld--blog .ld-prose .alignwide,
.ld.ld--blog .ld-prose .alignfull { width: auto; max-width: 100%; margin-left: 0; margin-right: 0; }
.ld.ld--blog .ld-prose .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.ld.ld--blog .ld-prose .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.ld.ld--blog .ld-prose .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.ld.ld--blog .ld-prose::after { content: ""; display: table; clear: both; }

.ld.ld--blog .ld-prose hr { height: 1px; border: 0; background: var(--lx-line); margin: 2em 0; }
.ld.ld--blog .ld-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .9375rem; }
.ld.ld--blog .ld-prose th,
.ld.ld--blog .ld-prose td { padding: 10px 12px; text-align: left; border: 1px solid var(--lx-line); }
.ld.ld--blog .ld-prose th { color: var(--lx-ink); background: var(--lx-bg); }

.ld .ld-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; font-weight: 600; }
.ld .ld-pages > a,
.ld .ld-pages > .post-page-numbers { padding: 4px 12px; border: 1px solid var(--lx-line); border-radius: 8px; color: var(--lx-ink); }

.ld.ld--blog .ld-tags { margin-top: 36px; }

/* ==========================================================================
   4. Author box
   ========================================================================== */
.ld .ld-author {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 44px;
    padding: 24px;
    background: var(--lx-bg);
    border: 1px solid var(--lx-line);
    border-radius: var(--lx-r-md);
}
.ld .ld-author__avatar { flex: none; width: 72px; height: 72px; border-radius: 50%; }
.ld .ld-author__text { min-width: 0; }
.ld .ld-author__label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lx-muted); }
.ld .ld-author__name { margin-top: 2px; font-size: 1.125rem; font-weight: 700; color: var(--lx-ink); }
.ld .ld-author__name a { color: inherit; }
.ld .ld-author__name a:hover { color: var(--lx-accent); }
.ld .ld-author__bio { margin-top: 8px; font-size: .9375rem; line-height: 1.6; color: var(--lx-ink-2); }

@media (max-width: 480px) {
    .ld .ld-author { flex-direction: column; align-items: center; text-align: center; }
}

/* ==========================================================================
   5. Previous / next
   ========================================================================== */
.ld .ld-postnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.ld .ld-postnav__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: var(--lx-surface);
    border: 1px solid var(--lx-line);
    border-radius: var(--lx-r-md);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.ld .ld-postnav__link:hover,
.ld .ld-postnav__link:focus-visible { border-color: var(--lx-accent); box-shadow: var(--lx-shadow-md); transform: translateY(-2px); }
.ld .ld-postnav__link--next { grid-column: 2; text-align: right; }
.ld .ld-postnav__link--prev:only-child { grid-column: 1; }
.ld .ld-postnav__label { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--lx-muted); }
.ld .ld-postnav__title {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    color: var(--lx-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 599px) {
    .ld .ld-postnav { grid-template-columns: minmax(0, 1fr); }
    .ld .ld-postnav__link--next { grid-column: 1; }
}

/* ==========================================================================
   6. Comments (the theme's comments.php markup, lightly styled)
   ========================================================================== */
.ld .ld-comments { margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--lx-line); }
.ld .ld-comments .comments-title,
.ld .ld-comments .comment-reply-title { margin-bottom: 18px; font-size: 1.35rem; font-weight: 700; color: var(--lx-ink); }
.ld .ld-comments ol,
.ld .ld-comments ul { list-style: none; margin: 0; padding: 0; }
.ld .ld-comments .children { margin-left: 24px; }
.ld .ld-comments .comment-body { padding: 18px 0; border-bottom: 1px solid var(--lx-line); }
.ld .ld-comments .comment-meta,
.ld .ld-comments .comment-metadata { font-size: .8125rem; color: var(--lx-muted); }
.ld .ld-comments .avatar { border-radius: 50%; }
.ld .ld-comments a { color: var(--lx-accent); }
.ld .ld-comments label { display: block; margin-bottom: 4px; font-size: .875rem; font-weight: 600; color: var(--lx-ink); }
.ld .ld-comments input[type="text"],
.ld .ld-comments input[type="email"],
.ld .ld-comments input[type="url"],
.ld .ld-comments textarea {
    width: 100%;
    padding: 10px 12px;
    font: inherit;
    color: var(--lx-ink);
    background: var(--lx-surface);
    border: 1px solid var(--lx-line-strong);
    border-radius: var(--lx-r-sm);
}
.ld .ld-comments input[type="submit"],
.ld .ld-comments .submit {
    padding: 12px 24px;
    font: inherit;
    font-weight: 650;
    color: #fff;
    cursor: pointer;
    background: var(--lx-accent);
    border: 0;
    border-radius: var(--lx-r-sm);
}
.ld .ld-comments input[type="submit"]:hover,
.ld .ld-comments .submit:hover { background: var(--lx-accent-hover); }
.ld .ld-comments .comment-form > p { margin-top: 14px; }
