/* ==========================================================================
   LookBookAir — blog v2: blog index (website/blogs.blade.php) and single post (website/single.blade.php).
   Loads after site.css, home.css (post cards, FAQ accordion) and inner.css (page header, .lb-prose).
   ========================================================================== */

/* ---------- blog index: header band with the search box ---------- */
.lb-bloghead__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; }
.lb-bloghead__text { flex: 1 1 420px; min-width: 0; }
.lb-bloghead__search { position: relative; flex: 0 1 340px; min-width: 0; animation: lb-rise .8s var(--ease) both; }
.lb-bloghead__search .lb-ico { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lb-bloghead__search input { display: block; width: 100%; height: 46px; padding: 0 16px 0 43px; background: #fff; border: 1px solid transparent; border-radius: var(--r); font-size: 1rem; color: var(--ink); transition: box-shadow .2s var(--ease); }
.lb-bloghead__search input::placeholder { color: #98A5B6; }
.lb-bloghead__search input:focus { outline: 0; box-shadow: 0 0 0 3px rgba(255, 102, 0, .55); }

/* ---------- blog index: card grid (flex, because the page script switches the container to display:flex) ---------- */
.lb-bloggrid { display: flex; flex-wrap: wrap; gap: 22px 20px; }
.lb-bloggrid__item { flex: 0 0 calc((100% - 40px) / 3); min-width: 0; }

.lb-post--card { flex-direction: column; height: 100%; }
.lb-post--card:hover { transform: translateY(-4px); }
.lb-post--card .lb-post__media { flex: none; aspect-ratio: 16 / 10; }
.lb-post--card .lb-post__body { flex: 1 1 auto; padding: 14px 16px 15px; }
.lb-body .lb-post--card .lb-post__title { margin-top: 7px; font: 700 1.02rem/1.36 var(--ff-head); letter-spacing: -.012em; }
.lb-post--card .lb-post__excerpt { margin-top: 6px !important; font-size: .88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lb-post__author { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 13px; font-size: .8rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.lb-post__author .author-avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--navy-50); }

/* empty state */
.lb-blogempty { flex: 1 1 100%; padding: clamp(28px, 5vw, 60px) 0; text-align: center; }
.lb-blogempty__icon { display: block; margin: 0 auto 14px; color: #A9B5C4; }
.lb-body .lb-blogempty__title { font: 800 clamp(1.2rem, 2vw, 1.5rem)/1.2 var(--ff-head); letter-spacing: -.02em; }
.lb-blogempty__text { max-width: 480px; margin: 8px auto 20px !important; color: var(--muted); }

/* loading placeholders shown by the page script while it filters */
.lb-skel { height: 100%; overflow: hidden; background: #fff; border: 1px solid rgba(5, 32, 60, .08); border-radius: var(--r-lg); }
.lb-skel__body { padding: 16px; }
.lb-bloglist .skeleton { background: linear-gradient(90deg, #EEF2F6 25%, #E2E8F0 50%, #EEF2F6 75%); background-size: 200% 100%; animation: lb-skel 1.5s infinite; }
.lb-bloglist .skeleton-img { aspect-ratio: 16 / 10; }
.lb-bloglist .skeleton-text { height: .9rem; margin-bottom: .55rem; border-radius: 4px; }
.lb-bloglist .skeleton-text.title { width: 80%; height: 1.3rem; }
.lb-bloglist .skeleton-text.excerpt { width: 100%; height: .7rem; }
.lb-bloglist .skeleton-text.excerpt:last-child { width: 60%; margin-bottom: 0; }
@keyframes lb-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- pagination (Laravel's bootstrap-5 markup, styled without Bootstrap) ---------- */
.lb-pager { margin-top: clamp(26px, 3.4vw, 42px); padding-top: clamp(18px, 2.2vw, 24px); border-top: 1px solid var(--line); }
.lb-pager .d-none { display: none; }
.lb-pager .d-sm-none { display: flex; }
.lb-pager .d-sm-none .pagination { flex: 1 1 auto; justify-content: space-between; }
.lb-pager .pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lb-pager .page-link { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font: 600 .86rem/1 var(--ff-body); color: var(--navy); text-decoration: none; transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.lb-pager a.page-link:hover { border-color: var(--navy); background: var(--navy-50); }
.lb-pager .page-item.active .page-link { background: var(--navy); border-color: var(--navy); color: #fff; }
.lb-pager .page-item.disabled .page-link { background: var(--bg); color: #A9B5C4; }
.lb-pager .small { font-size: .85rem; color: var(--muted); }
.lb-pager .fw-semibold { font-weight: 600; color: var(--ink); }
@media (min-width: 576px) {
    .lb-pager .d-sm-none { display: none; }
    .lb-pager .d-sm-flex { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
}
@media (min-width: 576px) and (max-width: 899.98px) {
    .lb-pager .d-sm-flex { flex-direction: column; justify-content: center; }
    .lb-pager .pagination { justify-content: center; }
}

@media (max-width: 1023.98px) {
    .lb-bloggrid__item { flex-basis: calc((100% - 20px) / 2); }
}
@media (max-width: 767.98px) {
    .lb-bloghead__search { flex-basis: 100%; }
}
@media (max-width: 559.98px) {
    .lb-bloggrid { gap: 16px; }
    .lb-bloggrid__item { flex-basis: 100%; }
}

/* ---------- single post: header ---------- */
.lb-body .lb-arthead .lb-phead__title { max-width: 30ch; font-size: clamp(1.45rem, 2.7vw, 2.15rem); line-height: 1.2; }

/* ---------- single post: article + contents sidebar ---------- */
.lb-art__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 3.6vw, 48px); align-items: start; }
.lb-art__main { min-width: 0; }
.lb-art__side { position: sticky; top: calc(var(--header-h) + 20px); min-width: 0; }

.lb-art__byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.lb-art__author { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lb-art__author .author-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--navy-50); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--navy-100); }
.lb-art__author-name { font: 700 .95rem/1.25 var(--ff-head); color: var(--navy); }
.lb-art__author-role { margin-top: 2px; font-size: .8rem; line-height: 1.3; color: var(--muted); }
.lb-art__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .82rem; font-weight: 500; color: var(--muted); }
.lb-art__badge { padding: 4px 10px; border-radius: 999px; background: var(--navy-50); font-size: .76rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.lb-art__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.lb-art__meta-item .lb-ico { width: 15px; height: 15px; }

.lb-art__hero { overflow: hidden; margin-bottom: clamp(20px, 2.6vw, 30px); border-radius: var(--r-xl); background: var(--navy-50); box-shadow: var(--sh-2); }
.lb-art__hero img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }

/* some posts carry an image inside the heading tag — give it room */
.lb-art .lb-prose :is(h2, h3, h4) > p { margin: .65em 0 0; }

/* share row */
.lb-art__share { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: clamp(26px, 3.4vw, 40px); padding-top: 18px; border-top: 1px solid var(--line); }
.lb-art__share-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lb-art__share-label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.lb-art__share-btns { display: inline-flex; gap: 8px; }
.lb-art .share-button { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 50%; color: var(--navy); cursor: pointer; transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.lb-art .share-button:hover { background: var(--navy); border-color: var(--navy); color: #fff; transform: translateY(-2px); }

/* FAQ (same accordion as the rest of the site; the question is a paragraph here, as before) */
.lb-art__faq .faq-question { margin: 0; }

/* author card */
.lb-art__bio { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); margin-top: clamp(30px, 4vw, 50px); padding: clamp(18px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: var(--r-xl); background: linear-gradient(135deg, var(--navy-50) 0%, #fff 70%); }
.lb-art__bio-photo { flex: none; width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--navy-50); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--navy-100); }
.lb-art__bio-body { min-width: 0; }
.lb-body .lb-art__bio-title { font: 800 1.15rem/1.25 var(--ff-head); letter-spacing: -.015em; }
.lb-art__bio-text { margin-top: 6px !important; font-size: .93rem; line-height: 1.65; color: var(--text); }
.lb-art__bio-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* latest posts */
.lb-art__latest { margin-top: clamp(30px, 4vw, 50px); }
.lb-art__latest-title { margin-bottom: 14px !important; font: 800 clamp(1.3rem, 2.1vw, 1.6rem)/1.22 var(--ff-head); letter-spacing: -.02em; color: var(--navy); }
.lb-art__latest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.lb-art__latest-list > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.lb-art__latest .lb-post--row .lb-post__media { width: 84px; min-height: 78px; }
.lb-art__latest .lb-post--row .lb-post__body { padding: 10px 14px; }
.lb-body .lb-art__latest .lb-post--row .lb-post__title { margin-top: 0; font-size: .92rem; }
.lb-art__latest .lb-post__meta { margin-top: 4px; }

/* table of contents (list is built by assets/js/post.js) */
.lb-toc { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.lb-toc__title { display: flex; align-items: center; gap: 9px; margin: 0 0 10px !important; padding: 9px 12px; border-radius: 10px; background: var(--navy); color: #fff; font: 700 .9rem/1.2 var(--ff-head); }
.lb-toc__title svg { flex: none; width: 17px; height: 17px; color: var(--orange); }
.lb-toc .toc-nav { max-height: calc(100vh - var(--header-h) - 130px); padding-right: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lb-toc ul { margin: 0; padding: 0; list-style: none; }
.lb-toc li > ul { margin-left: 12px; }
.lb-toc li { margin: 0; }
.lb-toc .toc-link { display: block; padding: 6px 10px; border-left: 2px solid transparent; border-radius: 0 8px 8px 0; font-size: .83rem; font-weight: 500; line-height: 1.4; color: var(--text); text-decoration: none; overflow-wrap: anywhere; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.lb-toc .toc-link.level-2 { font-size: .86rem; font-weight: 600; color: var(--ink); }
.lb-toc .toc-link:hover { background: var(--navy-50); color: var(--navy); }
.lb-toc .toc-link.active { background: var(--orange-50); border-left-color: var(--orange); color: var(--orange-700); }
.lb-toc .text-muted { padding: 4px 10px; font-size: .86rem; color: var(--muted); }

@media (max-width: 1023.98px) {
    .lb-art__grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .lb-art__side { position: static; order: -1; }
    .lb-toc { padding: 12px; }
    /* fixed height: the list is filled in by script, and a growing box would push the article down while it loads */
    .lb-toc .toc-nav { height: 196px; max-height: none; }
}
@media (max-width: 639.98px) {
    .lb-art__latest-list { grid-template-columns: minmax(0, 1fr); }
    .lb-art__hero { border-radius: var(--r-lg); }
    .lb-art__bio { flex-direction: column; }
    .lb-art__bio-photo { width: 64px; height: 64px; }
}
