@font-face {
  font-family: "Medieval";
  src: url("Canterbury.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --paper: #e7dbc1;
  --paper-2: #f6f0e5;
  --paper-light: rgba(255, 252, 247, 0.92);
  --ink: #2a2118;
  --ink-soft: #62513f;
  --line: rgba(79, 58, 37, 0.16);
  --accent: #612616;
  --accent-hover: #8e3d22;
  --nav: rgba(236, 227, 211, 0.88);
  --shadow: rgba(48, 31, 17, 0.11);
  --shadow-strong: rgba(39, 24, 13, 0.18);
  --header-deep: rgba(18, 12, 9, 0.58);
  --header-soft: rgba(255, 244, 221, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at top, rgba(255, 247, 230, 0.55), transparent 26%),
    linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.header {
  position: relative;
  height: 360px;
  overflow: hidden;
  box-shadow:
    inset 0 -110px 140px rgba(0, 0, 0, 0.2),
    0 18px 34px rgba(35, 22, 13, 0.12);
}

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.2), var(--header-deep)),
    radial-gradient(circle at center, var(--header-soft), transparent 42%);
  pointer-events: none;
}

#headerimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.12) brightness(0.63);
}

h1 {
  margin: 0;
  font-family: "Medieval", serif;
  font-size: clamp(60px, 7.4vw, 128px);
  color: #ffffff;
  text-shadow:
    0 12px 30px rgba(0, 0, 0, 0.56),
    0 2px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  max-width: 92%;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  letter-spacing: 0.02em;
  z-index: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  background: var(--nav);
  backdrop-filter: blur(12px);
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  border-bottom: 1px solid rgba(73, 53, 32, 0.12);
  box-shadow: 0 12px 26px rgba(66, 47, 28, 0.08);
}

.navbar a {
  text-decoration: none;
  color: #241911;
  font-family: Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar a:hover {
  background-color: rgba(255, 255, 255, 0.5);
  border-color: rgba(90, 70, 51, 0.14);
  box-shadow: 0 6px 12px rgba(70, 50, 31, 0.08);
  transform: translateY(-1px);
}

.navbar a:active {
  transform: translateY(0);
}

main {
  max-width: 980px;
  margin: 42px auto 80px;
  padding: 54px 52px 72px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(248, 241, 231, 0.9));
  border: 1px solid rgba(95, 70, 45, 0.12);
  border-radius: 28px;
  box-shadow:
    0 24px 46px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.home-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: 920px;
  padding-top: 46px;
}

.home-main h2 {
  margin-bottom: 20px;
}

.plain-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: 920px;
}

p {
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 21px;
  line-height: 1.95;
  letter-spacing: 0.012em;
  margin: 0 0 1.45em;
  text-align: left;
}

main a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

main a:visited {
  color: var(--accent);
}

main a:hover {
  color: var(--accent-hover);
}

main h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 42px;
  color: #3f2b1d;
  margin: 0 0 20px;
  letter-spacing: 0.015em;
}

main h3 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 30px;
  color: #4a3020;
  margin: 0 0 14px;
}

.intro {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 22px;
}

.literature-list,
.works-list {
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 20px;
  line-height: 1.8;
  padding-left: 24px;
  margin: 0 0 2em;
}

.article-list {
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 20px;
  line-height: 1.8;
  padding-left: 24px;
  margin: 0 0 2em;
}

.article-list li {
  margin-bottom: 0.75em;
}

.literature-list li,
.works-list li {
  margin-bottom: 0.75em;
}

.literature-list a,
.works-list a {
  color: var(--accent);
}

.author-card {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 34px;
  margin-bottom: 26px;
  box-shadow:
    0 18px 34px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  scroll-margin-top: 110px;
}

.author-card h2 {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 36px;
  margin: 0 0 12px;
  color: #3e2a1c;
}

.author-card p {
  margin-bottom: 0.9em;
}

.author-card .poem {
  margin-bottom: 0;
}

.pattern-poem-display {
  margin: 0 0 28px;
}

.pattern-poem-figure {
  margin: 0 auto;
  width: min(100%, 520px);
  background: var(--paper-light);
  border-radius: 18px;
  overflow: hidden;
}

.pattern-poem-figure img {
  display: block;
  width: 100%;
  margin: 0;
  box-shadow:
    0 18px 34px var(--shadow),
    0 0 0 1px rgba(95, 70, 45, 0.12);
}

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

