/* =========================================================
   Apitect API Feed Display — Public / Frontend Styles
   ========================================================= */

.apitect-wrapper {
    font-family: inherit;
    line-height: 1.6;
    margin: 1em 0;
}

.apitect-title {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 .75em;
    padding-bottom: .4em;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
}

/* ---- Error ---- */
.apitect-error {
    padding: 10px 14px;
    background: #fce7e7;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    color: #d63638;
    font-size: .9em;
}

/* ---- Table ---- */
.apitect-table-scroll { overflow-x: auto; }

.apitect-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9em;
}

.apitect-table th,
.apitect-table td {
    padding: 9px 12px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

.apitect-table thead th {
    background: #2271b1;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.apitect-table tbody tr:nth-child(even) { background: #f6f7f7; }
.apitect-table tbody tr:hover           { background: #e8f0fb; }

/* Key-value variant */
.apitect-kv th {
    width: 200px;
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
}

/* ---- List ---- */
.apitect-list {
    margin: 0;
    padding: 0 0 0 1.4em;
}
.apitect-list li { padding: 4px 0; }

/* ---- Cards ---- */
.apitect-cards {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
    gap: 16px;
}

.apitect-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    font-size: .9em;
}

.apitect-card-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}
.apitect-card-row:last-child { border-bottom: none; }

.apitect-card-key {
    font-weight: 600;
    color: #555;
    min-width: 90px;
    flex-shrink: 0;
}

.apitect-card-val {
    word-break: break-word;
    color: #1d2327;
}

/* ---- Raw JSON ---- */
.apitect-raw {
    background: #1e2535;
    color: #a8d8a8;
    padding: 16px;
    border-radius: 6px;
    font-size: .82em;
    overflow: auto;
    max-height: 500px;
}

/* ---- Nested ---- */
.apitect-nested {
    background: #f6f7f7;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: .8em;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 200px;
    overflow: auto;
}

/* ---- Links ---- */
.apitect-wrapper a {
    color: #2271b1;
    text-decoration: none;
}
.apitect-wrapper a:hover { text-decoration: underline; }

/* ---- Scalar ---- */
.apitect-scalar { font-size: 1em; margin: 0; }

/* ---- Responsive ---- */
@media ( max-width: 600px ) {
    .apitect-cards { grid-template-columns: 1fr; }
    .apitect-kv th { width: 120px; }
}
