/* Hackdot: classic (c. 2001-2005) Slashdot layout. Teal title bars, grey boxes, three columns. */
:root {
  --teal: #006666;
  --teal-dark: #004d4d;
  --teal-light: #e6f0f0;
  --bg: #ffffff;
  --text: #000000;
  --muted: #555555;
  --box: #cccccc;
  --box-body: #eeeeee;
  --comment-head: #e0e0e0;
  --link: #006666;
  --rule: #bbbbbb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121414;
    --text: #e4e4e4;
    --muted: #a0a8a8;
    --box: #2a3333;
    --box-body: #1b2020;
    --comment-head: #262c2c;
    --link: #5fc4c4;
    --rule: #3a4444;
    --teal-light: #1a2929;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 Verdana, Arial, Helvetica, sans-serif;
}

a { color: var(--link); }
a:visited { color: var(--teal-dark); }
@media (prefers-color-scheme: dark) { a:visited { color: #3fa3a3; } }

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--teal);
  border-bottom: 4px solid var(--teal-dark);
  color: #fff;
}
.logo {
  font: bold 40px/1 Georgia, "Times New Roman", serif;
  letter-spacing: -1px;
  color: #fff !important;
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--teal-dark);
}
.logo span { color: #b8e0e0; }
.tagline { font-style: italic; font-size: 14px; }
.masthead-search { margin-left: auto; }
.masthead-search input {
  font: inherit;
  padding: 3px 6px;
  border: 1px solid var(--teal-dark);
  width: 180px;
}

/* Three columns */
.page {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 210px;
  gap: 14px;
  max-width: 1150px;
  margin: 12px auto;
  padding: 0 16px;
}

.box { margin-bottom: 12px; background: var(--box-body); border: 1px solid var(--box); }
.box h2 {
  margin: 0;
  padding: 3px 6px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
}
.box ul { list-style: none; margin: 0; padding: 4px 6px; }
.box li { padding: 2px 0; }
.box p { margin: 0; padding: 6px; font-size: 11px; color: var(--muted); }
.rightnav li { font-size: 11px; border-bottom: 1px dotted var(--rule); padding: 3px 0; }
.rightnav li:last-child { border-bottom: 0; }
.leftnav .box { background: var(--box); }
.leftnav li a { font-weight: bold; text-decoration: none; }

/* Story blocks */
.story { margin-bottom: 20px; }
.story-title {
  margin: 0;
  padding: 4px 8px;
  background: var(--teal);
  font-size: 14px;
}
.story-title a, .story-title a:visited { color: #fff; text-decoration: none; }
.story-title a:hover { text-decoration: underline; }
.story-title .rank { color: #b8e0e0; font-weight: normal; margin-right: 4px; }
.page-note { color: var(--muted); font-size: 11px; margin: 0 0 10px; }
.story-meta { padding: 4px 8px; font-size: 11px; color: var(--muted); background: var(--teal-light); }
.dept { font-style: italic; }
.story-body { padding: 4px 8px; overflow-wrap: anywhere; }
.story-body p { margin: 6px 0; }
.story-link { font-size: 11px; }
.story-links { padding: 0 8px; font-size: 11px; font-weight: bold; }

.section-heading { font-size: 18px; color: var(--teal); margin: 0 0 12px; }
@media (prefers-color-scheme: dark) { .section-heading { color: var(--link); } }
.pager { text-align: right; font-weight: bold; }
.empty { color: var(--muted); font-style: italic; }
.breadcrumb { font-size: 12px; }

/* Comments */
.comments { margin-top: 18px; border-top: 2px solid var(--teal); padding-top: 8px; }
.comment, .result { margin: 8px 0; }
.comment-head {
  padding: 3px 6px;
  background: var(--comment-head);
  border-top: 1px solid var(--rule);
  font-size: 11px;
}
.comment-head.removed { color: var(--muted); font-style: italic; }
.comment-subject { font-weight: bold; margin-right: 6px; }
.comment-by { color: var(--muted); }
.comment-body { padding: 2px 6px; overflow-wrap: anywhere; }
.comment-body p { margin: 6px 0; }
.comment-body pre { overflow-x: auto; background: var(--box-body); padding: 6px; }
.comment-links { padding: 0 6px; font-size: 11px; color: var(--muted); }
/* Nesting: indent per level, capped so deep threads stay readable on a phone. */
.comment { border-left: 1px solid var(--rule); }
.comment.depth-0 { border-left: 0; }
.depth-1 { margin-left: 18px; } .depth-2 { margin-left: 36px; } .depth-3 { margin-left: 54px; }
.depth-4 { margin-left: 72px; } .depth-5 { margin-left: 90px; } .depth-6 { margin-left: 108px; }
.depth-7 { margin-left: 126px; } .depth-8 { margin-left: 144px; } .depth-9 { margin-left: 162px; }
.depth-10 { margin-left: 180px; }

/* Polls */
.poll { margin: 12px 8px; }
.poll h3 { margin: 0 0 6px; font-size: 13px; }
.poll-option { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 2px 8px; margin-bottom: 6px; }
.poll-label p { margin: 0; }
.poll-bar { grid-column: 1; height: 8px; background: var(--teal); min-width: 2px; }
.poll-votes { grid-column: 2; grid-row: 1 / span 2; font-size: 11px; color: var(--muted); }

/* Archive and search */
.day-nav { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.day-pick, .search-form { margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.search-form input[type=search] { flex: 1; min-width: 160px; }
.search-form input, .search-form select, .search-form button, .day-pick input, .day-pick button { font: inherit; padding: 3px 6px; }

.footer {
  max-width: 1150px;
  margin: 24px auto;
  padding: 8px 16px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

/* Phones: stack the columns, sections first, sidebar boxes after the stories. */
@media (max-width: 760px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .leftnav { order: 0; }
  .leftnav .box:last-child { display: none; }
  .leftnav ul { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .content { order: 1; }
  .rightnav { order: 2; }
  .masthead-search { margin-left: 0; width: 100%; }
  .masthead-search input { width: 100%; }
  .comment[class*="depth-"] { margin-left: 0; }
  .depth-1, .depth-2, .depth-3, .depth-4, .depth-5, .depth-6, .depth-7, .depth-8, .depth-9, .depth-10 {
    padding-left: 6px;
  }
  .depth-1 { margin-left: 6px !important; } .depth-2 { margin-left: 12px !important; }
  .depth-3 { margin-left: 18px !important; } .depth-4 { margin-left: 24px !important; }
  .depth-5, .depth-6, .depth-7, .depth-8, .depth-9, .depth-10 { margin-left: 30px !important; }
}
