/*
Theme Name: Pastor Bobby Ministry
Theme URI: https://example.com/
Author: Vinebuilders Studio LLC
Description: Custom responsive ministry website theme for Pastor Bobby. Built for desktop, tablet, mobile, and later Capacitor wrapping.
Version: 1.2.0
Text Domain: pastor-bobby-ministry
*/

:root {
  --pb-bg: #ffffff;
  --pb-surface: #f5f6f8;
  --pb-text: #17181b;
  --pb-muted: #656a73;
  --pb-border: #e3e5e8;
  --pb-accent: #20242b;
  --pb-radius: 18px;
  --pb-shadow: 0 12px 32px rgba(0,0,0,.08);
  --pb-max: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pb-bg);
  color: var(--pb-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; }

.pb-container {
  width: min(calc(100% - 40px), var(--pb-max));
  margin-inline: auto;
}

.pb-section { padding: 72px 0; }

.pb-section--soft { background: var(--pb-surface); }

.pb-section__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.pb-section__heading h2,
.pb-section__heading h1 {
  margin: 0;
  line-height: 1.1;
}

.pb-section__heading p {
  margin: 8px 0 0;
  color: var(--pb-muted);
}

.pb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--pb-accent);
  background: var(--pb-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pb-button--ghost {
  background: transparent;
  color: var(--pb-accent);
}

.pb-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--pb-border);
}

.pb-header-inner {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.pb-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.1rem;
}

.pb-brand img {
  max-height: 50px;
  width: auto;
}

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

.pb-nav li { position: relative; }

.pb-nav a,
.pb-nav button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--pb-text);
  font-weight: 700;
  cursor: pointer;
}

.pb-nav .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  padding: 12px;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: 14px;
  box-shadow: var(--pb-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .18s ease;
}

.pb-nav li:hover > .sub-menu,
.pb-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pb-nav .sub-menu a {
  width: 100%;
  justify-content: flex-start;
  border-radius: 10px;
  font-weight: 600;
}

.pb-nav .sub-menu a:hover { background: var(--pb-surface); }

.pb-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-search-link,
.pb-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--pb-border);
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pb-menu-toggle { display: none; }

.pb-hero {
  min-height: 620px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  background: #111;
  color: #fff;
}

.pb-hero__media {
  position: absolute;
  inset: 0;
}

.pb-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.76) 0%, rgba(0,0,0,.38) 55%, rgba(0,0,0,.15) 100%);
}

.pb-hero__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 120px 0 82px;
}

.pb-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  font-size: .8rem;
  opacity: .86;
}

.pb-hero h1 {
  margin: 10px 0 14px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: .96;
}

.pb-hero p {
  max-width: 620px;
  font-size: 1.08rem;
  color: rgba(255,255,255,.87);
}

.pb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.pb-hero .pb-button--ghost {
  border-color: rgba(255,255,255,.9);
  color: #fff;
}

.pb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 22px;
}

.pb-grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.pb-grid--6 { grid-template-columns: repeat(6, minmax(0,1fr)); }

.pb-card {
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.pb-card__media {
  aspect-ratio: 16/9;
  background: #d9dde3;
  overflow: hidden;
}

.pb-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.pb-card:hover .pb-card__media img { transform: scale(1.03); }

.pb-card__body { padding: 20px; }

.pb-card__body h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.pb-card__body p {
  color: var(--pb-muted);
  margin: 0;
}

.pb-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--pb-muted);
  font-size: .88rem;
}

.pb-feature-card {
  min-height: 360px;
  border-radius: var(--pb-radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: end;
  color: #fff;
  background: #20242b;
}

.pb-feature-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-feature-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.78), rgba(0,0,0,.12));
}

.pb-feature-card__content {
  position: relative;
  z-index: 2;
  padding: 26px;
}

.pb-feature-card__content h3 {
  margin: 6px 0 0;
  font-size: 1.55rem;
}

.pb-search-panel {
  padding: 34px;
  border-radius: var(--pb-radius);
  background: #fff;
  border: 1px solid var(--pb-border);
}

.pb-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.pb-search-form input[type="search"] {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--pb-border);
  border-radius: 999px;
  outline: none;
}

.pb-search-form input[type="search"]:focus { border-color: #777; }

.pb-site-footer {
  background: #111318;
  color: #fff;
  padding: 56px 0 100px;
}

.pb-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3,1fr);
  gap: 32px;
}

.pb-footer-grid h4 { margin-top: 0; }

.pb-footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pb-footer-grid li + li { margin-top: 8px; }

.pb-footer-grid a { color: rgba(255,255,255,.78); }

.pb-bottom-nav {
  display: none;
}

.pb-page-hero {
  background: #16181d;
  color: #fff;
  padding: 74px 0;
}

