/* Longview Community Church — site styles
   Mobile first. The menu switches to the desktop layout at 1080px (see "Desktop menu"). */

:root {
  --navy: #102a54;
  --navy-2: #1d3f7a;
  --blue: #2f67ce;
  --blue-dark: #2152ad;
  --sky: #1cb5ec;
  --ink: #1c2430;
  --muted: #556171;
  --line: #dfe5ee;
  --soft: #f3f6fb;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 42, 84, .06), 0 6px 20px rgba(16, 42, 84, .08);
  --header-h: 64px;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.125rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: var(--blue-dark); }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 1.6em 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

.container, .container-wide { width: 100%; margin: 0 auto; padding: 0 16px; }
.container { max-width: 780px; }
.container-wide { max-width: 1160px; }
@media (min-width: 640px) { .container, .container-wide { padding: 0 24px; } }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .65rem 1.4rem; border-radius: 999px;
  font: 700 1.05rem/1.2 var(--sans); text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--soft); color: var(--navy); }
.btn-outline { border-color: rgba(255, 255, 255, .8); color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white); border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 1240px; height: var(--header-h); margin: 0 auto; padding: 0 12px 0 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.05; }
.brand-top { font: 700 1.2rem/1.05 var(--serif); }
.brand-bottom { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.menu-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font: 700 1rem var(--sans); cursor: pointer;
}
.menu-icon, .menu-icon span, .menu-icon span::before, .menu-icon span::after { display: block; width: 18px; height: 2px; }
.menu-icon { position: relative; height: 14px; }
.menu-icon span { position: absolute; top: 6px; background: currentColor; transition: background-color .15s; }
.menu-icon span::before, .menu-icon span::after {
  content: ""; position: absolute; left: 0; background: currentColor; transition: transform .2s;
}
.menu-icon span::before { transform: translateY(-6px); }
.menu-icon span::after { transform: translateY(6px); }
.menu-toggle[aria-expanded="true"] .menu-icon span { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon span::before { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon span::after { transform: rotate(-45deg); }

/* ---------------------------------------------------------------- mobile menu (full-screen panel) */
.nav-list, .sub-menu { list-style: none; margin: 0; padding: 0; }

@media (max-width: 1079.98px) {
  html:not(.js) .menu-toggle { display: none; }
  html:not(.js) .header-inner { height: auto; flex-wrap: wrap; padding-top: 10px; }
  html:not(.js) .site-nav { flex-basis: 100%; }
  .js .site-nav {
    display: none;
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    overflow-y: auto; overscroll-behavior: contain;
    background: var(--white); padding: 4px 16px 40px;
  }
  .nav-open { overflow: hidden; }
  .nav-open .site-nav { display: block; }

  .nav-list { max-width: 640px; margin: 0 auto; }
  .nav-item { border-bottom: 1px solid var(--line); }
  .nav-item > a.nav-link {
    display: flex; align-items: center; min-height: 56px;
    font-size: 1.25rem; font-weight: 700; color: var(--navy); text-decoration: none;
  }
  .sub-toggle {
    display: block; width: 100%; padding: 18px 0 4px; border: 0; background: none; text-align: left;
    font: 700 .85rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    pointer-events: none;
  }
  .sub-menu { display: grid; grid-template-columns: 1fr; padding-bottom: 10px; }
  @media (min-width: 340px) { .sub-menu { grid-template-columns: 1fr 1fr; column-gap: 16px; } }
  .sub-menu a {
    display: flex; align-items: center; min-height: 48px; padding: 4px 0;
    font-size: 1.1rem; color: var(--ink); text-decoration: none; line-height: 1.25;
  }
  .sub-menu a:hover { color: var(--blue); }
  .nav-item [aria-current="page"] { color: var(--blue); font-weight: 700; }
  .nav-item [aria-current="page"]::before {
    content: ""; width: 4px; height: 1.2em; margin-right: 8px; border-radius: 2px; background: var(--blue);
  }
  .nav-give { border-bottom: 0; padding-top: 20px; }
  .nav-give .btn { width: 100%; font-size: 1.15rem; }
  .nav-footer { max-width: 640px; margin: 20px auto 0; color: var(--muted); font-size: 1rem; }
  .nav-footer p { margin: .35em 0; }
}

/* ---------------------------------------------------------------- desktop menu */
@media (min-width: 1080px) {
  :root { --header-h: 76px; }
  .header-inner { padding: 0 24px; }
  .brand img { width: 52px; height: 52px; }
  .brand-top { font-size: 1.35rem; }
  .menu-toggle, .nav-footer { display: none; }
  .site-nav { margin-left: auto; }
  .nav-list { display: flex; align-items: center; gap: 2px; }
  .nav-item { position: relative; }
  .nav-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
    border: 0; border-radius: 8px; background: none; cursor: pointer;
    font: 600 1.05rem var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
  }
  .nav-link:hover, .sub-toggle[aria-expanded="true"] { background: var(--soft); color: var(--navy); }
  .sub-toggle::after {
    content: ""; width: 7px; height: 7px; margin-top: -4px;
    border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
    transition: transform .15s;
  }
  .sub-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
  .is-current > .nav-link { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); border-radius: 8px 8px 0 0; }

  .sub-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 260px;
    padding: 8px; margin-top: 6px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
  .sub-toggle[aria-expanded="true"] + .sub-menu { display: block; }
  @media (hover: hover) { .has-sub:hover .sub-menu { display: block; } }
  .sub-menu a {
    display: block; padding: 10px 12px; border-radius: 8px;
    color: var(--ink); text-decoration: none; font-size: 1.02rem; line-height: 1.3;
  }
  .sub-menu a:hover { background: var(--soft); color: var(--navy); }
  .sub-menu [aria-current="page"] { color: var(--blue); font-weight: 700; }
  .nav-give { margin-left: 10px; }
  .nav-give .btn { min-height: 44px; padding: .5rem 1.4rem; }
}

