/* =========================================================
   DOOFHISTORY.ORG — Master Stylesheet
   The Australian Doof Archive, 1821–2021
   Black/red/cream archive aesthetic. Institutional. Frozen.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 0.9em;
  line-height: 1.7;
  color: #202122;
  background-color: #faf8f4;
}

/* --- Site Header --- */
#site-header {
  background: #1a1a1a;
  border-bottom: 3px solid #cc2200;
  padding: 0;
}

#site-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

#wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

#wordmark-title {
  font-family: Georgia, serif;
  font-size: 1.7em;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: 0.3px;
}

#wordmark-tagline {
  font-size: 0.72em;
  color: #cc4422;
  font-style: italic;
  margin-top: 1px;
}

#site-notice {
  background: #2a2a2a;
  border-bottom: 1px solid #cc2200;
  font-size: 0.78em;
  color: #aaa;
  padding: 4px 20px;
  text-align: center;
  font-style: italic;
}

/* --- Navigation Tabs --- */
#page-tabs {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #a2a9b1;
  background: #faf8f4;
  padding: 8px 20px 0;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
}

.tab-item {
  display: inline-block;
  padding: 5px 14px 4px;
  font-size: 0.8em;
  color: #0645ad;
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-right: 2px;
  margin-bottom: -1px;
  background: #faf8f4;
  white-space: nowrap;
}

.tab-item:hover { background: #fff; }

.tab-item.active {
  background: #fff;
  border-color: #a2a9b1;
  border-bottom-color: #fff;
  color: #202122;
  cursor: default;
}

.tab-item.talk-tab { color: #72777d; }
.tab-item.talk-tab:hover { color: #0645ad; }

/* --- Main Layout --- */
#content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  padding: 0 20px;
}

/* --- Left Sidebar --- */
#sidebar {
  width: 200px;
  min-width: 200px;
  padding: 20px 12px 20px 0;
  font-size: 0.78em;
}

.sidebar-box {
  margin-bottom: 14px;
  border: 1px solid #b0a090;
}

.sidebar-box h3 {
  background: #1a1a1a;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 0.88em;
  font-weight: bold;
  padding: 5px 8px;
  border-bottom: 2px solid #cc2200;
  margin: 0;
}

.sidebar-box ul {
  list-style: none;
  padding: 6px 8px 8px 14px;
  background: #f5f0ea;
}

.sidebar-box ul li {
  margin-bottom: 3px;
  line-height: 1.5;
}

.sidebar-box ul li a {
  color: #0645ad;
  text-decoration: none;
}

.sidebar-box ul li a:hover { text-decoration: underline; }

/* --- Main Article Content --- */
#article-content {
  flex: 1;
  background: #fff;
  padding: 20px 30px 30px 20px;
  border-left: 1px solid #b0a090;
  border-right: 1px solid #b0a090;
  border-bottom: 1px solid #b0a090;
  min-width: 0;
}

/* --- Article Title --- */
#firstHeading {
  font-family: Georgia, serif;
  font-size: 1.9em;
  font-weight: normal;
  color: #1a1a1a;
  border-bottom: 2px solid #1a1a1a;
  padding-bottom: 6px;
  margin-bottom: 16px;
  line-height: 1.3;
}

/* --- Body Text --- */
p { margin-bottom: 0.85em; line-height: 1.7; }

/* --- Headings --- */
h2 {
  font-family: Georgia, serif;
  font-size: 1.3em;
  font-weight: normal;
  color: #1a1a1a;
  border-bottom: 1px solid #c8c0b0;
  padding-bottom: 3px;
  margin: 22px 0 10px;
}

h3 {
  font-family: Georgia, serif;
  font-size: 1.05em;
  font-weight: bold;
  color: #1a1a1a;
  margin: 16px 0 8px;
}

h4 {
  font-family: Georgia, serif;
  font-size: 0.95em;
  font-weight: bold;
  color: #202122;
  margin: 12px 0 6px;
}

/* --- Links --- */
a { color: #0645ad; text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: #0b0080; }
a.new { color: #cc2200; }

/* --- Table of Contents --- */
#toc {
  background: #f5f0ea;
  border: 1px solid #b0a090;
  padding: 12px 16px;
  display: inline-block;
  margin: 0 0 16px 20px;
  min-width: 200px;
  max-width: 360px;
  float: right;
  font-size: 0.84em;
}

#toc-title {
  font-weight: bold;
  font-size: 0.95em;
  text-align: center;
  margin-bottom: 8px;
  color: #1a1a1a;
}

#toc ol { margin: 0; padding-left: 20px; }
#toc ol li { margin-bottom: 3px; line-height: 1.5; }
#toc ol li a { color: #0645ad; text-decoration: none; }
#toc ol li a:hover { text-decoration: underline; }

