/* ====================================================================
   Creativelines — Blog (frontend) — Phase 10
   Listing + featured + sidebar + single article
   ==================================================================== */

/* ============================================================
   FEATURED BLOCK
   ============================================================ */

.bl-featured {
    padding: 2rem 0 1rem;
}
.bl-featured__card {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 0;
    background: var(--cl-black);
    border-radius: var(--r-lg);
    overflow: hidden;
    text-decoration: none;
    color: white;
    transition: transform var(--t-base) var(--ease-out);
    min-height: 380px;
}
@media (max-width: 800px) {
    .bl-featured__card { grid-template-columns: 1fr; }
}
.bl-featured__card:hover { transform: translateY(-3px); }

.bl-featured__cover {
    overflow: hidden;
    aspect-ratio: 16/10;
}
@media (max-width: 800px) {
    .bl-featured__cover { aspect-ratio: 21/9; }
}
.bl-featured__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}
.bl-featured__card:hover .bl-featured__cover img { transform: scale(1.04); }

.bl-featured__body {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.bl-featured__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.bl-featured__pin {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--cl-yellow);
    color: var(--cl-black);
    padding: 0.25em 0.7em;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.bl-featured__title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 1rem;
    text-wrap: balance;
}
.bl-featured__excerpt {
    font-size: var(--fs-md);
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    margin: 0 0 1.25rem;
}
.bl-featured__meta {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.6);
}


/* ============================================================
   LISTING GRID + SIDEBAR
   ============================================================ */

.bl-listing { padding: clamp(2rem, 4vw, 3rem) 0 clamp(3rem, 5vw, 5rem); }

.bl-listing__grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
}
@media (max-width: 900px) {
    .bl-listing__grid { grid-template-columns: 1fr; }
}

.bl-pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem 1.5rem;
}


/* ============================================================
   PUBLIC POST CARD
   ============================================================ */

.bl-pub-card {
    display: flex;
    flex-direction: column;
}
.bl-pub-card__cover {
    display: block;
    aspect-ratio: 16/10;
    border-radius: var(--r-md);
    overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--cl-yellow) 15%, var(--cl-bg)) 0%, var(--cl-bg) 100%);
    margin-bottom: 1.25rem;
}
.bl-pub-card__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.7s var(--ease-out);
}
.bl-pub-card:hover .bl-pub-card__cover img { transform: scale(1.04); }
.bl-pub-card__cover-placeholder { width: 100%; height: 100%; }

.bl-pub-card__cat {
    display: inline-block;
    color: var(--cat-color, var(--cl-yellow));
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.bl-pub-card__cat:hover { text-decoration: underline; }

.bl-pub-card__title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.6rem;
    letter-spacing: -0.02em;
}
.bl-pub-card__title a {
    color: var(--cl-fg);
    text-decoration: none;
    background-image: linear-gradient(var(--cl-yellow), var(--cl-yellow));
    background-size: 0 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s var(--ease-out);
}
.bl-pub-card__title a:hover { background-size: 100% 2px; }

.bl-pub-card__excerpt {
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--cl-fg-muted);
    margin: 0 0 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bl-pub-card__meta {
    font-size: var(--fs-xs);
    color: var(--cl-fg-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.bl-pub-card__author { font-weight: 500; color: var(--cl-fg-muted); }
.bl-pub-card__dot   { opacity: 0.5; }


/* ============================================================
   PAGINATION
   ============================================================ */

.bl-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 3rem;
}
.bl-pagination__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    background: transparent;
    border: 1px solid var(--cl-border, rgba(0,0,0,0.08));
    border-radius: var(--r-md);
    color: var(--cl-fg-muted);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: all var(--t-base);
    font-variant-numeric: tabular-nums;
}
.bl-pagination__btn:hover {
    border-color: var(--cl-yellow);
    color: var(--cl-yellow);
}
.bl-pagination__btn.is-active {
    background: var(--cl-yellow);
    border-color: var(--cl-yellow);
    color: var(--cl-black);
    font-weight: 600;
}


/* ============================================================
   SIDEBAR
   ============================================================ */

.bl-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
@media (min-width: 901px) {
    .bl-sidebar { position: sticky; top: 2rem; }
}

.bl-sidebar__section {}
.bl-sidebar__title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cl-fg-subtle);
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--cl-border, rgba(0,0,0,0.08));
}