/* ---------------------------------------------------------------- page header & content */
.page-header { background: var(--navy); color: #fff; padding: 36px 0 32px; }
.page-header h1 { color: #fff; margin: 0; }
.eyebrow {
  margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sky);
}
@media (min-width: 640px) { .page-header { padding: 56px 0 48px; } }

.page main > .container, .page main > .container-wide { padding-top: 8px; padding-bottom: 64px; }

.page-banner { margin: 24px 0 8px; }
.page-banner img { display: block; width: 100%; border-radius: var(--radius); }

.prose::after { content: ""; display: table; clear: both; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose h2, .prose h3, .prose h4 { clear: both; }
.prose > :first-child { margin-top: 1.5rem; }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 4px solid var(--sky); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { border-radius: 8px; }
.prose img.align-left, .prose img.align-right, .prose img.align-center,
.prose img:not([class]) { display: block; margin: 1rem auto; }
@media (min-width: 600px) {
  .prose img.align-left { float: left; max-width: 42%; margin: .3rem 1.5rem 1rem 0; }
  .prose img.align-right { float: right; max-width: 42%; margin: .3rem 0 1rem 1.5rem; }
  .prose img:not([class]) { display: inline-block; margin: .3rem .5rem .5rem 0; vertical-align: top; max-width: 48%; }
}
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.5em; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5em .75em; vertical-align: top; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; margin: 1.5em 0; }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 1.5em 0;
}
.gallery a, .gallery > img { display: block; aspect-ratio: 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; margin: 0 !important; max-width: none !important; float: none !important; }

/* calendar */
.calendar-frame { width: 100%; height: 1000px; border: 1px solid var(--line); border-radius: var(--radius); }
.prose iframe.calendar-frame { aspect-ratio: auto; }

/* leadership */
.people { display: grid; gap: 32px; margin: 1.5em 0 3em; }
.person { display: grid; gap: 16px; align-items: start; }
.prose .person img { display: block; width: 160px; max-width: none; height: 160px; object-fit: cover; border-radius: 50%; margin: 0; }
.person h3 { margin: 0; }
.person-role { margin: .2em 0 0 !important; font-weight: 700; color: var(--blue); }
.person-email { margin: 0 0 .75em !important; }
@media (min-width: 640px) { .person { grid-template-columns: 160px 1fr; gap: 28px; } }

/* sermons & news lists */
.sermon-list, .news-list { list-style: none; padding: 0 !important; }
.sermon-list li, .news-list li { border-bottom: 1px solid var(--line); margin: 0 !important; }
.sermon-list a, .news-list a { display: block; padding: .7em 0 .1em; font-weight: 600; }
.sermon-list li { padding-bottom: .6em; }
.news-list li { padding-bottom: .7em; }
.news-date { display: block; color: var(--muted); font-size: .95rem; }
@media (min-width: 760px) { .sermon-list { columns: 2; column-gap: 32px; } .sermon-list li { break-inside: avoid; } }

.post-date { color: var(--muted); font-weight: 600; }
.pager { display: grid; gap: 12px; margin: 3em 0 1em; }
@media (min-width: 600px) { .pager { grid-template-columns: 1fr 1fr; } .pager-next { grid-column: 2; text-align: right; } }
.pager a {
  display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; font-weight: 700;
}
.pager a span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pager a:hover { border-color: var(--blue); }

