/*
Theme Name: Textual Redesign
Description: Child theme of Textual for The Singaporean Investor. Left sidebar on desktop, slide-open menu on mobile, black, grey and navy.
Author: The Singaporean Investor
Template: textual
Version: 1.1.2
License: GNU General Public License version 3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: textual
*/

:root { --navy: #1F4E79; --ink: #111; --body: #333; --muted: #555;
  --sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif; --serif: 'Source Serif 4', Georgia, serif; }

html { font-size: 62.5%; }
html, body { background: #fff !important; }
html body { height: auto; min-height: 100%; margin: 0; color: var(--body); font-family: var(--serif) !important; }
body h1, body h2, body h3, body h4, body h5, body h6 { font-family: var(--sans) !important; color: #000; font-weight: 900; }
body a { color: var(--navy); }
body a:hover, body a:focus { color: #000; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Layout */
.tsi { display: grid; grid-template-columns: clamp(290px, 25vw, 372px) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "brand main" "side main"; min-height: 100vh; border-top: 7px solid var(--navy); box-shadow: inset 0 7px 0 #bbb; padding-top: 7px; }
.tsi-brand { grid-area: brand; display: flex; align-items: center; gap: 12px; padding: 24px 26px; border-right: 2px solid #000; }
.tsi-logo { width: 76px; height: 76px; object-fit: contain; flex: none; }
.tsi-brand .tsi-name { font: 900 24px/1.02 var(--sans); text-transform: uppercase; color: var(--ink); text-decoration: none; letter-spacing: 0; }
.tsi-toggle { display: none; }
.tsi-side { grid-area: side; min-width: 0; padding: 8px 26px 40px; border-right: 2px solid #000; font: 16px/1.45 var(--sans); color: #222; }
.tsi-main { grid-area: main; min-width: 0; padding: 40px 7% 56px; }
.tsi-column { max-width: 660px; }

/* Sidebar and menu widgets */
.tsi-side .widget { margin: 0 0 32px; overflow-wrap: break-word; }
.tsi-side h4 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.tsi-side p { margin: 0 0 10px; }
.tsi-side img, .tsi-side iframe { max-width: 100%; }
.tsi-side img { height: auto; }
.tsi-side ul { list-style: none; margin: 0; padding: 0; }
.tsi-side li { padding: 6px 0; line-height: 1.3; }
.tsi-side a { text-decoration: underline; }
.tsi-side li a { text-decoration: none; }
.tsi-side select { max-width: 100%; }
.tsi-side form[role="search"], .tsi-side .searchform { display: flex; }
.tsi-side form[role="search"] label { flex: 1; min-width: 0; margin: 0; }
.tsi-side input[type="search"], .tsi-side input[type="text"] { box-sizing: border-box; width: 100%; min-width: 0; height: 44px; margin: 0;
  padding: 0 10px; border: 2px solid #000; border-radius: 6px; background: #fff; font: 16px var(--sans); }
.tsi-side input[type="submit"], .tsi-side button[type="submit"] { height: 44px; margin: 0; padding: 0 16px; border: 0 !important; border-radius: 0 6px 6px 0;
  background: var(--navy) !important; color: #fff !important; font: 700 16px var(--sans) !important; }
.tsi-copyright { font-size: 14px; color: var(--muted); }

/* Posts */
.tsi-main .loop > article.post, .tsi-main article.tsi-post { position: static; margin: 0 0 56px; padding: 0; }
.tsi-main .tsi-title { margin: 0 0 20px; padding: 0; font-size: 36px; line-height: 1.15; }
.tsi-main h1.tsi-title { font-size: 40px; }
/* Pages: title starts at the same height, and at the same size, as a post title. */
.tsi-main article.type-page { margin-top: 0; padding-top: 0; }
.tsi-main article.type-page > .inner { margin-top: 0; padding-top: 0; }
.tsi-main article.type-page > .inner > h2 { margin: 0 0 20px; padding: 0; font-size: 40px; line-height: 1.15; }
.tsi-main article.type-page > .inner > .post-content { margin-top: 0; padding-top: 0; }
body .tsi-main .tsi-title a { color: #000; text-decoration: none; }
.tsi-main .post-content { display: block; font-size: 19px; line-height: 1.65; margin: 0; }
.tsi-main .post-content p { margin: 0 0 20px; padding: 0; }
/* Empty lines left in the editor show as visible spacing. */
.tsi-main .post-content p:empty { display: block; height: 1em; }
.tsi-main .post-content h2 { font-size: 27px; line-height: 1.25; margin: 32px 0 14px; }
.tsi-main .post-content h3 { font-size: 23px; line-height: 1.3; margin: 28px 0 12px; }
.tsi-main .post-content img, .tsi-main .post-content iframe { max-width: 100%; }
.tsi-main .post-content table { display: block; overflow-x: auto; font-size: 16px; border: 0 !important; }
.tsi-main .post-content table td, .tsi-main .post-content table th { white-space: nowrap; }
.tsi-main .post-content .tsi-table { display: block; margin: 0 0 20px; }
.tsi-main .post-content .tsi-table-scroll { overflow-x: auto; scrollbar-width: none; }
.tsi-main .post-content .tsi-table-scroll::-webkit-scrollbar { display: none; }
.tsi-main .post-content .tsi-table table { display: table; overflow: visible; width: auto !important; max-width: none; table-layout: auto !important; margin: 0; }
.tsi-main .post-content .tsi-long { width: 280px; white-space: normal; }
@media screen and (max-width: 800px) { .tsi-main .post-content .tsi-long { width: 220px; } }
.tsi-main .tsi-table-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 4px 0 0; padding: 0; border: 0; background: transparent; cursor: pointer; --thumb: 44px; }
.tsi-main .tsi-table-bar[hidden] { display: none; }
.tsi-main .tsi-table-bar::-webkit-slider-runnable-track { height: 12px; border-radius: 6px; background: #ddd; }
.tsi-main .tsi-table-bar::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--thumb); height: 12px; border: 0; border-radius: 6px; background: var(--navy); }
.tsi-main .tsi-table-bar::-moz-range-track { height: 12px; border-radius: 6px; background: #ddd; }
.tsi-main .tsi-table-bar::-moz-range-thumb { width: var(--thumb); height: 12px; border: 0; border-radius: 6px; background: var(--navy); }
@media print {
  .tsi-main .post-content table td, .tsi-main .post-content table th, .tsi-main .post-content .tsi-long { white-space: normal; width: auto; }
  .tsi-main .post-content .tsi-table-scroll { overflow: visible; }
  .tsi-main .post-content .tsi-table table { width: 100% !important; }
  .tsi-main .tsi-table-bar { display: none; }
}
.tsi-main .post-content .alignwide, .tsi-main .post-content .alignfull { width: auto !important; max-width: 100% !important; margin-left: 0; margin-right: 0; }
.tsi-main a.more-link { font: 700 19px var(--sans); text-decoration: underline; }
.tsi-meta { clear: both; display: flex; flex-direction: column; gap: 2px; border-top: 2px solid #000; margin-top: 20px; padding-top: 8px; font: 15px/1.45 var(--sans); }
.tsi-meta time { font-weight: 700; text-transform: uppercase; color: var(--ink); }
.tsi-meta span { color: var(--muted); }
body .tsi-meta a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
body .tsi-meta a:hover, body .tsi-meta a:focus { color: #000; }

/* Promo */
.tsi-promo { border: 2px solid var(--navy); padding: 20px; margin: 0 0 40px; font-size: 18px; line-height: 1.6; }
.tsi-promo p { margin: 0 0 14px; }
.tsi-promo p:last-child { margin-bottom: 0; }
.tsi-promo img { display: block; max-width: 100%; height: auto; margin: 0 auto; }

/* Related posts and comments */
.tsi-main .related-posts { display: block; background: none; margin: 0 0 40px; padding: 0; }
.tsi-main .related-posts h5 { font-size: 20px; margin: 0 0 6px; }
.tsi-main .related-posts .related-post { display: block; width: auto; border-bottom: 1px solid #ccc; padding: 12px 0; }
.tsi-main .related-posts h6 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
body .tsi-main .related-posts h6 a { color: var(--ink); text-decoration: none; }
.tsi-main .related-posts time { font: 14px var(--sans); text-transform: uppercase; color: var(--muted); }
.tsi-main .comments-wrapper { background: none; margin: 0; padding: 0; font-family: var(--sans); }
.tsi-main #comments input[type="text"], .tsi-main #comments input[type="email"], .tsi-main #comments input[type="url"], .tsi-main #comments textarea {
  box-sizing: border-box; border: 1px solid #666; border-radius: 6px; background: #fff; font-family: var(--sans); }
body .tsi-main input[type="submit"] { background: var(--navy) !important; border: 2px solid var(--navy) !important; color: #fff !important; border-radius: 8px; }

/* Older posts */
.tsi-main .tsi-pages { display: flex; justify-content: center; gap: 28px; font: 700 17px var(--sans); }
.tsi-status { text-align: center; font: 16px var(--sans); color: var(--muted); }
.tsi-main .post.result { margin-bottom: 40px; padding-top: 0; }
.tsi-main .post.result h1 { font-size: 32px; line-height: 1.2; margin-top: 0; }
.tsi-main .footer-widgets, .tsi-main .header-widgets { background: none; padding: 24px 0; }

/* Mobile */
@media screen and (max-width: 800px) {
  .tsi { display: block; box-shadow: none; border-top: 0; padding-top: 0; }
  .tsi-brand { padding: 10px 16px; border-right: 0; border-bottom: 2px solid #000; position: relative; margin-bottom: 14px; }
  .tsi-brand::after { content: ''; position: absolute; left: 0; right: 0; top: calc(100% + 2px); height: 14px; background: linear-gradient(var(--navy) 50%, #bbb 50%); }
  .tsi-logo { width: 64px; height: 64px; }
  .tsi-brand .tsi-name { font-size: clamp(18px, 5.6vw, 23px); }
  .tsi-js .tsi-toggle { display: flex; margin-left: auto; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; padding: 0; border: 0 !important; background: none !important; color: #000 !important; cursor: pointer; }
  .tsi-toggle .tsi-icon-close, .tsi-open .tsi-toggle .tsi-icon-open { display: none; }
  .tsi-open .tsi-toggle .tsi-icon-close { display: block; }
  .tsi-side { border-right: 0; padding: 28px; font-size: 17px; }
  .tsi-js .tsi-side { display: none; }
  .tsi-js.tsi-open .tsi-side { display: block; }
  .tsi-open .tsi-main { display: none; }
  .tsi-main { padding: 28px 28px 40px; }
  .tsi-main .tsi-title, .tsi-main h1.tsi-title, .tsi-main article.type-page > .inner > h2 { font-size: 28px; }
  .tsi-main .post-content { font-size: 18px; }
}

@media print { .tsi { display: block; } .tsi-side, .tsi-toggle, .tsi-promo, .comments-wrapper { display: none; } }

/* Search form (parent's searchform.php) with a visible button */
.tsi-side .searchform > div { display: flex; width: 100%; }
.tsi-side .searchform input.s[type="text"] { flex: 1; font-size: 16px; }
.tsi-side .searchform input.searchsubmit[type="submit"] { display: block; flex: none; }

/* Comment form sizing */
.tsi-main #comments { font-size: 16px; }
.tsi-main #comments h3, .tsi-main #comments h3#reply-title { font-size: 20px; }
.tsi-main #comments input[type="text"], .tsi-main #comments input[type="email"], .tsi-main #comments input[type="url"], .tsi-main #comments textarea { width: 100%; max-width: 100%; padding: 12px; font-size: 16px; }
