/* Bluff YSA Ward — styles
   Visual language modeled on churchofjesuschrist.org: white canvas, charcoal text,
   teal-blue primary, photo cards with simple captions, generous whitespace. */

:root {
  --text: #212225;
  --text-muted: #53575b;
  --border: #d9dbdc;
  --bg: #ffffff;
  --bg-alt: #f4f5f6;
  --brand: #006184;
  --brand-hover: #004e6b;
  --brand-dark: #0b4a61;
  --brand-tint: #e6f0f3;
  --focus: #1a8fc0;
  --radius: 4px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .12);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, .14);
  --font: "Roboto", Arial, Helvetica, sans-serif;
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.2rem; font-weight: 500; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* Preview banner */
.preview-banner {
  background: #fff4d6; color: #5c4400; font-size: .875rem; text-align: center;
  padding: 6px 16px; border-bottom: 1px solid #f0dca0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius);
  font: 500 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 36px; padding: 7px 14px; font-size: .875rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-tint); color: var(--brand-hover); }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: var(--brand-tint); color: var(--brand-dark); }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.8); }
.btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #fff;
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 500; font-size: 1.05rem; }
.brand-sub { font-size: .75rem; color: var(--text-muted); }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; border-radius: var(--radius);
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  color: var(--text); text-decoration: none; padding: 8px 12px; font-size: .95rem; border-radius: var(--radius);
}
.site-nav a:not(.btn):hover { background: var(--bg-alt); }
.site-nav .btn { margin-left: 8px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 12px 8px; border-bottom: 1px solid var(--bg-alt); }
  .site-nav .btn { margin: 12px 0 0; }
}

/* Hero */
.hero { background: var(--brand-dark); color: #fff; }
.hero-inner { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 48px; align-items: center; }
@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.3fr 1fr; padding-top: 72px; padding-bottom: 72px; }
}
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 400; margin-bottom: 16px; }
.hero-lead { font-size: 1.15rem; max-width: 34em; opacity: .95; }
.hero-meta { font-size: .95rem; opacity: .85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.eyebrow { font-size: .8rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.next-up .eyebrow { opacity: .85; }
.next-up-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; width: 100%;
  background: #fff; color: var(--text); border: 0; border-radius: var(--radius); padding: 12px; text-align: left;
  cursor: pointer; font: inherit; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s;
}
.next-up-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.next-up-card img { width: 96px; height: 120px; object-fit: cover; border-radius: 2px; background: var(--bg-alt); }
.next-up-card .nu-title { font-size: 1.15rem; font-weight: 500; margin: 0 0 4px; }
.next-up-card .nu-when { color: var(--brand); font-weight: 500; margin: 0 0 2px; font-size: .95rem; }
.next-up-card .nu-where { color: var(--text-muted); margin: 0; font-size: .9rem; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 24px; }
.section-sub { color: var(--text-muted); margin: 0; }

/* Events */
.event-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.event-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-align: left; padding: 0; cursor: pointer; font: inherit; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.event-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.event-card .flyer { aspect-ratio: 4 / 5; background: var(--bg-alt); overflow: hidden; }
.event-card .flyer img { width: 100%; height: 100%; object-fit: cover; }
.event-card .caption { padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.event-card .when { color: var(--brand); font-size: .85rem; font-weight: 500; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.event-card .title { font-size: 1.05rem; font-weight: 500; margin: 0 0 2px; }
.event-card .where { color: var(--text-muted); font-size: .9rem; margin: 0; }
.event-skeleton { aspect-ratio: 4 / 6; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-alt) 25%, #eceeef 50%, var(--bg-alt) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { background: var(--bg-alt); padding: 24px; border-radius: var(--radius); color: var(--text-muted); text-align: center; }

/* Weekly */
.weekly-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.weekly-list li { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 16px 18px; }
.weekly-list .day { color: var(--brand); font-size: .8rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 4px; }
.weekly-list .name { font-weight: 500; font-size: 1.05rem; margin: 0 0 4px; }
.weekly-list .detail { color: var(--text-muted); font-size: .92rem; margin: 0; }

/* Announcement cards */
.card-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); }
.card .card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.card.featured { border-top: 4px solid var(--brand); }

/* Resources */
.resource-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.resource {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.resource:hover { box-shadow: var(--shadow-hover); border-color: #c4c8ca; color: var(--text); }
.resource h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 1.05rem; }
.resource h3::after { content: "\2192"; color: var(--brand); font-size: 1.1rem; }
.resource p { color: var(--text-muted); font-size: .92rem; margin: 0; }

/* Location */
.location { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .location { grid-template-columns: 1fr 1.4fr; } }
.location address { font-style: normal; font-size: 1.1rem; margin-bottom: 16px; }
.meeting-times { list-style: none; padding: 0; margin: 0 0 24px; }
.meeting-times li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; }
.meeting-times li span:last-child { color: var(--text-muted); white-space: nowrap; }
.map-frame { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-alt); }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* Footer */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 32px 0; font-size: .9rem; color: var(--text-muted); }
.footer-inner { display: grid; gap: 16px; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1fr 1.5fr; align-items: start; } }
.footer-name { color: var(--text); font-weight: 500; margin-bottom: 4px; }
.footer-social a { margin-right: 16px; }
.footer-disclaimer { margin: 0; }

/* Event dialog */
.event-dialog {
  width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
  border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.3); color: var(--text);
}
.event-dialog::backdrop { background: rgba(20, 24, 28, .6); }
.dialog-inner { display: grid; position: relative; }
@media (min-width: 760px) { .dialog-inner { grid-template-columns: 1fr 1fr; } }
.dialog-flyer { background: #111; display: grid; place-items: center; }
.dialog-flyer img { width: 100%; max-height: 80vh; object-fit: contain; }
.dialog-body { padding: 28px; overflow-y: auto; }
@media (min-width: 760px) { .dialog-body { max-height: calc(100vh - 32px); } }
.dialog-body .eyebrow { color: var(--brand); }
.dialog-body h2 { font-size: 1.7rem; margin-bottom: 8px; }
.dialog-where { color: var(--text-muted); }
.dialog-desc { white-space: pre-line; margin: 16px 0 24px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dialog-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.92); color: var(--text); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow);
}
.dialog-close:hover { background: #fff; }

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

/* Hero photo (Christus with the Salt Lake Temple) under the teal overlay.
   Swap the image by replacing assets/hero.jpg; keep it landscape, about 2000px wide. */
.hero {
  background-color: var(--brand-dark);
  background-image: linear-gradient(rgba(11, 74, 97, .82), rgba(11, 74, 97, .82)), url("hero.jpg");
  background-size: cover;
  background-position: center 22%;
}

/* Compact activity thumbnails: smaller tiles that show the whole flier (no cropping).
   Click/tap still opens the full-size details pop-up. */
.event-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.event-card .flyer { aspect-ratio: 3 / 4; background: var(--bg-alt); }
.event-card .flyer img { object-fit: contain; }
.event-card .caption { padding: 10px 12px 12px; }
.event-card .when { font-size: .72rem; }
.event-card .title { font-size: .95rem; line-height: 1.3; }
.event-card .where { font-size: .8rem; }
@media (max-width: 480px) {
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
