/* 5ives — Butterick. Based on practicaltypography.com. */

html { font-size: 2.4vw; }
@media (min-width:1000px) { html { font-size: 24px; } }
@media (max-width:520px)  { html { font-size: 18px; } }

* { margin: 0; padding: 0; }

body {
  font-family: "Equity A", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.4;
  font-variant-numeric: oldstyle-nums;
  color: #111;
  background: #fff;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  -webkit-font-smoothing: subpixel-antialiased;
  padding-bottom: 12rem;
}

/* --- Ribbon --- */
.site-ribbon {
  background: linear-gradient(90deg,#1d1d1f 0%,#2a2a2e 100%);
  padding: 4px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Triplicate A Code","SF Mono",monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.site-ribbon .ribbon-id { color:#fff; font-weight:600; }
.site-ribbon .ribbon-detail { color:rgba(255,255,255,0.55); }

/* --- Page body --- */
.page-body { padding: 3rem 2.5rem 0; }
@media (max-width:520px) { .page-body { padding: 1.5rem; } }

/* --- Site header --- */
.site-header {
  border-top: 1px solid #333;
  padding-top: 0.5rem;
  margin-bottom: 3rem;
}
.site-title {
  font-family: "Advocate","Concourse OT",sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 2.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: #111;
  text-decoration: none;
}

/* --- Links (his exact treatment) --- */
a { text-decoration: none; color: inherit; transition: background 0.2s; }
a:hover { background: #fbf3f3; border-radius: 8px; }

/* suppress highlight on structural links */
.site-title:hover,
.post-nav a:hover,
.page-nav a:hover,
.site-footer a:hover,
.post-tags a:hover,
.post-list-item a:hover { background: none; border-radius: 0; }

/* the red degree mark after in-text links */
.post-content a::after {
  content: "\FEFF\B0";
  position: relative;
  margin-left: 0.10em;
  font-size: 90%;
  top: -0.10em;
  color: #933;
  font-variant-numeric: normal;
}

/* --- Two-column grid --- */
.content-grid {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  column-gap: 2.5rem;
}
@media (max-width:520px) { .content-grid { grid-template-columns: 1fr; } }

/* --- Post title (his "topic" element) --- */
.post-title {
  font-family: "Advocate","Concourse OT",sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 2.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-top: 1rem;
  margin-bottom: 2rem;
  border-top: 1px solid #333;
  padding-top: 0.02em;
  hyphens: none;
  grid-column: 2;
}
@media (max-width:520px) { .post-title { grid-column:1; font-size:1.8rem; } }

/* --- Post label column --- */
.post-label { text-align: right; padding-top: 0.15rem; }
@media (max-width:520px) { .post-label { text-align:left; } }

.post-date {
  display: block;
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.78rem;
  color: #667;
  line-height: 1.3;
}
.post-tags { margin-top: 0.5rem; }
.post-tags a {
  display: block;
  font-family: "Equity A Caps","Equity A",Georgia,serif;
  font-size: 0.72rem;
  color: #667;
  font-feature-settings: 'c2sc' 1;
  text-transform: lowercase;
  line-height: 1.6;
}

/* --- Post content --- */
.post-content { margin-bottom: 3rem; }
.post-content p { margin-bottom: 1em; }

/* His exact ol treatment */
.post-content ol { counter-reset: foobar; }
.post-content ol li,
.post-content ul li { margin-left: 2.5rem; list-style: none; margin-bottom: 1em; }
.post-content ol li::before {
  counter-increment: foobar;
  content: counter(foobar);
  font-family: "Concourse 3 Tab","Concourse 3","Concourse OT",sans-serif;
  font-size: 1.10rem;
  position: absolute;
  margin-left: -2.5rem;
  font-variant-numeric: normal;
}
.post-content ul li::before { content: "•"; position: absolute; margin-left: -2.5rem; }
.post-content blockquote { margin:1em 0; padding-left:1.5em; border-left:1px solid #ccc; color:#667; }
.post-content code { font-family:"Triplicate A Code",monospace; font-size:0.85em; font-variant-numeric:normal; }
.post-content strong { font-weight: bolder; }
.post-content em { font-style: italic; }

/* --- Post nav --- */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5em;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.78rem;
  color: #667;
}
.post-nav a { color: #667; }
.post-nav .nav-prev { text-align:left; max-width:45%; }
.post-nav .nav-next { text-align:right; max-width:45%; margin-left:auto; }
@media (max-width:520px) {
  .post-nav { flex-direction:column; gap:0.5em; }
  .post-nav .nav-next { text-align:left; margin-left:0; max-width:100%; }
  .post-nav .nav-prev { max-width:100%; }
}

/* --- Index year groups --- */
.year-group { margin-bottom: 2.5rem; }
.year-label {
  font-family: "Concourse 4","Concourse OT",sans-serif;
  font-size: 0.75rem;
  color: #667;
  text-align: right;
  padding-top: 0.2em;
  font-feature-settings: 'c2sc' 1;
  text-transform: lowercase;
}
@media (max-width:520px) { .year-label { text-align:left; margin-bottom:0.4rem; } }

.post-list { list-style: none; }
.post-list-item { margin-bottom: 0.5rem; line-height: 1.35; }
.post-list-item a { font-size: 0.98rem; color: #111; }
.post-list-item a:hover { background:#fbf3f3; border-radius:8px; }
.post-list-date {
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.72rem;
  color: #aaa;
  margin-left: 0.5em;
  font-variant-numeric: normal;
}

/* --- Page nav --- */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.78rem;
  color: #667;
}
.page-nav a { color: #667; }
.page-link-disabled { visibility: hidden; }
.page-info { font-size:0.72rem; color:#aaa; font-variant-numeric:normal; }

/* --- Tag pages --- */
.tag-page-header {
  margin-bottom: 2.5rem;
  border-top: 1px solid #333;
  padding-top: 0.75rem;
}
.tag-page-header .content-grid {
  align-items: baseline;
}
/* The "#" in the label column */
.tag-page-label {
  font-family: "Advocate", "Concourse OT", sans-serif;
  font-stretch: condensed;
  font-size: 3.5rem;
  font-weight: 400;
  color: #bbb;
  line-height: 1;
  padding-top: 0.1em;
}
.tag-page-title {
  font-family: "Advocate", "Concourse OT", sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 3.5rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  color: #111;
}
.tag-page-count {
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.4rem;
  font-variant-numeric: normal;
}
.tag-page-count a { color: #888; }
.tag-page-count a:hover { color: #111; }
/* Tag index page */
.tag-index-header { margin-bottom:2rem; border-top:1px solid #333; padding-top:0.5rem; }
.tag-index-title {
  font-family: "Advocate","Concourse OT",sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.tag-index-subtitle {
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.78rem;
  color: #667;
  margin-top: 0.3rem;
}
.tag-index { list-style:none; column-count:2; column-gap:2.5rem; }
.tag-index-item { display:flex; align-items:baseline; gap:0.5em; margin-bottom:0.5rem; break-inside:avoid; }
.tag-index-link { font-size:0.95rem; }
.tag-index-count { font-family:"Concourse 3","Concourse OT",sans-serif; font-size:0.7rem; color:#aaa; font-variant-numeric:normal; }
@media (max-width:520px) { .tag-index { column-count:1; } }

/* --- Footer --- */
.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.72rem;
  color: #aaa;
}
.site-footer a { color: #aaa; }

/* --- About --- */
.about-title {
  font-family: "Advocate","Concourse OT",sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 2.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  border-top: 1px solid #333;
  padding-top: 0.05em;
  margin-bottom: 1rem;
}
.about-content p { margin-bottom: 1em; }

/* --- Archive --- */
.archive-header { margin-bottom: 2rem; }
.archive-title {
  font-family: "Advocate","Concourse OT",sans-serif;
  font-stretch: condensed;
  font-weight: 400;
  font-size: 2.3rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  border-top: 1px solid #333;
  padding-top: 0.05em;
}
.archive-subtitle {
  font-family: "Concourse 3","Concourse OT",sans-serif;
  font-size: 0.78rem;
  color: #889;
  margin-top: 0.3rem;
}
.archive-year-group {
  margin-bottom: 2rem;
  align-items: baseline;
}
.archive-year-label {
  font-family: "Concourse 4","Concourse OT",sans-serif;
  font-size: 0.75rem;
  color: #889;
  text-align: right;
  padding-top: 0.15rem;
  font-feature-settings: 'c2sc' 1;
  text-transform: lowercase;
}
.archive-list { list-style: none; }
.archive-item { margin-bottom: 0.3rem; line-height: 1.35; font-size: 0.95rem; }
.archive-item a { color: #111; }
@media (max-width:520px) { .archive-year-label { text-align:left; } }

/* --- Preview widget --- */
.preview-toggle {
  position:fixed; bottom:1rem; right:1rem;
  display:flex; background:#f4f2ec; border:1px solid #ddd; border-radius:4px;
  font-family:"Concourse 3",sans-serif; font-size:0.65rem; z-index:1000; opacity:0.35; transition:opacity 0.2s;
}
.preview-toggle:hover { opacity:1; }
.preview-toggle button { background:none; border:none; border-right:1px solid #ddd; padding:0.35em 0.6em; cursor:pointer; color:#999; font-family:inherit; font-size:inherit; }
.preview-toggle button:last-child { border-right:none; }
.preview-toggle button:hover, .preview-toggle button.active { background:#333; color:#fff; }
body.preview-mobile .page-body { max-width:375px; border-left:1px dashed #ccc; border-right:1px dashed #ccc; }
body.preview-tablet .page-body { max-width:768px; border-left:1px dashed #ccc; border-right:1px dashed #ccc; }

/* --- Print --- */
@media print {
  body { background:#fff; color:#000; font-size:11pt; }
  .site-ribbon, .post-nav, .preview-toggle, .page-nav { display:none; }
  .post-content a::after { content:none; }
}

/* Hide details/summary disclosure UI in non-VS themes */
.year-group details > summary { display: none; }
.year-group details > summary::-webkit-details-marker { display: none; }

/* --- Homepage: shuffled post list --- */
.posts-shuffle { }

.post-item {
  margin-bottom: 2.8rem;
}
.post-item.current {
  outline: 2px solid rgba(68, 68, 204, 0.15);
  outline-offset: 8px;
  border-radius: 2px;
}

.post-item .post-title {
  font-family: "Concourse OT", "Gill Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  font-stretch: normal;
  font-variant-numeric: normal;
  text-transform: none;
  letter-spacing: normal;
  color: #333;
  margin-bottom: 0.5rem;
  margin-top: 0;
  border-top: none;
  padding-top: 0;
  line-height: 1.3;
  grid-column: unset;
}

.post-item .post-tags {
  font-family: "Concourse OT", "Gill Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.68rem;
  color: #999;
  margin-bottom: 0.4rem;
  margin-top: 0;
}
.post-item .post-tags .hash { color: #ccc; }
.post-item .post-tags a { display: inline; font-family: inherit; font-size: inherit; color: #999; font-feature-settings: normal; text-transform: none; line-height: inherit; }

.post-item .post-content ol {
  padding-left: 1.8em;
  margin: 0;
  counter-reset: none;
}
.post-item .post-content ol li {
  margin-left: 0;
  list-style: decimal;
  padding-left: 0.3em;
  margin-bottom: 0.25em;
}
.post-item .post-content ol li::before { content: none; }

.keyboard-hint {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  font-family: "Concourse OT", "Gill Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.68rem;
  color: #999;
  background: #f4f2ec;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.4em 0.7em;
  z-index: 1000;
  opacity: 0.6;
  transition: opacity 0.2s;
  user-select: none;
}
.keyboard-hint:hover { opacity: 1; }
.keyboard-hint kbd {
  font-family: "Triplicate A Code", "SF Mono", monospace;
  font-size: 0.65rem;
  background: #e8e6e0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: #777;
}
.keyboard-hint .dismiss {
  margin-left: 0.6em;
  cursor: pointer;
  color: #bbb;
  font-size: 0.75rem;
}
.keyboard-hint .dismiss:hover { color: #666; }

@media print {
  .keyboard-hint { display: none; }
  .post-item.current { outline: none; }
  .sort-menu { display: none; }
}

/* --- Homepage: sort menu --- */
.sort-menu {
  font-family: "Concourse OT", "Gill Sans", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 0.72rem;
  text-align: center;
  margin-bottom: 1.2rem;
  color: #333;
  user-select: none;
}
.sort-menu .sort-active {
  color: #333;
  font-weight: 600;
  cursor: pointer;
}
.sort-menu .sort-link {
  color: #999;
  text-decoration: none;
  background: none;
  border-radius: 0;
}
.sort-menu .sort-link:hover {
  color: #333;
  background: none;
  border-radius: 0;
}
.sort-menu .sort-sep {
  color: #ccc;
  margin: 0 0.4em;
}
