/* ============================================================
   Lazza Theme: build overview, chapter pages, post context
   ============================================================ */

/* ---------- Shared ---------- */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.crumbs a { color: var(--primary); font-weight: 600; }
.crumbs a:hover { color: var(--accent); }

.bo-section-title {
    font-size: 1.6rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

/* ---------- Build overview: hero ---------- */
.build-overview { padding-top: 0; }

.bo-hero {
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
    color: #fff;
    padding: 2.5rem 0 2.25rem;
    text-align: center;
}
.bo-kicker {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.bo-hero h1 {
    color: #fff;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

/* Before and after slider */
.ba-slider {
    --pos: 50%;
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--dark-3);
    user-select: none;
    touch-action: pan-y;
}
.ba-slider img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.ba-before-wrap {
    position: absolute;
    inset: 0;
    clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 3px;
    margin-left: -1.5px;
    background: #fff;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.ba-handle span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--accent);
    color: var(--dark);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}
.ba-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: ew-resize;
}
.ba-range:focus-visible ~ .ba-handle span,
.ba-slider:focus-within .ba-handle span { outline: 3px solid #fff; outline-offset: 2px; }
.ba-tag {
    position: absolute;
    top: 14px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}
.ba-tag-before { left: 14px; }
.ba-tag-after  { right: 14px; background: var(--accent); color: var(--dark); }
.ba-hint {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ---------- Intro + facts ---------- */
.bo-intro {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2.5rem;
    align-items: center;
    padding-top: 2.75rem;
    padding-bottom: 1rem;
}
.bo-intro-text p {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}
.bo-intro-text .btn-primary { margin-top: 0.5rem; font-size: 0.9rem; padding: 0.7rem 1.4rem; }
.bo-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.bo-fact {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
}
.bo-fact dt {
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--dark);
}
.bo-fact dd {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-top: 0.2rem;
}

/* ---------- Timeline ---------- */
.bo-timeline { padding-top: 2.5rem; }
.bo-chapters {
    list-style: none;
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    counter-reset: none;
}
.bo-chapters::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 23px;
    width: 3px;
    background: linear-gradient(var(--accent), var(--primary));
    border-radius: 3px;
}
.bo-chapter {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}
.bo-num {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--dark);
    color: var(--accent);
    border: 3px solid var(--accent);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bo-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem 1.1rem;
    transition: box-shadow 0.2s, transform 0.15s;
}
.bo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bo-chapter-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-dark);
}
.bo-card h3 { font-size: 1.35rem; margin: 0.1rem 0 0.35rem; }
.bo-card h3 a { color: var(--dark); }
.bo-card h3 a:hover { color: var(--primary); }
.bo-blurb { color: var(--text-light); font-size: 0.95rem; line-height: 1.6; }

.bo-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.9rem;
}
.bo-pair figure { margin: 0; position: relative; }
.bo-pair img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.bo-pair figcaption {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}
.bo-pair figure:last-child figcaption { background: var(--accent); color: var(--dark); }
.bo-arrow {
    font-size: 1.6rem;
    color: var(--accent);
    font-weight: 700;
}
.bo-card-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.bo-meta { font-size: 0.82rem; color: var(--text-muted); }
.bo-open { font-weight: 700; font-size: 0.88rem; }

/* ---------- Extras ---------- */
.bo-extras { padding-top: 2.5rem; }
.bo-extra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 980px;
    margin: 0 auto;
}
.bo-extra {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    color: var(--dark);
    font-weight: 700;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.92rem;
    transition: box-shadow 0.2s, transform 0.15s;
}
.bo-extra:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--primary); }
.bo-extra img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.bo-extra-icon {
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-2);
    color: var(--accent);
    font-size: 2rem;
}
.bo-extra > span:last-child { padding: 0.7rem 0.9rem; }

.bo-other { text-align: center; padding-top: 2.5rem; }
.bo-other-link {
    display: inline-block;
    background: var(--dark);
    color: #fff;
    padding: 1rem 1.75rem;
    border-radius: var(--radius);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}
.bo-other-link:hover { color: var(--accent); }

/* ---------- Chapter page ---------- */
.chapter-header { margin-bottom: 2rem; max-width: 760px; }
.chapter-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.5rem; }
.chapter-blurb { font-size: 1.08rem; color: var(--text-light); }

