/* ThinkTwisted reboot theme
   Typography: classic system stacks only (Georgia/Tahoma) — intentionally
   not using modern webfonts. */

:root {
  --ink: #23262d;
  --ink-soft: #5a5f6a;
  --accent: #4b3fb0;
  --accent-deep: #2a2468;
  --rule: #e3e1da;
  --paper: #ffffff;
  --bg: #f2efe8;
  --link: #2f4bb2;
  --link-hover: #b45309;
  --body-font: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body-font);
  font-size: 1.0625rem; line-height: 1.65;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px 40px; }

/* masthead */
.masthead { padding: 28px 4px 10px; }
.masthead h1 { margin: 0; font-size: 2.6rem; letter-spacing: -0.5px; }
.masthead h1 a { color: var(--accent-deep); text-decoration: none; }
.masthead .tagline { margin: 2px 0 0; color: var(--ink-soft); font-style: italic; }

/* tab bar (public toggles live in the CMS) */
nav.tabs {
  display: flex; flex-wrap: wrap; gap: 2px;
  background: var(--accent-deep); border-radius: 6px; overflow: hidden;
  margin: 8px 0 20px; font-family: Tahoma, Verdana, sans-serif; font-size: .85rem;
}
nav.tabs a { color: rgba(255,255,255,.85); padding: 10px 18px; text-decoration: none; text-transform: lowercase; letter-spacing: .08em; }
nav.tabs a:hover { background: rgba(255,255,255,.16); color: #fff; }
nav.tabs a.on { background: var(--paper); color: var(--accent-deep); font-weight: 700; }

/* layout */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.main { min-width: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 26px 30px; }
.side { min-width: 0; }

/* posts */
article.post { padding: 8px 0 26px; border-bottom: 3px double var(--rule); margin-bottom: 26px; }
article.post:last-of-type { border-bottom: 0; }
.post-title { margin: 0 0 2px; font-size: 1.7rem; line-height: 1.25; }
.post-title a { color: var(--accent); text-decoration: none; }
.post-title a:hover { text-decoration: underline; }
.post-meta { margin: 2px 0 14px; color: var(--ink-soft); font-family: Tahoma, Verdana, sans-serif; font-size: .78rem; }
.post-meta a { color: var(--ink-soft); }
.post-body img { max-width: 100%; height: auto; }
.post-body h2, .post-body h3 { margin: 1.2em 0 .4em; }
.post-body a { color: var(--link); }
.post-body a:hover { color: var(--link-hover); }
.post-body blockquote { margin: 1em 0; padding: 2px 16px; border-left: 4px solid var(--rule); color: var(--ink-soft); }
.post-body pre { background: #23262d; color: #e8e6df; padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: .85rem; }
.post-body code { font-size: .9em; }
.post-body iframe { max-width: 100%; }
.video-embed { margin: 12px 0; }
.media-lost { color: var(--ink-soft); font-style: italic; font-family: Tahoma, Verdana, sans-serif; font-size: .85rem; }
.post-foot { font-family: Tahoma, Verdana, sans-serif; font-size: .8rem; margin: 10px 0 0; }
.post-foot a { color: var(--link); }

.archive-title { font-size: 1.4rem; color: var(--accent-deep); border-bottom: 3px double var(--rule); padding-bottom: 6px; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 110px; object-fit: cover; border-radius: 5px; border: 1px solid var(--rule); display: block; }
.gallery figcaption { font-family: Tahoma, Verdana, sans-serif; font-size: .68rem; color: var(--ink-soft); margin-top: 3px; }

/* lightbox */
#lightbox { position: fixed; inset: 0; background: rgba(18,16,40,.92); display: none; align-items: center; justify-content: center; z-index: 50; }
#lightbox.show { display: flex; }
#lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 4px; box-shadow: 0 10px 60px rgba(0,0,0,.6); }
#lightbox .cap { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; color: #cfcbe8; font-family: Tahoma, Verdana, sans-serif; font-size: .8rem; }
#lightbox .x { position: fixed; top: 10px; right: 18px; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: 0; }

/* prev/next */
.postnav { display: flex; justify-content: space-between; gap: 20px; border-top: 3px double var(--rule); padding-top: 14px; font-family: Tahoma, Verdana, sans-serif; font-size: .8rem; }
.postnav .next { text-align: right; }

/* comments */
.comments { margin-top: 30px; border-top: 3px double var(--rule); padding-top: 8px; }
.comments h3 { font-size: 1.15rem; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.cavatar { flex: 0 0 38px; height: 38px; border-radius: 50%; background: var(--accent-deep); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: Tahoma, sans-serif; font-size: 1rem; }
.cbody { min-width: 0; }
.cmeta { margin: 0 0 4px; font-family: Tahoma, Verdana, sans-serif; font-size: .75rem; color: var(--ink-soft); }
.cbody p { margin: .3em 0; }
.cform { margin-top: 18px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; }
.cform label { display: block; font-family: Tahoma, Verdana, sans-serif; font-size: .75rem; margin: 8px 10px 8px 0; }
.cform input[type=text], .cform input[type=email] { font: inherit; padding: 6px 8px; width: 220px; }
.cform textarea { font: inherit; width: 100%; padding: 8px; }
.cform input[type=submit] { font-family: Tahoma, Verdana, sans-serif; background: var(--accent); color: #fff; border: 0; padding: 9px 18px; border-radius: 5px; cursor: pointer; }
.closed { color: var(--ink-soft); font-style: italic; }

/* sidebar */
.widget { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; }
.widget h2 { margin: 0 0 8px; font-size: 1rem; color: var(--accent-deep); border-bottom: 1px solid var(--rule); padding-bottom: 5px; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 3px 0; font-size: .95rem; }
.widget .count { color: var(--ink-soft); font-size: .8rem; }

/* ads — placeholder slots only until a network is configured in Settings */
.ad { margin: 18px 0; text-align: center; }
.ad-placeholder {
  border: 2px dashed #c9c5b8; border-radius: 6px; background: #faf9f5;
  color: #a39e8d; font-family: Tahoma, Verdana, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 90px; max-width: 728px; margin-left: auto; margin-right: auto;
}
.ad-placeholder em { font-size: .7rem; font-style: normal; }
.ad-skyscraper.ad-placeholder { height: 250px; max-width: 300px; }

/* pager + footer */
.pager { display: flex; justify-content: space-between; padding: 6px 0 0; font-family: Tahoma, Verdana, sans-serif; font-size: .85rem; }
.foot { margin-top: 26px; text-align: center; color: var(--ink-soft); font-family: Tahoma, Verdana, sans-serif; font-size: .72rem; }
.footmeta a { color: var(--ink-soft); }
.empty, .hint { color: var(--ink-soft); font-style: italic; }

/* ===== admin ===== */
body.admin { background: #eceaf2; font-family: Tahoma, Verdana, sans-serif; font-size: .9rem; }
.admast { background: var(--accent-deep); color: #fff; }
.admast .brand { display: inline-block; padding: 12px 18px; color: #fff; text-decoration: none; font-family: Georgia, serif; font-size: 1.15rem; }
.admast .brand span { opacity: .6; font-size: .8rem; }
.adnav { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.adnav a { color: #cfcbe8; text-decoration: none; padding: 14px 12px; font-size: .8rem; }
.adnav a.on, .adnav a:hover { background: #fff; color: var(--accent-deep); }
.admin-body { max-width: 960px; margin: 0 auto; padding: 22px 18px 60px; }
.admin-body h1 { font-size: 1.5rem; margin: 0 0 16px; color: var(--accent-deep); }
.admin-body h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.admin-body form p, .admin-body p { margin: 8px 0; }
body.admin .admin-body label { display: inline-block; margin-right: 14px; }
body.admin .admin-body label.fwide { display: block; margin-right: 0; }
.admin-body input[type=text], .admin-body input[type=email], .admin-body input[type=date],
.admin-body input[type=number], .admin-body input[type=password], .admin-body textarea, .admin-body select {
  font: inherit; padding: 6px 8px; border: 1px solid #b9b5c9; border-radius: 5px; background: #fff; max-width: 100%;
}
.admin-body textarea { display: block; margin-top: 4px; }
.admin-body button, .bigbtn {
  font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 5px;
  padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.admin-body button.big { padding: 10px 22px; font-size: 1rem; }
.admin-body button.danger { background: #a33; }
.admin-body .inline { display: inline; }
a.tiny { font-size: .75rem; }
table.grid { border-collapse: collapse; width: 100%; background: #fff; border: 1px solid #d5d2e0; }
table.grid th, table.grid td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #e6e4ee; vertical-align: top; font-size: .82rem; }
table.grid th { background: #f4f3f9; }
tr.pending td { background: #fff7df; }
.num, .ip { color: var(--ink-soft); white-space: nowrap; font-size: .78rem; }
.ctext { max-width: 420px; }
.on::before { content: '\25CF'; color: #2a2; margin-right: 4px; }
.off::before { content: '\25CB'; color: #999; margin-right: 4px; }
.flash { background: #dff0d8; border: 1px solid #b7dfb9; border-radius: 5px; padding: 8px 12px; }
.err { color: #a33; }
.badge { background: #a33; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: .75rem; }
.galrow { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.galrow img { width: 90px; height: 64px; object-fit: cover; border-radius: 4px; border: 1px solid #ccc; }
.chkrow .chk { font-size: .85rem; }
.fwide { display: block; }

/* post editor: roomier text entry (admin .wrap must not cap it) */
body.admin .wrap { max-width: none; }
.admin-body.wide { max-width: 1250px; }

/* admin list action buttons: one row, baseline-aligned */
table.grid td.act { white-space: nowrap; }
table.grid td.act form.inline { display: inline-block; vertical-align: middle; }
table.grid td.act button, table.grid td.act span, table.grid td.act a.tiny { vertical-align: middle; }
table.grid td.act span.on, table.grid td.act span.off { display: inline-block; min-width: 44px; }

/* ===== wysiwyg post editor ===== */
.admin-body textarea[hidden] { display: none; }
.wysiwyg-label { font-size: .82rem; color: var(--ink-soft); margin: 2px 0 5px; }
.wysiwyg-root { border: 1px solid #b9b5c9; border-radius: 6px; overflow: hidden; background: #fff; }
.wysiwyg-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 6px 8px; background: #f4f3f9; border-bottom: 1px solid #cfcadf;
  position: sticky; top: 0; z-index: 3;
}
.wysiwyg-root select { font-size: .78rem; padding: 3px 4px; border: 1px solid #b9b5c9; border-radius: 4px; background: #fff; max-width: none; }
.wysiwyg-root .wysiwyg-toolbar button {
  font: inherit; font-size: .85rem; min-width: 30px; padding: 5px 8px;
  background: #fff; color: #2a2740; border: 1px solid #b9b5c9; border-radius: 4px;
}
.wysiwyg-root .wysiwyg-toolbar button:hover { background: #eae7f5; }
.wysiwyg-toolbar button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wysiwyg-sep { width: 1px; height: 22px; background: #cfcadf; margin: 0 3px; }
.wysiwyg-spacer { flex: 1 1 auto; }
.wysiwyg-editor {
  display: block !important; min-height: 320px; max-height: 68vh; overflow: auto;
  padding: 16px 18px; font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem; line-height: 1.6; color: var(--ink);
}
.wysiwyg-editor:focus { outline: none; box-shadow: inset 0 0 0 2px #d8d4ec; }
.wysiwyg-editor p { margin: 0 0 .8em; }
.wysiwyg-editor h1, .wysiwyg-editor h2, .wysiwyg-editor h3 { margin: .6em 0 .35em; color: var(--accent-deep); }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 .8em; padding-left: 1.6em; }
.wysiwyg-editor blockquote { margin: .8em 0; padding: 2px 16px; border-left: 4px solid var(--rule); color: var(--ink-soft); }
.wysiwyg-editor pre { background: #f4f3f9; padding: 10px 12px; border-radius: 6px; overflow-x: auto; font-family: "Courier New", monospace; font-size: .9rem; }
.wysiwyg-editor img { max-width: 100%; height: auto; }
.wysiwyg-root .wysiwyg-raw { display: none; }
.wysiwyg-root.mode-html .wysiwyg-editor { display: none !important; }
.wysiwyg-root.mode-html .wysiwyg-raw {
  display: block; width: 100%; min-height: 320px; padding: 14px 16px; border: 0; resize: vertical;
  font-family: "Courier New", monospace; font-size: .85rem; line-height: 1.5; color: var(--ink);
}

/* responsive */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .side { order: 2; }
  .masthead h1 { font-size: 2rem; }
}
