/* Reusable components: buttons, tags, access modes, lists, tables, Q&A. */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: 600 15px/1 var(--font-body);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }

.btn--secondary { background: var(--control); color: var(--text); border-color: var(--line-2); }
.btn--secondary:hover { background: var(--panel-2); border-color: var(--faint); }

.btn[aria-disabled="true"],
.btn:disabled { opacity: 0.5; transform: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.actions--center { justify-content: center; }

.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 15px; }

.section-title { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 16px; }
.section-title--center { text-align: center; margin-inline: auto; max-width: 22em; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
.section-head .section-title { margin-bottom: 0; max-width: 20em; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--accent-wash);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    vertical-align: middle;
}

/* Access modes */
.modes {
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    padding: 20px;
}
.modes__head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.modes__title { color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
.modes__tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.modes__tab {
    min-height: 40px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: 600 14px/1.2 var(--font-body);
    transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.modes__tab:hover { color: var(--text); }
.modes__tab[aria-selected="true"] { background: var(--control); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.modes__panel + .modes__panel { margin-top: 20px; }
.js .modes__panel + .modes__panel { margin-top: 0; }
.js [data-nojs] { display: none; }
.modes__panel-title { font-weight: 700; margin-bottom: 4px; }
.modes__summary { color: var(--muted); font-size: 14px; min-height: 3.2em; margin-bottom: 8px; }
.modes__rows { border-top: 1px solid var(--line); }
.modes__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.modes__row:last-child { border-bottom: 0; padding-bottom: 0; }

.state { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font-family: var(--font-mono); font-size: 12px; }
.state__mark { width: 8px; height: 8px; border-radius: 2px; }
.state--allowed { color: var(--text); }
.state--allowed .state__mark { background: var(--text); }
.state--asks { color: var(--accent); }
.state--asks .state__mark { border: 2px solid var(--accent); }
.state--blocked { color: var(--faint); }
.state--blocked .state__mark { width: 10px; height: 2px; border-radius: 0; background: var(--faint); }

/* Lists */
.feature-list { display: grid; gap: 12px; }
.feature-list li { position: relative; padding-left: 20px; color: var(--muted); }
.feature-list li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.62em;
    width: 7px; height: 7px;
    border-radius: 2px;
    background: var(--accent);
}

/* Panels */
.panel {
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.panel p { color: var(--muted); }
.panel__title { font-size: 20px; margin-bottom: 10px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.table-wrap:focus-visible { outline-offset: 2px; }
.spec-table,
.compare-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th,
.spec-table td,
.compare-table th,
.compare-table td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table tr:last-child > *,
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.spec-table th { width: 42%; color: var(--muted); font-weight: 500; }

/* Q&A */
.qa { border-bottom: 1px solid var(--line); }
.qa__q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    min-height: 64px;
    padding: 16px 0;
    list-style: none;
    font-weight: 600;
    font-size: 17px;
    transition: color 150ms var(--ease);
}
.qa__q::-webkit-details-marker { display: none; }
.qa__q::after {
    content: "";
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-3px) rotate(45deg);
    transition: transform 200ms var(--ease);
}
.qa__q:hover { color: var(--accent); }
.qa[open] > .qa__q::after { transform: translateY(2px) rotate(-135deg); }
.qa__a { display: grid; gap: 12px; padding: 0 40px 24px 0; color: var(--muted); max-width: 68ch; }

@media (max-width: 760px) {
    .pair { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .panel { padding: 22px; }
}
