/* Site-wide fonts (dedbit + bitsuse + chat), loaded by include/fonts.head.php AFTER the theme
   stylesheet (style.*.css / bootstrap) so these rules win over the old Tahoma declarations there.
   - IBM Plex Sans Thai (loopless): headings, menus, table headers, buttons
   - IBM Plex Sans Thai Looped (with loops): content - torrent lists, forum posts, chat, forms
   Weights 400 + 600 only (Google Fonts); "bold" (700) renders with the 600 face. */

/* ---- content (Looped) ---- */
body,
input, textarea, select,
#TB_window, #TB_secondLine, div.jqi, div.jqi .jqimessage,
input.chatinput, #chatupdate {
	font-family: "IBM Plex Sans Thai Looped", Tahoma, sans-serif;
}
/* Thai stacks upper vowels + tone marks above the x-height: 1.6 keeps them clear of the
   line above (Tahoma's tight metrics hid this; Plex is taller). */
body { line-height: 1.6; }
/* Form controls: NOT the 1.6 of the text, and not "normal" either - for Plex Looped "normal" is
   ~1.6 too (tall font metrics), which made inputs 28px (Chromium) / 33px (WebKit) and pushed the
   header search out of the 25px bar. Explicit size as well: browsers default form controls to
   11px (Safari/Mac), 13.33px (Chromium) or 16px (WebKit/Linux), so the text looked tiny in a tall
   box on Safari. 1.3 still leaves room for Thai upper vowels + tone marks inside the box. */
input, select, button, textarea { font-size: 13px; line-height: 1.3; }
textarea { line-height: 1.5; } /* multi-line post/message text */
/* Chromium forces line-height:normal on submit/button inputs and selects (WebKit on selects),
   so line-height can't size them - give single-line buttons/selects an explicit height instead.
   Rules with an id (#btnLogin 45px, #nav search) still win. */
input[type="submit"], input[type="button"], input[type="reset"], button,
select:not([multiple]):not([size]) { height: 24px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }

/* ---- UI (loopless) ---- */
h1, h2, h3, h4, h5, h6,
.ddsmoothmenu, .ddsmoothmenu ul li ul li a, div#nav,
th, td.colhead, table.main th, table.peerlist th,
table.torrenttable td.colhead, table.torrenttable th,
button, input[type="submit"], input[type="button"], input[type="reset"], .btn, div.jqi button,
div.divError, div.divNotice, div.divNoticeBlue, div.divNoticePink, div.divNoticePurple,
div.divInfo, div.divBox, div.detailshead, p.pager, .ui-font {
	font-family: "IBM Plex Sans Thai", Tahoma, sans-serif;
}
.content-font { font-family: "IBM Plex Sans Thai Looped", Tahoma, sans-serif; }

/* ---- numbers that line up in columns ---- */
table.torrenttable td:not([align="left"]), table.peerlist td, div#userinfo, .tabnum {
	font-variant-numeric: tabular-nums;
}

/* ---- top menu bar ---- */
/* #nav is position:fixed without a z-index, so the positioned header login form (later in the DOM)
   painted over the open dropdowns. 99 = above all page content, below the thickbox popup overlay
   (#TB_overlay 100, #TB_window 102) so popups still cover the menu. */
div#nav { z-index: 99; }
/* search box + button inside the 25px bar */
div#nav input { font-size: 12px; line-height: 1.2; height: 21px; padding: 0 4px; margin: 2px 0 0; box-sizing: border-box; vertical-align: top; }

/* ---- boxes with a fixed height that clipped Thai upper vowels / tone marks ---- */
/* top menu bar: 25px bar, links get their height from padding + line-height */
.ddsmoothmenu ul li a { line-height: 14px; }
/* header user box: 4 lines inside a 100px overflow:hidden header */
div#userinfo table tr td { line-height: 1.45; }
/* bbcode editor toolbar items were cut at 22px */
table.bbcode td ul li { height: auto !important; min-height: 22px; }
/* torrent lists (browse, index, profile tables) and peer lists are dense: 1.45 instead of the
   1.6 used for posts, news and chat (headings were 180% of 110% before) */
table.torrenttable td, table.torrenttable th, table.peerlist td, table.peerlist th { line-height: 1.45; }