.pb-page-hero h1 {
  font-size: clamp(2.4rem,5vw,4.4rem);
  margin: 0 0 12px;
}

.pb-page-hero p {
  color: rgba(255,255,255,.78);
  max-width: 700px;
}

.pb-content-wrap {
  width: min(calc(100% - 40px), 900px);
  margin: 56px auto;
}

.pb-archive-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 22px;
}

.pb-empty {
  padding: 40px;
  border: 1px dashed var(--pb-border);
  border-radius: var(--pb-radius);
  text-align: center;
  color: var(--pb-muted);
}

@media (max-width: 1000px) {
  .pb-header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .pb-menu-toggle { display: inline-flex; }

  .pb-nav {
    position: fixed;
    inset: 82px 0 auto 0;
    max-height: calc(100vh - 82px);
    overflow: auto;
    background: #fff;
    border-bottom: 1px solid var(--pb-border);
    padding: 18px 20px 28px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
  }

  .pb-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .pb-nav > ul {
    display: block;
  }

  .pb-nav a,
  .pb-nav button {
    width: 100%;
    justify-content: space-between;
    padding-inline: 4px;
  }

  .pb-nav .sub-menu {
    position: static;
    display: block;
    visibility: visible;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border: 0;
    min-width: 0;
    padding: 0 0 8px 16px;
  }

  .pb-grid--6 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .pb-grid--4,
  .pb-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }

  .pb-footer-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 680px) {
  body { padding-bottom: 68px; }

  .pb-container { width: min(calc(100% - 28px), var(--pb-max)); }

  .pb-header-inner { min-height: 68px; }
  .pb-nav { inset: 68px 0 auto 0; max-height: calc(100vh - 68px); }

  .pb-header-actions .pb-button { display: none; }

  .pb-section { padding: 50px 0; }

  .pb-section__heading {
    display: block;
  }

  .pb-section__heading > a {
    margin-top: 16px;
  }

  .pb-hero { min-height: 570px; }
  .pb-hero__content { padding: 90px 0 58px; }

  .pb-grid,
  .pb-grid--4,
  .pb-grid--6,
  .pb-archive-grid {
    grid-template-columns: 1fr;
  }

  .pb-search-form {
    grid-template-columns: 1fr;
  }

  .pb-footer-grid { grid-template-columns: 1fr; }

  .pb-bottom-nav {
    position: fixed;
    z-index: 1200;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(255,255,255,.98);
    border-top: 1px solid var(--pb-border);
    display: grid;
    grid-template-columns: repeat(5,1fr);
  }

  .pb-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: .72rem;
    font-weight: 700;
    color: #3a3d44;
  }

  .pb-bottom-nav span:first-child {
    font-size: 1.2rem;
    line-height: 1;
  }

  .pb-feature-card { min-height: 300px; }
}


/* ===== v1.1 Mega Menu + Homepage polish ===== */

.pb-header-inner {
  grid-template-columns: minmax(180px, auto) 1fr auto;
}

.pb-desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pb-desktop-nav > a,
.pb-desktop-nav > .pb-nav-item > button {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--pb-text);
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
}

.pb-desktop-nav > a:hover,
.pb-desktop-nav > .pb-nav-item > button:hover {
  background: var(--pb-surface);
}

.pb-nav-item {
  position: relative;
}

.pb-mega {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, 10px);
  width: min(760px, 88vw);
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: 20px;
  box-shadow: var(--pb-shadow);
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: .18s ease;
}

.pb-nav-item:hover .pb-mega,
.pb-nav-item:focus-within .pb-mega {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.pb-mega-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 22px;
}

.pb-mega h4 {
  margin: 0 0 10px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--pb-muted);
}

.pb-mega a {
  display: block;
  padding: 8px 0;
  font-weight: 700;
}

.pb-mega a:hover {
  text-decoration: underline;
}

.pb-mega-feature {
  padding: 18px;
  border-radius: 16px;
  background: var(--pb-surface);
}

.pb-mega-feature strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.pb-mega-feature p {
  margin: 0 0 14px;
  color: var(--pb-muted);
  font-size: .94rem;
}

.pb-mini-link {
  font-size: .92rem;
  font-weight: 800;
}

.pb-home-intro {
  padding: 26px 0;
  border-bottom: 1px solid var(--pb-border);
  background: #fff;
}

.pb-home-intro__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
}

.pb-home-intro h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.7vw, 2.3rem);
}

.pb-home-intro p {
  margin: 6px 0 0;
  color: var(--pb-muted);
}

.pb-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.pb-channel-card {
  min-height: 390px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: end;
  background: linear-gradient(135deg, #222831, #111318);
  color: white;
  box-shadow: var(--pb-shadow);
}

.pb-channel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 25%, rgba(255,255,255,.16), transparent 30%),
    linear-gradient(0deg, rgba(0,0,0,.82), rgba(0,0,0,.1));
}

