/**
 * GDB public pages — cards & panels (works without Vite).
 */

/* --- Shared: pills, aside panels, doc cards --- */
.gdb-pill-stat {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid #e4e4e7;
    background: #fff;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
    color: #52525b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gdb-pill-stat strong {
    color: #18181b;
    font-weight: 700;
}

a.gdb-pill-stat {
    font-weight: 600;
    color: #27272a;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.gdb-pill-stat:hover {
    border-color: #d4d4d8;
    background: #fafafa;
}

.gdb-aside-panel {
    border-radius: 1rem;
    border: 1px solid #e4e4e7;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    padding: 1.35rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gdb-aside-panel--code {
    background: #fafafa;
}

.gdb-aside-panel pre {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #3f3f46;
}

.gdb-aside-panel .gdb-panel-title {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #71717a;
}

.gdb-doc-card {
    border-radius: 1rem;
    border: 1px solid #e4e4e7;
    background: linear-gradient(165deg, #ffffff 0%, #fafafa 100%);
    padding: 1.5rem 1.5rem 1.35rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gdb-doc-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.gdb-doc-card h2 {
    margin: 0;
    font-family: "Source Serif 4", ui-serif, Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    color: #09090b;
    letter-spacing: -0.02em;
}

.gdb-doc-badge {
    display: inline-flex;
    align-self: flex-start;
    border-radius: 9999px;
    border: 1px solid #e4e4e7;
    background: #fff;
    padding: 0.25rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #52525b;
    margin-bottom: 0.5rem;
}

.gdb-doc-card ul {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.gdb-doc-card li + li {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f4f4f5;
}

.gdb-doc-version-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.gdb-doc-card a {
    font-weight: 600;
    color: #18181b;
    text-underline-offset: 3px;
}

.gdb-doc-card .gdb-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid #d4d4d8;
    background: #fff;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #18181b;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gdb-doc-card .gdb-btn-ghost:hover {
    background: #fafafa;
    border-color: #a1a1aa;
}

/* --- Briefs: chain grid --- */
.gdb-chain-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}

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

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

.gdb-chain-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.5rem 1.5rem 1.35rem;
    border-radius: 1rem;
    border: 1px solid #e4e4e7;
    background: linear-gradient(155deg, #ffffff 0%, #f4f4f5 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.gdb-chain-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #18181b, #71717a);
    opacity: 0.85;
}

.gdb-chain-card:hover {
    transform: translateY(-2px);
    border-color: #d4d4d8;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
}

.gdb-chain-card:focus-visible {
    outline: 2px solid #52525b;
    outline-offset: 3px;
}

.gdb-chain-card-label {
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #71717a;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.gdb-chain-card-title {
    margin: 0;
    font-family: "Source Serif 4", ui-serif, Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    color: #09090b;
    letter-spacing: -0.02em;
}

.gdb-chain-card:hover .gdb-chain-card-title {
    text-decoration: underline;
    text-decoration-color: #d4d4d8;
    text-underline-offset: 4px;
}

.gdb-chain-card-desc {
    margin: 0.65rem 0 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #52525b;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gdb-chain-card-meta {
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #71717a;
}

.gdb-chain-card-cta {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #18181b;
}

/* --- Briefs: archive rows --- */
.gdb-archive-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.gdb-archive-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border-radius: 0.875rem;
    border: 1px solid #e4e4e7;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
    .gdb-archive-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.gdb-archive-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.gdb-archive-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #18181b;
}

.gdb-archive-card-mono {
    margin: 0.2rem 0 0;
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    color: #a1a1aa;
}

.gdb-archive-card-date {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #52525b;
    font-variant-numeric: tabular-nums;
}

.gdb-archive-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.gdb-archive-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: #71717a;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    background: #f4f4f5;
}

.gdb-archive-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
    background: #18181b;
    border: 1px solid #18181b;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.gdb-archive-open:hover {
    background: #27272a;
    border-color: #27272a;
}

.gdb-archive-open:active {
    transform: scale(0.98);
}

/* Filter bar */
.gdb-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 0.875rem;
    background: #fafafa;
    border: 1px solid #e4e4e7;
}

.gdb-filter-row label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #71717a;
    margin-bottom: 0.35rem;
}

.gdb-filter-row select {
    min-width: 14rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d4d4d8;
    background: #fff;
    font-size: 0.9375rem;
    color: #18181b;
}

