:root {
  --paper: #fffdf7;
  --ink: #202124;
  --red: #8e1717;
  --line: #d8d1c5;
  --muted: #6b655e;
  --blue: #174f86;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #e8e4dc;
  color: var(--ink);
  font: 16px/1.45 Georgia, serif;
}

/* Keeps the site logo from filling the page. */
.rt-topbar .install-app img {
  display: block;
  width: 110px;
  height: 110px;
  max-width: 110px;
  object-fit: contain;
}

.site-shell {
  max-width: 1500px;
  margin: auto;
  padding: 16px;
}

.three-column {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(390px, 1.55fr) minmax(250px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.column {
  min-width: 0;
}

.panel,
.community-post {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px #00000010;
}

.column-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--red);
  font: 700 1.25rem Arial, sans-serif;
}

.article-card h2 {
  margin: 0.2em 0;
}

.article-card img,
.post-media {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #111;
  border-radius: 7px;
}

.article-meta,
time {
  color: var(--muted);
  font: 12px Arial, sans-serif;
}

.community-post header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.composer textarea,
.composer input,
.reply-form input {
  width: 100%;
  margin: 5px 0;
  padding: 10px;
  border: 1px solid #aaa;
  border-radius: 6px;
}

.composer-row,
.reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer button,
.reply-form button,
#load-more,
.weather-box button {
  padding: 9px 14px;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.post-body {
  margin: 10px 0;
  overflow-wrap: anywhere;
}

/* Uniform eight-line preview for articles and main community posts. */
.read-more-content {
  position: relative;
  max-height: 11.6em;
  overflow: hidden;
}

.read-more-content.is-expanded {
  max-height: none;
  overflow: visible;
}

.read-more-content.is-collapsed::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.8em;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--paper));
}

.read-more-button {
  display: inline-block;
  margin: 8px 0 4px;
  padding: 7px 12px;
  color: var(--red);
  font-weight: bold;
  background: #fff;
  border: 1px solid var(--red);
  border-radius: 18px;
  cursor: pointer;
}

.community-embed {
  aspect-ratio: 16 / 9;
}

.community-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.link-card {
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow-wrap: anywhere;
  background: #f0eee8;
  border-left: 4px solid var(--blue);
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.reaction-row button,
.post-tools button {
  padding: 5px 9px;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 18px;
  cursor: pointer;
}

.reaction-row details {
  position: relative;
}

.reaction-row details ul {
  position: absolute;
  z-index: 4;
  width: 210px;
  max-height: 220px;
  padding: 10px 24px;
  overflow: auto;
  background: #fff;
  border: 1px solid #bbb;
}

.post-tools {
  display: flex;
  gap: 7px;
  margin: 8px 0;
}

.reply {
  margin: 8px 0;
  padding: 8px 10px;
  background: #f7f4ed;
  border-left: 3px solid #c9c2b6;
}

.ad-slot img,
.countdown-slot img {
  max-width: 100%;
  height: auto;
}

.install-app {
  cursor: pointer;
}

.weather-box a {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
}

.sticky-side {
  position: sticky;
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 1024px) {
  .three-column {
    grid-template-columns: 1fr;
  }

  .column-center {
    order: 1;
  }

  .column-left {
    order: 2;
  }

  .column-right {
    order: 3;
  }

  .sticky-side {
    position: static;
  }

  .site-shell {
    padding: 10px;
  }

  .community-post,
  .panel {
    border-radius: 6px;
  }
}

@media (max-width: 520px) {
  .site-shell {
    padding: 5px;
  }

  .panel,
  .community-post {
    padding: 11px;
  }

  .composer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .community-post header {
    flex-direction: column;
  }

  .reaction-row button {
    font-size: 12px;
  }

  .post-tools {
    flex-wrap: wrap;
  }
}