.entry-cards {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.entry-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.15s;
}
.entry-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); color: var(--text); }
.entry-card-img { position: relative; background: var(--dark-3); }
.entry-card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.entry-card-part {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent);
    color: var(--dark);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.entry-card-body { padding: 1rem 1.15rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.entry-card-body h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.entry-card:hover h2 { color: var(--primary); }
.entry-card-body p { font-size: 0.9rem; color: var(--text-light); line-height: 1.55; flex: 1; }
.entry-card-meta { margin-top: 0.75rem; font-size: 0.78rem; color: var(--text-muted); }

/* ---------- Single post extras ---------- */
.part-progress { display: flex; gap: 4px; margin-top: 0.75rem; max-width: 320px; }
.part-progress span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.part-progress span.done { background: var(--accent); }

.chapter-contents {
    margin-top: 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    max-width: 760px;
}
.chapter-contents h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.chapter-contents ol { list-style: decimal; padding-left: 1.4rem; }
.chapter-contents li { padding: 0.15rem 0; font-size: 0.95rem; }
.chapter-contents li.current { font-weight: 700; color: var(--dark); }
.chapter-contents-all { display: inline-block; margin-top: 0.75rem; font-weight: 700; font-size: 0.88rem; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
    .bo-intro { grid-template-columns: 1fr; gap: 1.75rem; }
}
@media (max-width: 600px) {
    .bo-hero { padding: 1.75rem 0 1.5rem; }
    .ba-slider { aspect-ratio: 4 / 3; border-radius: var(--radius); }
    .bo-chapters::before { left: 17px; }
    .bo-chapter { grid-template-columns: 36px 1fr; gap: 0.75rem; }
    .bo-num { width: 36px; height: 36px; font-size: 0.95rem; border-width: 2px; }
    .bo-card { padding: 1rem; }
    .bo-pair { gap: 0.4rem; }
    .bo-arrow { font-size: 1.1rem; }
    .entry-cards { grid-template-columns: 1fr; }
    .post-navigation { flex-direction: column; }
    .post-navigation a { max-width: 100%; }
}

/* ---------- New build menu ---------- */
.build-nav > li > a { font-size: 0.9rem; font-weight: 600; padding: 0.85rem 1.1rem; }
.build-nav li ul { min-width: 260px; }
.build-nav .nav-overview a { color: var(--accent); font-weight: 700; }
.build-nav .nav-n {
    display: inline-block;
    width: 1.4rem;
    color: var(--accent);
    font-weight: 700;
    opacity: 0.85;
}
.build-nav .nav-divider { height: 1px; margin: 0.35rem 1rem; background: rgba(255, 255, 255, 0.12); }

/* ---------- Photo steps (photo with its own text) ---------- */
.entry-content { max-width: 1120px; }
.entry-content > p { max-width: 760px; }

.photo-step {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.5rem 2rem;
    align-items: start;
    margin: 0 0 2rem;
    padding: 1.1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.photo-step.is-multi { grid-template-columns: 1fr; }

.photo-step-photos { display: grid; gap: 0.75rem; }
.photo-step.photos-2 .photo-step-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo-step.photos-3 .photo-step-photos { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.entry-content a.step-photo {
    display: block;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--dark-3);
    text-decoration: none;
    cursor: zoom-in;
}
.step-photo img {
    width: 100%;
    height: auto;
    transition: transform 0.35s ease;
}
.photo-step.is-multi .step-photo img,
.photo-gallery .step-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.step-photo:hover img { transform: scale(1.03); }
.step-photo::after {
    content: "\2922";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.7);
    color: #fff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.photo-step-text { align-self: center; }
.photo-step-text p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text);
}
.photo-step.is-multi .photo-step-text { max-width: 760px; }

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    margin: 0 0 2rem;
}

/* Lightbox: photo with its caption, arrows to move through */
.lb-content { flex-direction: column; max-height: 100vh; padding: 3rem 0 1rem; }
.lb-img { max-height: 74vh; }
.lb-close { top: 0.25rem; right: 0.5rem; position: fixed; z-index: 2; }
.lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 64px;
    border: none;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
}
.lb-nav:hover { background: var(--accent); color: var(--dark); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-caption {
    max-width: min(760px, 92vw);
    margin-top: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    max-height: 18vh;
    overflow-y: auto;
}
.lb-count {
    display: block;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

@media (max-width: 760px) {
    .build-page { padding: 0 1rem; }
    .photo-step,
    .photo-step.is-multi { grid-template-columns: 1fr; gap: 0.9rem; padding: 0; background: none; border: none; box-shadow: none; }
    .photo-step.photos-3 .photo-step-photos { grid-template-columns: 1fr 1fr; }
    .photo-step.photos-3 .step-photo:first-child { grid-column: 1 / -1; }
    .photo-step-text p { font-size: 1rem; }
    .photo-step { padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); border-radius: 0; }
    .photo-gallery { grid-template-columns: 1fr 1fr; }
    .lb-nav { width: 38px; height: 52px; font-size: 2rem; top: auto; bottom: 14px; transform: none; }
    .lb-img { max-width: 100vw; border-radius: 0; }
    .lb-caption { padding: 0 3.5rem; font-size: 0.9rem; }
}

/* ---------- Search ---------- */
.nav-bar .container { align-items: center; gap: 1rem; }
.nav-search {
    display: flex;
    align-items: center;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 0 0.3rem 0 0.9rem;
    flex: 0 1 260px;
}
.nav-search:focus-within { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }
.nav-search input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    padding: 0.45rem 0;
}
.nav-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.nav-search button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
}
.nav-search button:hover { color: var(--accent); }
.primary-nav.build-nav { width: auto; }

.search-big { display: flex; gap: 0.5rem; margin-top: 1.25rem; max-width: 560px; }
.search-big input {
    flex: 1;
    min-width: 0;
    font: inherit;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
}
.search-big input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.search-big .btn-primary { border: none; cursor: pointer; font-size: 0.9rem; }
.entry-card-where {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent-dark);
    margin-bottom: 0.25rem;
}
.entry-card mark { background: rgba(221, 153, 51, 0.3); color: inherit; padding: 0 2px; border-radius: 2px; }

@media (max-width: 768px) {
    .nav-bar .container { flex-direction: column-reverse; align-items: stretch; gap: 0; }
    .nav-search { margin: 0.75rem 1rem; flex-basis: auto; }
    .primary-nav.build-nav { width: 100%; }
}
