html, body {
  overflow: hidden;
  height: 100vh;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
}

.viewport-lock {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin: 0 2rem 0;
  background: #f5f0e8;
  border: 1px solid #c0b9a8;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.10),
    3px 0 6px -2px rgba(0, 0, 0, 0.08),
    -3px 0 6px -2px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 0;
}

/* Paper edge gradients */
.viewport-lock > header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5rem;
  background: linear-gradient(to bottom, rgba(215, 205, 185, 0.3), transparent);
  pointer-events: none;
  z-index: 10;
  border-radius: 3px 3px 0 0;
}

.viewport-lock > .main-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5rem;
  background: linear-gradient(to top, rgba(200, 190, 170, 0.4), transparent);
  pointer-events: none;
  z-index: 10;
}


/* Header */
.site-header {
  text-align: center;
  padding: 0.8rem 2rem 0.4rem;
  flex-shrink: 0;
  position: relative;
}

.header-rule {
  border-top: 3px double #1a1a1a;
  margin: 0 auto;
}

.masthead-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.2rem 0;
}

.masthead-side {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  color: #888;
}

.masthead-left {
  text-align: left;
}

.masthead-right {
  text-align: right;
  align-items: flex-end;
}

.header-date,
.header-count {
  font-size: 0.7rem;
}

.header-tagline {
  font-style: italic;
  font-size: 0.7rem;
}

.header-headline {
  font-style: italic;
  font-size: 0.72rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22rem;
}

.masthead-right .header-headline {
  align-self: flex-end;
}

.masthead {
  font-family: "Old Standard TT", Georgia, serif;
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 1rem;
}

.masthead-link {
  text-decoration: none;
  color: inherit;
}

.masthead-link:hover {
  opacity: 0.8;
}

/* Main content area */
.main-content {
  flex: 1;
  overflow: hidden;
  padding: 0.5rem 2rem 0.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Front page grid */
.newspaper-grid {
  display: flex;
  gap: 1.2rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.main-column {
  flex: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #ccc;
  padding-right: 1.2rem;
}

.main-column > .article-card.featured {
  flex: 3;
  min-height: 0;
}

.sub-columns {
  flex: 2;
  display: flex;
  gap: 1.2rem;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid #ccc;
  padding-top: 0.6rem;
}

.sub-column {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sub-column:first-child {
  border-right: 1px solid #ccc;
  padding-right: 1.2rem;
}

.side-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.side-column > .article-card + .article-card {
  border-top: 1px solid #ccc;
  padding-top: 0.6rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side-column > .article-card {
  flex: 1;
  min-height: 0;
}

/* Standard grid for non-featured pages */
.newspaper-grid.standard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 1.2rem;
}

.standard .article-card {
  border-right: 1px solid #ccc;
  padding-right: 1.2rem;
}

.standard .article-card:nth-child(3n) {
  border-right: none;
  padding-right: 0;
}

.card-image {
  width: 100%;
  max-height: 30%;
  overflow: hidden;
  margin-bottom: 0.6rem;
  flex-shrink: 1;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  font-family: Arial, Helvetica, sans-serif;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.3rem 0;
}

.featured .card-title {
  font-size: 1.8rem;
}

.card-subtitle {
  font-size: 0.95rem;
  font-style: italic;
  color: #555;
  margin-bottom: 0.4rem;
}

.card-summary {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #333;
  flex: 1;
  overflow: hidden;
}

.card-meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #888;
  font-family: Arial, Helvetica, sans-serif;
  flex-shrink: 0;
}

.card-author::after {
  content: " \2022 ";
}

.article-card:hover .card-title {
  text-decoration: underline;
}

/* Article detail pages */
.article-header {
  text-align: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #ccc;
  margin-bottom: 0.8rem;
  flex-shrink: 0;
}

.article-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  font-family: Arial, Helvetica, sans-serif;
}

.article-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0.3rem 0;
}

.article-subtitle {
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  color: #555;
  margin-bottom: 0.3rem;
}

.article-meta {
  font-size: 0.8rem;
  color: #888;
  font-family: Arial, Helvetica, sans-serif;
}

.article-author::after {
  content: " \2022 ";
}

