:root {
  color-scheme: light;
  --ink: #101624;
  --text: #1f2937;
  --muted: #647083;
  --line: #d7dde7;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --mist: #eef3f7;
  --green: #006847;
  --red: #ce2b37;
  --blue: #1c4f7a;
  --gold: #87651f;
  --shadow: 0 18px 55px rgba(16, 22, 36, 0.12);
  --max: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #d9e2ef;
  --muted: #a5b2c4;
  --line: #2f3a4c;
  --paper: #0b101a;
  --soft: #121a27;
  --mist: #172132;
  --green: #40c998;
  --red: #ff6372;
  --blue: #8bc9ff;
  --gold: #d9bd76;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top right, rgba(64, 201, 152, 0.1), transparent 28rem),
    radial-gradient(circle at top left, rgba(255, 99, 114, 0.08), transparent 24rem),
    var(--paper);
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.service-strip {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.55rem clamp(1rem, 4vw, 3rem) 0.7rem;
  color: #fff;
  background:
    linear-gradient(90deg, var(--green) 0 33%, #fff 33% 66%, var(--red) 66% 100%) bottom / 100% 3px no-repeat,
    var(--ink);
  font-size: 0.9rem;
}

.service-strip span {
  color: rgba(255, 255, 255, 0.76);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(215, 221, 231, 0.9);
  backdrop-filter: blur(14px);
}

html[data-theme="dark"] .site-header {
  background: rgba(11, 16, 26, 0.94);
  border-bottom-color: rgba(47, 58, 76, 0.92);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  min-width: 11rem;
}

.brand img {
  display: block;
  width: min(17rem, 58vw);
  height: auto;
}

html[data-theme="dark"] .brand {
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem 0.45rem;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.site-nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
}

.theme-toggle {
  justify-content: center;
  width: 2.75rem;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
}

.theme-toggle::before {
  content: "";
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: inset 0 0 0 0.18rem var(--soft);
}

.site-nav a:hover,
.site-nav a:focus,
.theme-toggle:hover,
.theme-toggle:focus {
  color: var(--ink);
  background: var(--soft);
}

html[data-theme="dark"] .site-nav a:hover,
html[data-theme="dark"] .site-nav a:focus,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .theme-toggle:focus {
  color: #ffffff;
  background: #1a2434;
}

html[data-theme="dark"] .theme-toggle::before {
  background: #f8fafc;
  box-shadow: inset -0.35rem -0.35rem 0 #1a2434;
}

.site-nav .nav-cta {
  color: #fff;
  background: var(--ink);
}

.site-nav .nav-cta:hover,
.site-nav .nav-cta:focus {
  color: #fff;
  background: var(--blue);
}

.hero {
  min-height: min(68vh, 38rem);
  display: grid;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(11, 18, 32, 0.92), rgba(11, 18, 32, 0.64) 52%, rgba(11, 18, 32, 0.12)),
    url("images/hero-vatican.jpg") center / cover no-repeat;
}

.hero-inner {
  width: min(var(--max), 100%);
  padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 3rem) clamp(2.6rem, 6vw, 4.5rem);
  color: #fff;
}

.status,
.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3,
p,
dd {
  overflow-wrap: break-word;
}

h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .facts strong,
html[data-theme="dark"] .archive-hero h1,
html[data-theme="dark"] .record-card {
  color: #f6f8fc;
}

.hero h1 {
  color: #fff;
  font-size: clamp(3rem, 6.5vw, 5.9rem);
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.28;
}

.hero-copy {
  max-width: 44rem;
  margin: 1.25rem 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.8rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  color: #fff;
  background: var(--red);
}

.button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
}

