/* John Hart Memorial - site styles
   Recreates the look of the original Wix site with plain CSS. */

@font-face {
  font-family: 'Enriqueta';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/enriqueta-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Enriqueta';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/enriqueta-700.woff2) format('woff2');
}

:root {
  --tan: #a87c4f;
  --tan-dark: #8c6540;
  --tan-light: #e6d6c4;
  --text: #a87c4f;
  --panel: #ffffff;
  --nav-text: #2a2a2a;
  --page-width: 980px;
  --serif: 'Enriqueta', Georgia, serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { background: #1d1410; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #1d1410 url(../images/background.jpg) center top / cover no-repeat fixed;
}

/* iOS ignores background-attachment: fixed; use a fixed layer instead */
@supports (-webkit-touch-callout: none) {
  body { background: #1d1410; }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url(../images/background.jpg) center / cover no-repeat;
  }
}

a { color: var(--tan); }
a:hover { color: var(--tan-dark); }

img { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header / navigation ---------- */
.site-header {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 45px 16px 46px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav a {
  display: block;
  width: 105px;
  padding: 7px 4px;
  text-align: center;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--nav-text);
  background: #fff;
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { background: var(--tan-light); color: #000; }
.site-nav a[aria-current="page"] {
  background: var(--tan);
  color: #fff;
  font-weight: bold;
}

/* ---------- Main panel ---------- */
.panel {
  max-width: var(--page-width);
  margin: 0 auto;
  background: var(--panel);
  padding: 16px 13px 28px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--tan);
  line-height: 1.25;
  margin: 0 0 .5em;
}

.site-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 14px 13px 60px;
  font-size: 13px;
  color: var(--tan);
}
.site-footer p { margin: 0; }

.btn {
  display: inline-block;
  background: var(--tan);
  color: #fff;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 13px;
  padding: 6px 24px;
  border: 0;
  cursor: pointer;
  transition: background-color .2s;
}
.btn:hover, .btn:focus-visible { background: var(--tan-dark); color: #fff; }

/* ---------- Home page ---------- */
.hero {
  position: relative;
  height: 360px;
  overflow: hidden;
  background: #c9dbe8;
}
/* Banner image is 1900x720 (same shape as the desktop banner).
   On narrower screens the sides are trimmed, keeping John (at ~62% across) in view. */
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 0;
  display: block;
}
.hero-name {
  position: absolute;
  left: 23px;
  bottom: 0;
  width: 257px;
  padding: 0 10px 14px;
  background: #fff;
  text-align: center;
}
.hero-name h1 {
  font-size: 34px;
  margin: 0;
  padding-top: 2px;
}
.hero-name .years {
  font-size: 19px;
  margin: 0;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 0 30px;
  margin-top: 8px;
}
.home-main { padding-right: 10px; border-right: 2px solid var(--tan); }
.home-main > *:last-child { margin-bottom: 0; }

.notice {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 6px;
}

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  margin-bottom: 14px;
}
.video iframe,
.video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.home-main p, .home-aside p { font-size: 15px; margin: 0 0 1.2em; }
.home-aside { padding-top: 2px; }
.home-aside .summary { font-size: 16px; line-height: 1.35; }
.home-aside .summary span { display: block; }

.story-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  margin-top: 16px;
  background: var(--tan);
  color: #fff;
  text-decoration: none;
  font-size: 17px;
  transition: background-color .2s;
}
.story-cta:hover, .story-cta:focus-visible { background: var(--tan-dark); color: #fff; }

address { font-style: normal; }

/* Circular photo carousel */
.carousel {
  position: relative;
  margin: 50px 0 0;
  padding: 0 32px;
}
.carousel-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 6px;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track a {
  flex: 0 0 auto;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  overflow: hidden;
  scroll-snap-align: start;
  display: block;
}
.carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.carousel-track a:hover img { transform: scale(1.06); }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 48px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(0,0,0,.6);
  padding: 0;
}
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }
.carousel-btn svg { width: 22px; height: 40px; filter: drop-shadow(0 0 2px rgba(0,0,0,.5)); }

/* ---------- Obituary ---------- */
.obituary { padding: 18px 23px 40px; }
.obituary blockquote {
  margin: 0 0 22px;
  font-style: italic;
  font-size: 23px;
  line-height: 1.35;
}
.obituary p { font-size: 15px; margin: 0 0 1.4em; }

