/* ===== A4 PAPER — what prints ===== */
.a4{
  width:794px;min-height:1123px;background:#fff;margin:0 auto;
  padding:40px 44px;color:#000;font-family:'Merriweather',Georgia,serif;font-size:13px;
  box-shadow:0 4px 20px rgba(0,0,0,.15);
}
.a4 *{box-sizing:border-box}

/* header — 3-column flex so nothing overlaps */
.paper-head{text-align:center;border-bottom:2.5px solid #000;padding-bottom:10px;margin-bottom:4px}
.paper-head .head-grid{display:flex;align-items:flex-start;gap:10px}
.paper-head .hg-left{flex:0 0 120px;text-align:left}
.paper-head .hg-center{flex:1 1 auto;text-align:center;min-width:0}
.paper-head .hg-right{flex:0 0 92px;display:flex;align-items:flex-start;justify-content:flex-end}
.paper-head .logo-box img{max-width:92px;max-height:92px;object-fit:contain}
.paper-head .roll-fields{font-size:11px;font-weight:400}
.paper-head .roll-fields div{margin-bottom:12px}
.paper-head .roll-fields .lineblank{display:block;border-bottom:1px solid #000;width:100%;max-width:118px;height:11px;margin-top:3px}
.paper-head .inst{font-size:22px;font-weight:700;margin:0;line-height:1.15;word-wrap:break-word}
.paper-head .board{font-size:11.5px;font-weight:700;margin:3px 0 0;letter-spacing:.3px;text-transform:uppercase;color:#111}
.paper-head .csx{font-size:14px;margin:5px 0 0;font-weight:700}
.paper-head .prep{font-size:11px;color:#333;margin-top:3px}
.meta-row{display:flex;justify-content:space-between;font-size:12.5px;font-weight:700;margin:8px 2px 2px;padding:5px 0;border-bottom:1px solid #000}
.comment-line{font-size:11.5px;font-style:italic;text-align:center;margin:5px 0 0;color:#222}
.instructions{font-style:italic;font-size:12px;margin:9px 0 12px;padding:7px 11px;background:#f6f6f6;border-left:3px solid #000}

/* sections */
.sec-title{font-size:14px;font-weight:700;background:#000;color:#fff;padding:5px 11px;margin:14px 0 8px;display:flex;justify-content:space-between;align-items:center}
.sec-note{font-size:11.5px;font-style:italic;margin:-2px 0 8px 2px}
.sec-block{break-inside:auto}
.sec-break{page-break-before:always;break-before:page}

.q-line{display:flex;gap:8px;margin-bottom:8px;page-break-inside:avoid;break-inside:avoid}
.q-line .qn{font-weight:700;min-width:22px}
.q-line .qbody{flex:1}
.q-line .qmarks{font-weight:700;white-space:nowrap;margin-left:8px}
.q-img{display:block;max-width:70%;max-height:180px;object-fit:contain;margin:6px 0}

.mcq-opts{display:grid;grid-template-columns:1fr 1fr;gap:2px 24px;margin-top:5px;font-size:12.5px}
.mcq-opts .o{display:flex;align-items:center;gap:5px}
.mcq-opts .o .ol{font-weight:700}
.mcq-opts .o img{max-height:44px;max-width:120px;object-fit:contain}

.tf-mark{font-weight:700;white-space:nowrap;margin-left:6px}
.wordbank{font-size:11.5px;margin-top:3px;padding:3px 8px;border:1px dashed #888;display:inline-block}

.sub-list{margin:5px 0 0 8px}
.sub-list .sub{display:flex;gap:6px;margin-bottom:3px}
.sub-list .sub .sl{font-weight:700}
.sub-list .sub .sm{margin-left:auto;font-weight:700}

.paper-foot{text-align:center;font-weight:700;margin-top:20px;border-top:1.5px solid #000;padding-top:8px;font-size:13px}

/* Urdu paper — flex row auto-reverses under dir=rtl (roll→right, logo→left) */
.a4.paper-urdu{direction:rtl}
.a4.paper-urdu .paper-head .hg-left{text-align:right}
.a4.paper-urdu .instructions{border-left:none;border-right:3px solid #000}
.a4 .urdu{font-family:'Noto Nastaliq Urdu',serif;direction:rtl;text-align:right}

/* Export mode — remove screen-only min-height/padding so PDF fits exact A4 with html2pdf margins */
.a4.exporting{min-height:0;padding:0;box-shadow:none;width:794px}

/* Fit-to-page compact mode */
.a4.fit{font-size:11px;padding:28px 34px}
.a4.fit .paper-head .inst{font-size:19px}
.a4.fit .sec-title{margin:9px 0 5px;padding:4px 9px;font-size:12.5px}
.a4.fit .q-line{margin-bottom:5px}
.a4.fit .mcq-opts{font-size:11px}
.a4.fit .instructions{margin:6px 0 8px;padding:5px 9px}

/* Board style tweaks */
.a4.board-cambridge .paper-head{border-bottom-width:1.5px}
.a4.board-cambridge .sec-title{background:#1f2937}
.a4.board-fbise .paper-head,.a4.board-bise_rwp .paper-head,.a4.board-bise_lhr .paper-head,.a4.board-bise_pb .paper-head{border-bottom:3px double #000}
