/* JAN style */
:root {
  --paper: #e6eae2;
  --panel: #f3f5ef;
  --ink: #14181b;
  --muted: #4d5a58;
  --rule: #14181b;
  --accent: #0f6b5c;
  --accent-ink: #ffffff;
  --highlight: #f2c230;
  --font-body: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-plate: 'UnifrakturCook', 'Old English Text MT', Georgia, serif;
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.6 var(--font-body);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--highlight);
  color: var(--ink);
  padding: 0.5rem 1rem;
  z-index: 10;
}

/* mast head */
.masthead {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.masthead-inner {
  text-align: center;
  border-bottom: 4px double var(--rule);
  padding-bottom: 0.75rem;
}

.nameplate {
  display: block;
  font: 700 clamp(2.6rem, 9vw, 5.5rem)/1.05 var(--font-plate);
  color: var(--ink);
  text-decoration: none;
}

.dateline {
  margin: 0.25rem 0 0;
  font-style: italic;
  color: var(--muted);
  font-size: 1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

/* front page layout */
.front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
}

.lead-column {
  min-width: 0;
}

.rail {
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
  align-self: start;
}

.rail-title,
.section-title {
  font: 800 1.35rem/1.2 var(--font-body);
  margin: 0 0 0.75rem;
}

.section-title {
  font-size: 1.6rem;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.4rem;
  margin-bottom: 1.25rem;
}

.rail-list {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.rail-list li {
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.rail-list a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.rail-list a:hover {
  text-decoration: underline;
}

.rail-votes {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}

/* stories */
.story {
  display: grid;
  gap: 0.9rem;
}

.headline {
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

.headline a {
  color: var(--ink);
  text-decoration: none;
}

.headline a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.dek {
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.meta {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--rule);
  filter: grayscale(0.15) contrast(1.03);
}

.story-lead .headline {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.story-lead .dek {
  font-size: 1.3rem;
}

.story-lead .photo img {
  aspect-ratio: 16 / 9;
}

.secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.secondary .story+.story {
  border-left: 1px solid var(--rule);
  padding-left: 1.75rem;
}

.story-secondary .headline {
  font-size: 1.5rem;
}

.story-compact .headline {
  font-size: 1.25rem;
}

.story-compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

.story-compact .photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.story-compact .photo img {
  height: 100%;
}

.story-compact .story-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
}

.story-compact .dek {
  font-size: 1rem;
}

.article-preview {
  position: relative;
  width: 100%;
  margin: .15rem 0 .65rem;
}

.article-preview p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
}

.read-more {
  display: inline-block;
  margin-top: .35rem;
  font-weight: 700;
}

.story-compact .vote {
  margin-top: auto;
}

.latest {
  margin-top: 2.5rem;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 1.75rem 1.5rem;
}

.more {
  margin-top: 1.5rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.empty-front {
  max-width: 36rem;
  margin: 3rem auto;
  text-align: center;
}

/* vote */
.vote {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 600 1rem var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.2rem 0.85rem;
  cursor: pointer;
}

.vote:hover {
  background: var(--panel);
}

.vote.is-voted {
  background: var(--highlight);
}

.vote[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.vote-arrow {
  font-size: 0.8em;
}

.button,
.link-button {
  display: inline-block;
  font: 700 1rem var(--font-body);
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: 0.6rem 1.2rem;
}

.button:hover {
  background: var(--ink);
  color: var(--accent-ink);
}

.link-button {
  background: none;
  color: var(--accent);
  padding: 0;
  text-decoration: underline;
  font-weight: 600;
}

/* articles */
.article {
  max-width: var(--measure);
  margin: 0 auto;
}

.headline-article {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

.article .dek {
  font-size: 1.35rem;
  font-style: italic;
}

.article-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-block: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin-bottom: 1.5rem;
}

.article-bar .meta {
  margin: 0;
}

.hero {
  margin: 0 0 1.5rem;
}

.hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.prose {
  font-size: 1.2rem;
  line-height: 1.75;
}

.prose p {
  margin: 0 0 1.1em;
}

.prose p:first-child::first-letter {
  float: left;
  font: 800 3.6rem/0.85 var(--font-body);
  padding: 0.3rem 0.5rem 0 0;
}

.wikilink {
  font-weight: 600;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.share {
  margin-top: 2rem;
}

/* forms */
.submit,
.admin,
.archive {
  max-width: 760px;
  margin: 0 auto;
}

.archive {
  max-width: none;
}

.form {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.25rem;
}

.form label,
.field>label {
  display: grid;
  gap: 0.3rem;
  font-weight: 700;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.95rem;
}

.form input:not([type='file']),
.form textarea,
.form select {
  font: 400 1.05rem var(--font-body);
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  padding: 0.6rem 0.7rem;
  width: 100%;
}

.form textarea {
  resize: vertical;
}

.previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.preview {
  position: relative;
}

.preview img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid var(--ink);
}

.preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 50%;
  width: 1.6rem;
  height: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-error {
  color: #8a1c1c;
  font-weight: 600;
  margin: 0;
}

.thanks {
  margin-top: 1.5rem;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

/* admin */
.discord-settings {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.discord-settings summary {
  cursor: pointer;
  font-weight: 700;
}

.discord-settings .form {
  margin-top: 1rem;
}

.admin-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-item {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
}

.admin-item h3 {
  margin: 0;
  font-size: 1.2rem;
}

.admin-item p {
  margin: 0;
}

.admin-status {
  font-weight: 700;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-actions button {
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 0.3rem 0.8rem;
}

.admin-actions button:hover {
  background: var(--highlight);
}

.colophon {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
  border-top: 4px double var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1.1rem;
  max-width: 90vw;
  z-index: 20;
}

@media (max-width: 860px) {
  .front {
    grid-template-columns: 1fr;
  }

  .rail {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 1.25rem 0 0;
  }

  .latest-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .latest-grid {
    grid-template-columns: 1fr;
  }

  .secondary {
    grid-template-columns: 1fr;
  }

  .secondary .story+.story {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--rule);
    padding-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .vote {
    transition: background 0.15s;
  }

  .vote.is-voted .vote-arrow {
    animation: pop 0.25s ease-out;
  }

  @keyframes pop {
    50% {
      transform: translateY(-3px) scale(1.25);
    }
  }
}

/* article admin preview modal style */
body.modal-open {
  overflow: hidden;
}

.preview-dialog {
  width: min(900px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  margin: auto;
  padding: 1.5rem 1.75rem 2rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--rule);
  overflow-y: auto;
}

.preview-dialog::backdrop {
  background: rgba(20, 24, 27, 0.7);
}

.preview-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  font: 700 0.95rem var(--font-body);
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  border: 0;
  padding: 0.4rem 0.9rem;
}

.preview-close:hover {
  background: var(--accent);
}

.preview-dialog .article {
  clear: both;
}
