:root {
  --ink: #22364f;
  --muted: #52677a;
  --paper: #f7f9fb;
  --vellum: #e6ebf1;
  --wine: #3a6ea5;
  --wine-dark: #2e4e7e;
  --gold: #dce7e2;
  --olive: #2f4f4f;
  --stone: #bfd0df;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(46, 78, 126, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(28, 36, 42, 0.74) 0%, rgba(32, 38, 42, 0.48) 48%, rgba(32, 38, 42, 0.3) 100%),
    linear-gradient(0deg, rgba(20, 24, 26, 0.18), rgba(20, 24, 26, 0.02)),
    url("assets/martyrologe-hero.png") center / cover no-repeat;
  color: var(--white);
}

.hero::after {
  display: none;
}

.topbar {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.66);
  color: var(--white);
  font-size: 0.88rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.84);
}

.nav-links a:hover {
  color: var(--white);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 40px));
  margin: 22px auto 18px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker.dark {
  color: var(--wine);
}

.hero-parish {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto 10px;
  color: rgba(255, 255, 255, 0.68);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.hero-domain {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(1.82rem, 2.75vw, 2.6rem);
  line-height: 1;
  font-weight: 500;
}

.lead {
  max-width: 660px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.98rem, 1.28vw, 1.08rem);
  line-height: 1.42;
}

.hero-count {
  width: fit-content;
  margin: 14px 0 0;
  padding: 7px 10px;
  color: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.42);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.button.primary {
  background: var(--white);
  color: var(--wine-dark);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.58);
  color: var(--white);
}

.button.light {
  border-color: rgba(255, 255, 255, 0.6);
}

.section-inner {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.today-band {
  position: relative;
  z-index: 2;
  padding: 58px 0 76px;
}

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 470px);
  gap: 44px;
  align-items: end;
}

.today-grid h2,
.section-heading h2,
.reading-layout h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 2.25rem);
  line-height: 1.08;
  font-weight: 500;
}

.section-copy,
.reading-layout p,
.guide-section p,
.source-section p,
.about-section p,
.footer p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.section-copy.narrow {
  max-width: 620px;
  margin-bottom: 0;
}

.catalog-count {
  margin: 14px 0 0;
  color: var(--blue);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.daily-entry {
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--stone);
  box-shadow: var(--shadow);
}

.entry-date,
.month-day,
.tag {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-date,
.month-day {
  color: var(--wine);
}

.daily-entry h3,
.saint-card h3,
.about-section h2 {
  margin: 12px 0 10px;
  font-size: 1.18rem;
  font-weight: 500;
}

.daily-entry p,
.saint-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.daily-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.daily-toggle {
  width: fit-content;
  margin-top: 18px;
  padding: 11px 14px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(46, 78, 126, 0.32);
  border-radius: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.daily-toggle:hover {
  background: var(--green-soft);
  color: var(--olive);
}

.today-grid.has-many-entries {
  grid-template-columns: 1fr;
  align-items: start;
}

.today-grid.has-many-entries .daily-entry {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 18px 26px;
}

.today-grid.has-many-entries .daily-entry h3,
.today-grid.has-many-entries .daily-entry .daily-toggle,
.today-grid.has-many-entries .daily-entry .text-link {
  grid-column: 1;
}

.today-grid.has-many-entries .daily-list {
  grid-column: 2;
  grid-row: 1 / span 4;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.daily-item {
  padding-top: 14px;
  border-top: 1px solid rgba(46, 78, 126, 0.18);
}

.daily-item.featured-daily {
  padding: 16px;
  background: var(--gold);
  border: 1px solid rgba(47, 79, 79, 0.34);
}

.daily-item h4 {
  margin: 0 0 7px;
  font-size: 1.08rem;
  font-weight: 600;
}

.daily-item span {
  display: block;
  margin-top: 9px;
  color: var(--olive);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.source-badge {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 8px;
  background: var(--gold);
  color: var(--olive);
  border: 1px solid rgba(47, 79, 79, 0.32);
  border-radius: 4px;
  font: 700 0.72rem Arial, Helvetica, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--wine);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.result-count {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.editorial-band {
  padding: 0 0 78px;
}

.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  gap: 34px;
  align-items: end;
}

.editorial-grid h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 2.25rem);
  line-height: 1.08;
  font-weight: 500;
}

.progress-panel {
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--stone);
  box-shadow: var(--shadow);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
}

.progress-track,
.mini-progress {
  overflow: hidden;
  height: 10px;
  margin-top: 18px;
  background: #d5dee8;
  border-radius: 999px;
}

.progress-track span,
.mini-progress span {
  display: block;
  height: 100%;
  background: var(--wine);
  border-radius: inherit;
}

.mini-progress {
  height: 7px;
  margin: 0 0 14px;
}

.search-section {
  padding: 78px 0 90px;
  background: var(--vellum);
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.search-section .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(680px, 1.18fr);
}

.section-heading.compact {
  align-items: start;
}

.search-box {
  display: grid;
  gap: 8px;
  font-family: Arial, Helvetica, sans-serif;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(76px, 0.24fr) minmax(140px, 0.42fr) max-content;
  gap: 10px;
  align-items: start;
}

.date-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 22px;
}

