/* Hacker News Pixel-Accurate CSS Stylesheet */

body {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 10pt;
  color: #000000;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

/* Links color defaults */
a {
  color: #000000;
  text-decoration: none;
  cursor: pointer;
}

a:visited {
  color: #828282;
}

a:hover {
  text-decoration: underline;
}

/* Main centered table container */
.container {
  width: 85%;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #f6f6ef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  padding: 10px 15px;
  flex-grow: 1;
}

/* Header style matching HN layout with Cyan background */
.header {
  background-color: #00c0c0;
  padding: 2px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 12pt;
}

.logo-section {
  display: flex;
  align-items: center;
}

/* HN Orange Box logo with White W */
.logo-badge {
  border: 1px solid #ffffff;
  background-color: #ff6600;
  color: #ffffff;
  width: 18px;
  height: 18px;
  font-weight: bold;
  font-size: 12px;
  font-family: Verdana, Geneva, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  flex-shrink: 0;
}

.site-title {
  font-weight: bold;
  font-size: 10pt;
  color: #000000;
  margin-right: 10px;
}

.site-title a:visited {
  color: #000000;
}

/* Pipe separated navigation links */
.nav-links {
  font-size: 10pt;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: flex;
  align-items: center;
}

.nav-links li::after {
  content: "|";
  padding: 0 4px;
  color: #000000;
  font-weight: normal;
}

.nav-links li:last-child::after {
  content: "";
}

.nav-links a {
  color: #000000;
  text-decoration: none;
}

.nav-links a:visited {
  color: #000000;
}

.nav-links a.active {
  color: #ffffff;
}

/* User authentication section on top right */
.user-nav {
  font-size: 8pt;
  color: #000000;
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-nav a {
  color: #000000;
}

.user-nav a:visited {
  color: #000000;
}

.username-tag {
  font-weight: normal;
}

.karma-badge {
  font-weight: normal;
}

.karma-badge::before {
  content: "(";
}

.karma-badge::after {
  content: ")";
}

/* Story Lists styling */
.item-list {
  background-color: #f6f6ef;
  width: 100%;
  border-collapse: collapse;
}

.story-item {
  display: flex;
  align-items: flex-start;
  margin-top: 4px;
  margin-bottom: 1px;
}

.story-rank {
  font-size: 10pt;
  color: #828282;
  min-width: 25px;
  text-align: right;
  padding-right: 5px;
  user-select: none;
}

/* Upvote arrow caretaker */
.vote-form {
  margin: 3px 4px 0 2px;
  display: inline-block;
  vertical-align: middle;
}

.vote-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 10px;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pixel accurate grey triangle */
.vote-button::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid #828282;
  display: inline-block;
}

.vote-button:hover::before {
  border-bottom-color: #000000;
}

.story-details {
  flex-grow: 1;
}

.story-title-line {
  font-size: 10pt;
  line-height: 12pt;
}

.story-title-text {
  color: #000000;
}

.story-title-text:visited {
  color: #828282;
}

.story-domain {
  font-size: 8pt;
  color: #828282;
  margin-left: 3px;
}

.story-domain a {
  color: #828282;
}

.story-domain a:visited {
  color: #828282;
}

/* Story metadata subtext */
.story-meta {
  font-size: 7.5pt;
  color: #828282;
  line-height: 10pt;
  margin-top: 1px;
  margin-bottom: 5px;
}

.story-meta a {
  color: #828282;
}

.story-meta a:visited {
  color: #828282;
}

.story-meta a:hover {
  text-decoration: underline;
}

/* Pagination */
.pagination {
  margin-top: 10px;
  padding-left: 30px;
  font-size: 10pt;
}

.pagination a {
  color: #000000;
  font-weight: bold;
}

.pagination a:visited {
  color: #000000;
}

/* Submitting stories / Forms */
.card {
  margin-top: 10px;
  background-color: #f6f6ef;
}

.card-title {
  font-size: 10pt;
  font-weight: bold;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
}

.form-label {
  font-size: 9pt;
  width: 80px;
  font-weight: normal;
  color: #000000;
}

.form-input {
  width: 400px;
  font-family: monospace;
  font-size: 10pt;
  border: 1px solid #828282;
  padding: 2px;
}

.form-textarea {
  min-height: 100px;
  width: 400px;
  font-family: monospace;
}

.form-help {
  font-size: 8pt;
  color: #828282;
  margin-left: 85px;
  display: block;
  margin-top: -6px;
  margin-bottom: 10px;
}

.form-error {
  color: #ff0000;
  font-size: 10pt;
  margin-bottom: 10px;
}

.btn-primary {
  background-color: #e0e0d8;
  border: 1px solid #828282;
  font-size: 9pt;
  font-family: Verdana, Geneva, sans-serif;
  color: #000000;
  padding: 1px 6px;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
}

.btn-primary:hover {
  background-color: #d0d0c8;
}

.btn-secondary {
  background-color: transparent;
  border: none;
  font-size: 9pt;
  font-family: Verdana, Geneva, sans-serif;
  color: #828282;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.btn-secondary:hover {
  color: #000000;
}

/* User Login forms split (same page on HN) */
.login-toggle {
  display: none; /* unused on pixel perfect */
}

.hidden {
  display: none !important;
}

/* Story details (Ask post text, comments page) */
.story-header {
  margin-bottom: 10px;
}

.story-text-content {
  font-size: 9pt;
  line-height: 13pt;
  color: #000000;
  margin-top: 8px;
  margin-bottom: 12px;
  padding-left: 30px;
  max-width: 600px;
  white-space: pre-wrap;
}

.comment-form-container {
  padding-left: 30px;
  margin-top: 15px;
  margin-bottom: 20px;
}

.comment-textarea {
  width: 500px;
  height: 120px;
  font-family: monospace;
  font-size: 10pt;
  border: 1px solid #828282;
  padding: 2px;
  margin-bottom: 5px;
  display: block;
}

/* Comments rendering style */
.comments-container {
  margin-top: 20px;
}

.comment-thread {
  margin-bottom: 12px;
}

.comment-card {
  font-size: 9pt;
  color: #000000;
  position: relative;
  line-height: 12pt;
}

.comment-meta {
  font-size: 8pt;
  color: #828282;
  margin-bottom: 3px;
}

.comment-meta a {
  color: #828282;
}

.comment-meta a:visited {
  color: #828282;
}

.comment-author {
  color: #3c963c; /* green-ish color on HN for user profiles or standard gray */
}

.comment-author a {
  color: #828282;
}

.comment-author a:visited {
  color: #828282;
}

/* OP tag on comment */
.comment-author span {
  font-weight: bold;
}

.comment-body {
  font-size: 9pt;
  line-height: 12pt;
  margin-bottom: 4px;
  max-width: 800px;
  word-wrap: break-word;
}

.comment-actions {
  font-size: 8pt;
  color: #828282;
}

.comment-reply-btn {
  text-decoration: underline;
  color: #000000;
  cursor: pointer;
}

.comment-reply-btn:hover {
  text-decoration: underline;
}

.comment-replies {
  margin-left: 40px; /* Standard HN comment indent */
  margin-top: 8px;
}

.comment-reply-box {
  margin-top: 5px;
  margin-bottom: 8px;
}

/* User profile layout style */
.profile-card {
  font-size: 10pt;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.profile-avatar {
  display: none; /* Remove avatar circles - HN is pure text */
}

.profile-info-grid {
  display: table;
  margin-bottom: 15px;
}

.profile-row {
  display: table-row;
}

.profile-label {
  display: table-cell;
  color: #828282;
  padding-right: 15px;
  padding-bottom: 5px;
}

.profile-value {
  display: table-cell;
  color: #000000;
  padding-bottom: 5px;
}

.profile-about-section {
  max-width: 600px;
  line-height: 14pt;
}

.profile-about-title {
  font-weight: bold;
  font-size: 10pt;
  margin-bottom: 5px;
}

.profile-submissions {
  margin-top: 25px;
}

.profile-submissions h3 {
  font-size: 10pt;
  font-weight: bold;
  margin-bottom: 10px;
  border: none;
}

/* Error page styles */
.error-container {
  text-align: center;
  padding: 50px 20px;
  font-size: 10pt;
}

.error-code {
  font-size: 24pt;
  font-weight: bold;
  color: #ff6600;
  margin-bottom: 10px;
}

.error-message {
  font-size: 11pt;
  color: #000000;
  margin-bottom: 20px;
}

/* Hide theme toggles on pixel accurate HN design */
.theme-toggle {
  display: none !important;
}

/* Footer layout */
footer {
  margin-top: 40px;
  padding: 15px 0;
  border-top: 2px solid #ff6600;
  text-align: center;
  font-size: 8pt;
  color: #828282;
}

footer a {
  color: #000000;
}

footer a:visited {
  color: #000000;
}

/* Mobile Responsiveness Overrides (Classic HN Style) */
@media (max-width: 750px) {
  .container {
    width: 100%; /* Take up the entire screen on mobile, removing side gutters */
  }
  
  .header {
    flex-direction: column; /* Stack site title and nav-links vertically if tight */
    align-items: flex-start;
    padding: 5px 8px;
    gap: 4px;
  }
  
  .logo-section {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .nav-links {
    font-size: 9pt;
    flex-wrap: wrap;
    line-height: 14pt;
  }

  .main-content {
    padding: 8px 10px;
  }

  .story-rank {
    min-width: 20px;
    padding-right: 3px;
  }

  .comment-replies {
    margin-left: 15px; /* Reduce vertical nesting indentation on small mobile screens to keep comments readable */
  }

  /* Form & submit controls styling on mobile */
  .form-group {
    flex-direction: column;
    align-items: stretch;
  }

  .form-label {
    width: 100%;
    margin-bottom: 3px;
  }

  .form-input, .form-textarea, .comment-textarea {
    width: 100% !important; /* Force inputs to span full screen width */
    max-width: 100%;
  }

  .form-help {
    margin-left: 0;
    margin-top: 2px;
    margin-bottom: 8px;
  }

  .comment-form-container {
    padding-left: 0; /* Align comment textareas on mobile */
  }

  .comment-textarea {
    width: 100% !important;
  }
}