.button:hover,
.button:focus {
  transform: translateY(-1px);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 38rem;
  margin: 2.5rem 0 0;
  padding: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.hero-meta div {
  padding: 1rem;
  background: rgba(7, 13, 24, 0.42);
}

.hero-meta dt {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-meta dd {
  margin: 0.15rem 0 0;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  color: #fff;
  background: var(--ink);
}

.notice span {
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.9rem;
}

.section {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.25rem) clamp(1rem, 4vw, 3rem);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(var(--max), calc(100% - 2rem));
  margin-top: 0;
  padding: 0;
  background: var(--line);
  box-shadow: var(--shadow);
}

.facts div {
  min-height: 7.5rem;
  padding: 1.35rem;
  background: #fff;
}

html[data-theme="dark"] .facts div,
html[data-theme="dark"] .tier,
html[data-theme="dark"] .news-list article,
html[data-theme="dark"] .job-panel > div,
html[data-theme="dark"] .data-table-wrap,
html[data-theme="dark"] .record-card,
html[data-theme="dark"] .download-grid a {
  background: #111827;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.fact-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.facts strong {
  display: block;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.2vw, 1.85rem);
  line-height: 1.15;
}

.facts a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.split {
  display: grid;
  grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 6vw, 5.5rem);
}

.section-copy {
  color: var(--text);
  font-size: 1.03rem;
}

.section-copy p,
.section-heading p,
.section-intro {
  margin: 1rem 0 0;
}

.check-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 1.45rem;
  margin-top: 0.8rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.72rem;
  height: 0.72rem;
  background: linear-gradient(135deg, var(--green) 0 50%, var(--red) 50% 100%);
}

.band {
  width: 100%;
  max-width: none;
  background: linear-gradient(180deg, var(--soft), #fff);
}

html[data-theme="dark"] .band {
  background: linear-gradient(180deg, #121a27, #0b101a);
}

.band > * {
  width: min(var(--max), 100%);
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.tier,
.news-list article,
.job-panel > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 22, 36, 0.06);
}

.tier {
  min-height: 11.5rem;
  padding: 1.2rem;
}

.tier span {
  display: none;
  margin-bottom: 1rem;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.tier p {
  min-height: 3rem;
  margin: 0;
  color: var(--muted);
}

.tier strong {
  display: block;
  margin-top: 1rem;
  color: var(--green);
}

.small-note {
  margin-top: 1.25rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  font-size: 0.92rem;
}

.news-list {
  display: grid;
  gap: 0.8rem;
}

.news-list article {
  position: relative;
  padding: 1rem 1rem 1rem 1.2rem;
  border-left: 4px solid var(--green);
}

.news-list article:nth-child(even) {
  border-left-color: var(--red);
}

.news-list time {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--red);
  font-weight: 800;
  font-size: 0.86rem;
}

.archive-link {
  margin: 1.2rem 0 0;
}

.job-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.job-panel > div {
  padding: 1.45rem;
}

.job-panel .button {
  margin-top: 0.65rem;
}

.contact {
  display: grid;
  grid-template-columns: minmax(15rem, 0.78fr) minmax(0, 1.32fr);
  gap: clamp(2rem, 6vw, 5.5rem);
}

.contact-block {
  display: grid;
  gap: 0.65rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: var(--soft);
  font-style: normal;
}

.contact-block a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--blue);
  font-weight: 800;
}

.social {
  padding-top: 0;
}

.social h2 {
  font-size: clamp(1.35rem, 3vw, 2.1rem);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.site-footer {
  padding: 2rem clamp(1rem, 4vw, 3rem);
  color: rgba(255, 255, 255, 0.74);
  background: var(--ink);
}

.site-footer p {
  width: min(var(--max), 100%);
  margin: 0.4rem auto;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: #fff;
}

.archive-hero {
  display: grid;
  grid-template-columns: minmax(18rem, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 6vw, 5rem);
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 3rem);
  background:
    linear-gradient(90deg, rgba(0, 104, 71, 0.08), rgba(206, 43, 55, 0.06)),
    var(--soft);
}

html[data-theme="dark"] .archive-hero {
  background:
    linear-gradient(90deg, rgba(64, 201, 152, 0.1), rgba(255, 99, 114, 0.08)),
    #101827;
}

.archive-hero h1 {
  max-width: 12ch;
  color: var(--ink);
  font-size: clamp(2.7rem, 5.6vw, 5.1rem);
}

.archive-hero .hero-copy {
  color: var(--text);
}