/* --- Infobox --- */
.infobox {
  float: right;
  clear: right;
  margin: 0 0 16px 20px;
  border: 1px solid #b0a090;
  background: #f5f0ea;
  font-size: 0.8em;
  width: 240px;
}

.infobox-title {
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  font-weight: bold;
  padding: 7px 8px;
  font-size: 1.05em;
  border-bottom: 2px solid #cc2200;
}

.infobox-subtitle {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  padding: 4px 8px;
  border-bottom: 1px solid #b0a090;
  color: #54595d;
  background: #f5f0ea;
}

.infobox-image {
  text-align: center;
  padding: 8px;
  border-bottom: 1px solid #b0a090;
  background: #2a2a2a;
}

.infobox-image img {
  max-width: 222px;
  max-height: 260px;
  display: block;
  margin: 0 auto;
}

.infobox-placeholder-img {
  width: 180px;
  height: 200px;
  background: #3a3a3a;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  font-size: 0.85em;
  text-align: center;
  padding: 10px;
}

.infobox-image-caption {
  font-size: 0.78em;
  color: #aaa;
  font-style: italic;
  margin-top: 5px;
  text-align: center;
  padding: 0 4px;
}

.infobox table { width: 100%; border-collapse: collapse; }

.infobox td {
  padding: 4px 6px;
  vertical-align: top;
  border-bottom: 1px solid #ddd8d0;
  line-height: 1.5;
}

.infobox td:first-child {
  font-weight: bold;
  white-space: nowrap;
  color: #666;
  width: 40%;
}

/* --- Shed Infobox --- */
.shed-infobox {
  float: right;
  clear: right;
  margin: 0 0 16px 20px;
  border: 1px solid #b0a090;
  background: #f5f0ea;
  font-size: 0.8em;
  width: 260px;
}

.shed-infobox-title {
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  font-weight: bold;
  padding: 7px 8px;
  border-bottom: 2px solid #cc2200;
}

.shed-placeholder-img {
  width: 100%;
  height: 180px;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  font-size: 0.8em;
  text-align: center;
  padding: 10px;
}

.shed-img-real { width: 100%; height: auto; display: block; }

/* --- Notice Templates --- */
.notice-stub, .notice-disputed, .notice-cleanup, .notice-archive-notice {
  border: 1px solid #b0a090;
  background: #f5f0ea;
  padding: 8px 12px 8px 46px;
  margin: 12px 0;
  font-size: 0.85em;
  position: relative;
  clear: both;
}

.notice-stub::before {
  content: "📌";
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 1.4em;
}

.notice-disputed::before {
  content: "⚠";
  position: absolute;
  left: 12px;
  top: 8px;
  font-size: 1.4em;
  color: #cc2200;
}

.notice-archive-notice {
  background: #f5f0ea;
  border-color: #b0a090;
  padding-left: 12px;
  text-align: center;
  font-style: italic;
}

/* --- Citation Needed --- */
.citation-needed {
  color: #cc2200;
  font-size: 0.8em;
  vertical-align: super;
  cursor: help;
  font-style: normal;
  font-family: sans-serif;
}

/* --- Footnote References --- */
sup.ref {
  color: #cc2200;
  font-size: 0.72em;
  vertical-align: super;
  cursor: pointer;
}

sup.ref a { color: #cc2200; }

/* --- Footnotes Section --- */
.footnotes {
  font-size: 0.8em;
  border-top: 1px solid #c8c0b0;
  margin-top: 24px;
  padding-top: 10px;
  color: #54595d;
}

.footnotes ol { padding-left: 20px; }
.footnotes ol li { margin-bottom: 4px; line-height: 1.5; }

/* --- Categories --- */
#categories {
  border-top: 1px solid #c8c0b0;
  margin-top: 20px;
  padding-top: 8px;
  font-size: 0.8em;
  color: #54595d;
}

#categories strong { color: #1a1a1a; }
#categories a { color: #0645ad; margin: 0 4px; }

/* --- Tables --- */
.wikitable {
  border-collapse: collapse;
  font-size: 0.85em;
  width: 100%;
  margin: 12px 0;
}

.wikitable th {
  background: #2a2a2a;
  color: #fff;
  border: 1px solid #b0a090;
  padding: 5px 8px;
  text-align: left;
  font-weight: bold;
}

.wikitable td {
  border: 1px solid #b0a090;
  padding: 5px 8px;
  vertical-align: top;
}

.wikitable tr:nth-child(even) td { background: #f5f0ea; }

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid #cc2200;
  margin: 12px 0 12px 20px;
  padding: 8px 12px;
  color: #54595d;
  font-style: italic;
  font-size: 0.9em;
}

/* --- Archive Image Box --- */
.archive-image-box {
  float: right;
  clear: right;
  margin: 0 0 12px 16px;
  border: 1px solid #b0a090;
  background: #f5f0ea;
  padding: 4px;
  max-width: 220px;
  font-size: 0.75em;
  text-align: center;
}