/* ---------- Gallery ---------- */
.page-title {
  text-align: center;
  font-size: 34px;
  margin: 2px 0 6px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 680px;
  margin: 0 auto 30px;
}
.gallery-grid button {
  display: block;
  padding: 0;
  border: 0;
  background: #eee;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s, opacity .3s;
}
.gallery-grid button:hover img,
.gallery-grid button:focus-visible img { transform: scale(1.05); opacity: .9; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.96);
}
.lightbox.open { display: flex; }
.lightbox figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox img {
  max-width: 92vw;
  max-height: calc(92vh - 40px);
  object-fit: contain;
  box-shadow: 0 2px 18px rgba(0,0,0,.25);
}
.lightbox figcaption {
  min-height: 1.6em;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: transparent;
  color: var(--tan);
  cursor: pointer;
  padding: 10px;
  line-height: 0;
}
.lightbox button svg { width: 28px; height: 28px; }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-prev svg, .lightbox .lb-next svg { width: 36px; height: 60px; }
.lightbox .lb-count {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 13px;
}
body.no-scroll { overflow: hidden; }

/* ---------- Stories ---------- */
.stories-intro {
  text-align: center;
  padding: 22px 0 0;
}
.stories-intro h1 {
  font-weight: 700;
  font-size: 32px;
  margin-bottom: 8px;
}
.stories-intro p { font-size: 16px; margin: 0 0 12px; line-height: 1.35; }
.stories-intro hr {
  width: 254px;
  border: 0;
  border-top: 1px solid var(--tan-light);
  margin: 20px auto 0;
}

.stories {
  columns: 2 300px;
  column-gap: 72px;
  padding: 20px 23px 30px;
}
.story {
  break-inside: avoid;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tan-light);
}
.story p { font-size: 15px; margin: 0 0 1.2em; }
.story .author { margin: 0; }
.story a { word-break: break-all; }

/* ---------- Contact ---------- */
.contact { padding: 30px 23px 30px; }
.contact h1 { font-weight: 700; font-size: 32px; margin-bottom: 12px; }
.contact .intro { font-size: 15px; max-width: 420px; margin: 0 0 12px; }
.social { display: inline-block; line-height: 0; }
.social svg { width: 24px; height: 24px; }

.contact-form { margin-top: 44px; }
.contact-form label { display: block; }
.contact-form .sr-only, .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin: 0 0 11px;
  padding: 6px 32px;
  border: 2px solid var(--tan);
  font-family: var(--serif);
  font-size: 15px;
  color: #333;
  background: #fff;
  border-radius: 0;
}
.contact-form input { height: 38px; }
.contact-form textarea { height: 104px; padding-top: 12px; resize: vertical; }
.contact-form ::placeholder { color: #9b9b9b; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--tan-dark); box-shadow: 0 0 0 2px var(--tan-light); }
.contact-form .actions { text-align: right; }
.contact-form .btn { width: 110px; padding: 5px 0; font-size: 15px; }
.contact-form .hp { display: none; }
.form-status { min-height: 1.4em; font-size: 15px; margin: 10px 0 0; text-align: right; }
.form-status.error { color: #a33; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .site-header { padding: 20px 16px 22px; }
  .site-nav ul { gap: 6px; }
  .site-nav a { width: auto; min-width: 88px; padding: 9px 10px; font-size: 12px; }

  .panel { padding: 12px 12px 24px; }
  .hero { height: 230px; }
  .hero-name { left: 12px; width: 200px; padding-bottom: 8px; }
  .hero-name h1 { font-size: 27px; }
  .hero-name .years { font-size: 16px; }

  .home-columns { grid-template-columns: 1fr; }
  .home-main { border-right: 0; padding-right: 0; border-bottom: 2px solid var(--tan); padding-bottom: 8px; margin-bottom: 18px; }
  .notice { font-size: 20px; }
  .home-main p, .home-aside p, .home-aside .summary { font-size: 16px; }

  .carousel { margin-top: 30px; padding: 0 26px; }
  .carousel-track { gap: 14px; }
  .carousel-track a { width: 140px; height: 140px; }

  .obituary, .contact { padding: 12px 4px 20px; }
  .obituary blockquote { font-size: 19px; }
  .obituary p { font-size: 16px; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .page-title { font-size: 28px; }

  .stories { padding: 16px 4px 20px; }
  .stories-intro h1, .contact h1 { font-size: 27px; }

  .contact-form input, .contact-form textarea { padding-left: 12px; padding-right: 12px; font-size: 16px; }
  .contact-form input { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