.archive-facts {
  margin-top: 0;
}

.plain-heading {
  padding: 0 0 1.5rem;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

html[data-theme="dark"] .data-table th {
  background: #070d18;
}

.data-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: #fff;
  background: var(--ink);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  width: 8.5rem;
  color: var(--red);
  font-weight: 850;
}

.data-table a {
  color: var(--blue);
  font-weight: 850;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.archive-news-list {
  width: min(var(--max), 100%);
  margin: 2rem auto 0;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.detail-box {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  background: var(--soft);
}

.detail-box p {
  margin: 0.45rem 0;
}

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

.record-card {
  display: block;
  min-height: 7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(16, 22, 36, 0.06);
}

.record-card:hover,
.record-card:focus {
  border-color: rgba(28, 79, 122, 0.45);
  transform: translateY(-1px);
}

.record-card span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 850;
}

.record-card strong {
  display: block;
  line-height: 1.3;
}

.update-hero h1 {
  max-width: 14ch;
}

.archive-table-wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 2rem auto 0;
}

.archive-table {
  min-width: 52rem;
  font-size: 0.92rem;
}

.archive-table td:first-child {
  width: 4rem;
  color: var(--muted);
}

.archive-table td:nth-child(3) {
  color: var(--red);
  font-weight: 850;
}

.news-list h3 a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.news-list h3 a:hover,
.news-list h3 a:focus {
  color: var(--blue);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.download-grid a {
  display: block;
  min-height: 5.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(16, 22, 36, 0.06);
}

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

@media (max-width: 780px) {
  .service-strip {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .notice,
  .split,
  .contact,
  .job-panel,
  .archive-hero {
    grid-template-columns: 1fr;
  }

  .notice span {
    white-space: normal;
  }

  .facts {
    margin-top: 0;
    width: min(var(--max), calc(100% - 2rem));
  }

  .hero {
    min-height: 29rem;
  }

  .hero-inner {
    padding-top: 3rem;
    padding-bottom: 2.5rem;
  }

  .archive-hero h1 {
    max-width: 14ch;
  }
}

@media (max-width: 640px) {
  .facts,
  .tier-grid,
  .download-grid,
  .record-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 1rem;
    border-bottom: 1px solid var(--line);
  }

  .data-table tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    padding: 0 0 0.55rem;
    border-bottom: 0;
  }

  .data-table td:last-child {
    padding-bottom: 0;
  }

  .data-table td:first-child {
    width: 100%;
    margin-bottom: 0.35rem;
    color: var(--red);
  }

  .data-table td::before {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .data-table td:nth-child(1)::before {
    content: "Date";
  }

  .data-table td:nth-child(2)::before {
    content: "Item";
  }

  .archive-table td:first-child {
    color: var(--muted);
  }

  .archive-table td:nth-child(1)::before {
    content: "Record";
  }

  .archive-table td:nth-child(2)::before {
    content: "Category";
  }

  .archive-table td:nth-child(3)::before {
    content: "Capture";
  }

  .archive-table td:nth-child(4)::before {
    content: "Original";
  }

  .archive-table td:nth-child(5)::before {
    content: "Wayback";
  }

  .archive-table td:nth-child(6)::before {
    content: "Board";
  }

  .archive-table td:nth-child(7)::before {
    content: "ID";
  }
}

@media (max-width: 520px) {
  .service-strip {
    padding: 0.45rem 1rem;
  }

  .service-strip span {
    display: none;
  }

  .site-header {
    position: relative;
    padding: 0.75rem 1rem;
  }

  .brand img {
    width: min(13rem, 54vw);
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.25rem;
    width: 100%;
  }

  .notice {
    padding: 0.85rem 1rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .hero h1,
  .archive-hero h1 {
    font-size: 2.38rem;
  }

  .site-nav a,
  .theme-toggle {
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.38rem 0.45rem;
    font-size: 0.84rem;
  }

  .theme-toggle {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    width: 2.35rem;
    padding: 0;
  }

  .hero {
    min-height: 24rem;
  }

  .hero-inner {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .hero-meta {
    display: none;
  }
}
