/* Guides hub and guide pages. Loaded after blog.css and reuses its tokens, nav and
   article typography. Page markup is generated by tools/build_guides.py. */

.container.wide {
    max-width: 1040px;
}

[aria-current="page"] {
    color: var(--text);
}

/* ── HUB ── */
.guides-hub {
    padding: 4rem 0 5rem;
}
.guides-hub h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 0.75rem;
}
.guides-hub .listing-intro {
    max-width: 640px;
    margin-bottom: 2rem;
}

/* Filter tabs: plain links, one URL each. */
.guide-tabs {
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.guide-tabs ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0 0 0.25rem;
}
.guide-tabs a {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.35rem 0.95rem;
}
.guide-tabs a:hover {
    color: var(--text);
    border-color: var(--accent);
    text-decoration: none;
}
.guide-tabs a[aria-current="page"] {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}
.guide-tabs .count {
    font-weight: 400;
    opacity: 0.8;
}
.guide-tabs a:focus-visible,
.guide-link:focus-visible,
.guide-card h2 a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Cards */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.guide-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.guide-card:hover,
.guide-card:focus-within {
    border-color: var(--accent);
}
.guide-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.tag {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(79, 142, 247, 0.1);
    border: 1px solid rgba(79, 142, 247, 0.3);
    border-radius: 100px;
    padding: 0.1rem 0.65rem;
}
.read-time {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--muted);
}
.guide-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}
.guide-card h2 a {
    color: var(--text);
}
.guide-card h2 a:hover {
    color: var(--accent);
    text-decoration: none;
}
.guide-summary {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.guide-verbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.guide-verbs code {
    font-size: 0.78rem;
    color: var(--muted);
}
.guide-link {
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── GUIDE PAGE ── */
.guide {
    padding: 2.5rem 0 4rem;
}
.breadcrumb {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}
.breadcrumb a {
    color: var(--muted);
}
.breadcrumb a:hover {
    color: var(--text);
}
.guide .post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
}
.guide .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.guide .post-meta .sep {
    margin: 0 0.2rem;
}
.guide .guide-verbs {
    margin-bottom: 0;
}

/* The "Try it" box */
.try-it {
    margin-bottom: 2.5rem;
    padding: 1rem 1.25rem 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
}
.try-it h2 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green);
    margin: 0 0 0.6rem;
}
.try-it pre {
    margin-bottom: 0.9rem;
}

.viewer-link {
    margin: -1rem 0 2rem;
    font-weight: 600;
}

/* Guide body: blog.css styles `article h2` etc., so only the additions live here. */
.guide-body h2 {
    margin-top: 2.5rem;
}
.guide-body pre.output {
    margin-top: -1rem;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background: transparent;
    border-style: dashed;
    color: var(--muted);
    font-size: 0.8rem;
}
.guide-body pre.output::before {
    content: "output";
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--border);
    filter: brightness(2);
}
.verified {
    margin-top: 2.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.verified::before {
    content: "✓ ";
    color: var(--green);
}
.back {
    margin-top: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .guides-hub {
        padding-top: 2.5rem;
    }
    .guide-grid {
        grid-template-columns: 1fr;
    }
    .guide .post-header h1 {
        font-size: 1.7rem;
    }
}