.archive-image-placeholder {
  width: 200px;
  height: 150px;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  font-size: 0.85em;
  text-align: center;
  padding: 8px;
}

.archive-image-caption {
  padding: 4px 2px 0;
  color: #54595d;
  line-height: 1.4;
  font-style: italic;
}

/* --- Home Page --- */
.home-columns {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  margin-top: 12px;
}

.did-you-know-box, .recent-changes-box {
  background: #f5f0ea;
  border: 1px solid #b0a090;
  padding: 0;
  font-size: 0.85em;
}

.did-you-know-box h3, .recent-changes-box h3 {
  background: #1a1a1a;
  color: #fff;
  font-size: 0.9em;
  border-bottom: 2px solid #cc2200;
  padding: 5px 10px;
  margin: 0 0 8px;
}

.did-you-know-box ul, .recent-changes-box ul {
  padding: 0 12px 10px 26px;
}

.did-you-know-box ul li { margin-bottom: 7px; line-height: 1.5; }

.recent-changes-box ul { list-style: none; padding: 0 10px 8px; }

.recent-changes-box ul li {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd8d0;
  line-height: 1.4;
}

.rc-date { color: #72777d; font-size: 0.85em; display: block; }
.rc-diff { color: #00af89; font-size: 0.8em; }
.rc-diff.neg { color: #cc2200; }

/* --- Talk Pages --- */
.talk-archived-notice {
  background: #f5f0ea;
  border: 1px solid #b0a090;
  border-left: 3px solid #cc2200;
  padding: 8px 12px;
  margin-bottom: 20px;
  font-size: 0.85em;
  font-style: italic;
  color: #54595d;
}

.talk-thread {
  margin-bottom: 24px;
  border-bottom: 1px solid #e8e4de;
  padding-bottom: 16px;
}

.talk-thread h3 {
  font-size: 1em;
  font-weight: bold;
  background: #2a2a2a;
  color: #fff;
  padding: 5px 10px;
  margin: 0 0 10px 0;
  border-left: 3px solid #cc2200;
}

.talk-comment { margin: 8px 0; }
.talk-comment p { margin-bottom: 4px; }

.talk-reply-1 { margin-left: 20px; border-left: 2px solid #e0dbd4; padding-left: 10px; }
.talk-reply-2 { margin-left: 40px; border-left: 2px solid #e0dbd4; padding-left: 10px; }
.talk-reply-3 { margin-left: 60px; border-left: 2px solid #e0dbd4; padding-left: 10px; }
.talk-reply-4 { margin-left: 80px; border-left: 2px solid #e0dbd4; padding-left: 10px; }
.talk-reply-5 { margin-left: 100px; border-left: 2px solid #e0dbd4; padding-left: 10px; }

.talk-sig { color: #0645ad; font-size: 0.85em; }
.talk-timestamp { color: #72777d; font-size: 0.8em; }
.talk-unsigned { color: #72777d; font-size: 0.8em; font-style: italic; }
.talk-user-anon { color: #cc2200; }

/* --- Dispute Banner --- */
.dispute-banner {
  background: #fef6e7;
  border: 1px solid #c8a000;
  border-left: 3px solid #cc2200;
  padding: 8px 12px 8px 44px;
  margin: 12px 0;
  font-size: 0.85em;
  position: relative;
}

.dispute-banner::before {
  content: "⚖";
  position: absolute;
  left: 10px;
  top: 7px;
  font-size: 1.5em;
}

/* --- Footer --- */
#site-footer {
  background: #1a1a1a;
  border-top: 3px solid #cc2200;
  margin-top: 0;
  padding: 16px 20px;
  font-size: 0.75em;
  color: #888;
  text-align: center;
}

#site-footer a { color: #cc4422; }
#site-footer p { margin-bottom: 4px; }

/* --- Responsive --- */
@media (max-width: 900px) {
  #sidebar { display: none; }
  #article-content { border-left: none; border-right: none; padding: 16px; }
  .infobox, .shed-infobox { float: none; width: 100%; margin: 0 0 12px 0; }
  #toc { float: none; max-width: 100%; margin: 0 0 16px 0; }
  .home-columns { grid-template-columns: 1fr; }
  .archive-image-box { float: none; max-width: 100%; }
}

/* --- Print --- */
@media print {
  #site-header, #page-tabs, #sidebar, #site-footer { display: none; }
  #article-content { border: none; padding: 0; }
  body { font-size: 12pt; background: white; }
  a { color: #000; text-decoration: underline; }
}

/* Header right note */
#site-title-bar .header-note {
  font-size: 0.72em;
  color: #888;
  text-align: right;
  max-width: 320px;
  line-height: 1.5;
}
