/*
Theme Name: Shiloh A.M.E. Zion Preview
Theme URI: https://shilohamezgrover.org/
Author: Shiloh Website Project
Description: Prototype WordPress theme based on the approved Shiloh A.M.E. Zion Church design direction. Intended for private staging and design review.
Version: 0.8.67
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: shiloh-preview
*/

:root {
  --shiloh-charcoal: #17151a;
  --shiloh-charcoal-2: #24202a;
  --shiloh-plum: #6d304f;
  --shiloh-plum-deep: #4a263a;
  --shiloh-burnt: #c46f3d;
  --shiloh-gold: #d8912f;
  --shiloh-cream: #f8f2e9;
  --shiloh-white: #fffdf9;
  --shiloh-ink: #2d2628;
  --shiloh-muted: #6d6562;
  --shiloh-border: rgba(74,38,58,.17);
  --shiloh-radius: 14px;
  --shiloh-shadow: 0 12px 32px rgba(30,21,27,.10);
  --shiloh-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--shiloh-ink); background: var(--shiloh-cream); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.shiloh-container { width: min(var(--shiloh-max), calc(100% - 40px)); margin-inline: auto; }
.shiloh-serif { font-family: Georgia, 'Times New Roman', serif; }
.shiloh-eyebrow { color: var(--shiloh-gold); font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; }
.shiloh-section { padding: 58px 0; }
.shiloh-section-title { font: 400 clamp(2rem, 4vw, 3.1rem)/1.05 Georgia, 'Times New Roman', serif; margin: 0 0 18px; color: var(--shiloh-charcoal); }
.shiloh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.shiloh-btn:hover { transform: translateY(-1px); }
.shiloh-btn-primary { background: linear-gradient(135deg, var(--shiloh-burnt), var(--shiloh-gold)); color: #fff; box-shadow: 0 8px 20px rgba(196,111,61,.24); }
.shiloh-btn-outline { color: #fff; border-color: rgba(255,255,255,.72); background: rgba(23,21,26,.18); backdrop-filter: blur(4px); }
.shiloh-btn-light { color: var(--shiloh-plum-deep); border-color: var(--shiloh-plum); background: transparent; }

/* Header */
.shiloh-mobile-brand, .shiloh-mobile-action { display:none; }
.shiloh-header { position:absolute; inset:0 0 auto 0; z-index:20; color:#fff; }
.shiloh-nav { height: 92px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.shiloh-logo img { width: 124px; max-height: 105px; object-fit:contain; }
.shiloh-nav-links { display:flex; align-items:center; gap:32px; font-family: Georgia, 'Times New Roman', serif; font-size:1rem; }
.shiloh-nav-links a { opacity:.94; }
.shiloh-nav-links a:hover { color:#f0ad46; }
.shiloh-menu-toggle { display:none; border:1px solid rgba(255,255,255,.65); color:#fff; background:rgba(0,0,0,.18); border-radius:7px; padding:9px 11px; font-size:1.05rem; }

/* v0.6: preserve the overlay at the top; compact only after scrolling. */
html { scroll-padding-top: calc(80px + var(--shiloh-admin-offset, 0px)); }
.shiloh-header { transition: background-color .18s ease, box-shadow .18s ease; }
.shiloh-header.is-scrolled {
  position: fixed;
  top: var(--shiloh-admin-offset, 0px);
  background: rgba(23,21,26,.97);
  box-shadow: 0 4px 16px rgba(23,21,26,.18);
}
.shiloh-header.is-scrolled .shiloh-nav { height:64px; }
@media (max-width:900px) {
  .shiloh-header.is-scrolled .shiloh-nav-links { top:64px; margin-top:0; }
  .shiloh-header .shiloh-nav-links {
    max-height:calc(100dvh - 100px - var(--shiloh-admin-offset, 0px));
    overflow-y:auto;
  }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  .shiloh-header { transition:none; }
}

/* Hero */
.shiloh-hero { min-height: 560px; color:#fff; position:relative; background: var(--shiloh-charcoal); overflow:hidden; display:flex; align-items:center; }
.shiloh-hero:before { content:''; position:absolute; inset:0; background-image: linear-gradient(90deg, rgba(23,21,26,.98) 0%, rgba(63,37,47,.92) 34%, rgba(23,21,26,.42) 69%, rgba(23,21,26,.16) 100%), var(--hero-image); background-size:cover; background-position:center right; }
.shiloh-hero:after { content:''; position:absolute; inset:0; background: radial-gradient(circle at 22% 45%, rgba(109,48,79,.24), transparent 40%); pointer-events:none; }
.shiloh-hero-content { position:relative; z-index:2; padding-top:100px; width:min(610px,100%); }
.shiloh-hero .shiloh-brand-title { font:400 clamp(3.4rem, 7vw, 6rem)/.92 Georgia, 'Times New Roman', serif; margin:0; letter-spacing:-.035em; }
.shiloh-hero-title-primary { color:#fff; }
.shiloh-hero-title-secondary { color:#e0a03f; margin-left:.18em; }
.shiloh-tagline { font:italic 400 1.06rem/1.5 Georgia, 'Times New Roman', serif; margin:22px 0 16px; color:#f4e9e1; }
.shiloh-location { display:flex; gap:9px; align-items:center; margin-bottom:22px; color:#f8f1ec; }
.shiloh-hero-meta { display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.shiloh-hero-actions { display:flex; gap:14px; flex-wrap:wrap; }



/* Desktop-only v0.5 refinements. Mobile behavior remains unchanged pending review. */
@media (min-width: 901px) {
  .shiloh-nav {
    height: 68px;
    justify-content: flex-start;
    gap: 18px;
  }
  .shiloh-nav-links {
    flex: 1 1 auto;
  }
  .shiloh-hero {
    height: 200px;
    min-height: 200px;
    align-items: flex-start;
  }
  .shiloh-hero:before {
    /* Keep the worshipper's face clear of the title by concentrating the image on the right. */
    background-size: cover, auto 290%;
    background-position: center, right 34%;
    background-repeat: no-repeat;
  }
  .shiloh-hero-content {
    padding-top: 58px;
    padding-bottom: 10px;
    width: min(1040px, 100%);
  }
  .shiloh-hero .shiloh-brand-title {
    font-size: clamp(2.55rem, 4.2vw, 4.15rem);
    line-height: .98;
    white-space: nowrap;
  }
  .shiloh-tagline {
    margin: 6px 0 8px;
    font-size: .98rem;
    line-height: 1.3;
  }
  .shiloh-hero-meta {
    flex-wrap: nowrap;
    gap: 14px;
    align-items: center;
  }
  .shiloh-location {
    margin-bottom: 0;
    font-size: .94rem;
    white-space: nowrap;
  }
  .shiloh-hero-actions {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .shiloh-btn {
    min-height: 38px;
    padding: 0 16px;
  }

  /* Tighten only the second and third homepage rails. */
  .shiloh-feature-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }
  .shiloh-events {
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .shiloh-events .shiloh-center-head {
    margin-bottom: 18px;
  }
}

/* Pastor / latest message */
.shiloh-feature-grid { display:grid; grid-template-columns: 1.05fr 1fr; gap:36px; align-items:stretch; }
.shiloh-pastor { display:grid; grid-template-columns: 210px 1fr; gap:28px; align-items:center; padding-right:28px; border-right:1px solid var(--shiloh-border); }
.shiloh-pastor-photo { width:100%; aspect-ratio: .78; object-fit:cover; border-radius:12px; box-shadow:var(--shiloh-shadow); object-position:center 22%; }
.shiloh-pastor h2 { font:400 2.1rem/1.1 Georgia, 'Times New Roman', serif; margin:0 0 10px; }
.shiloh-pastor h2 em { display:block; color:var(--shiloh-plum); font-weight:400; }
.shiloh-pastor-copy { color:#4f4847; font-size:.96rem; }
.shiloh-pastor-name { margin:18px 0 4px; color:var(--shiloh-plum); font:italic 400 1.25rem Georgia, 'Times New Roman', serif; }
.shiloh-pastor-title { font-size:.73rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; margin-bottom:16px; }
.shiloh-message-card { background:#fff; border:1px solid var(--shiloh-border); border-radius:var(--shiloh-radius); overflow:hidden; box-shadow:var(--shiloh-shadow); }
.shiloh-message-thumb { position:relative; aspect-ratio:16/9; background: linear-gradient(145deg,#342a26,#8c542d); display:grid; place-items:center; overflow:hidden; }
.shiloh-message-thumb img { width:100%; height:100%; object-fit:cover; opacity:.72; }
.shiloh-play { position:absolute; width:76px; height:76px; border:3px solid rgba(255,255,255,.9); border-radius:50%; display:grid; place-items:center; background:rgba(23,21,26,.32); color:#fff; font-size:1.8rem; padding-left:4px; }
.shiloh-message-body { padding:18px 20px 20px; }
.shiloh-message-body h3 { font:400 1.7rem/1.1 Georgia, 'Times New Roman', serif; margin:0 0 6px; }

/* Events */
.shiloh-events { background:#fffaf4; border-top:1px solid rgba(109,48,79,.08); border-bottom:1px solid rgba(109,48,79,.08); }
.shiloh-center-head { text-align:center; margin-bottom:28px; }
.shiloh-events-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.shiloh-event { background:#fff; border:1px solid var(--shiloh-border); border-radius:12px; padding:22px; display:grid; grid-template-columns:78px 1fr; gap:18px; box-shadow:0 7px 20px rgba(55,35,44,.06); }
.shiloh-event-date { border-right:1px solid var(--shiloh-border); text-align:center; padding-right:14px; }
.shiloh-event-month { color:var(--shiloh-plum); font-size:.73rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.shiloh-event-day { font:400 2.4rem/1 Georgia, serif; color:var(--shiloh-charcoal); white-space:nowrap; }
.shiloh-event-day.is-range { font-size:1.55rem; letter-spacing:-.04em; }
.shiloh-event h3 { margin:0 0 5px; font:400 1.18rem/1.2 Georgia,serif; }
.shiloh-event p { font-size:.86rem; margin:0; color:var(--shiloh-muted); }

/* Connect */
.shiloh-connect { color:#fff; background:linear-gradient(100deg,#5a2945 0%,#7e3a50 47%,#d17834 100%); }
.shiloh-connect .shiloh-section-title { color:#fff; text-align:center; font-size:1.3rem; letter-spacing:.16em; text-transform:uppercase; }
.shiloh-connect-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.shiloh-connect-card { background:rgba(255,253,249,.96); color:var(--shiloh-ink); border-radius:11px; padding:24px 20px; min-height:185px; }
.shiloh-icon { width:52px; height:52px; border:1.5px solid var(--shiloh-gold); border-radius:50%; display:grid; place-items:center; color:var(--shiloh-burnt); font-size:1.35rem; margin-bottom:14px; }
.shiloh-icon svg { width:28px; height:28px; display:block; }
.shiloh-icon-worship { color:#946125; border-color:#946125; background:#f6eddf; }
.shiloh-icon-serve { color:#a34059; border-color:#a34059; background:#f8e9ed; }
.shiloh-icon-grow { color:#467346; border-color:#467346; background:#eaf2e5; }
.shiloh-icon-give { color:#ad6426; border-color:#ad6426; background:#fbefd9; }
.shiloh-connect-card h3 { font:400 1.1rem Georgia,serif; letter-spacing:.05em; text-transform:uppercase; margin:0 0 8px; }
.shiloh-connect-card p { font-size:.86rem; color:var(--shiloh-muted); }
.shiloh-text-link { color:var(--shiloh-plum); font-weight:700; font-size:.86rem; }

/* Footer */
.shiloh-footer { color:#fff; background:linear-gradient(120deg,#14131a,#20212a); padding:38px 0 0; }
.shiloh-footer-grid { display:grid; grid-template-columns:1.35fr 1.1fr 1fr .7fr; gap:34px; align-items:start; }
.shiloh-footer h3 { font:400 1rem Georgia,serif; letter-spacing:.08em; text-transform:uppercase; margin:0 0 14px; }
.shiloh-footer p, .shiloh-footer li { color:#e2dedc; font-size:.9rem; }
.shiloh-footer ul { list-style:none; padding:0; margin:0; }
.shiloh-footer li { margin-bottom:8px; }
.shiloh-footer-social { display:inline-flex; align-items:center; gap:8px; }
.shiloh-footer-underlined-link { text-decoration:underline; text-underline-offset:3px; }
.shiloh-footer-social svg { width:20px; height:20px; flex:none; fill:currentColor; }
.shiloh-footer-facebook svg { fill:#0866ff; background:#fff; border-radius:50%; }
.shiloh-footer-youtube svg { fill:#ff0000; background:linear-gradient(#fff,#fff) center / 12px 10px no-repeat; }
.shiloh-footer-logo img { width:145px; }
.shiloh-footer-credit { padding-bottom:16px; text-align:right; color:#cfcbca; font-size:.76rem; }
.shiloh-footer-credit a { color:inherit; text-decoration:underline; text-underline-offset:3px; }
.shiloh-copyright { margin-top:30px; padding:16px 0; border-top:1px solid rgba(255,255,255,.12); text-align:center; color:#cfcbca; font-size:.76rem; }

/* Interior */
.shiloh-page-hero { padding:160px 0 72px; background:linear-gradient(120deg,var(--shiloh-charcoal),var(--shiloh-plum-deep)); color:#fff; }
.shiloh-page-hero h1 { font:400 clamp(2.8rem,6vw,5rem)/1 Georgia,serif; margin:0; }
.shiloh-content { padding:58px 0; min-height:45vh; }
.shiloh-content .entry-content { max-width:820px; }

@media (max-width: 900px) {
  .shiloh-nav-links { display:none; position:absolute; top:82px; left:20px; right:20px; background:rgba(23,21,26,.98); border:1px solid rgba(255,255,255,.15); border-radius:12px; padding:18px; flex-direction:column; align-items:stretch; gap:0; }
  .shiloh-nav-links.is-open { display:flex; }
  .shiloh-nav-links a { padding:11px 8px; }
  .shiloh-menu-toggle { display:block; }
  .shiloh-nav-give { display:none; }
  .shiloh-feature-grid { grid-template-columns:1fr; }
  .shiloh-pastor { border-right:0; border-bottom:1px solid var(--shiloh-border); padding:0 0 34px; }
  .shiloh-events-grid { grid-template-columns:1fr; }
  .shiloh-connect-grid { grid-template-columns:repeat(2,1fr); }
  .shiloh-footer-grid { grid-template-columns:1fr 1fr; }
}

@media (max-width: 620px) {
  .shiloh-container { width:min(100% - 28px, var(--shiloh-max)); }
  .shiloh-nav { height:76px; }
  .shiloh-logo img { width:96px; }
  .shiloh-hero { min-height:640px; align-items:flex-end; }
  .shiloh-hero:before { background-image:linear-gradient(0deg, rgba(23,21,26,.98) 8%, rgba(23,21,26,.83) 50%, rgba(23,21,26,.35) 100%), var(--hero-image); background-position:62% center; }
  .shiloh-hero-content { padding:128px 0 58px; }
  .shiloh-hero .shiloh-brand-title { font-size:3.25rem; }
  .shiloh-hero-title-primary, .shiloh-hero-title-secondary { display:block; }
  .shiloh-hero-title-secondary { margin-left:0; font-size:.58em; margin-top:10px; }
  .shiloh-hero-meta { display:block; }
  .shiloh-location { margin-bottom:22px; }
  .shiloh-pastor { grid-template-columns:1fr; }
  .shiloh-pastor-photo { max-height:460px; object-position:center 20%; }
  .shiloh-connect-grid, .shiloh-footer-grid { grid-template-columns:1fr; }
  .shiloh-section { padding:44px 0; }
}

/* Page content and departments */
[hidden] { display:none !important; }
.shiloh-skip-link { position:fixed; top:-100px; left:16px; z-index:1000; padding:12px 18px; background:white; color:#17151a; }
.shiloh-skip-link:focus { top:8px; }
.shiloh-nav-links { list-style:none; padding-left:0; margin:0; }
a:focus-visible, button:focus-visible { outline:3px solid #d8912f; outline-offset:4px; }
.shiloh-content .entry-content { max-width:none; }
.entry-content > p, .entry-content > h2, .entry-content > h3, .shiloh-prose { max-width:760px; }
.shiloh-about-content .entry-content > p, .shiloh-about-content .entry-content > h2, .shiloh-about-content .entry-content > h3, .shiloh-about-content .shiloh-prose { max-width:none; }
.entry-content h2 { font:400 clamp(1.8rem,3vw,2.6rem)/1.2 Georgia,serif; color:var(--shiloh-plum-deep); margin:30px 0 16px; }
.entry-content p { font-size:1.06rem; }
.entry-content p a, .entry-content li a { text-decoration:underline; text-underline-offset:3px; }
.shiloh-page-actions { display:flex; flex-wrap:wrap; gap:14px; margin:26px 0; }
.shiloh-departments { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:26px; align-items:start; }
.shiloh-department { margin:0; overflow:hidden; border:1px solid var(--shiloh-border); border-radius:14px; background:var(--shiloh-white); }
.shiloh-department { content-visibility:auto; contain-intrinsic-size:auto 430px; }
.shiloh-department img, .shiloh-photo-placeholder { width:100%; aspect-ratio:4/3; object-fit:cover; display:block; }
.shiloh-department img { height:auto; aspect-ratio:4/3; object-fit:contain; background:#f2efec; }
.shiloh-department-photos > a { display:block; min-width:0; }
@media(max-width:620px) {
  /* Portrait phones: stack every individual ministry card at full width. */
  .shiloh-departments { grid-template-columns:minmax(0,1fr); gap:20px; }
  .shiloh-department { width:100%; min-width:0; grid-column:1 / -1; }
  .shiloh-department-photos {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-auto-flow:row;
    grid-auto-columns:auto;
    gap:0;
    width:100%;
    min-width:0;
    overflow:visible;
    padding-bottom:0;
    scroll-snap-type:none;
  }
  .shiloh-department-photos > a {
    display:block;
    width:100%;
    min-width:0;
    scroll-snap-align:none;
  }
  .shiloh-department img {
    width:100%;
    max-width:100%;
    height:auto;
    aspect-ratio:auto;
    object-fit:contain;
  }
  .shiloh-department figcaption { padding:16px 18px; }
}
.shiloh-photo-placeholder { display:grid; place-items:center; background:linear-gradient(140deg,#e8ddd2,#f4ede4); color:#6b585f; }
.shiloh-photo-placeholder span { border:1px solid #a08d92; padding:8px 15px; border-radius:30px; font-size:.85rem; }
.shiloh-department figcaption { padding:20px; font:400 1.25rem Georgia,serif; color:var(--shiloh-plum-deep); }
.shiloh-schedule { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.entry-content > .shiloh-schedule, .shiloh-personal-message { clear:both; }
.shiloh-schedule h3 { margin:0 0 10px; font:400 1.4rem Georgia,serif; color:var(--shiloh-plum-deep); }
.shiloh-schedule > div { border-left:3px solid var(--shiloh-gold); padding:4px 0 4px 20px; }
.shiloh-schedule p { margin:0; }
.shiloh-schedule-section { padding-bottom:10px; }
.shiloh-map { display:block; width:100%; height:440px; border:0; border-radius:14px; background:#e8ddd2; }
.shiloh-biography-photo { float:right; width:34%; max-width:350px; margin:0 0 28px 44px; border-radius:14px; }
.entry-content::after { content:''; display:block; clear:both; }
.shiloh-example { display:block; margin-bottom:9px; font-size:.73rem; font-weight:bold; color:#6d304f; }
.shiloh-event .shiloh-text-link { display:inline-block; margin-top:10px; }
.shiloh-event p + p { margin-top:8px; }
.shiloh-sources { padding-top:20px; border-top:1px solid var(--shiloh-border); font-size:.85rem !important; }
@media(max-width:900px) { .shiloh-departments { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) { .shiloh-departments,.shiloh-schedule { grid-template-columns:1fr; } .shiloh-biography-photo { float:none; width:100%; margin:0 0 26px; } .shiloh-map { height:330px; } .shiloh-page-hero { padding:130px 0 48px; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { transition:none !important; } }

/* Shared image header and current navigation */
.shiloh-brand-title { font:400 clamp(3.4rem,7vw,6rem)/.92 Georgia,serif; margin:0; letter-spacing:-.035em; }
.shiloh-nav-links a { display:block; padding:7px 9px; border-radius:6px; }
.shiloh-nav-links { gap:14px; }
.shiloh-nav-links .current-menu-item > a,.shiloh-nav-links .current-menu-ancestor > a,.shiloh-nav-links a[aria-current] { background:rgba(248,242,233,.19); box-shadow:inset 0 -2px #e0a03f; color:#fff; }
.shiloh-page-title { font:400 clamp(2.2rem,4vw,3.8rem)/1.15 Georgia,serif; color:var(--shiloh-plum-deep); margin:0 0 32px; overflow-wrap:anywhere; }
.shiloh-event-table { width:100%; border-collapse:collapse; background:var(--shiloh-white); }
.shiloh-event-table th,.shiloh-event-table td { text-align:left; padding:17px 20px; border-bottom:1px solid var(--shiloh-border); vertical-align:top; }
.shiloh-event-table thead { background:var(--shiloh-plum-deep); color:#fff; }
.shiloh-event-table tbody tr:nth-child(even) { background:#f0e8df; }
.shiloh-event-table th[scope=row] { width:170px; font-weight:normal; }
.shiloh-event-table td:nth-child(2) { width:52%; }
.shiloh-event-table a { text-decoration:underline; text-underline-offset:3px; }
.shiloh-sermons-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:26px; }
.shiloh-sermon { background:var(--shiloh-white); border:1px solid var(--shiloh-border); border-radius:12px; overflow:hidden; }
.shiloh-sermon img { display:block; width:100%; aspect-ratio:16/9; object-fit:contain; background:#17151a; }
.shiloh-sermon-body { padding:22px; }
.shiloh-sermon h2,.shiloh-sermon h3 { margin:0 0 12px; font:400 1.5rem/1.2 Georgia,serif; }
.shiloh-sermon p { margin:8px 0; }
.shiloh-sermon-meta { color:var(--shiloh-muted); font-size:.85rem !important; }
.shiloh-sermon-pagination { display:flex; flex-wrap:wrap; gap:10px; margin:28px 0; }
.shiloh-sermon-pagination a,.shiloh-sermon-pagination span { padding:8px 14px; border:1px solid var(--shiloh-border); border-radius:5px; }
.shiloh-sermon-pagination .current { background:var(--shiloh-plum-deep); color:white; }
@media(max-width:620px){
.shiloh-sermons-grid { grid-template-columns:1fr; }
.shiloh-event-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.shiloh-event-table,.shiloh-event-table tbody { display:block; }
.shiloh-event-table tr { display:grid; grid-template-columns:100px minmax(0,1fr); padding:10px; border-bottom:1px solid var(--shiloh-border); }
.shiloh-event-table th[scope=row] { width:auto; grid-row:span 2; }
.shiloh-event-table td:nth-child(2) { width:auto; }
.shiloh-event-table th,.shiloh-event-table td { border:0; padding:8px; }
.shiloh-event-table td:last-child { grid-column:2; font-size:.88rem; }
}

/* Compact navigation replaces the large hero on phones and small tablets. */
@media (max-width:900px) {
  .shiloh-header, .shiloh-header.is-scrolled { position:fixed; top:var(--shiloh-admin-offset,0px); background:rgba(23,21,26,.98); box-shadow:0 4px 16px rgba(23,21,26,.18); }
  .shiloh-header .shiloh-nav { height:64px; gap:12px; }
  .shiloh-mobile-brand { display:block; margin-right:auto; font:400 1.65rem Georgia,serif; }
  .shiloh-mobile-action { display:inline-flex; align-items:center; min-height:44px; font-size:.9rem; }
  .shiloh-menu-toggle { min-height:44px; font-size:.95rem; }
  .shiloh-header .shiloh-nav-links { top:64px; margin-top:0; max-height:calc(100dvh - 80px - var(--shiloh-admin-offset,0px)); }
  .shiloh-nav-links a { display:block; }
  #main-content { padding-top:64px; }
  .shiloh-hero { display:none; }
  .shiloh-content { padding-top:28px; }
}

.home .shiloh-pastor-photo { box-sizing:border-box; padding:5px; background:var(--shiloh-white); border:1px solid var(--shiloh-border); border-radius:16px; box-shadow:var(--shiloh-shadow); }

/* Phone homepage: welcome first, followed by a compact pastor portrait. */
@media (max-width:620px) {
  .home .shiloh-feature-section .shiloh-pastor > div { grid-row:1; }
  .home .shiloh-feature-section .shiloh-pastor > .shiloh-pastor-photo { grid-row:2; width:180px; max-width:100%; height:auto; max-height:none; justify-self:center; }
}

/* Native modal keeps the page position and keyboard focus behind the photo. */
body.shiloh-photo-open { overflow:hidden; }
.shiloh-photo-dialog { width:fit-content; max-width:calc(100vw - 28px); max-height:calc(100dvh - 28px); padding:56px 16px 12px; border:0; border-radius:12px; background:#17151a; color:#fff; box-shadow:0 20px 70px #0008; }
.shiloh-photo-dialog::backdrop { background:rgba(0,0,0,.8); }
.shiloh-photo-dialog img { display:block; width:auto; height:auto; max-width:100%; max-height:calc(100dvh - 150px); object-fit:contain; margin:auto; }
.shiloh-photo-close { position:absolute; top:8px; right:12px; min-height:40px; padding:6px 14px; border:1px solid #ffffff80; border-radius:6px; background:transparent; color:#fff; cursor:pointer; font:inherit; }
.shiloh-photo-caption { text-align:center; margin:12px 0 0; font-size:.9rem; }

/* Center gallery captions and sermon archive card details. */
.shiloh-department figcaption { text-align:center; }
.shiloh-sermons-grid .shiloh-sermon-body { text-align:center; }
.shiloh-event-pagination { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:16px; margin-top:24px; }
.shiloh-event-pagination a { display:inline-flex; align-items:center; min-height:44px; padding:8px 14px; border:1px solid var(--shiloh-plum); border-radius:6px; color:var(--shiloh-plum-deep); }


/* Sunday School lesson downloads */
.shiloh-lessons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:26px; margin:30px 0 12px; }
.shiloh-lesson-card { position:relative; background:var(--shiloh-white); border:1px solid var(--shiloh-border); border-radius:var(--shiloh-radius); padding:28px; box-shadow:var(--shiloh-shadow); overflow:hidden; }
.shiloh-lesson-card.is-current { border-top:4px solid var(--shiloh-gold); }
.shiloh-lesson-card.is-next { border-top:4px solid var(--shiloh-plum); }
.shiloh-lesson-card .shiloh-eyebrow { margin-top:0; }
.shiloh-lesson-date { margin:3px 0 8px; color:var(--shiloh-muted); font-weight:700; letter-spacing:.02em; }
.shiloh-lesson-card h2 { margin:0 0 22px; color:var(--shiloh-plum-deep); font:400 clamp(1.45rem,2.2vw,1.9rem)/1.22 Georgia,'Times New Roman',serif; }
.shiloh-btn-disabled { cursor:not-allowed; background:#ece7e2; border-color:#d7d0ca; color:#77706c; opacity:.9; }
.shiloh-btn-disabled:hover { transform:none; background:#ece7e2; border-color:#d7d0ca; color:#77706c; }
.shiloh-lesson-availability { margin:12px 0 0; color:var(--shiloh-muted); font-size:.9rem !important; }
.shiloh-lesson-empty { margin-top:28px; padding:24px; border:1px solid var(--shiloh-border); border-radius:var(--shiloh-radius); background:var(--shiloh-white); }
@media (max-width:760px) { .shiloh-lessons { grid-template-columns:1fr; } .shiloh-lesson-card { padding:22px; } }


/* Ministries photo viewer navigation */
.shiloh-photo-nav { position:absolute; top:50%; transform:translateY(-50%); width:46px; height:46px; border:1px solid #ffffff80; border-radius:50%; background:rgba(23,21,26,.78); color:#fff; cursor:pointer; font-size:1.8rem; line-height:1; display:flex; align-items:center; justify-content:center; z-index:2; }
.shiloh-photo-prev { left:12px; }
.shiloh-photo-next { right:12px; }
.shiloh-photo-nav:disabled { opacity:.28; cursor:default; }
@media (max-width:620px) {
  .shiloh-photo-dialog { padding-inline:8px; }
  .shiloh-photo-nav { width:42px; height:42px; }
  .shiloh-photo-prev { left:6px; }
  .shiloh-photo-next { right:6px; }
}


/* Our Pastor page: force a desktop right-side image panel and separate mobile layout. */
.shiloh-page--pastor .shiloh-page-title { font:400 clamp(1.7rem,2.4vw,1.95rem)/1.2 Georgia,serif; color:var(--shiloh-plum-deep); margin:0 0 20px; }
.shiloh-page--pastor .entry-content h2 { font:400 clamp(1.22rem,1.6vw,1.38rem)/1.3 Georgia,serif; color:var(--shiloh-plum-deep); margin:1.25em 0 .45em; }
.shiloh-page--pastor .shiloh-pastor-bio-layout-desktop { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:36px; align-items:start; }
.shiloh-page--pastor .shiloh-pastor-bio-layout-mobile { display:none; }
.shiloh-page--pastor .shiloh-pastor-bio-main { min-width:0; }
.shiloh-page--pastor .shiloh-pastor-bio-main > h2:first-child { margin-top:0; }
.shiloh-page--pastor .shiloh-pastor-bio-panel { display:grid; grid-template-columns:1fr; gap:26px; align-self:start; }
.shiloh-page--pastor .shiloh-pastor-bio-panel-item { background:var(--shiloh-white); border:1px solid var(--shiloh-border); border-radius:16px; padding:5px; box-shadow:var(--shiloh-shadow); }
.shiloh-page--pastor .shiloh-biography-photo { float:none; display:block; width:100%; max-width:100%; height:auto; margin:0; border-radius:12px; box-shadow:none; object-fit:contain; }
.shiloh-page--pastor .entry-content > p,
.shiloh-page--pastor .entry-content li,
.shiloh-page--pastor .entry-content .shiloh-personal-message p,
.shiloh-page--pastor .entry-content .shiloh-schedule p { font-size:1rem; line-height:1.7; }
.shiloh-page--pastor .shiloh-schedule { margin-top:30px; }
.shiloh-page--pastor .shiloh-page-actions { margin-top:24px; }
@media (max-width:860px) {
  .shiloh-page--pastor .shiloh-pastor-bio-layout-desktop { display:none; }
  .shiloh-page--pastor .shiloh-pastor-bio-layout-mobile { display:grid; grid-template-columns:1fr; gap:24px; }
  .shiloh-page--pastor .shiloh-pastor-bio-layout-mobile .shiloh-pastor-bio-panel-item { width:min(100%, 420px); margin:0 auto; }
}


/* About page: align typography and reading rhythm with the Our Pastor page.
   Unlike the Pastor page, About has no image rail, so its copy uses the full content width. */
.shiloh-about-content .shiloh-page-title { font:400 clamp(1.7rem,2.4vw,1.95rem)/1.2 Georgia,serif; color:var(--shiloh-plum-deep); margin:0 0 20px; }
.shiloh-about-content .entry-content h2 { font:400 clamp(1.22rem,1.6vw,1.38rem)/1.3 Georgia,serif; color:var(--shiloh-plum-deep); margin:1.25em 0 .45em; }
.shiloh-about-content .entry-content > h2:first-of-type { margin-top:0; }
.shiloh-about-content .entry-content > p,
.shiloh-about-content .entry-content li { font-size:1rem; line-height:1.7; }
.shiloh-about-content .shiloh-page-actions { margin-top:24px; }
.shiloh-about-content .shiloh-sources { max-width:none; line-height:1.6; }


/* Gallery albums: theme-bundled content with responsive WebP delivery. */
.shiloh-gallery-albums { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:26px; margin:30px 0 10px; align-items:start; }
.shiloh-album-card { margin:0; overflow:hidden; border:1px solid var(--shiloh-border); border-radius:14px; background:var(--shiloh-white); box-shadow:var(--shiloh-shadow); content-visibility:auto; contain-intrinsic-size:auto 470px; }
.shiloh-album-cover { display:block; background:#f2efec; }
.shiloh-album-cover img,.shiloh-album-card .shiloh-photo-placeholder { display:block; width:100%; aspect-ratio:4/3; object-fit:cover; }
.shiloh-album-cover img { object-position:center 20%; }
.shiloh-album-card-body { padding:20px; text-align:center; }
.shiloh-album-card h2 { margin:0 0 9px; font:400 1.35rem/1.25 Georgia,serif; color:var(--shiloh-plum-deep); }
.shiloh-album-card h2 a { color:inherit; text-decoration:none; }
.shiloh-album-card h2 a:hover { text-decoration:underline; text-underline-offset:3px; }
.shiloh-album-card-body p { margin:8px 0; font-size:.96rem; line-height:1.55; }
.shiloh-album-meta,.shiloh-album-date { color:var(--shiloh-muted); font-size:.88rem !important; }
.shiloh-gallery-empty { margin:28px 0; padding:24px; border:1px solid var(--shiloh-border); border-radius:14px; background:var(--shiloh-white); }
.shiloh-gallery-empty p { margin:0; max-width:none; }
.shiloh-album-description { max-width:820px !important; }
.shiloh-album-photos { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:28px 0; }
.shiloh-album-photo { margin:0; overflow:hidden; border:1px solid var(--shiloh-border); border-radius:12px; background:var(--shiloh-white); }
.shiloh-album-photo > a { display:block; background:#f2efec; }
.shiloh-album-photo img { display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; object-position:center 20%; }
.shiloh-album-photo figcaption { padding:12px 14px; text-align:center; color:var(--shiloh-muted); font-size:.88rem; }
.shiloh-album-back { margin-top:26px; }
@media(max-width:900px) { .shiloh-gallery-albums,.shiloh-album-photos { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:620px) { .shiloh-gallery-albums,.shiloh-album-photos { grid-template-columns:1fr; gap:20px; } .shiloh-album-card-body { padding:18px; } .shiloh-album-photo img { aspect-ratio:auto; object-fit:contain; } }