.article-body {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.article-columns {
  column-count: 2;
  column-gap: 2rem;
  column-rule: 1px solid #ddd;
  height: 100%;
  overflow: hidden;
}

.article-columns p {
  margin-bottom: 0.8rem;
  text-align: justify;
  text-indent: 1.5em;
}

.article-columns p:first-child {
  text-indent: 0;
}

.article-columns p:first-child::first-letter {
  font-size: 3.2em;
  float: left;
  line-height: 0.8;
  padding-right: 0.08em;
  font-weight: 700;
}

/* Front page positioning context for banners */
.front-page {
  position: relative;
}

/* Floating article preview banners */
.floating-banners {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.banner {
  position: absolute;
  width: 220px;
  padding: 14px 16px 12px;
  background: rgba(245, 240, 232, 0.92);
  border: 1px solid #c0b9a8;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.12);
  cursor: grab;
  font-family: Arial, Helvetica, sans-serif;
  transition: box-shadow 0.15s;
  user-select: none;
  pointer-events: auto;
}

.banner:hover {
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.18);
}

.banner.dragging {
  cursor: grabbing;
  box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.22);
  scale: 1.03;
}

.banner-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 0 2px;
}

.banner-close:hover {
  color: #333;
}

.banner-category {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.banner-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 3px 0 4px;
}

.banner-summary {
  font-size: 0.72rem;
  color: #555;
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.banner-link {
  font-size: 0.7rem;
  font-style: italic;
  color: #555;
  text-decoration: none;
}

.banner-link:hover {
  text-decoration: underline;
  color: #1a1a1a;
}

.article-figure {
  float: right;
  width: 45%;
  margin: 0 0 0.8rem 1.2rem;
  flex-shrink: 0;
}

.article-figure img {
  width: 100%;
  max-height: 30vh;
  object-fit: cover;
}

.article-figure figcaption {
  font-size: 0.75rem;
  font-style: italic;
  color: #666;
  margin-top: 0.3rem;
}

/* Mobile responsive */
@media (max-width: 640px) {
  /* 1. Unlock scrolling */
  html, body {
    overflow: visible;
    height: auto;
  }

  .viewport-lock {
    height: auto;
    overflow: visible;
    margin: 0 0.5rem;
  }

  .main-content {
    overflow: visible;
  }

  /* 2. Simplify header */
  .masthead {
    font-size: 1.6rem;
  }

  .masthead-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .masthead-side {
    display: none;
  }

  .site-header {
    padding: 0.5rem 0.5rem 0.3rem;
  }

  /* 3. Front page — titles only, single column */
  .newspaper-grid {
    flex-direction: column;
    gap: 0;
    flex: none;
    overflow: visible;
  }

  .main-column {
    flex: none;
    border-right: none;
    padding-right: 0;
    overflow: visible;
  }

  .main-column > .article-card.featured {
    flex: none;
  }

  .sub-columns {
    flex-direction: column;
    gap: 0;
    overflow: visible;
    border-top: none;
    padding-top: 0;
  }

  .sub-column {
    overflow: visible;
  }

  .sub-column:first-child {
    border-right: none;
    padding-right: 0;
  }

  .side-column {
    flex-direction: column;
    overflow: visible;
  }

  .side-column > .article-card {
    flex: none;
  }

  .card-image,
  .card-meta {
    display: none;
  }

  .card-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-summary {
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-category {
    margin-bottom: 0.3rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .featured .card-title {
    font-size: 1.2rem;
  }

  .article-card {
    border-bottom: 1px solid #ccc;
    padding: 0.5rem 0;
    overflow: visible;
  }

  /* Standard grid */
  .newspaper-grid.standard {
    grid-template-columns: 1fr;
  }

  .standard .article-card {
    border-right: none;
    padding-right: 0;
  }

  /* 4. Hide floating banners */
  .floating-banners {
    display: none;
  }

  /* 5. Article detail pages — single column */
  .article-columns {
    column-count: 1;
    height: auto;
    overflow: visible;
  }

  .article-columns p {
    text-align: left;
  }

  .article-figure {
    float: none;
    width: 100%;
    margin: 0 0 0.8rem 0;
  }

  .article-title {
    font-size: 1.6rem;
  }

  .article-body {
    flex: none;
    overflow: visible;
  }

  .main-content {
    padding: 0.5rem 0.5rem;
    flex: none;
  }

  /* 6. Front-page pagination containers */
  .front-page {
    overflow: visible;
    flex: none;
  }

  .page {
    overflow: visible;
    flex: none;
  }

  .page.active {
    display: flex;
  }
}