.gallery-item {
  margin: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 14px 28px rgba(60, 40, 22, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.gallery-grid > .gallery-item:only-child {
  max-width: 720px;
  justify-self: center;
  width: 100%;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.gallery-item img:hover {
  transform: scale(1.01);
  filter: saturate(1.04);
}

.gallery-item img:focus-visible {
  outline: 3px solid rgba(97, 38, 22, 0.34);
  outline-offset: -3px;
}

.gallery-item figcaption {
  padding: 14px 16px 16px;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  color: #4a3020;
}

.image-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: none;
  overflow: visible;
}

.image-lightbox::backdrop {
  background: rgba(18, 12, 9, 0.82);
  backdrop-filter: blur(5px);
}

.image-lightbox-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-image {
  display: block;
  max-width: min(92vw, 1220px);
  max-height: 80vh;
  border-radius: 20px;
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.38);
}

.lightbox-caption {
  margin: 0;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(246, 240, 229, 0.96);
  color: #3e2a1c;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  box-shadow: 0 12px 22px rgba(25, 16, 9, 0.18);
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(28, 18, 12, 0.74);
  color: #fff8ef;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(45, 29, 19, 0.88);
}

.magazine-kicker {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #7a5c3b;
  margin-bottom: 12px;
}

.magazine-deck {
  font-size: 27px;
  line-height: 1.75;
  margin-bottom: 2.1em;
  color: #413022;
}

.magazine-rule {
  border: 0;
  border-top: 1px solid rgba(90, 70, 51, 0.22);
  margin: 46px 0;
}

.magazine-feature {
  margin-bottom: 44px;
  padding-bottom: 12px;
}

.magazine-feature p:last-child {
  margin-bottom: 0;
}

.byline {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7a5c3b;
  margin-bottom: 14px;
}

.magazine-piece-title {
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 34px;
  color: #4a3020;
  margin: 0 0 16px;
}

.poem {
  white-space: pre-line;
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 21px;
  line-height: 1.95;
  letter-spacing: 0.012em;
  color: var(--ink);
}

.magazine-main {
  max-width: 1040px;
  padding: 42px 58px 78px;
}

.art-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: center;
  margin: 0 0 32px;
}

.art-feature {
  margin: 0;
}

.art-feature img {
  display: block;
  width: 100%;
  height: clamp(280px, 44vw, 460px);
  object-fit: cover;
  object-position: center;
  border-radius: 28px;
  box-shadow: 0 28px 42px rgba(63, 44, 29, 0.16);
}

.art-copy {
  padding: 8px 0;
}

.art-credit {
  margin: 0 0 10px;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a5f49;
}

.art-copy p:last-child {
  margin-bottom: 0;
}

.magazine-hero {
  position: relative;
  padding: 18px 0 34px;
  border-bottom: 1px solid rgba(90, 70, 51, 0.22);
  margin-bottom: 34px;
}

.magazine-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  color: #715742;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.magazine-brand {
  margin: 0;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(52px, 7vw, 88px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 0.95;
  color: #3d291b;
  text-align: center;
}

.magazine-subtitle {
  max-width: 760px;
  margin: 18px auto 0;
  font-size: 22px;
  line-height: 1.75;
  text-align: center;
  color: #4f3b2c;
}

.magazine-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 24px;
}

.print-button {
  appearance: none;
  border: 1px solid rgba(92, 62, 37, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(240, 227, 203, 0.9));
  color: #3d281b;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(65, 45, 27, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.print-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(65, 45, 27, 0.12);
}

.issue-note {
  max-width: 820px;
  margin: 0 auto 10px;
  text-align: center;
  color: #64503d;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0 28px;
}

.section-heading h2 {
  margin: 0;
  white-space: nowrap;
}

.section-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(90, 70, 51, 0.2);
}

.magazine-feature {
  position: relative;
  margin-bottom: 52px;
  padding: 0 0 18px;
}

.magazine-feature::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 140px;
  height: 1px;
  background: rgba(90, 70, 51, 0.16);
}

.magazine-feature:last-child::after {
  display: none;
}

.story-label {
  font-style: italic;
  color: #715742;
}

.magazine-main .magazine-feature p {
  max-width: 760px;
}

.magazine-main .magazine-feature .poem {
  max-width: 760px;
}

.magazine-main .magazine-feature .opening::first-letter {
  float: left;
  font-family: "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 4.2em;
  line-height: 0.8;
  padding-right: 10px;
  padding-top: 6px;
  color: #5d2b18;
}