.gdb-filter-submit {
    padding: 0.5rem 1.15rem;
    border-radius: 0.5rem;
    border: 1px solid #18181b;
    background: #18181b;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.gdb-filter-submit:hover {
    background: #27272a;
}

/* Briefs chain show: stacked cards */
.gdb-brief-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gdb-brief-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-radius: 1rem;
    border: 1px solid #e4e4e7;
    background: linear-gradient(120deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
    .gdb-brief-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.gdb-brief-card:hover {
    border-color: #d4d4d8;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.gdb-brief-card-date {
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #18181b;
    letter-spacing: -0.02em;
}

.gdb-brief-card-status {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #71717a;
}

.gdb-brief-card .gdb-btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: #18181b;
    border: 1px solid #18181b;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.gdb-brief-card .gdb-btn-pdf:hover {
    background: #27272a;
    border-color: #27272a;
}

.gdb-brief-card .gdb-btn-pdf:active {
    transform: scale(0.98);
}

.gdb-text-back {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #52525b;
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: color 0.15s ease;
}

.gdb-text-back:hover {
    color: #18181b;
}

/* Stat card rows (about, statistics) */
.gdb-about-stats,
.gdb-stat-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Statistics panels */
.gdb-table-panel {
    border-radius: 0.875rem;
    border: 1px solid #e4e4e7;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.gdb-table-panel h3 {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #71717a;
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    border-bottom: 1px solid #e4e4e7;
}

.gdb-table-panel table {
    width: 100%;
    font-size: 0.875rem;
}

.gdb-table-panel th {
    padding: 0.5rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #71717a;
}

.gdb-table-panel td {
    padding: 0.6rem 1rem;
    border-top: 1px solid #f4f4f5;
}

/* Protocol sections */
.gdb-protocol-section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #f4f4f5;
}

.gdb-protocol-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.gdb-protocol-body {
    margin-top: 0.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    border: 1px solid #e4e4e7;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Protocol page — HTML from admin markdown */
.gdb-protocol-markdown {
    color: #3f3f46;
    font-size: 0.9375rem;
    line-height: 1.65;
}

.gdb-protocol-markdown > *:first-child {
    margin-top: 0;
}

.gdb-protocol-markdown h1 {
    margin: 0 0 2rem;
    font-family: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #09090b;
}

.gdb-protocol-markdown h2 {
    margin: 2.25rem 0 0.75rem;
    font-family: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #09090b;
}

.gdb-protocol-markdown h3 {
    margin: 1.5rem 0 0.5rem;
    font-family: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #18181b;
}

.gdb-protocol-markdown p {
    margin: 0 0 1rem;
}

.gdb-protocol-markdown ul,
.gdb-protocol-markdown ol {
    margin: 0 0 1.25rem;
    padding-left: 1.35rem;
}

.gdb-protocol-markdown li {
    margin-bottom: 0.35rem;
}

.gdb-protocol-markdown li::marker {
    color: #a1a1aa;
}

.gdb-protocol-markdown a {
    font-weight: 500;
    color: #27272a;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #d4d4d8;
}

.gdb-protocol-markdown a:hover {
    color: #09090b;
    text-decoration-color: #a1a1aa;
}

.gdb-protocol-markdown code {
    font-size: 0.875em;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: #f4f4f5;
    color: #3f3f46;
}

.gdb-protocol-markdown pre {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    background: #fafafa;
    border: 1px solid #e4e4e7;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.gdb-protocol-markdown pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.gdb-protocol-markdown blockquote {
    margin: 0 0 1.25rem;
    padding-left: 1rem;
    border-left: 3px solid #e4e4e7;
    color: #52525b;
}

.gdb-protocol-markdown hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #e4e4e7;
}

/* Admin protocol preview (Tailwind layout) */
.protocol-admin-preview h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #111827;
}

.protocol-admin-preview h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: #111827;
}

.protocol-admin-preview h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.35rem;
}

.protocol-admin-preview ul,
.protocol-admin-preview ol {
    margin: 0 0 0.75rem;
    padding-left: 1.25rem;
}

.protocol-admin-preview p {
    margin: 0 0 0.75rem;
}

.protocol-admin-preview a {
    color: #4f46e5;
    text-decoration: underline;
}
