
.cei-gallery-blue-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 300px;
  background: radial-gradient(circle at 78% 18%, rgba(214, 166, 74, 0.18), transparent 28%), linear-gradient(135deg, #10182f, #132f69);
  color: #fff;
}

.cei-gallery-blue-hero .container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.cei-gallery-hero-inner {
  max-width: 760px;
}

.cei-gallery-hero-eyebrow {
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
  color: #d6a64a;
}

.cei-gallery-hero-title {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  margin: 16px 0 0;
  letter-spacing: -0.05em;
  color: #fff;
  font-weight: 800;
}

body.cei-gallery-page .page-hero:has(+ .container.content .cei-gallery-shell),
body:has(.cei-gallery-shell) .page-hero {
  display: none !important;
}

.cei-gallery-shell,
.cei-gallery-shell * {
  box-sizing: border-box;
}

/* v1.1.1: gallery moved a bit lower to clear the blue header and a slimmer carousel. */
.cei-gallery-shell {
  --cei-bg: #f7f4ee;
  --cei-card: rgba(255, 255, 255, 0.88);
  --cei-text: #14213d;
  --cei-muted: #6a7485;
  --cei-line: rgba(20, 33, 61, 0.12);
  --cei-accent: #1e4f8f;
  --cei-accent-dark: #153964;
  width: min(1320px, calc(100vw - 72px));
  max-width: none;
  margin-left: 50%;
  margin-right: 0;
  margin-top: 16px;
  transform: translateX(-50%);
  padding: clamp(18px, 2.2vw, 34px) clamp(16px, 2.4vw, 38px) clamp(36px, 5vw, 72px);
  color: var(--cei-text);
  font-family: inherit;
  background:
    radial-gradient(circle at 12% 0%, rgba(214, 166, 74, 0.16), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 244, 238, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: clamp(24px, 3vw, 38px);
  box-shadow: 0 28px 80px rgba(16, 24, 47, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  isolation: isolate;
}


/* Ajustes para o tema Católicos em Ennis: remove o espaço branco do container da página
   e permite que a galeria ocupe quase toda a largura da tela. */
body .container.content:has(.cei-gallery-shell),
body .content:has(.cei-gallery-shell),
body .entry-content:has(.cei-gallery-shell),
body .wp-block-post-content:has(.cei-gallery-shell),
body .page-content:has(.cei-gallery-shell) {
  width: 100% !important;
  max-width: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body .container.content:has(.cei-gallery-shell) .cei-gallery-shell,
body .content:has(.cei-gallery-shell) .cei-gallery-shell,
body .entry-content:has(.cei-gallery-shell) .cei-gallery-shell,
body .wp-block-post-content:has(.cei-gallery-shell) .cei-gallery-shell,
body .page-content:has(.cei-gallery-shell) .cei-gallery-shell {
  margin-left: auto;
  margin-right: auto;
  margin-top: 16px;
  transform: none;
}

.cei-gallery-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.cei-gallery-kicker {
  margin: 0 0 6px;
  color: var(--cei-accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}

.cei-gallery-title {
  margin: 0;
  color: var(--cei-text);
  font-size: clamp(2.3rem, 6vw, 4.7rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.cei-gallery-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--cei-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cei-accent);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(20, 33, 61, 0.08);
}

.cei-gallery-back:hover,
.cei-gallery-back:focus {
  background: var(--cei-accent);
  color: #fff;
  outline: none;
}

.cei-gallery-section {
  margin-top: 24px;
  position: relative;
}

.cei-gallery-section h2 {
  margin: 0 0 16px;
  color: var(--cei-text);
  font-size: clamp(1.45rem, 2.7vw, 2.15rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.cei-carousel {
  position: relative;
}

.cei-carousel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.4vw, 24px);
  min-height: clamp(280px, 36vw, 520px);
  padding: clamp(8px, 1vw, 14px);
  overflow: hidden;
  border-radius: clamp(22px, 3vw, 34px);
  perspective: 1200px;
  background: linear-gradient(145deg, rgba(255,255,255,0.62), rgba(232,238,247,0.38));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.cei-carousel-main,
.cei-carousel-peek {
  display: block;
  overflow: hidden;
  border-radius: clamp(20px, 2.5vw, 30px);
  background: #eef1f6;
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.22), inset 0 1px 0 rgba(255,255,255,0.55);
  transform-style: preserve-3d;
}

.cei-carousel-main {
  position: relative;
  z-index: 4;
  flex: 0 0 min(76%, 960px);
  height: clamp(270px, 33vw, 490px);
  border: 1px solid rgba(255,255,255,0.54);
  padding: 0;
  cursor: zoom-in;
  transform: translateZ(22px);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.cei-carousel-main img,
.cei-carousel-peek img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cei-carousel-main:hover,
.cei-carousel-main:focus {
  transform: translateZ(34px) translateY(-4px) rotateX(1deg);
  box-shadow: 0 30px 76px rgba(20, 33, 61, 0.28), inset 0 1px 0 rgba(255,255,255,0.62);
  outline: none;
}

.cei-carousel-peek {
  position: relative;
  flex: 0 0 min(27%, 360px);
  height: clamp(220px, 28vw, 400px);
  opacity: 0.62;
  filter: blur(1.25px) saturate(0.88);
  transform: scale(0.94) translateZ(-24px);
}

.cei-carousel-peek-left {
  margin-left: max(-10vw, -220px);
  transform: scale(0.94) translateZ(-24px) rotateY(-7deg);
}

.cei-carousel-peek-right {
  margin-right: max(-10vw, -220px);
  transform: scale(0.94) translateZ(-24px) rotateY(7deg);
}

.cei-carousel-peek::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cei-carousel-peek-left::after {
  background: linear-gradient(90deg, rgba(247, 244, 238, 0.92), rgba(247, 244, 238, 0.1) 54%, rgba(247, 244, 238, 0));
}

.cei-carousel-peek-right::after {
  background: linear-gradient(270deg, rgba(247, 244, 238, 0.92), rgba(247, 244, 238, 0.1) 54%, rgba(247, 244, 238, 0));
}

.cei-open-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(8px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.72);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.cei-carousel-main:hover .cei-open-hint,
.cei-carousel-main:focus .cei-open-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cei-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: clamp(42px, 5vw, 58px);
  height: clamp(42px, 5vw, 58px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  color: var(--cei-accent-dark);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(20, 33, 61, 0.24);
  transform: translateY(-50%) translateZ(42px);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.cei-carousel-arrow:hover,
.cei-carousel-arrow:focus {
  background: var(--cei-accent);
  color: #fff;
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

.cei-carousel-prev {
  left: calc(50% - min(38%, 480px) + 20px);
}

.cei-carousel-next {
  right: calc(50% - min(38%, 480px) + 20px);
}

.cei-gallery-thumbs {
  display: flex;
  gap: clamp(10px, 1.4vw, 16px);
  margin-top: 16px;
  padding: 8px 4px 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.cei-thumb {
  flex: 0 0 clamp(118px, 10vw, 168px);
  height: clamp(82px, 7.4vw, 116px);
  padding: 0;
  border: 3px solid transparent;
  border-radius: 18px;
  overflow: hidden;
  background: #eef1f6;
  cursor: pointer;
  scroll-snap-align: start;
  opacity: 0.76;
  transform: translateY(0) translateZ(0);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.12);
}

.cei-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cei-thumb:hover,
.cei-thumb:focus,
.cei-thumb.is-active {
  opacity: 1;
  transform: translateY(-4px) scale(1.02);
  border-color: var(--cei-accent);
  box-shadow: 0 16px 30px rgba(20, 33, 61, 0.18);
  outline: none;
}

.cei-folders-section {
  margin-top: clamp(28px, 5vw, 54px);
}

.cei-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(14px, 1.8vw, 20px);
}

.cei-folder-card {
  position: relative;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(245,248,252,0.9));
  color: var(--cei-text);
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(20, 33, 61, 0.13), inset 0 1px 0 rgba(255,255,255,0.75);
  transform: translateY(0) perspective(800px) rotateX(0deg);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.cei-folder-card:hover,
.cei-folder-card:focus {
  border-color: rgba(30, 79, 143, 0.45);
  box-shadow: 0 24px 48px rgba(20, 33, 61, 0.2), inset 0 1px 0 rgba(255,255,255,0.82);
  transform: translateY(-5px) perspective(800px) rotateX(2deg);
  outline: none;
}

.cei-folder-tab {
  position: absolute;
  left: 18px;
  top: -9px;
  width: 54px;
  height: 18px;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(145deg, #d9e5f5, #eef5ff);
  border: 1px solid rgba(20, 33, 61, 0.09);
  border-bottom: 0;
}

.cei-folder-preview {
  display: block;
  width: 100%;
  height: 86px;
  border-radius: 14px;
  background-position: center;
  background-size: cover;
  background-color: #eef1f6;
}

.cei-folder-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.cei-folder-name {
  display: block;
  min-height: 1.2em;
  font-size: 0.94rem;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.cei-empty-state {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 22px;
  border: 1px dashed rgba(20, 33, 61, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--cei-muted);
}

.cei-empty-state strong {
  color: var(--cei-text);
}

.cei-empty-small {
  padding: 16px;
}

.cei-lightbox {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 54px);
  background: rgba(4, 10, 18, 0.92);
}

.cei-lightbox.is-open {
  display: flex;
}

.cei-lightbox img {
  display: block;
  max-width: min(100%, 1180px);
  max-height: 88vh;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

.cei-lightbox-close,
.cei-lightbox-nav {
  position: fixed;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #14213d;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.cei-lightbox-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  font-size: 2rem;
  line-height: 1;
}

.cei-lightbox-nav {
  top: 50%;
  width: 50px;
  height: 50px;
  transform: translateY(-50%);
  font-size: 2.5rem;
  line-height: 0.8;
}

.cei-lightbox-prev {
  left: 18px;
}

.cei-lightbox-next {
  right: 18px;
}

.cei-lightbox-close:hover,
.cei-lightbox-close:focus,
.cei-lightbox-nav:hover,
.cei-lightbox-nav:focus {
  background: var(--cei-accent);
  color: #fff;
  outline: none;
}

@media (max-width: 760px) {
  .cei-gallery-shell {
    width: calc(100vw - 20px);
    margin-left: auto;
    margin-right: auto;
    margin-top: -24px;
    transform: none;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 24px;
  }

  
/* Ajustes para o tema Católicos em Ennis: remove o espaço branco do container da página
   e permite que a galeria ocupe quase toda a largura da tela. */
body .container.content:has(.cei-gallery-shell),
body .content:has(.cei-gallery-shell),
body .entry-content:has(.cei-gallery-shell),
body .wp-block-post-content:has(.cei-gallery-shell),
body .page-content:has(.cei-gallery-shell) {
  width: 100% !important;
  max-width: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body .container.content:has(.cei-gallery-shell) .cei-gallery-shell,
body .content:has(.cei-gallery-shell) .cei-gallery-shell,
body .entry-content:has(.cei-gallery-shell) .cei-gallery-shell,
body .wp-block-post-content:has(.cei-gallery-shell) .cei-gallery-shell,
body .page-content:has(.cei-gallery-shell) .cei-gallery-shell {
  margin-left: auto;
  margin-right: auto;
  margin-top: 16px;
  transform: none;
}

.cei-gallery-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .cei-carousel-stage {
    min-height: clamp(220px, 60vw, 340px);
    border-radius: 18px;
  }

  .cei-carousel-main {
    flex-basis: 84%;
    height: clamp(205px, 56vw, 320px);
  }

  .cei-carousel-peek {
    flex-basis: 28%;
    height: clamp(165px, 46vw, 270px);
  }

  .cei-carousel-peek-left {
    margin-left: -24vw;
  }

  .cei-carousel-peek-right {
    margin-right: -24vw;
  }

  .cei-carousel-prev {
    left: 14px;
  }

  .cei-carousel-next {
    right: 14px;
  }

  .cei-folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cei-lightbox-nav {
    width: 42px;
    height: 42px;
  }
}

/* v1.0.4 - Remove the theme page hero/title area and start the gallery immediately. */
body:has(.cei-gallery-shell) .page-hero,
body.cei-gallery-page .page-hero {
  display: none !important;
}

body:has(.cei-gallery-shell) .content,
body:has(.cei-gallery-shell) .container.content,
body.cei-gallery-page .content,
body.cei-gallery-page .container.content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.cei-gallery-shell {
  padding-top: clamp(8px, 1.2vw, 18px);
}

.cei-gallery-topbar-back-only {
  justify-content: flex-start;
  margin-bottom: 14px;
}


/* v1.0.4 - hide theme wording above the gallery ("Comunidade Católicos em Ennis" / "Gallery") and remove all leftover vertical gap. */
html body.cei-gallery-page .page-hero,
html body.cei-gallery-page main > .page-hero,
html body:has(.cei-gallery-shell) .page-hero {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

html body.cei-gallery-page .page-hero .eyebrow,
html body.cei-gallery-page .page-hero h1,
html body:has(.cei-gallery-shell) .page-hero .eyebrow,
html body:has(.cei-gallery-shell) .page-hero h1,
html body.cei-gallery-page .entry-title,
html body.cei-gallery-page .wp-block-post-title {
  display: none !important;
}

html body.cei-gallery-page .content,
html body.cei-gallery-page .container.content,
html body:has(.cei-gallery-shell) .content,
html body:has(.cei-gallery-shell) .container.content {
  width: 100% !important;
  max-width: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}


/* v1.0.5 - Keep the blue header/hero band but remove only the wording inside it. */
html body.cei-gallery-page .page-hero,
html body.cei-gallery-page main > .page-hero,
html body:has(.cei-gallery-shell) .page-hero {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, #10182f, #132f69) !important;
}

html body.cei-gallery-page .page-hero .eyebrow,
html body.cei-gallery-page .page-hero h1,
html body:has(.cei-gallery-shell) .page-hero .eyebrow,
html body:has(.cei-gallery-shell) .page-hero h1,
html body.cei-gallery-page .entry-title,
html body.cei-gallery-page .wp-block-post-title {
  display: none !important;
}

html body.cei-gallery-page .page-hero .container,
html body:has(.cei-gallery-shell) .page-hero .container {
  min-height: 0 !important;
}

html body.cei-gallery-page .content,
html body.cei-gallery-page .container.content,
html body:has(.cei-gallery-shell) .content,
html body:has(.cei-gallery-shell) .container.content {
  width: 100% !important;
  max-width: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}


@media (max-width: 900px) {
  .cei-gallery-blue-hero {
    min-height: 230px;
  }

  .cei-gallery-blue-hero .container {
    padding: 0 22px;
  }

  .cei-gallery-hero-title {
    font-size: clamp(30px, 10vw, 46px);
  }
}