/* ---------------------------------------------------------------- home */
.hero { position: relative; display: grid; align-items: end; min-height: clamp(460px, 72vh, 640px); color: #fff; overflow: hidden; background: var(--navy); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(16, 42, 84, .95) 0%, rgba(16, 42, 84, .7) 45%, rgba(16, 42, 84, .3) 100%);
}
.hero-inner { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 48px; }
.hero h1 { color: #fff; margin: 0 0 .4em; max-width: 20ch; font-size: clamp(2rem, 6vw, 3.3rem); }
.hero-lead { font-size: clamp(1.15rem, 2.5vw, 1.35rem); margin: 0 0 1.5em; max-width: 36ch; }
.hero .eyebrow { color: #9fe0fb; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 479.98px) { .hero-actions .btn { flex: 1 1 100%; } }

.section { padding: 56px 0; }
.section-soft { background: var(--soft); }
.section h2 { margin-top: 0; }
.section-intro { color: var(--muted); max-width: 60ch; margin: 0 0 1.75em; }

.cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--blue); color: var(--ink); }
.card-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px;
  border-radius: 50%; background: #e6f0ff; color: var(--blue);
}
@media (max-width: 559.98px) {
  .card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; align-items: start; }
  .card-icon { grid-row: span 2; width: 44px; height: 44px; margin: 0; }
  .card .more { display: none; }
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-title { font-size: 1.2rem; font-weight: 700; color: var(--navy); }
.card-text { color: var(--muted); }
.more { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--blue); }
.more::after { content: " →"; }

.split { display: grid; gap: 32px; align-items: center; }
.split img { display: block; width: 100%; border-radius: var(--radius); }
@media (min-width: 880px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; } }
.split p { margin: 0 0 1em; }
.facts { list-style: none; padding: 0; margin: 0 0 1.5em; display: grid; gap: 10px; }
.facts li { display: flex; gap: 12px; }
.facts strong { min-width: 6.5em; color: var(--navy); }
.link-row { display: flex; flex-wrap: wrap; gap: 12px; }
.link-row .btn-outline-dark { border-color: var(--blue); color: var(--blue); }
.link-row .btn-outline-dark:hover { background: #e6f0ff; }

.news-grid { display: grid; gap: 16px; }
@media (min-width: 880px) { .news-grid { grid-template-columns: 2fr 1fr; } }
.news-card {
  display: flex; flex-direction: column; gap: 6px; padding: 24px; height: 100%;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
}
.news-card:hover { border-color: var(--blue); color: var(--ink); }
.news-card-title { font: 700 1.5rem/1.25 var(--serif); color: var(--navy); }
.news-card-text { color: var(--muted); }
.side-links { display: grid; gap: 12px; align-content: start; }
.side-links a {
  display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 12px 18px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  font-weight: 700; color: var(--navy); text-decoration: none;
}
.side-links a::after { content: "→"; color: var(--blue); }
.side-links a:hover { border-color: var(--blue); }

.tiles { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 108px; padding: 16px 18px;
  border-radius: var(--radius); background: var(--navy-2); color: #fff; text-decoration: none;
  background-image: linear-gradient(135deg, rgba(28, 181, 236, .25), transparent 60%);
  transition: background-color .15s;
}
.tile:hover { background-color: var(--blue); color: #fff; }
.tile strong { font-size: 1.15rem; }
.tile span { font-size: .95rem; opacity: .85; line-height: 1.35; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy); color: #d5def0; padding: 56px 0 24px; font-size: 1.02rem; }
.site-footer a { color: #fff; }
.site-footer h2 {
  font: 700 .85rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #9fe0fb; margin: 0 0 1em;
}
.site-footer p { margin: 0 0 1em; }
.footer-grid { display: grid; gap: 32px; max-width: 1160px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand img { width: 64px; height: 64px; }
.footer-name { font: 700 1.25rem var(--serif); color: #fff; margin: .5em 0 .3em !important; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5em; }
.social { list-style: none; display: flex; gap: 8px; padding: 0; margin: 1em 0 0; }
.social a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
}
.social a:hover { background: var(--blue); }
.social svg { width: 20px; height: 20px; fill: #fff; }
.footer-bottom { max-width: 1160px; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .95rem; }

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

@media print {
  .site-header, .site-footer, .pager { display: none; }
  .page-header { background: none; color: #000; padding: 0; }
  .page-header h1 { color: #000; }
}