.bl-sidebar__recent {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.bl-sidebar__post {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0.7rem;
    align-items: center;
    text-decoration: none;
    color: var(--cl-fg);
}
.bl-sidebar__post-thumb {
    aspect-ratio: 1;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: linear-gradient(135deg, var(--cl-yellow) 0%, var(--cl-red) 100%);
}
.bl-sidebar__post-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.bl-sidebar__post-thumb--empty { opacity: 0.4; }
.bl-sidebar__post-title {
    display: block;
    font-size: var(--fs-sm);
    line-height: 1.35;
    font-weight: 500;
    color: var(--cl-fg);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bl-sidebar__post:hover .bl-sidebar__post-title { color: var(--cl-red); }
.bl-sidebar__post-meta {
    display: block;
    font-size: var(--fs-xs);
    color: var(--cl-fg-subtle);
    margin-top: 4px;
}

.bl-sidebar__cats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.bl-sidebar__cat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    text-decoration: none;
    color: var(--cl-fg);
    border-bottom: 1px dashed var(--cl-border, rgba(0,0,0,0.06));
    font-size: var(--fs-sm);
}
.bl-sidebar__cat:last-child { border-bottom: 0; }
.bl-sidebar__cat-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}
.bl-sidebar__cat-name { flex: 1; }
.bl-sidebar__cat:hover .bl-sidebar__cat-name { color: var(--cl-red); }
.bl-sidebar__cat-count {
    font-size: var(--fs-xs);
    color: var(--cl-fg-subtle);
    font-variant-numeric: tabular-nums;
}

.bl-sidebar__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.bl-sidebar__tag {
    display: inline-block;
    padding: 0.3em 0.8em;
    background: color-mix(in srgb, var(--cl-yellow) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--cl-yellow) 20%, transparent);
    border-radius: 999px;
    font-size: var(--fs-xs);
    color: var(--cl-fg-muted);
    text-decoration: none;
    transition: all var(--t-base);
}
.bl-sidebar__tag:hover {
    background: var(--cl-yellow);
    color: var(--cl-black);
    border-color: var(--cl-yellow);
}


/* ============================================================
   ARTICLE — reading-progress + head
   ============================================================ */

.cl-container--narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--cl-container-pad, 1.25rem);
}

.bl-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}
.bl-progress__bar {
    height: 100%;
    width: 0%;
    background: var(--cl-yellow);
    transition: width 0.1s linear;
}

.bl-article-head {
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}
.bl-article-head__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--cl-fg-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    margin-bottom: 2rem;
}
.bl-article-head__back:hover { color: var(--cl-yellow); }
.bl-article-head__back svg { width: 16px; height: 16px; }

.bl-article-head__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.bl-article-head__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin: 0 0 1rem;
    text-wrap: balance;
}
.bl-article-head__subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    color: var(--cl-fg-muted);
    line-height: 1.4;
    margin: 0 0 1.75rem;
    font-weight: 400;
}

.bl-article-head__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: var(--fs-sm);
    color: var(--cl-fg-muted);
}
.bl-article-head__author {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.bl-article-head__author-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cl-yellow) 0%, var(--cl-red) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--fs-sm);
}
.bl-article-head__author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bl-article-head__author-name {
    color: var(--cl-fg);
    font-weight: 600;
    text-decoration: none;
}
.bl-article-head__author-name:hover { color: var(--cl-red); }
.bl-article-head__dot { opacity: 0.5; }


/* ============================================================
   COVER
   ============================================================ */

.bl-article-cover {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
}
.bl-article-cover img {
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: cover;
    display: block;
}
.bl-article-cover__caption {
    max-width: 760px;
    margin: 0.85rem auto 0;
    padding: 0 var(--cl-container-pad, 1.25rem);
    font-size: var(--fs-sm);
    color: var(--cl-fg-muted);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.bl-article-cover__credit {
    color: var(--cl-fg-subtle);
    font-style: italic;
}


/* ============================================================
   BODY
   ============================================================ */

.bl-article-body-wrap { padding-bottom: clamp(3rem, 6vw, 5rem); }

.bl-article-body {
    font-size: clamp(1.05rem, 1.35vw, 1.15rem);
    line-height: 1.75;
    color: var(--cl-fg);
}
.bl-article-body p { margin: 0 0 1.4em; }
.bl-article-body p:first-child::first-letter {
    font-family: var(--font-display);
    font-size: 3.2em;
    font-weight: 700;
    float: left;
    line-height: 0.9;
    margin: 0.05em 0.1em 0 0;
    color: var(--cl-red);
}
.bl-article-body h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin: 2.5em 0 0.75em;
    color: var(--cl-fg);
}
.bl-article-body h3 {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 1.8vw, 1.45rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.018em;
    margin: 2em 0 0.5em;
}
.bl-article-body a {
    color: var(--cl-red);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.bl-article-body strong { font-weight: 600; }
.bl-article-body em { font-style: italic; }
.bl-article-body ul,
.bl-article-body ol {
    margin: 0 0 1.4em;
    padding-left: 1.5em;
}
.bl-article-body li { margin-bottom: 0.4em; }
.bl-article-body blockquote {
    border-left: 4px solid var(--cl-yellow);
    padding: 0.5em 0 0.5em 1.5em;
    margin: 2em 0;
    font-family: var(--font-display);
    font-size: 1.2em;
    line-height: 1.45;
    font-style: italic;
    color: var(--cl-fg);
}
.bl-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r-md);
    margin: 2em 0;
    display: block;
}
.bl-article-body code {
    background: color-mix(in srgb, var(--cl-yellow) 12%, transparent);
    padding: 0.15em 0.45em;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}
