/* ════════════════════════════════════════════════════════════
   LumorowLMS — IELTS: Match the Paragraph (Topic Sentences)
   Frontend + editor styles. Uses --llmsb-primary for accents.
   ════════════════════════════════════════════════════════════ */

/* Width override: shared.css caps every .llmsb-block at 780px so
   narrow blocks (flashcards, vocab) stay narrow. As a "wide" reading
   exercise we override that cap here — same pattern as the IELTS
   Reading Complete block. Pairs with the v3.5.156 sidebar-hiding
   rules so the post content area gives us room to expand into. */
.llmsb-ipt-block {
    width: 100%;
    max-width: 1600px;
    border: 2px solid var(--llmsb-primary, #F77205);
    border-radius: 12px;
    padding: 20px 22px;
    background: #fff;
    color: #1a1a2e;
    margin: 24px auto;
}

.llmsb-ipt-cols {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Left: title + topic sentences */
.llmsb-ipt-passage {
    flex: 1 1 280px;
    min-width: 240px;
}
.llmsb-ipt-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 14px;
    line-height: 1.2;
}
.llmsb-ipt-para {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 8px 0;
    line-height: 1.55;
}
.llmsb-ipt-para-letter {
    flex: 0 0 18px;
    font-weight: 700;
    color: #1a1a2e;
}
.llmsb-ipt-para-text {
    flex: 1 1 auto;
    color: #1a1a2e;
}

/* Right: questions + matching table */
.llmsb-ipt-qcol {
    flex: 1 1 280px;
    min-width: 240px;
}
.llmsb-ipt-q-head {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
}
.llmsb-ipt-q-instr {
    margin: 0 0 2px;
    font-size: 0.95rem;
    color: #1a1a2e;
    line-height: 1.45;
}
.llmsb-ipt-q-instr-sub {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.45;
}

/* Matching table — mirrors the IELTS Reading Complete block's
   .llmsb-iel-r-pgmatch-tbl pattern. Letter columns are narrow (30px),
   the statement column takes the remaining width. Header row is
   solid brand orange with white bold letters.
   table-layout:fixed + !important so themes that set table{width:auto}
   can't shrink the table below its container — the empty space on the
   right of the statement column comes from auto-layout giving up. */
.llmsb-ipt-tbl {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #c8cdd3;
    font-size: 14px;
}
.llmsb-ipt-tbl th,
.llmsb-ipt-tbl td {
    border: 1px solid #c8cdd3;
    padding: 8px 10px;
    text-align: center;
}
.llmsb-ipt-tbl thead th {
    background: var(--llmsb-primary, #F77205);
    color: #fff;
    font-weight: 700;
    width: 30px;
}
.llmsb-ipt-tbl thead th:first-child {
    background: var(--llmsb-primary, #F77205);
    width: auto;
}
.llmsb-ipt-tbl-rowhead {
    text-align: left !important;
    font-weight: 400;
    background: #fff !important;
    line-height: 1.4;
    width: auto;
    vertical-align: middle;
}
.llmsb-ipt-tbl-num {
    font-weight: 700;
    margin-right: 6px;
    color: #1a1a2e;
}
.llmsb-ipt-tbl-text { font-weight: 400; color: #1a1a2e; }
.llmsb-ipt-tbl-cell {
    cursor: pointer;
    height: 34px;
    min-width: 30px;
    transition: background 0.1s;
}
.llmsb-ipt-tbl-cell:hover { background: #f4f6fa; }
.llmsb-ipt-tbl-cell.is-selected {
    background: var(--llmsb-primary, #F77205);
}
.llmsb-ipt-tbl-cell.is-selected::after {
    content: '✓';
    color: #fff;
    font-weight: 700;
}

/* Controls */
.llmsb-ipt-controls {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}
.llmsb-ipt-submit {
    background: var(--llmsb-primary, #F77205);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 28px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.15s, opacity 0.15s;
}
.llmsb-ipt-submit:hover:not(:disabled) { background: #d96304; }
.llmsb-ipt-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Results */
.llmsb-ipt-results { margin-top: 18px; }
.llmsb-ipt-r-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}
.llmsb-ipt-r-table th,
.llmsb-ipt-r-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
.llmsb-ipt-r-table th {
    background: #fafafa;
    color: #555;
    font-weight: 600;
}
.llmsb-ipt-r-table tr.is-ok { background: #f0fdf4; }
.llmsb-ipt-r-table tr.is-wrong { background: #fef2f2; }
.llmsb-ipt-r-table .mark { font-weight: 700; font-size: 1.1rem; }
.llmsb-ipt-r-table tr.is-ok .mark { color: #16a34a; }
.llmsb-ipt-r-table tr.is-wrong .mark { color: #dc2626; }
.llmsb-ipt-r-explain td { font-size: 0.9rem; color: #555; padding-top: 0; }

/* ── Editor styles ──────────────────────────────────────── */
.llmsb-ipt-editor {
    padding: 18px;
    background: #fff;
    border: 2px dashed var(--llmsb-primary, #F77205);
    border-radius: 12px;
}
.llmsb-ipt-editor-header {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--llmsb-primary, #F77205);
    margin-bottom: 8px;
}
.llmsb-ipt-editor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 10px;
}
.llmsb-ipt-editor-meta .ok strong { color: #15803d; }
.llmsb-ipt-editor-meta .warn strong { color: #c2410c; }
.llmsb-ipt-editor-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 8px;
}
.llmsb-ipt-editor-section {
    margin-top: 18px;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.llmsb-ipt-editor-section h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--llmsb-primary, #F77205);
}
.llmsb-ipt-row {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
}
.llmsb-ipt-row-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.llmsb-ipt-row-num {
    background: var(--llmsb-primary, #F77205);
    color: #fff;
    border-radius: 16px;
    padding: 3px 10px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Mobile collapse */
@media (max-width: 720px) {
    .llmsb-ipt-cols { flex-direction: column; }
    .llmsb-ipt-tbl-letter, .llmsb-ipt-tbl-cell { width: 32px; height: 36px; }
}
