:root {
  --site-header-offset: 16rem;
}

html {
  scroll-padding-top: calc(var(--site-header-offset) + 1.5rem);
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

#marginalia,
#marginalia-note {
  scroll-margin-top: calc(var(--site-header-offset) + 1.5rem);
}

/* Solar icons */
.solar-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.solar-icon path,
.solar-icon circle {
  vector-effect: non-scaling-stroke;
}

/* Drop cap */
.drop-cap::first-letter {
  float: left;
  font-family: 'Bitter', serif;
  font-size: 5rem;
  line-height: 1;
  padding-top: 4px;
  padding-right: 12px;
  color: #b22222;
  font-weight: 900;
}

/* Newspaper columns */
.newspaper-cols {
  column-gap: 2rem;
  hyphens: auto;
  text-align: justify;
}
@media (min-width: 768px) {
  .newspaper-cols {
    column-count: 2;
  }
}

/* Justified text */
.justified-text {
  text-align: justify;
  hyphens: auto;
}

/* Ink bleed button gradient */
.ink-bleed {
  background: radial-gradient(circle, #8f000d 0%, #b22222 100%);
}

/* Newsletter feedback */
.newsletter-feedback {
  min-height: 1.25rem;
  font-style: italic;
  font-size: 0.875rem;
  color: #5a403e;
}
.newsletter-feedback.is-success { color: #1a3d1a; }
.newsletter-feedback.is-error   { color: #ba1a1a; }

.post-layout {
  align-items: start;
}

.post-rail {
  min-width: 0;
}

.post-rail-inner {
  position: sticky;
  top: calc(var(--site-header-offset) + 1rem);
  max-height: calc(100vh - var(--site-header-offset) - 2rem);
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: none;
}

.post-rail-inner::-webkit-scrollbar {
  display: none;
}

.post-rail-note {
  overflow: visible;
}

.post-newsletter-form {
  align-items: stretch;
}

.post-newsletter-input {
  min-width: 0;
  width: 100%;
}

.post-newsletter-button {
  white-space: nowrap;
}

/* 3D flip card: the figure's portrait on the front, the full standing on the back. */
.flip-card {
  perspective: 1600px;
  cursor: pointer;
  outline: none;
}
/* Both faces share one grid cell. Unflipped, the back is pinned to the
   portrait's size so the card is exactly as tall as the portrait; flipped, it
   joins the grid and the card grows to fit the whole standing, never scrolling. */
.flip-card__inner {
  position: relative;
  display: grid;
  width: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}
.flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}
.flip-card__face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card__front {
  display: block;
}
.flip-card:not(.is-flipped) .flip-card__back {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.flip-card__back {
  transform: rotateY(180deg);
  background: #f4efd9;
  border: 1px solid rgba(29, 28, 16, 0.2);
  padding: 1.75rem 1.5rem;
}
.flip-card:focus-visible {
  box-shadow: 0 0 0 2px #b22222;
}

/* Prose styles for rendered markdown in post body */
.prose-gazette p {
  margin-bottom: 1.5rem;
}
.prose-gazette > p:first-child::first-letter {
  float: left;
  font-family: 'Bitter', serif;
  font-size: 5rem;
  line-height: 1;
  padding-top: 4px;
  padding-right: 12px;
  color: #b22222;
  font-weight: 900;
}
.prose-gazette h2 {
  font-family: 'Bitter', serif;
  font-size: 1.5rem;
  font-style: italic;
  margin-top: 3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2beba;
  padding-bottom: 0.5rem;
}
.prose-gazette h3 {
  font-family: 'Bitter', serif;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.prose-gazette ul {
  list-style: none;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.prose-gazette ul li {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.prose-gazette ul li::before {
  content: "⌂";
  color: #8f000d;
  font-weight: bold;
  flex-shrink: 0;
}
.prose-gazette blockquote {
  margin: 3rem 0;
  padding: 1rem 2rem;
  position: relative;
}
.prose-gazette blockquote p {
  font-family: 'Caveat', cursive;
  font-size: 1.75rem;
  color: #395f94;
  line-height: 1.4;
  margin-bottom: 0;
}
.prose-gazette blockquote p::first-letter {
  float: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  color: inherit;
  font-weight: inherit;
}
.prose-gazette strong { font-weight: 700; }
.prose-gazette em { font-style: italic; }
.prose-gazette a { color: #8f000d; text-decoration: underline; }

@media (max-width: 1023px) {
  .post-rail-inner {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --site-header-offset: 10.5rem;
  }

  .home-thesis-paper {
    transform: rotate(var(--paper-mobile-rotate, 0deg)) translateY(var(--paper-mobile-offset, 0px)) !important;
    width: min(100%, 22rem);
    margin-left: auto;
    margin-right: auto;
  }
}

.pantheon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}

.pantheon-card {
  position: relative;
  background: #fff9e5;
  border: 2px solid #1d1c10;
  transition: transform 0.2s ease;
}

.pantheon-card:hover {
  transform: translateY(-3px);
}

.pantheon-card::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid #8b8370;
  pointer-events: none;
}

.pantheon-card.unrevealed {
  opacity: 0.76;
}

.pantheon-card.unrevealed:hover {
  transform: none;
}

.card-header {
  text-align: center;
  padding: 1.2rem 1rem 0.8rem;
  border-bottom: 2px solid #1d1c10;
  position: relative;
}

.card-header::before,
.card-header::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #1d1c10;
}

.card-header::before {
  bottom: -5px;
}

.card-header::after {
  bottom: -2px;
}

.card-numeral {
  font-family: "Bitter", serif;
  font-size: 2rem;
  color: #b22222;
  letter-spacing: 0.05em;
}

.card-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 2px solid #1d1c10;
  background: #ede8d5;
}

.card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-portrait--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pantheon-card--poster {
  border: 0;
  background: transparent;
}

.pantheon-card--poster::after {
  display: none;
}

.pantheon-card--poster:hover {
  transform: translateY(-2px);
}

.pantheon-poster-image {
  display: block;
  width: 100%;
  height: auto;
  /* Every poster card shares the first figure's ratio (500x671) so the
     engravings render equally tall and the scorecards below stay aligned;
     the PNGs are transparent, so any letterboxing is invisible. */
  aspect-ratio: 500 / 671;
  object-fit: contain;
}

.pantheon-placeholder-name {
  font-family: "Bitter", serif;
  text-align: center;
  font-size: 2rem;
  line-height: 1.15;
  color: #6b5b4f;
  opacity: 0.45;
}

.card-motif {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: "Caveat", cursive;
  font-size: 0.9rem;
  color: #6b5b4f;
  background: #fff9e5;
  padding: 2px 8px;
  border: 1px solid #8b8370;
  opacity: 0.92;
}

.card-ribbon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.4rem 0.8rem;
  font-family: "Bitter", serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}

.card-ribbon.available {
  background: #b22222;
  color: #fff9e5;
}

.card-ribbon.archived {
  background: #6b5b4f;
  color: #fff9e5;
}

.card-body {
  padding: 1.2rem 1.2rem 0.8rem;
}

.card-name {
  font-family: "Bitter", serif;
  font-size: 1.05rem;
  letter-spacing: 0.2em;
  color: #1d1c10;
  text-align: center;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.card-source {
  font-style: italic;
  font-size: 0.75rem;
  color: #6b5b4f;
  text-align: center;
  margin-bottom: 0.8rem;
  line-height: 1.45;
}

.card-divider {
  text-align: center;
  color: #6b5b4f;
  font-size: 0.9rem;
  margin: 0.6rem 0;
  position: relative;
}

.card-divider::before,
.card-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: #8b8370;
}

.card-divider::before {
  left: 8%;
}

.card-divider::after {
  right: 8%;
}

.card-description {
  font-style: italic;
  font-size: 0.8rem;
  color: #6b5b4f;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 0.8rem;
}

.card-stats {
  padding: 0 1.2rem 1rem;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-family: "Bitter", serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: #1d1c10;
  width: 90px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.stat-bar-track {
  flex: 1;
  height: 10px;
  background: #e0dbd0;
  position: relative;
}

.stat-bar-fill {
  height: 100%;
  background: #b22222;
}

.stat-value {
  font-family: "Bitter", serif;
  font-size: 0.6rem;
  color: #1d1c10;
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.card-footer {
  border-top: 1px solid #8b8370;
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.5rem;
}

.card-footer--poster {
  border-top: 0;
  padding: 1rem 0 0;
}

.btn-order {
  flex: 1;
  display: block;
  text-align: center;
  padding: 0.6rem 0.4rem;
  font-family: "Bitter", serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-order.primary {
  background: #b22222;
  color: #fff9e5;
  border-color: #b22222;
}

.btn-order.primary:hover {
  background: #8b1a1a;
  border-color: #8b1a1a;
}

.btn-order.secondary {
  background: transparent;
  color: #1d1c10;
  border-color: #1d1c10;
}

.btn-order.secondary:hover {
  background: #1d1c10;
  color: #fff9e5;
}

.btn-price {
  display: block;
  font-family: "Bitter", serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0;
  text-transform: none;
}

.card-footer.archived {
  justify-content: center;
}

.archived-notice {
  font-family: "Caveat", cursive;
  font-size: 1rem;
  color: #6b5b4f;
  text-align: center;
  line-height: 1.45;
}

.unrevealed-silhouette {
  font-size: 4rem;
  color: #8b8370;
  opacity: 0.4;
}

.card-arriving {
  font-family: "Bitter", serif;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6b5b4f;
  text-align: center;
  padding: 1.5rem 1rem;
  line-height: 1.8;
}

.card-stats--tease {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.card-stats--tease .stat-row:last-child {
  margin-bottom: 0;
}

.card-gazette-mark {
  border-top: 2px solid #1d1c10;
  position: relative;
  padding: 0.5rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.card-gazette-mark::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: #1d1c10;
}

.card-gazette-name {
  font-family: "Bitter", serif;
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: #6b5b4f;
  text-transform: uppercase;
}

.card-gazette-number {
  font-style: italic;
  font-size: 0.65rem;
  color: #b22222;
}

@media (max-width: 900px) {
  .pantheon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

body.newsletter-overlay-open {
  overflow: hidden;
}

.newsletter-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.newsletter-overlay.hidden {
  display: none;
}

.newsletter-overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.newsletter-overlay__dialog {
  position: relative;
  width: min(100%, 36rem);
  max-height: min(92vh, 54rem);
  overflow: auto;
  padding-top: 1.25rem;
}

.newsletter-overlay__close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(25%, -15%);
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #1d1c10;
  background: #fff9e5;
  color: #1d1c10;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.newsletter-overlay__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.newsletter-overlay__logo {
  width: min(7rem, 28vw);
  height: auto;
  filter: drop-shadow(0 3px 10px rgba(29, 28, 16, 0.15));
}

.newsletter-count {
  text-wrap: balance;
}

@media (max-width: 640px) {
  .newsletter-overlay {
    padding: 1rem;
  }

  .newsletter-overlay__dialog {
    width: 100%;
    padding-top: 1rem;
  }

  .newsletter-overlay__close {
    transform: none;
    top: 0.15rem;
    right: 0.15rem;
  }

  .newsletter-overlay__logo {
    width: min(5.25rem, 26vw);
  }
}
