/* Evangel Community Church - one-page site */

:root {
  /* colours taken from the EC logo */
  --gold: #977d1c;
  --gold-light: #c3a84a;
  --steel: #64889e;
  --steel-dark: #3e5f72;
  --charcoal: #3f4444;
  --teal-dark: var(--steel-dark);
  --teal: var(--gold);
  --welcome-bg: #5d8197;
  --footer-bg: #cbdde1;
  --text: #5c5c5c;
  --muted: #777;
  --gold: #b8962e;
  --max: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); }
a:hover { color: var(--teal); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 900px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #000;
  /* strong, soft shadow falling onto the page below the bar */
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35), 0 14px 32px rgba(0, 0, 0, 0.35);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { width: 58px; height: auto; filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 2px #fff); }
.main-nav { display: flex; gap: 24px; }
.main-nav a {
  font-family: "Barlow", sans-serif; font-weight: 500; font-size: 18px;
  color: #fff; text-decoration: none;
}
.main-nav a:hover { color: var(--gold-light); }

/* ---------- Hero: logo + slot reels ---------- */
/* hero is the positioning box for the hidden warm-up tiles */
.hero {
  position: relative;
  --gold: #977d1c;
  --steel: #64889e;
  --gap: clamp(2px, 0.6vw, 8px);
  --lever: 56px;
  --w: min(64px, calc((100vw - 40px - var(--lever) - 14 * var(--gap)) / 15));
  --h: calc(var(--w) * 1.25);
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(30px, 6vw, 70px) 20px clamp(40px, 6vw, 70px);
  background: #fff;
  text-align: center;
}
.hero-logo { width: clamp(150px, 22vw, 240px); height: auto; margin-bottom: clamp(24px, 4vw, 44px); }

.machine { display: flex; align-items: center; gap: 10px; }
.reels { display: flex; gap: var(--gap); }

/* Slot-machine handle */
.lever {
  position: relative; width: calc(var(--lever) - 10px); height: calc(var(--h) * 3);
  padding: 0; border: 0; background: none; cursor: grab;
  perspective: 400px;
}
.lever-base {
  position: absolute; left: 0; right: 0; top: 50%; height: 34px; transform: translateY(-50%);
  background: var(--steel); border-radius: 6px 10px 10px 6px;
  box-shadow: inset -4px 0 0 rgba(0,0,0,.12);
}
.lever-arm {
  position: absolute; left: 50%; bottom: 50%; width: 6px; margin-left: -3px;
  height: calc(var(--h) * 1.25);
  background: linear-gradient(90deg, #8a8f8f, #d9dcdc 45%, #8a8f8f);
  border-radius: 3px;
  transform-origin: 50% 100%;
  transition: transform .35s cubic-bezier(.3,1.6,.5,1);
}
.lever-knob {
  position: absolute; left: 50%; top: -12px; width: 26px; height: 26px; margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e7cf6e, var(--gold) 60%, #6e5a10);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.lever:hover .lever-arm { transform: rotateX(-14deg); }
.lever.pulled .lever-arm { transform: rotateX(-180deg); transition: transform .2s ease-in; }
.lever:focus-visible { outline: 2px solid var(--steel); outline-offset: 4px; border-radius: 6px; }
.reel {
  width: var(--w); height: calc(var(--h) * 3);
  overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%);
}
.strip { will-change: transform; transform: translateZ(0); }
.machine { position: relative; isolation: isolate; }

.tile {
  width: var(--w); height: var(--h);
  background: center / 100% 100% no-repeat;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.tile.letter {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700;
  font-size: calc(var(--w) * 0.82); line-height: 1;
}
.tile.letter.c0 { background: var(--steel); }
.tile.letter.c1 { background: var(--gold); }
.tile.blank { background: #fff; box-shadow: none; }
.arrow { width: 70%; height: 70%; fill: #fff; }
/* "PULL TO PLAY" - arrow nudges toward the handle, knob glows */
.hero.cta .arrow-right { animation: nudgeRight 1s ease-in-out infinite; }
.hero.cta .arrow-down { animation: nudgeDown 1s ease-in-out infinite; }
@keyframes nudgeRight { 50% { transform: translateX(18%); } }
@keyframes nudgeDown { 50% { transform: translateY(18%); } }
.lever-knob { animation: knobGlow 1.2s ease-in-out infinite; }   /* handle knob always pulses */
@keyframes knobGlow { 50% { box-shadow: 0 0 0 6px rgba(195,168,74,.35), 0 0 18px 6px rgba(195,168,74,.55); } }
.hero.cta .spin-btn:not(:disabled) { background: var(--gold); color: #fff; }
@media (prefers-reduced-motion: reduce) { .hero.cta .arrow, .lever-knob { animation: none; } }

.tagline {
  margin: clamp(10px, 2vw, 18px) 0 0;
  font-family: "Barlow Semi Condensed", sans-serif; font-size: clamp(17px, 2.2vw, 24px);
  color: var(--steel); letter-spacing: .5px;
}
.spin-btn {
  margin-top: 14px; padding: 6px 16px;
  font: 500 14px "Barlow", sans-serif; color: var(--gold);
  background: none; border: 1px solid currentColor; border-radius: 20px; cursor: pointer;
  transition: opacity .3s, background .2s, color .2s;
}
.spin-btn:disabled { opacity: .35; cursor: default; }
.spin-btn:not(:disabled):hover { background: var(--gold); color: #fff; }

/* ---------- Contact: reel windows ---------- */
.contact { padding: 56px 0 64px; background: var(--welcome-bg); }
.contact-intro {
  margin: 0 auto 34px; max-width: 760px; text-align: center;
  font-family: "Barlow Semi Condensed", sans-serif; font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.35; color: #fff;
}
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px 18px 24px; background: #fff; color: var(--text); text-decoration: none;
  border-top: 4px solid var(--gold);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
  transition: transform .2s, box-shadow .2s;
}
.contact-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12); color: var(--text); }
.mini-reel {
  --t: 64px;
  width: var(--t); height: calc(var(--t) * 1.25); overflow: hidden; border-radius: 6px;
  margin-bottom: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.mini-strip { display: flex; flex-direction: column; will-change: transform; }
.mini-tile { width: var(--t); height: calc(var(--t) * 1.25); flex: none; background: center / 100% 100% no-repeat; }
.icon-tile { display: flex; align-items: center; justify-content: center; background: var(--steel); }
.contact-card:nth-child(1) .icon-tile, .contact-card:nth-child(3) .icon-tile { background: var(--gold); }
.icon-tile svg { width: 30px; height: 30px; fill: #fff; }
.card-label {
  font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; font-size: 15px; color: var(--steel-dark);
}
.card-value { margin-top: 4px; font-size: 16px; line-height: 1.45; word-break: break-word; }
.card-hint { margin-top: 8px; font-size: 13px; color: var(--gold); font-weight: 600; }

/* ---------- Service Times: flip-board ---------- */
.services { padding: 60px 0 80px; text-align: center; }
.services h2 {
  margin: 0 0 26px; font-family: "Barlow", sans-serif; font-weight: 500;
  font-size: clamp(34px, 5vw, 48px); color: var(--text);
}
.board {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  max-width: 860px; margin: 0 auto; text-align: left;
  background: var(--charcoal); border-radius: 10px; color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.18), inset 0 0 0 6px #343838;
  padding: 10px;
}
.board-day { padding: 22px 26px; }
.board-day + .board-day { border-left: 1px solid rgba(255,255,255,.12); }
.board-day h3 {
  margin: 0 0 14px; font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 3px; font-size: 18px; color: var(--gold-light);
}
.board-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
.board-row + .board-row { border-top: 1px dashed rgba(255,255,255,.15); }
.event { font-family: "Barlow", sans-serif; font-size: 17px; color: #e9ecec; }
.flip { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.flap {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 36px; border-radius: 4px;
  background: linear-gradient(#262a2a 0 50%, #1f2222 50% 100%);
  font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; font-size: 24px; color: #f4e7b8;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0,0,0,.55); }
.flap.colon { width: 10px; background: none; box-shadow: none; color: #f4e7b8; }
.flap.colon::after { display: none; }
.flap.ampm { width: 36px; font-size: 16px; letter-spacing: 1px; margin-left: 4px; color: var(--gold-light); }
.flap.blank { visibility: hidden; }
.next-up {
  display: inline-block; margin: 22px 0 0; padding: 8px 18px; border-radius: 30px;
  background: #f3efe2; color: var(--charcoal); font-size: 15px;
}
.next-up strong { color: var(--gold); }

/* ---------- Map popup ---------- */
.map-dialog {
  width: min(900px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 10px;
  border-top: 5px solid var(--gold); box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden;
}
.map-dialog::backdrop { background: rgba(40, 52, 60, .6); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.dialog-head h2 {
  margin: 0; font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; font-size: 20px; color: var(--steel-dark);
}
.dialog-close {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eef2f4;
  font-size: 24px; line-height: 1; color: var(--charcoal); cursor: pointer;
}
.dialog-close:hover { background: var(--gold); color: #fff; }
.map-dialog iframe { display: block; width: 100%; height: min(52vh, 440px); border: 0; background: #eef2f4; }
.dialog-foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
  padding: 12px 18px; font-size: 15px;
}
.dialog-foot a { color: var(--gold); font-weight: 600; text-decoration: none; }
.dir-form { padding: 0 18px 14px; }
.dir-form label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--charcoal); }
.dir-row { display: flex; gap: 8px; }
.dir-row input {
  flex: 1; min-width: 0; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1px solid #c9d3d9; border-radius: 6px;
}
.dir-row input:focus { outline: 2px solid var(--steel); outline-offset: 1px; }
.dir-go, .dir-print {
  padding: 10px 16px; font: 600 15px "Barlow", sans-serif; color: #fff;
  background: var(--gold); border: 0; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.dir-go:hover, .dir-print:hover { background: var(--steel-dark); }
.dir-print { padding: 7px 14px; font-size: 14px; background: var(--steel); }
.dir-locate {
  margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 14px "Barlow", sans-serif; color: var(--steel-dark); text-decoration: underline;
}
.dir-actions { display: inline-flex; align-items: center; gap: 16px; }
.map-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }

/* ---------- Footer ---------- */
.site-footer { background: #000; text-align: center; padding: 64px 20px 56px; }
.site-footer img {
  width: 160px; margin: 0 auto 22px;
  filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 4px #fff);
}
#footer-line {
  margin: 0; font-family: "Barlow", sans-serif; font-weight: 600; font-size: 19px; color: #fff;
  letter-spacing: .5px; min-height: 1.6em;
}
#footer-line .fl { display: inline-block; }
#footer-line.armed .fl { opacity: 0; }
#footer-line .fl.drop { animation: letterDrop .9s cubic-bezier(.22,.61,.36,1) both; }
/* fade in while dropping gently into place (no bounce) */
@keyframes letterDrop {
  from { transform: translateY(var(--from, -60px)); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- Print: only the directions popup ---------- */
@media print {
  body.printing-directions > *:not(#map-dialog) { display: none !important; }
  body.printing-directions #map-dialog {
    position: static; display: block; width: 100%; box-shadow: none; border: 0; max-height: none;
  }
  body.printing-directions .dialog-close,
  body.printing-directions .dir-form,
  body.printing-directions .dir-actions { display: none !important; }
  body.printing-directions .map-dialog iframe { height: 520px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .hero { --lever: 0px; }
  .lever { display: none; }
}

@media (max-width: 760px) {
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 15px; }
  .contact-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; }
  .board-day + .board-day { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .board-day { padding: 18px 16px; }
  .event { font-size: 15px; }
  .flap { width: 22px; height: 32px; font-size: 21px; }
  .flap.ampm { width: 32px; font-size: 14px; }
}
