/* Restoration of Catholic Tradition | jack007.com
   Palette: Marian blue + gilt frame, rubric red accents, stone paper. */
/* Self-hosted fonts (SIL Open Font License) */
@font-face { font-family: "Cinzel"; src: url("../fonts/cinzel-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("../fonts/cinzel-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --lapis: #1d2b4f;
  --lapis-deep: #131c35;
  --rubric: #9b1c1c;
  --gilt: #a9803a;
  --gilt-light: #d9b86c;
  --paper: #f8f7f4;
  --stone: #ece8e0;
  --ink: #23211e;
  --muted: #5d5850;
  --rule: #d6cfc1;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --text: "EB Garamond", Garamond, Georgia, serif;
  --measure: 40rem;
  --wide: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.25rem;
  line-height: 1.68;
  font-feature-settings: "liga", "onum";
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lapis); text-decoration-color: var(--gilt); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--rubric); text-decoration-color: var(--rubric); }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 3px; }
em { font-style: italic; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header and navigation ---------- */
.site-header { background: var(--lapis-deep); color: #fff; position: relative; z-index: 20; border-bottom: 1px solid var(--gilt); }
.site-header .inner { max-width: var(--wide); margin: 0 auto; padding: .9rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: .7rem; font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: .06em; line-height: 1.2; }
.brand:hover { color: var(--gilt-light); }
.brand svg { flex: none; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(217,184,108,.6); color: #fff; font: 600 1rem var(--text); padding: .35rem .8rem; cursor: pointer; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; gap: .2rem; align-items: center; }
.nav a, .nav .sub-toggle { color: #f1ece2; text-decoration: none; font-family: var(--text); font-size: 1.08rem; padding: .45rem .7rem; display: block; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav .sub-toggle:hover, .nav a[aria-current="page"] { color: var(--gilt-light); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gilt); text-underline-offset: .35em; }
.has-sub { position: relative; }
.sub-toggle::after { content: ""; display: inline-block; width: .38em; height: .38em; margin-left: .45em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.2em) rotate(45deg); }
.sub { position: absolute; right: 0; top: 100%; min-width: 17rem; background: var(--lapis); border: 1px solid var(--gilt); padding: .4rem 0; display: none; }
.sub a { padding: .45rem 1.1rem; }
.has-sub:hover .sub, .has-sub:focus-within .sub, .has-sub.open .sub { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--lapis-deep); border-bottom: 1px solid var(--gilt); display: none; padding: .5rem 1.25rem 1rem; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .sub { position: static; display: block; border: 0; background: none; padding: 0 0 0 1rem; min-width: 0; }
  .sub-toggle::after { display: none; }
  .sub-toggle { cursor: default; color: var(--gilt-light) !important; }
}

/* ---------- Home hero ---------- */
.hero { position: relative; color: #fff; text-align: center; overflow: hidden; background: var(--lapis-deep); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(19,28,53,.25) 0%, rgba(19,28,53,.85) 75%); }
.hero .inner { position: relative; z-index: 1; max-width: 54rem; margin: 0 auto; padding: clamp(5rem, 14vw, 9.5rem) 1.25rem clamp(4.5rem, 12vw, 8rem); }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.1rem, 5.6vw, 4rem); line-height: 1.12; letter-spacing: .03em; margin: 0; text-shadow: 0 2px 18px rgba(0,0,0,.45); }
.hero h1 span { display: block; font-size: .5em; font-weight: 500; letter-spacing: .18em; color: var(--gilt-light); margin-top: .9rem; }
.motto { font-family: var(--display); font-size: clamp(.95rem, 1.8vw, 1.15rem); letter-spacing: .32em; color: #f1ece2; margin: 2.4rem auto 0; display: flex; align-items: center; justify-content: center; gap: 1rem; }
.motto::before, .motto::after { content: ""; height: 1px; width: clamp(2rem, 8vw, 5rem); background: var(--gilt-light); }
.motto-translation { font-style: italic; color: #ece6d8; margin: .5rem 0 0; font-size: 1.05rem; }
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .motto, .motto-translation { animation: rise 1.1s ease-out both; }
  .motto { animation-delay: .35s; }
  .motto-translation { animation-delay: .55s; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- Interior page head ---------- */
.page-head { background: var(--lapis); color: #fff; border-bottom: 3px double var(--gilt); }
.page-head .inner { max-width: var(--wide); margin: 0 auto; padding: 2.6rem 1.25rem 2.4rem; }
.crumbs { font-size: 1rem; margin: 0 0 .8rem; color: #cfc8b8; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--gilt-light); }
.crumbs a { color: #e9e3d6; }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 4.4vw, 3rem); line-height: 1.15; letter-spacing: .02em; margin: 0; }
.page-head .sub-title { font-style: italic; color: var(--gilt-light); margin: .5rem 0 0; font-size: 1.25rem; }

/* ---------- Content ---------- */
main { display: block; }
.section { padding: clamp(2.8rem, 6vw, 4.5rem) 1.25rem; }
.section.stone { background: var(--stone); }
.prose { max-width: var(--measure); margin: 0 auto; }
.wide { max-width: var(--wide); margin: 0 auto; }
.prose p { margin: 0 0 1.15em; }
.prose h2, .wide h2, .section-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.35rem, 2.6vw, 1.75rem); letter-spacing: .03em; line-height: 1.25; color: var(--lapis); margin: 2.2em 0 .8em; }
.prose h2:first-child, .section-title:first-child { margin-top: 0; }
.prose h2::after, .section-title::after { content: ""; display: block; width: 3rem; height: 2px; background: var(--rubric); margin-top: .55rem; }
.center { text-align: center; }
.center.section-title::after, .center .section-title::after { margin-left: auto; margin-right: auto; }

/* Rubricated drop cap, as in the old missals */
.lede::first-letter {
  font-family: var(--display); color: var(--rubric); float: left;
  font-size: 3.9em; line-height: .82; padding: .08em .12em 0 0; font-weight: 600;
}
.lede { font-size: 1.32rem; }

/* Museum-style figure with caption plate */
figure { margin: 2.2rem 0; }
.plate { background: #fff; padding: .6rem; border: 1px solid var(--rule); }
.plate img { width: 100%; }
figcaption { font-size: 1.02rem; line-height: 1.5; color: var(--muted); padding: .75rem .2rem .1rem; border-top: 0; }
figcaption strong { display: block; color: var(--ink); font-weight: 600; font-size: 1.08rem; }
.fig-wide { max-width: 52rem; margin-left: auto; margin-right: auto; }
.fig-right { float: right; width: min(46%, 18rem); margin: .4rem 0 1.2rem 1.8rem; }
.fig-left { float: left; width: min(46%, 18rem); margin: .4rem 1.8rem 1.2rem 0; }
@media (max-width: 640px) { .fig-right, .fig-left { float: none; width: 100%; margin: 1.6rem 0; } }
.clear { clear: both; }
a.lb { display: block; cursor: zoom-in; }

/* Two-column feature: text + image */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; max-width: var(--wide); margin: 0 auto; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.split figure { margin: 0; }

/* Reasons list with small cross markers */
.reasons { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 2rem; }
.reasons li { padding-left: 1.7rem; position: relative; }
.reasons li::before { content: "\271D"; position: absolute; left: 0; top: .05em; color: var(--rubric); font-size: .95em; }

/* Exhibit grid on home page */
.exhibits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.2rem 1.8rem; margin-top: 2rem; }
.exhibit.feature { grid-column: span 2; }
.exhibit.feature .frame img { object-position: 50% 35%; }
@media (max-width: 900px) { .exhibits { grid-template-columns: repeat(2, minmax(0, 1fr)); }  }
@media (max-width: 560px) { .exhibits { grid-template-columns: 1fr; } .exhibit.feature { grid-column: auto; } }
.exhibit { text-decoration: none; color: var(--ink); display: block; }
.exhibit .frame { height: 15rem; overflow: hidden; background: var(--lapis-deep); border: 1px solid var(--rule); }
.exhibit .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.exhibit:hover .frame img { transform: scale(1.04); }
.exhibit h3 { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: .02em; color: var(--lapis); margin: .9rem 0 .25rem; line-height: 1.3; }
.exhibit:hover h3 { color: var(--rubric); }
.exhibit p { margin: 0; font-size: 1.05rem; color: var(--muted); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .exhibit .frame img { transition: none; } }

.button { display: inline-block; font-family: var(--text); font-weight: 600; font-size: 1.1rem; color: #fff; background: var(--lapis); border: 1px solid var(--lapis); padding: .65rem 1.5rem; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--rubric); border-color: var(--rubric); color: #fff; }

/* Latin inscription block */
.inscription { text-align: center; margin: 2rem 0 2.4rem; padding: 1.8rem 1.2rem; border-top: 1px solid var(--gilt); border-bottom: 1px solid var(--gilt); }
.inscription .latin { font-family: var(--display); font-size: clamp(1.05rem, 2.4vw, 1.35rem); letter-spacing: .06em; color: var(--lapis); margin: 0 0 .7rem; line-height: 1.5; }
.inscription .english { font-style: italic; margin: 0; color: var(--muted); }

/* Side-by-side Spanish/English inscription */
.translation { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.6rem 0 2rem; }
.translation > div { background: #fff; border: 1px solid var(--rule); padding: 1.1rem 1.3rem; }
.translation h3 { font-family: var(--display); font-size: .95rem; letter-spacing: .08em; color: var(--rubric); margin: 0 0 .5rem; font-weight: 600; }
.translation p { margin: 0; line-height: 1.6; }
@media (max-width: 640px) { .translation { grid-template-columns: 1fr; } }

/* Authentic document translation */
.document { background: #fff; border: 1px solid var(--rule); outline: 1px solid var(--rule); outline-offset: -8px; padding: clamp(1.4rem, 4vw, 2.4rem); margin: 1.6rem 0; font-size: 1.15rem; }
.document p:last-child { margin-bottom: 0; }
.document .salutation { font-variant: small-caps; letter-spacing: .03em; }

/* Gallery */
.gallery-group { margin-bottom: 3.2rem; }
.gallery-group > p { max-width: var(--measure); color: var(--muted); margin: 0 0 1.4rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 1.3rem; }
.grid figure { margin: 0; }
.grid .plate { padding: .45rem; }
.grid .plate a { aspect-ratio: 1 / 1; overflow: hidden; background: var(--stone); }
.grid .plate img { width: 100%; height: 100%; object-fit: cover; }
.grid figcaption { font-size: .98rem; }

/* Links page */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.link-list li:first-child { padding-top: 0; }
.link-list h2 { font-family: var(--display); font-size: 1.2rem; letter-spacing: .03em; margin: 0 0 .4rem; font-weight: 600; }
.link-list h2::after { display: none; }
.link-list p { margin: 0; }
.link-list .also { margin-top: .5rem; }

/* Dedication (footer) */
.site-footer .dedication { display: flex; gap: 1.2rem; align-items: flex-start; }
.site-footer .dedication img { width: 5.5rem; flex: none; border: 1px solid var(--gilt); padding: .25rem; background: #fff; }
.site-footer .dedication p { margin: 0 0 .2rem; }
.site-footer .dedication .latin { font-family: var(--display); color: var(--gilt-light); letter-spacing: .06em; margin-top: .3rem; }

/* Contact form */
.contact-block { background: var(--lapis); color: #f1ece2; }
.contact-block .section-title { color: #fff; }
.contact-block .section-title::after { background: var(--gilt-light); }
.contact-block a { color: var(--gilt-light); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; margin-top: 1.4rem; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-size: 1.02rem; margin-bottom: .3rem; }
.form input, .form textarea { width: 100%; font: 1.1rem var(--text); padding: .6rem .75rem; border: 1px solid #b7ad99; background: #fff; color: var(--ink); border-radius: 0; }
.form textarea { min-height: 9rem; resize: vertical; }
.form .req { color: var(--rubric); }
.contact-block .form .req { color: var(--gilt-light); }
.contact-block .button { background: var(--gilt); border-color: var(--gilt); color: var(--lapis-deep); }
.contact-block .button:hover { background: #fff; border-color: #fff; color: var(--lapis-deep); }
.hidden-field { position: absolute !important; left: -9999px !important; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--lapis-deep); color: #c9c2b2; font-size: 1.02rem; border-top: 1px solid var(--gilt); }
.site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 2.6rem 1.25rem; display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; }
.site-footer a { color: #ebe5d8; }
.site-footer .fname { font-family: var(--display); color: #fff; letter-spacing: .05em; font-size: 1.05rem; margin: 0 0 .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 1.5rem; }
.site-footer li { margin-bottom: .3rem; break-inside: avoid; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(217,184,108,.35); padding-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; font-size: .95rem; }
@media (max-width: 720px) { .site-footer .inner { grid-template-columns: 1fr; } }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10,14,26,.92); }
.lightbox .lb-inner { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 4rem 1.5rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 9rem); width: auto; height: auto; border: 1px solid var(--gilt); background: #fff; }
.lightbox .lb-caption { color: #eee8db; text-align: center; max-width: 44rem; margin-top: 1rem; font-size: 1.08rem; line-height: 1.5; }
.lightbox button { position: absolute; background: rgba(19,28,53,.7); color: #fff; border: 1px solid rgba(217,184,108,.6); font: 1.6rem/1 var(--text); width: 2.8rem; height: 2.8rem; cursor: pointer; }
.lightbox button:hover { background: var(--rubric); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: .8rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .8rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox .lb-inner { padding: 3.5rem .8rem 1rem; } .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; } }

@media print {
  .site-header, .contact-block, .site-footer, .nav-toggle { display: none; }
  body { background: #fff; font-size: 12pt; }
}
@media (min-width: 900px) { .grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; } }
.gallery-group .grid { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1rem; }
.gallery-intro { margin-bottom: 2.8rem; }
@media (max-width: 560px) { .motto { letter-spacing: .18em; gap: .6rem; } .motto::before, .motto::after { width: 1.2rem; } }

/* ---------- Collection item pages ---------- */
.item-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.8rem, 4vw, 3.2rem); align-items: start; max-width: var(--wide); margin: 0 auto 2.6rem; }
.item-top figure { margin: 0; }
.item-top figure.tall { max-width: 22rem; justify-self: center; }
@media (max-width: 820px) { .item-top { grid-template-columns: 1fr; } }
.details { background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--gilt); padding: 1.4rem 1.5rem 1.2rem; }
.details h2 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: .04em; color: var(--lapis); margin: 0 0 .9rem; }
.details dl { margin: 0; display: grid; grid-template-columns: 7.2rem 1fr; gap: .55rem 1rem; font-size: 1.06rem; line-height: 1.45; }
.details dt { color: var(--rubric); font-weight: 600; }
.details dd { margin: 0; }
@media (max-width: 420px) { .details dl { grid-template-columns: 1fr; gap: .1rem; } .details dd { margin-bottom: .55rem; } }
.significance { border-left: 3px solid var(--rubric); padding-left: clamp(1rem, 3vw, 1.8rem); }
.significance h2 { margin-top: 0; }
.significance p { font-size: 1.28rem; }
.prose h3 { font-family: var(--display); font-weight: 600; font-size: 1.12rem; letter-spacing: .03em; color: var(--lapis); margin: 1.8em 0 .6em; }
.exhibit .meta { color: var(--rubric); font-size: .98rem; margin: 0 0 .3rem; font-style: italic; }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; } }
.button.ghost { background: transparent; color: var(--lapis); }
.button.ghost:hover { background: var(--lapis); color: #fff; border-color: var(--lapis); }
.exhibits:not(:has(.feature)) .exhibit .frame { height: 13.5rem; }
