/* Credential Library — Ledger components layered on shared.v2.css. */

/* This is a wide index, not an article: do not reserve the section-rail column. */
@media (min-width: 1280px) {
    #main {
        display: block;
    }
}

.cred-wrap {
    max-width: 1180px;
}

.cred-highlights,
.cred-library,
.cred-method {
    scroll-margin-top: 6.75rem;
}

.cred-hero .sp-hero-inner {
    max-width: 1180px;
}

.cred-eyebrow,
.cred-section-kicker {
    font-family: var(--mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: var(--ls-3);
    text-transform: uppercase;
    color: var(--gold-ink);
}

.cred-eyebrow {
    margin-bottom: var(--sp-4);
}

.cred-intro {
    max-width: 760px;
}

.cred-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-6);
}

.cred-primary-link,
.cred-secondary-link,
.cred-doc,
.cred-clear {
    font-family: var(--mono);
    font-size: var(--t-sm);
    font-weight: 600;
    letter-spacing: var(--ls-1);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.cred-primary-link {
    background: var(--text);
    color: var(--bg);
    padding: 0.8rem 1.1rem;
}

.cred-primary-link:hover {
    background: var(--gold-ink);
    color: #fff;
}

.cred-secondary-link {
    color: var(--text);
    border: 1px solid var(--rule-strong);
    padding: 0.8rem 1.1rem;
}

.cred-secondary-link:hover {
    border-color: var(--gold);
    color: var(--gold-ink);
}

.cred-section-kicker {
    margin-bottom: var(--sp-2);
}

.cred-section-lead {
    max-width: 72ch;
    color: var(--muted);
    margin-bottom: var(--sp-6);
}

.cred-highlight-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--sp-7);
    list-style: none;
    counter-reset: highlights;
}

.cred-highlight-list li {
    counter-increment: highlights;
    border-top: 1px solid var(--rule);
}

.cred-highlight-list a {
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    column-gap: var(--sp-3);
    padding: var(--sp-4) 0;
    text-decoration: none;
}

.cred-highlight-list a::before {
    content: counter(highlights, decimal-leading-zero);
    grid-row: span 2;
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--gold-ink);
    padding-top: 0.2rem;
}

.cred-highlight-list span {
    font-family: var(--display);
    font-size: 1.08rem;
    line-height: 1.35;
}

.cred-highlight-list small {
    color: var(--muted);
    font-size: var(--t-sm);
    line-height: 1.45;
}

.cred-highlight-list a:hover span {
    color: var(--gold-ink);
    text-decoration: underline;
    text-decoration-color: var(--gold-soft);
    text-underline-offset: 0.18em;
}

.cred-controls {
    position: sticky;
    top: 6.4rem;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(210px, 1.5fr) repeat(4, minmax(132px, 1fr)) auto auto;
    gap: var(--sp-2);
    align-items: end;
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
    background: var(--bg);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-1);
}

.cred-control {
    display: grid;
    gap: var(--sp-1);
    min-width: 0;
}

.cred-control label,
.cred-toggle {
    font-family: var(--mono);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: var(--ls-2);
    text-transform: uppercase;
    color: var(--muted);
}

.cred-control input,
.cred-control select {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: #fffdf8;
    color: var(--text);
    font: 400 0.95rem/1.35 var(--body);
    padding: 0.65rem 0.75rem;
}

.cred-control input:focus-visible,
.cred-control select:focus-visible,
.cred-toggle:focus-within,
.cred-clear:focus-visible,
.cred-doc:focus-visible,
.cred-primary-link:focus-visible,
.cred-secondary-link:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.cred-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 2.75rem;
    cursor: pointer;
    white-space: nowrap;
}

.cred-toggle input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--text);
}

.cred-clear {
    min-height: 2.75rem;
    border: 1px solid var(--rule-strong);
    background: transparent;
    color: var(--text);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

.cred-clear:hover {
    border-color: var(--gold);
    color: var(--gold-ink);
}

.cred-status {
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--muted);
    margin-bottom: var(--sp-4);
}

.cred-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-4);
}

.cred-card {
    display: flex;
    flex-direction: column;
    min-height: 285px;
    padding: var(--sp-5);
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--rule-strong);
    border-radius: var(--radius);
    scroll-margin-top: 13.5rem;
}

.cred-card.is-featured {
    border-top-color: var(--gold);
    background: linear-gradient(180deg, rgba(197, 160, 89, 0.1), rgba(255, 253, 248, 0.78) 42%);
}

.cred-card[hidden] {
    display: none;
}

.cred-top {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
    margin-bottom: var(--sp-4);
}

.cred-category,
.cred-kind,
.cred-badge {
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: var(--ls-1);
    line-height: 1.2;
    text-transform: uppercase;
}

.cred-category {
    color: var(--muted);
    margin-inline-end: auto;
}

.cred-kind {
    color: var(--text);
    background: var(--accent-muted);
    padding: 0.32rem 0.5rem;
}

.cred-badge {
    color: var(--gold-ink);
    border: 1px solid var(--gold-soft);
    padding: 0.3rem 0.48rem;
}

.cred-title {
    font-family: var(--display);
    font-size: clamp(1.28rem, 2vw, 1.55rem);
    font-weight: 480;
    letter-spacing: -0.02em;
    line-height: 1.18;
    margin-bottom: var(--sp-2);
    overflow-wrap: anywhere;
}

.cred-provider {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.45;
    margin-bottom: var(--sp-3);
}

.cred-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--text);
    margin-bottom: var(--sp-3);
}

.cred-scope {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.55;
    margin-bottom: var(--sp-4);
}

.cred-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
    margin-top: auto;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--rule);
}

.cred-doc {
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-2);
    color: var(--text);
    border: 1px solid var(--rule-strong);
    padding: 0.55rem 0.7rem;
}

.cred-doc span {
    color: var(--muted);
    font-size: var(--t-xs);
    font-weight: 500;
}

.cred-doc:hover {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.cred-doc:hover span {
    color: var(--gold);
}

.cred-formats-note {
    font-family: var(--mono);
    font-size: var(--t-xs);
    color: var(--muted);
}

.cred-empty {
    border: 1px solid var(--rule);
    padding: var(--sp-5);
    color: var(--muted);
    text-align: center;
}

.cred-method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-5);
}

.cred-method-grid article {
    border-top: 2px solid var(--text);
    padding-top: var(--sp-4);
}

.cred-method-grid h3 {
    font-family: var(--display);
    font-size: var(--t-lg);
    font-weight: 480;
    margin-bottom: var(--sp-2);
}

.cred-method-grid p,
.cred-privacy {
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.cred-privacy {
    max-width: 78ch;
    margin-top: var(--sp-6);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--rule);
}

.cred-return {
    margin-top: var(--sp-5);
    font-family: var(--mono);
    font-size: var(--t-sm);
    letter-spacing: var(--ls-1);
}

@media (max-width: 1180px) {
    .cred-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cred-control-search {
        grid-column: span 2;
    }

    .cred-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .cred-controls {
        position: static;
        grid-template-columns: 1fr;
    }

    .cred-control-search {
        grid-column: auto;
    }

    .cred-highlight-list,
    .cred-grid,
    .cred-method-grid {
        grid-template-columns: 1fr;
    }

    .cred-card {
        min-height: 0;
        scroll-margin-top: 7rem;
    }

    .cred-toggle,
    .cred-clear {
        justify-content: center;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cred-primary-link,
    .cred-secondary-link,
    .cred-doc,
    .cred-clear {
        transition: none;
    }
}