.date-action {
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--stone);
  border-radius: 4px;
  background: var(--vellum);
  color: var(--wine-dark);
  font: 700 0.82rem Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.date-action:hover {
  border-color: var(--wine-dark);
  background: var(--wine);
  color: var(--white);
}

.search-box label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-box input,
.search-box select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--wine-dark);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
  font: 1rem Arial, Helvetica, sans-serif;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.filter {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--wine-dark);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 700 0.86rem Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  background: var(--wine);
  border-color: var(--wine);
  color: var(--white);
}

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

.saint-card {
  min-height: 335px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--white);
  border: 1px solid rgba(46, 78, 126, 0.18);
}

.saint-card.featured-saint {
  border-color: rgba(47, 79, 79, 0.52);
  box-shadow: 0 16px 38px rgba(58, 110, 165, 0.12);
}

.saint-card.hidden {
  display: none;
}

.saints-grid.date-view {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.saints-grid.date-view .saint-card {
  min-height: 0;
  padding: 18px;
}

.saints-grid.date-view .saint-card h3 {
  margin: 8px 0 8px;
  font-size: 1.18rem;
}

.saints-grid.date-view .saint-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.5;
}

.saints-grid.date-view .meta-list {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.saints-grid.date-view .tag {
  padding-top: 12px;
}

.tag {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 20px;
  color: var(--olive);
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(46, 78, 126, 0.16);
}

.meta-list div,
.meta-list dt,
.meta-list dd {
  margin: 0;
}

.meta-list dt {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-list dd {
  margin-top: 4px;
  color: var(--ink);
  line-height: 1.35;
}

.month-section {
  padding: 82px 0 90px;
  background: var(--paper);
}

.feast-section {
  padding: 82px 0 90px;
  background: var(--vellum);
}

.feast-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  align-items: start;
}

.feast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feast-card,
.movable-feasts {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--stone);
}

.feast-card h3,
.movable-feasts h3 {
  margin: 10px 0 10px;
  font-size: 1.18rem;
  font-weight: 500;
}

.feast-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.movable-feasts {
  position: sticky;
  top: 18px;
}

.movable-feasts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.month-card {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--stone);
}

.month-card h3 {
  margin: 0;
  color: var(--wine);
  font-size: 1.2rem;
  font-weight: 500;
  text-transform: capitalize;
}

.month-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
}

.month-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 10px;
  font-family: Arial, Helvetica, sans-serif;
}