.pb-channel-card__content {
  position: relative;
  z-index: 2;
  padding: 28px;
}

.pb-channel-card__content h3 {
  margin: 6px 0 8px;
  font-size: 1.8rem;
  line-height: 1.05;
}

.pb-channel-card__content p {
  margin: 0;
  color: rgba(255,255,255,.82);
}

.pb-card-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 10px;
  scroll-snap-type: inline mandatory;
}

.pb-card-row > * {
  scroll-snap-align: start;
}

.pb-band {
  background: #111318;
  color: white;
}

.pb-band .pb-section__heading p {
  color: rgba(255,255,255,.65);
}

.pb-band .pb-card {
  background: #191c22;
  border-color: rgba(255,255,255,.08);
  color: white;
}

.pb-band .pb-card__body p,
.pb-band .pb-card__meta {
  color: rgba(255,255,255,.65);
}

.pb-split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
}

.pb-panel {
  border-radius: 22px;
  padding: 34px;
  background: #fff;
  border: 1px solid var(--pb-border);
}

.pb-panel--dark {
  background: #181b21;
  color: white;
  border-color: transparent;
}

.pb-panel h2,
.pb-panel h3 {
  margin-top: 0;
}

.pb-panel p {
  color: var(--pb-muted);
}

.pb-panel--dark p {
  color: rgba(255,255,255,.72);
}

.pb-quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pb-quick-links a {
  min-height: 86px;
  display: flex;
  align-items: center;
  padding: 18px;
  background: var(--pb-surface);
  border-radius: 14px;
  font-weight: 800;
}

.pb-quick-links a:hover {
  background: #eceef1;
}

.pb-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.pb-page-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
}

.pb-page-nav a:hover {
  background: rgba(255,255,255,.1);
}

@media (max-width: 1000px) {
  .pb-desktop-nav {
    display: none;
  }

  .pb-header-inner {
    grid-template-columns: 1fr auto auto;
  }

  .pb-channel-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pb-home-intro__inner,
  .pb-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .pb-channel-grid {
    grid-template-columns: 1fr;
  }

  .pb-channel-card {
    min-height: 310px;
  }

  .pb-home-intro__inner {
    gap: 18px;
  }

  .pb-quick-links {
    grid-template-columns: 1fr;
  }
}


/* ===== v1.2 Media modal + richer single media architecture ===== */

.pb-media-shell {
  margin: 34px 0;
  border-radius: 22px;
  overflow: hidden;
  background: #111318;
  color: #fff;
  box-shadow: var(--pb-shadow);
}

.pb-media-shell__poster {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #222831, #111318);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pb-media-shell__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .84;
}

.pb-media-shell__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.5), rgba(0,0,0,.08));
}

.pb-play-button {
  position: absolute;
  z-index: 2;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.88);
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .18s ease;
}

.pb-play-button:hover {
  transform: scale(1.06);
  background: rgba(0,0,0,.78);
}

.pb-media-shell__body {
  padding: 24px;
}

.pb-media-shell__body h2,
.pb-media-shell__body h3 {
  margin: 0 0 8px;
}

.pb-media-shell__body p {
  color: rgba(255,255,255,.72);
  margin: 0;
}

.pb-media-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.pb-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--pb-surface);
  color: var(--pb-text);
  font-size: .84rem;
  font-weight: 800;
}

.pb-content-section {
  margin: 42px 0;
}

.pb-content-section h2 {
  margin-bottom: 16px;
}

.pb-related {
  margin-top: 56px;
}

.pb-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.pb-modal.is-open {
  display: block;
}

.pb-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.84);
  backdrop-filter: blur(4px);
}

.pb-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 36px));
  margin: 5vh auto 0;
  background: #0d0f13;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.pb-modal__bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px 0 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.pb-modal__bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pb-modal__close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.pb-modal__player {
  aspect-ratio: 16/9;
  background: #000;
}

.pb-modal__player iframe,
.pb-modal__player video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.pb-audio-player {
  width: 100%;
}

body.pb-modal-open {
  overflow: hidden;
}

@media (max-width: 680px) {
  .pb-modal__dialog {
    width: 100%;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }

  .pb-modal__player {
    margin-top: 8vh;
  }

  .pb-play-button {
    width: 68px;
    height: 68px;
    font-size: 1.45rem;
  }
}


/* v1.2 explicit responsive nav visibility fix */
.pb-nav { display: none; }

@media (max-width: 1000px) {
  .pb-nav { display: block; }
}

@media (min-width: 1001px) {
  .pb-nav { display: none !important; }
  .pb-menu-toggle { display: none !important; }
}
