:root {
  --red: #7d1f17;
  --red-dark: #561009;
  --gold: #c9a24b;
  --cream: #f7f1e5;
  --ink: #2b211c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 1.1rem/1.7 Georgia, "Times New Roman", serif;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-weight: normal; line-height: 1.2; }
h2 { color: var(--red); font-size: 2rem; text-align: center; margin-bottom: .5rem; }

/* Header */
header {
  /* dark tint over the photo keeps the text readable */
  background:
    linear-gradient(rgb(20 8 6 / .55), rgb(20 8 6 / .45) 50%, rgb(20 8 6 / .65)),
    url("images/header-church.jpg") center 25% / cover no-repeat,
    var(--red-dark);
  color: var(--cream);
  border-bottom: 5px solid var(--gold);
}
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.cross { width: 20px; height: 30px; fill: var(--gold); flex: none; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav ul a { text-decoration: none; }
nav ul a:hover { color: var(--gold); }

.hero { text-align: center; padding: 1.5rem 1.5rem 3.5rem; }
header { text-shadow: 0 1px 6px rgb(0 0 0 / .8); }
.hero .button { text-shadow: none; }
.medallion {
  width: 240px;
  margin: 0 auto 1.25rem;
  /* shadow follows the cut-out shape of the halo and hair */
  filter: drop-shadow(0 6px 14px rgb(0 0 0 / .55));
}
h1 { font-size: clamp(1.9rem, 5vw, 3rem); margin-bottom: 1.5rem; }

.button {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  border-radius: 3px;
  padding: .8rem 1.6rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { filter: brightness(1.1); }

/* Sections */
.wrap { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; }
.narrow { max-width: 640px; }
.hint { text-align: center; margin-bottom: 2rem; opacity: .8; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 2rem;
}
.gallery button {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #ebe2d0;
  padding: .75rem;
  transition: transform .2s;
}
.gallery button:hover img { transform: translateY(-4px); }
figcaption { text-align: center; margin-top: .5rem; font-style: italic; }

#why { background: #2b211c; color: var(--cream); }
#why h2 { color: var(--gold); text-align: left; margin-bottom: 1.25rem; }
.why { display: grid; grid-template-columns: 2fr 3fr; gap: 3rem; align-items: center; }
.why p { margin-bottom: 1rem; }

/* Photo inside the About text, with the words flowing around it */
.why > div { display: flow-root; }
.wrapped { float: right; width: 45%; max-width: 270px; margin: .4rem 0 1rem 1.5rem; }
.wrapped button { display: block; width: 100%; border: 0; background: none; cursor: zoom-in; }
.wrapped img { width: 100%; }
.wrapped figcaption { font-size: .95rem; line-height: 1.4; }
@media (max-width: 480px) {
  .wrapped { width: 50%; margin: .35rem 0 .75rem 1rem; }
  .wrapped figcaption { font-size: .8rem; }
  /* phones show a close-up (see <picture> in index.html); tapping still shows the whole photo */
  .wrapped img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center; }
}

/* Form */
#contact-form { display: flex; flex-direction: column; }
label { margin: 1rem 0 .25rem; }
label span { opacity: .65; font-size: .9em; }
input, textarea {
  font: inherit;
  padding: .65rem .75rem;
  border: 1px solid #b9a98c;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#contact-form .button { margin-top: 1.5rem; background: var(--red); color: var(--cream); }
#form-status { margin-top: 1rem; text-align: center; }

footer {
  background: var(--red-dark);
  color: var(--cream);
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 5px solid var(--gold);
}
footer .cross { margin-bottom: .75rem; }
.small { font-size: .85rem; opacity: .7; margin-top: .75rem; }

/* Enlarged image viewer */
#viewer {
  margin: auto;
  border: 2px solid var(--gold);
  background: var(--cream);
  padding: 1rem;
  max-width: 94vw;
  text-align: center;
}
#viewer::backdrop { background: rgb(0 0 0 / .8); }
#viewer img { max-height: 75vh; margin: 0 auto; width: auto; }
#viewer form { text-align: right; }
#viewer form button { border: 0; background: none; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--ink); }

@media (max-width: 760px) {
  .why { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery img { transition: none; }
}