.month-metrics span {
  padding: 5px 8px;
  background: var(--vellum);
  border: 1px solid var(--stone);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.month-card ul,
.source-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.month-card a {
  color: inherit;
  text-decoration: none;
}

.month-card a:hover {
  color: var(--wine);
}

.month-card a span {
  color: var(--wine);
  font-weight: 700;
}

.reading-band {
  padding: 88px 0;
  background: var(--wine-dark);
  color: var(--white);
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 54px;
  align-items: center;
}

.reading-layout p {
  color: rgba(255, 255, 255, 0.8);
}

blockquote {
  margin: 0;
  padding: 30px 0 30px 30px;
  border-left: 2px solid var(--gold);
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.35;
}

blockquote p {
  margin: 0;
  color: var(--white);
}

.about-section {
  padding: 82px 0;
}

.guide-section {
  padding: 86px 0;
  background: var(--white);
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 52px;
}

.guide-layout h2,
.source-grid h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.25vw, 2.25rem);
  line-height: 1.08;
  font-weight: 500;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.guide-list article {
  padding: 22px;
  border: 1px solid var(--stone);
  background: var(--paper);
}

.guide-list span {
  color: var(--gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.guide-list h3,
.source-grid h3 {
  margin: 12px 0 8px;
  font-size: 1.18rem;
  font-weight: 500;
}

.guide-list p {
  margin: 0;
}

.source-section {
  padding: 82px 0;
  background: var(--gold);
}

.source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 42px;
}

.source-grid article:last-child {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--stone);
}

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

.columns article {
  padding-top: 24px;
  border-top: 1px solid var(--stone);
}

.footer {
  padding: 42px 0;
  background: var(--wine-dark);
  color: var(--white);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.footer h2,
.footer p {
  margin: 0;
}

.footer p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.footer-contact {
  color: rgba(255, 255, 255, 0.86);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.footer-contact:hover {
  color: var(--white);
}

.back-to-top {
  position: fixed;
  right: max(18px, calc((100vw - 1200px) / 2 + 18px));
  bottom: 22px;
  z-index: 20;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  background: var(--wine-dark);
  box-shadow: 0 14px 34px rgba(34, 54, 79, 0.22);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.back-to-top::before {
  content: "";
  width: 13px;
  height: 13px;
  border-top: 4px solid var(--white);
  border-left: 4px solid var(--white);
  transform: translateY(4px) rotate(45deg);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--wine);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .hero {
    min-height: 0;
    background-position: 61% center;
  }

  .topbar,
  .section-heading,
  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-section .section-heading {
    grid-template-columns: 1fr;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero-content {
    margin: 20px auto 18px;
  }

  .today-grid,
  .today-grid.has-many-entries .daily-entry,
  .reading-layout,
  .editorial-grid,
  .guide-layout,
  .source-grid,
  .columns {
    grid-template-columns: 1fr;
  }

  .today-grid.has-many-entries .daily-entry h3,
  .today-grid.has-many-entries .daily-entry .daily-toggle,
  .today-grid.has-many-entries .daily-entry .text-link,
  .today-grid.has-many-entries .daily-list {
    grid-column: auto;
  }

  .today-grid.has-many-entries .daily-list {
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .saints-grid,
  .month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar,
  .section-inner,
  .hero-content {
    width: min(100% - 28px, 1200px);
  }

  .hero {
    min-height: 0;
  }

  .topbar {
    padding: 10px 0;
  }

  .hero-content {
    margin: 18px auto 16px;
  }

  h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.12rem);
  }

  .nav-links {
    gap: 16px;
    font-size: 0.84rem;
  }

  .daily-entry,
  .saint-card {
    padding: 22px;
  }

  .saints-grid,
  .saints-grid.date-view,
  .month-grid,
  .feast-grid,
  .guide-list {
    grid-template-columns: 1fr;
  }

  .today-grid.has-many-entries .daily-list {
    grid-template-columns: 1fr;
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .feast-layout {
    grid-template-columns: 1fr;
  }

  .movable-feasts {
    position: static;
  }

  .search-section,
  .month-section,
  .feast-section,
  .reading-band,
  .guide-section,
  .source-section,
  .about-section {
    padding: 64px 0;
  }

  .editorial-band {
    padding-bottom: 58px;
  }

  .progress-top {
    flex-direction: column;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}
