/* Classicalia — printed worksheets for the grammar lessons (built by grammar-print.js).
   Each .sheet is one A4 page at 96dpi. On screen the worksheet sits off the page,
   where it can be measured; in print it is the only thing that shows. Paper has
   one theme, whatever the site's. */

/* the Print menu */
.pmenu { position: relative; display: inline-flex; }
.pmenu-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 270px; background: var(--paper, #fff); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 30px rgba(14,30,63,.16); padding: 6px; }
.pmenu-list[hidden] { display: none; }
.pmenu-list button { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-radius: 7px; padding: 9px 11px; cursor: pointer; }
.pmenu-list button:hover, .pmenu-list button:focus-visible { background: var(--faint, #eef0f4); outline: none; }
.pmenu-list b { display: block; font-size: 14.5px; }
.pmenu-list span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 1px; }

#ws { position: absolute; left: -99999px; top: 0; }
#ws * { all: revert; box-sizing: border-box; margin: 0; padding: 0; }
#ws .sheet { display: flex; flex-direction: column; width: 794px; height: 1123px; overflow: hidden; background: #fff; color: #141a2b; font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12.5px; line-height: 1.5; padding: 46px 54px 40px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#ws .content { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
#ws .foot { display: flex; justify-content: space-between; font-size: 10px; color: #7a8296; border-top: .75px solid #cfd4de; padding-top: 7px; margin-top: 10px; }
#ws em, #ws .la { font-family: 'Lora', Georgia, 'Times New Roman', serif; }
#ws em { font-style: italic; }
#ws .la { font-size: 14.5px; color: #141a2b; }
#ws b { font-weight: 600; color: #141a2b; }
#ws p { display: block; }
#ws .nb { color: #4a5266; }
#ws ul, #ws ol { display: block; margin-left: 16px; }
#ws li { display: list-item; margin: 2px 0; }
#ws table { display: table; border-collapse: collapse; width: 100%; font-size: 12px; }
#ws th { text-align: left; font-weight: 600; color: #5d6579; font-size: 10.5px; padding: 0 8px 5px 0; border-bottom: .75px solid #9aa2b4; }
#ws td { padding: 5px 8px 5px 0; border-bottom: .5px solid #dde1e8; vertical-align: top; }
#ws table.by-number .num { width: 1%; vertical-align: top; padding: 6px 12px 0 0; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5d6579; border-bottom: 0; white-space: nowrap; }
#ws table.by-number .case { color: #5d6579; }
#ws table.by-number tbody + tbody tr:first-child > * { border-top: 1.5px solid #141a2b; }
#ws table.by-number tbody tr:last-child td { border-bottom: 0; }
/* marked words: solid for one mark, dashed for the other, so a black-and-white printer keeps the difference */
#ws u { text-decoration: none; padding-bottom: 1px; }
#ws u.c { border-bottom: 2px solid #1f9d55; }
#ws u.v { border-bottom: 2px dashed #1a6fff; }
#ws .mk { display: flex; gap: 16px; font-size: 10.5px; color: #5d6579; }
#ws .mk i { display: inline-block; width: 22px; vertical-align: 3px; margin-right: 6px; }
#ws .mk .c i { border-bottom: 2px solid #1f9d55; }
#ws .mk .v i { border-bottom: 2px dashed #1a6fff; }
#ws .lines { --gap: 26px; height: calc(var(--gap) * var(--n, 2)); background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--gap) - 1px), #b9c0cd calc(var(--gap) - 1px) var(--gap)); }
#ws .box { display: inline-block; min-width: 150px; height: 24px; border-bottom: 1px solid #8b93a6; }
#ws .who { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; font-size: 11px; color: #5d6579; }
#ws .who span { border-bottom: .75px solid #8b93a6; padding-bottom: 16px; }
#ws .q { display: grid; grid-template-columns: 22px 1fr; gap: 4px 6px; }
#ws .q .n { font-weight: 700; color: #5d6579; }
#ws .forms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; }
#ws .forms > div { display: grid; grid-template-columns: 20px 1fr auto; gap: 6px; align-items: end; }
#ws .forms .n { font-weight: 700; color: #5d6579; }
#ws .forms.wide { grid-template-columns: 1fr; gap: 12px; }
#ws .forms.wide > div { grid-template-columns: 20px 1fr 190px; }
#ws .forms .la { font-size: 13px; }
#ws .forms .box { min-width: 120px; }

/* A: revision sheet */
#ws .A .hd { border-top: 5px solid #0E1E3F; padding-top: 14px; }
#ws .A .kick { font-size: 10.5px; font-weight: 700; color: #5d6579; letter-spacing: .06em; text-transform: uppercase; }
#ws .A h2 { font-family: 'Lora', Georgia, serif; font-size: 25px; font-weight: 600; line-height: 1.15; margin: 4px 0; }
#ws .A .deck { color: #4a5266; max-width: 68ch; }
#ws .A h3 { display: block; font-family: 'Lora', Georgia, serif; font-size: 16px; font-weight: 600; margin: 6px 0 6px; }
#ws .A .glance { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; border: 1px solid #9aa2b4; border-radius: 8px; padding: 10px 14px; font-size: 12px; }
#ws .glance dt, #ws .remember dt { font-weight: 600; color: #141a2b; }
#ws .glance dd { color: #333a4d; }
#ws .A .ex { border-left: 3px solid #0E1E3F; padding: 2px 0 2px 12px; }
#ws .A .ex .en { color: #333a4d; font-size: 12px; margin-top: 2px; }
#ws .A .ex .nt { color: #5d6579; font-size: 11px; margin-top: 2px; }
#ws .A .warn { background: #f2f4f7; border-radius: 8px; padding: 10px 14px; }
#ws .A .warn b.k { display: block; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #5d6579; margin-bottom: 4px; }

/* B: exercise sheet */
#ws .B .hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-bottom: 2px solid #141a2b; padding-bottom: 10px; }
#ws .B h2 { font-family: 'Lora', Georgia, serif; font-size: 22px; font-weight: 600; line-height: 1.15; }
#ws .B .sub { font-size: 11px; color: #5d6579; margin-top: 2px; }
#ws .B .who { flex: none; width: 290px; grid-template-columns: 1fr 1fr; }
#ws .B .who span:first-child { grid-column: 1 / -1; }
#ws .B .remember { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; border: 1.5px solid #141a2b; border-radius: 6px; padding: 10px 14px; }
#ws .B .remember.one { grid-template-columns: 1fr; }
#ws .B .remember h4 { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 6px; }
#ws .B .remember dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11.5px; }
#ws .B .task { display: flex; justify-content: space-between; align-items: baseline; border-bottom: .75px solid #9aa2b4; padding-bottom: 4px; margin-top: 4px; }
#ws .B .task h3 { font-family: 'Lora', Georgia, serif; font-size: 15px; font-weight: 600; }
#ws .B .task span { font-size: 10.5px; color: #5d6579; }
#ws .B .q { grid-template-columns: 24px 1fr 34px; gap: 2px 6px; }
#ws .B .q .n { color: #141a2b; }
#ws .B .q .m { font-size: 10px; color: #5d6579; text-align: right; }
#ws .B .content { gap: 10px; }
#ws .B .lines { --gap: 24px; }

/* the answers page */
#ws .hd.ans { display: block; border: 0; border-bottom: 2px solid #141a2b; padding: 0 0 10px; }
#ws .hd.ans .tag2 { display: block; font-size: 10.5px; color: #5d6579; margin-bottom: 3px; }
#ws .hd.ans h2 { font-family: 'Lora', Georgia, serif; font-size: 20px; font-weight: 600; margin: 0; }
#ws .sheet h3 { font-family: 'Lora', Georgia, serif; font-weight: 600; }
#ws .ans.item { display: grid; grid-template-columns: 22px 1fr; gap: 2px 6px; margin: 4px 0; }
#ws .ans.item .n { font-weight: 700; color: #5d6579; }
#ws .ans .model { font-size: 12.5px; }
#ws .ans .scheme { font-size: 11px; color: #4a5266; }
#ws .ans .scheme span { white-space: nowrap; margin-right: 10px; }
#ws ol.ans { margin-left: 18px; font-size: 12px; }

@media print {
  @page { size: A4; margin: 0; }
  html.ws-on, html.ws-on body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  html.ws-on body > *:not(#ws) { display: none !important; }
  html.ws-on #ws { position: static; }
  #ws .sheet { height: 296mm; break-after: page; }
  #ws .sheet:last-child { break-after: auto; }
}