.bl-article-body pre {
    background: var(--cl-black);
    color: white;
    padding: 1.25em;
    border-radius: var(--r-md);
    overflow-x: auto;
    margin: 2em 0;
    font-size: 0.92em;
}
.bl-article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}


/* ============================================================
   TOC
   ============================================================ */

.bl-toc {
    background: color-mix(in srgb, var(--cl-yellow) 5%, transparent);
    border-left: 3px solid var(--cl-yellow);
    padding: 1rem 1.5rem;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    margin: 0 0 2.5rem;
}
.bl-toc__title {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cl-fg-subtle);
    font-weight: 700;
    margin: 0 0 0.75rem;
}
.bl-toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}
.bl-toc__list li {
    counter-increment: toc-counter;
    margin: 0.4rem 0;
}
.bl-toc__list li::before {
    content: counter(toc-counter, decimal-leading-zero);
    color: var(--cl-fg-subtle);
    font-size: var(--fs-xs);
    margin-right: 0.6rem;
    font-variant-numeric: tabular-nums;
}
.bl-toc__list li.is-sub { padding-left: 1.5rem; }
.bl-toc__list a {
    color: var(--cl-fg-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    transition: color var(--t-base);
}
.bl-toc__list a:hover,
.bl-toc__list a.is-active { color: var(--cl-red); font-weight: 500; }


/* ============================================================
   TAGS + SHARE + AUTHOR BLOCK
   ============================================================ */

.bl-article-tags {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--cl-border, rgba(0,0,0,0.08));
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.bl-article-tags__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cl-fg-subtle);
    font-weight: 700;
    margin-right: 0.4rem;
}
.bl-article-tags__tag {
    display: inline-block;
    padding: 0.35em 0.85em;
    background: color-mix(in srgb, var(--cl-yellow) 10%, transparent);
    border-radius: 999px;
    font-size: var(--fs-sm);
    color: var(--cl-fg);
    text-decoration: none;
    transition: all var(--t-base);
}
.bl-article-tags__tag:hover {
    background: var(--cl-yellow);
    color: var(--cl-black);
}

.bl-article-share {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bl-article-share__label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cl-fg-subtle);
    font-weight: 700;
    margin-right: 0.4rem;
}
.bl-article-share__btn {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--cl-surface, color-mix(in srgb, var(--cl-fg) 4%, transparent));
    border: 1px solid var(--cl-border, rgba(0,0,0,0.08));
    color: var(--cl-fg-muted);
    cursor: pointer;
    transition: all var(--t-base);
    text-decoration: none;
}
.bl-article-share__btn svg { width: 16px; height: 16px; }
.bl-article-share__btn:hover {
    background: var(--cl-yellow);
    color: var(--cl-black);
    border-color: var(--cl-yellow);
}

.bl-article-author-block {
    margin-top: 3rem;
    padding: 1.75rem;
    background: color-mix(in srgb, var(--cl-yellow) 5%, var(--cl-bg));
    border: 1px solid var(--cl-border, rgba(0,0,0,0.06));
    border-radius: var(--r-lg);
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 600px) {
    .bl-article-author-block { grid-template-columns: 1fr; text-align: left; }
}
.bl-article-author-block__avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cl-yellow) 0%, var(--cl-red) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
}
.bl-article-author-block__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bl-article-author-block__eyebrow {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cl-fg-subtle);
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.bl-article-author-block__name {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 600;
    margin: 0 0 0.2rem;
    letter-spacing: -0.015em;
}
.bl-article-author-block__role {
    font-size: var(--fs-sm);
    color: var(--cl-fg-muted);
    margin-bottom: 0.85rem;
}
.bl-article-author-block__bio {
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--cl-fg);
    margin: 0 0 0.85rem;
}
.bl-article-author-block__link {
    font-size: var(--fs-sm);
    color: var(--cl-red);
    font-weight: 500;
    text-decoration: none;
}
.bl-article-author-block__link:hover { text-decoration: underline; }


/* ============================================================
   RELATED
   ============================================================ */

.bl-related {
    padding: clamp(3rem, 6vw, 5rem) 0;
    background: color-mix(in srgb, var(--cl-yellow) 4%, var(--cl-bg));
}
