:root {
  --burgundy: #6d0000;
  --orange: #fb5e1c;
  --orange-dark: #c9430d;
  --text: #292929;
  --muted: #666666;
  --border: #d7d7d7;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--burgundy);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 2px;
}

.site-header {
  min-height: 96px;
  color: var(--white);
  background: var(--burgundy);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: min(1600px, calc(100% - 40px));
  min-height: 96px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  width: 78px;
  height: 86px;
  object-fit: contain;
  background: var(--white);
}

.site-name {
  margin: 0;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
}

.maintenance-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 205px;
  padding: 28px 20px;
  text-align: center;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
    url("../images/colorful-abstract-background-7462.jpg");
  background-position: center;
  background-size: cover;
  border-bottom: 4px solid var(--burgundy);
}

.hero-content {
  width: min(900px, 100%);
  padding: 20px;
  background: rgba(255, 255, 255, 0.88);
}

.maintenance-hero h1 {
  margin: 0;
  color: var(--burgundy);
  font-size: clamp(1.65rem, 2.7vw, 2.35rem);
  line-height: 1.15;
}

.maintenance-message {
  margin: 7px 0 0;
  font-size: 0.95rem;
}

.page-content {
  flex: 1 0 auto;
  width: min(1600px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 26px;
}

.parish-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
}

.parish-card {
  min-width: 0;
  background: var(--white);
}

.parish-card + .parish-card {
  border-left: 1px solid var(--border);
}

.parish-summary {
  min-height: 305px;
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.parish-image {
  width: 105px;
  height: 105px;
  margin: 0 auto 10px;
}

.parish-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.parish-type {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.parish-identity h2 {
  min-height: 2.4em;
  margin: 2px 0 0;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.2;
}

.communities {
  margin-top: 9px;
  color: var(--orange-dark);
}

.communities h3 {
  margin: 5px 0 2px;
  font-size: 0.72rem;
  line-height: 1.3;
}

.communities ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  line-height: 1.35;
}

.communities li {
  display: inline;
}

.communities li:not(:last-child)::after {
  content: ", ";
}

.contact-section {
  padding: 14px 16px 16px;
}

.contact-section-title {
  margin: 0 0 7px;
  color: var(--burgundy);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.contact-block {
  padding: 9px 0;
}

.contact-block + .contact-block {
  border-top: 1px solid var(--border);
}

.contact-block h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.25;
}

.contact-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

address {
  margin-top: 5px;
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.36;
}

address p {
  margin: 0 0 5px;
}

address p:last-of-type {
  margin-bottom: 4px;
}

address span {
  display: block;
}

.email-link {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  min-height: 72px;
  padding: 25px 20px;
  color: var(--white);
  text-align: center;
  background: var(--burgundy);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1180px) {
  .parish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parish-card + .parish-card {
    border-left: 0;
  }

  .parish-card:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .parish-card:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .contact-section {
    font-size: 0.95rem;
  }

  address {
    font-size: 0.78rem;
  }
}

@media (max-width: 680px) {
  .header-content,
  .page-content {
    width: min(100% - 24px, 520px);
  }

  .site-header,
  .header-content {
    min-height: 80px;
  }

  .site-logo {
    width: 62px;
    height: 70px;
  }

  .header-brand {
    gap: 10px;
  }

  .site-name {
    font-size: 0.82rem;
  }

  .maintenance-hero {
    min-height: 180px;
    padding: 20px 12px;
  }

  .hero-content {
    padding: 16px 12px;
  }

  .maintenance-hero h1 {
    font-size: 1.55rem;
  }

  .maintenance-message {
    font-size: 0.86rem;
  }

  .page-content {
    padding: 14px 0 18px;
  }

  .parish-grid {
    grid-template-columns: 1fr;
  }

  .parish-card:nth-child(even) {
    border-left: 0;
  }

  .parish-card:nth-child(n + 2) {
    border-top: 1px solid var(--border);
  }

  .parish-summary {
    min-height: 0;
  }

  .contact-section {
    padding: 14px 16px;
  }

  address {
    font-size: 0.8rem;
  }
}

@media print {
  .site-header,
  .site-footer {
    color: #000000;
    background: #ffffff;
    border: 1px solid #000000;
  }

  .maintenance-hero {
    min-height: 0;
    background: #ffffff;
    border: 1px solid #000000;
  }

  .hero-content {
    background: #ffffff;
  }

  .page-content {
    width: 100%;
  }

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

  .parish-card {
    break-inside: avoid;
  }
}
