/* Docs hub (/docs/ only; loaded via the page's `stylesheets` front matter) */

/* Full-width bands: hero gradient on top, then sections alternate white / tint */
.docs-hero {
    background: linear-gradient(135deg, #F0F5E7 0%, #FFFFFF 100%);
}

.docs-band-tint {
    background: #F0F5E7;
}

/* Section jump links under the hero copy */
.docs-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-primary-light);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.docs-jump:hover {
    background: var(--color-primary-dark);
}

.docs-jump:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Card grid: one column, two from md, three from lg. Cards fill from the left;
   a short row leaves its remaining slots empty. */
.docs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .docs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .docs-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* One card per tutorial, guide, or package */
.docs-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.docs-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.docs-card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    object-position: left center;
}

.docs-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}

.docs-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #6B7280;
}

.docs-card-title {
    color: var(--color-primary-dark);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.docs-card-title a {
    color: inherit;
    text-decoration: none;
}

.docs-card-title a:hover {
    color: var(--color-primary-light);
}

.docs-card-text {
    color: var(--color-text-light);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.docs-card-text code {
    background: #F3F4F6;
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

/* The button sits at the bottom of every card in a row, whatever the text length */
.docs-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    align-self: flex-start;
    margin-top: auto;
    background: var(--color-primary-light);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.docs-card-cta:hover {
    background: var(--color-primary-dark);
}

.docs-card-cta:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.docs-card-cta svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Slots a band has not filled yet: a dashed outline, the first with a short note */
.docs-card-placeholder {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    min-height: 14rem;
    background: transparent;
    border: 2px dashed #D1D5DB;
    box-shadow: none;
}

.docs-card-placeholder:hover {
    transform: none;
    box-shadow: none;
}

.docs-card-placeholder .docs-card-title {
    color: var(--color-text-light);
}

.docs-card-placeholder .docs-card-text {
    margin-bottom: 0;
}

/* Below three columns the silent ghosts stop lining up beside the real card and
   just add scroll, so only the placeholder that says something is kept. */
@media (max-width: 1023px) {
    .docs-card-placeholder[aria-hidden] {
        display: none;
    }
}

/* Outline variant for links that leave the site (package READMEs on GitHub) */
.docs-card-cta-secondary {
    background: transparent;
    color: var(--color-primary-dark);
    border: 2px solid var(--color-primary-dark);
    padding: calc(0.5rem - 2px) calc(1rem - 2px);
}

.docs-card-cta-secondary:hover {
    background: #F3F4F6;
}