@page {
  margin: 0.68in 0.72in 0.78in;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  body {
    color: #241910;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .header,
  .navbar,
  .magazine-toolbar,
  .image-lightbox {
    display: none !important;
  }

  main,
  .magazine-main {
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .magazine-main {
    font-size: 11.25pt;
    line-height: 1.65;
  }

  .magazine-main a {
    color: inherit;
    text-decoration: none;
  }

  .magazine-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 9.1in;
    box-sizing: border-box;
    padding: 0.22in 0 0.42in;
    margin: 0 0 0.36in;
    border-bottom: 1px solid #d6c8b6;
    break-after: page;
    page-break-after: always;
  }

  .magazine-hero + .section-heading {
    margin-top: 0;
  }

  .magazine-meta {
    justify-content: center;
    gap: 0.3in;
    margin-bottom: 0.16in;
    font-size: 9pt;
  }

  .magazine-kicker {
    margin-bottom: 0.14in;
    font-size: 9pt;
    letter-spacing: 0.24em;
    text-align: center;
  }

  .magazine-brand {
    font-size: 32pt;
    line-height: 0.92;
  }

  .magazine-subtitle,
  .issue-note {
    max-width: 5.9in;
    margin-left: auto;
    margin-right: auto;
    font-size: 12pt;
    line-height: 1.58;
  }

  .section-heading {
    gap: 0.18in;
    margin: 0.32in 0 0.16in;
    break-after: avoid;
    page-break-after: avoid;
  }

  .section-heading h2 {
    font-size: 22pt;
  }

  .section-heading + * {
    break-before: avoid;
    page-break-before: avoid;
  }

  .print-section-start {
    break-before: page;
    page-break-before: always;
  }

  .byline {
    margin-bottom: 0.08in;
    font-size: 9pt;
    letter-spacing: 0.14em;
  }

  .magazine-piece-title {
    margin-bottom: 0.14in;
    font-size: 19pt;
  }

  .magazine-feature {
    margin-bottom: 0.38in;
    padding-bottom: 0.18in;
    border-bottom: 1px solid #d6c8b6;
  }

  .magazine-feature:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .magazine-feature::after {
    display: none;
  }

  .magazine-main .magazine-feature p {
    max-width: none;
    font-size: 11.25pt;
    line-height: 1.68;
  }

  .magazine-main .magazine-feature .poem {
    max-width: none;
    font-size: 12.75pt;
    line-height: 1.78;
  }

  .magazine-main .magazine-feature .opening::first-letter {
    font-size: 3.45em;
    padding-right: 8px;
    padding-top: 4px;
  }

  .gallery-item,
  .pattern-poem-display,
  .pattern-poem-figure,
  .magazine-poem-feature {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .magazine-gallery-feature .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.18in;
    margin-top: 0.18in;
  }

  .magazine-gallery-feature .gallery-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 3.85in;
    justify-self: center;
  }

  .gallery-item {
    border-radius: 0;
    border: 1px solid #d7ccbd;
    background: #faf6ef;
    box-shadow: none;
  }

  .gallery-item img {
    max-height: 3.45in;
    object-fit: cover;
  }

  .gallery-item figcaption {
    padding: 0.1in 0.12in 0.12in;
    font-size: 10.5pt;
  }

  .magazine-pattern-feature {
    max-width: 5.3in;
    margin-left: auto;
    margin-right: auto;
  }

  .pattern-poem-display {
    margin-bottom: 0.22in;
  }

  .pattern-poem-figure {
    width: 100%;
    border: 1px solid #d7ccbd;
    border-radius: 0;
    background: #faf6ef;
  }

  .pattern-poem-figure img {
    box-shadow: none;
  }

  .magazine-poem-feature {
    max-width: 5.45in;
    margin-left: auto;
    margin-right: auto;
  }

  .magazine-poem-feature .poem,
  .magazine-poem-feature p {
    max-width: none;
  }

  .magazine-prose-feature {
    column-count: 2;
    column-gap: 0.32in;
    column-fill: auto;
  }

  .magazine-prose-feature > .byline,
  .magazine-prose-feature > .magazine-piece-title,
  .magazine-prose-feature > .story-label {
    column-span: all;
  }

  .magazine-prose-feature p {
    margin: 0 0 0.14in;
    orphans: 3;
    widows: 3;
  }
}

main > p:first-child:not(.magazine-kicker):not(.intro) {
  font-size: 22px;
}

@media (max-width: 820px) {
  .header {
    height: 300px;
  }

  .navbar {
    gap: 12px;
    padding: 14px 12px;
  }

  .navbar a {
    font-size: 16px;
    padding: 7px 11px;
  }

  main {
    margin: 26px 14px 56px;
    padding: 36px 24px 54px;
  }

  .home-main {
    margin: 24px auto 56px;
    padding: 28px 20px 40px;
  }

  .plain-main {
    margin: 24px auto 56px;
    padding: 28px 20px 40px;
  }

  p {
    font-size: 19px;
  }

  main h2 {
    font-size: 34px;
  }

  main h3,
  .magazine-piece-title {
    font-size: 26px;
  }

  .magazine-main {
    padding: 34px 24px 54px;
  }

  .magazine-brand {
    font-size: clamp(38px, 10vw, 62px);
  }

  .magazine-subtitle {
    font-size: 20px;
  }

  .magazine-meta {
    flex-direction: column;
    gap: 8px;
  }

  .magazine-toolbar {
    justify-content: flex-end;
    margin: 0 0 18px;
  }

  .art-spread {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header {
    height: 230px;
  }

  h1 {
    font-size: clamp(38px, 9vw, 54px);
    max-width: 96%;
  }

  main {
    border-radius: 18px;
    padding: 28px 18px 44px;
  }

  .home-main {
    border-radius: 0;
    padding: 24px 18px 34px;
  }

  .plain-main {
    border-radius: 0;
    padding: 24px 18px 34px;
  }

  .magazine-deck {
    font-size: 21px;
  }

  .magazine-main {
    padding: 28px 18px 44px;
  }

  .section-heading {
    gap: 10px;
    margin: 38px 0 22px;
  }

  .print-button {
    width: 100%;
    text-align: center;
  }
}
