/* ============================================
   parishes.css
   Page-specific styles for the Parishes directory
   Layers on top of tokens.css + components.css
   ============================================ */

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--color-navy-900);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

/* ============================================
   HERO CAROUSEL
   ============================================ */

.parishes-hero {
  position: relative;
  background: var(--color-navy-900);
}

.parishes-carousel {
  position: relative;
  width: 100%;
  height: clamp(320px, 50vh, 520px);
  overflow: hidden;
}

.parishes-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.parishes-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 600ms ease-in-out;
  will-change: opacity;
}

.parishes-carousel-slide.is-active {
  opacity: 1;
}

.parishes-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65);
}

/* Arrows */
.parishes-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  transition: background-color 200ms, transform 200ms;
}

.parishes-carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.parishes-carousel-arrow:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus);
}

.parishes-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.parishes-carousel-arrow--prev {
  left: var(--space-4);
}

.parishes-carousel-arrow--next {
  right: var(--space-4);
}

/* Dots */
.parishes-carousel-dots {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.parishes-carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background-color 200ms, border-color 200ms, transform 200ms;
}

.parishes-carousel-dot:hover {
  border-color: #fff;
  transform: scale(1.15);
}

.parishes-carousel-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus);
}

.parishes-carousel-dot.is-active {
  background: var(--color-gold-500);
  border-color: var(--color-gold-500);
}

/* Hero overlay text */
.parishes-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  pointer-events: none;
}

.parishes-hero-overlay .container {
  pointer-events: auto;
}

.parishes-hero-overlay .kicker {
  color: var(--color-gold-500);
  margin-bottom: var(--space-2);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: var(--text-small);
}

.parishes-hero-overlay h1 {
  color: #fff;
  font-size: clamp(28px, 5vw, 48px);
  margin-bottom: var(--space-3);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.parishes-hero-subtitle {
  font-size: var(--text-body);
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Reduced motion: disable auto-advance handled in JS */
@media (prefers-reduced-motion: reduce) {
  .parishes-carousel-slide {
    transition: opacity 100ms;
  }
}

/* ============================================
   SEARCH & DIRECTORY
   ============================================ */

.parishes-directory {
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}

.parishes-intro {
  max-width: 720px;
  margin: 0 auto var(--space-6);
  text-align: center;
}

.parishes-intro p {
  font-size: var(--text-body);
  color: var(--color-text);
  margin: 0;
}

/* Search box */
.parishes-search-wrapper {
  max-width: 540px;
  margin: 0 auto var(--space-5);
}

.parishes-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.parishes-search-icon {
  position: absolute;
  left: 14px;
  color: var(--color-muted);
  pointer-events: none;
}

.parishes-search-input {
  width: 100%;
  min-height: 52px;
  padding: 14px 48px 14px 44px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-ink);
  transition: border-color 200ms, box-shadow 200ms;
}

.parishes-search-input::placeholder {
  color: var(--color-muted);
}

.parishes-search-input:focus {
  outline: none;
  border-color: var(--color-blue-600);
  box-shadow: 0 0 0 3px rgba(10, 143, 206, 0.15);
}

.parishes-search-clear {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

/* The JS toggles the hidden attribute, but display: flex above outranks the UA
   stylesheet's [hidden] { display: none }, so the clear button showed on an empty
   search box. Restore it explicitly. */
.parishes-search-clear[hidden] { display: none; }

.parishes-search-clear:hover {
  background: var(--color-bg-subtle);
  color: var(--color-ink);
}

.parishes-search-clear:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus);
}

/* Results info */
.parishes-results-info {
  text-align: center;
  font-size: var(--text-small);
  color: var(--color-muted);
  margin-bottom: var(--space-5);
  min-height: 20px;
}

/* ============================================
   CITY BANDS
   Bands are emitted per distinct city by parishes.js. The background alternates
   positionally, so it keeps working when the parish list changes.
   ============================================ */

.parish-band { padding: var(--space-8) 0; }
.parish-band:nth-of-type(odd)  { background: var(--surface-alt); }
.parish-band:nth-of-type(even) { background: var(--color-card-bg); }

.parish-band-city {
  text-align: center;
  color: var(--color-navy-900);
  font-family: var(--font-heading);
  font-size: var(--text-h2);
  font-weight: 600;
  margin: 0 0 var(--space-6);
}

.parish-band-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

/* Two single-parish cities sharing one band, side by side */
.parish-band-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
}
.parish-band-pair .parish-band-grid { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 768px) {
  .parish-band { padding: var(--space-7) 0; }
  .parish-band-grid,
  .parish-band-pair { grid-template-columns: minmax(0, 1fr); }
  .parish-band-pair { gap: var(--space-6); }
  .parish-band-city { font-size: 26px; margin-bottom: var(--space-5); }
}

/* ============================================
   PARISH CARD
   Square thumbnail at the left, details at the right.
   ============================================ */

.parish-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--space-4);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  transition: box-shadow 250ms, transform 250ms;
}

.parish-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Square thumbnail with a navy border, per the comp */
.parish-card-thumb {
  width: 132px;
  height: 132px;
  border: 2px solid var(--color-navy-900);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-navy-900);
}
.parish-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Shown when a record has no photo yet */
.parish-card-initial {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--color-navy-900);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
}

.parish-card-info { min-width: 0; }

.parish-card-name {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  font-weight: 600;
  color: var(--color-navy-900);
  margin: 0 0 var(--space-1);
  line-height: var(--lh-heading);
}

.parish-card-address {
  font-size: var(--text-small);
  color: var(--color-muted);
  margin: 0;
  line-height: 1.5;
  font-style: normal;
}

.parish-card-phone {
  font-size: var(--text-small);
  color: var(--color-muted);
  margin: var(--space-1) 0 0;
}
.parish-card-phone a { color: var(--color-muted); }
.parish-card-phone a:hover { color: var(--color-navy-900); }

/* Mass-time toggle — the comp omits mass times, but they are the project's only
   schedule data, so they stay here behind a disclosure. */
.parish-card-details { margin: var(--space-3) 0; }

.parish-card-details-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: var(--text-small);
  color: var(--color-gold-500);
  cursor: pointer;
  list-style: none;
}
.parish-card-details-summary::-webkit-details-marker { display: none; }
.parish-card-details-summary::before { content: "\203A"; font-weight: 700; }
.parish-card-details[open] .parish-card-details-summary::before { content: "\2304"; }
.parish-card-details-summary:hover { color: var(--color-gold-400); }
.parish-card-details-summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.7);
  border-radius: 4px;
}

.parish-card-details-body { padding-top: var(--space-3); }

.parish-card-site {
  margin-top: var(--space-2);
  min-height: 38px;
  padding: 8px 18px;
}

.parish-card-maps {
  display: inline-block;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-navy-900);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 520px) {
  .parish-card { grid-template-columns: minmax(0, 1fr); }
  .parish-card-thumb { width: 100%; height: 180px; }
}

/* Mass times */
.parish-card-mass {
  flex: 1;
  margin-bottom: var(--space-4);
}

.parish-card-mass-section {
  margin-bottom: var(--space-3);
}

.parish-card-mass-section:last-child {
  margin-bottom: 0;
}

.parish-card-mass-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-1);
}

.parish-card-mass-label--es {
  color: var(--color-blue-600);
}

.parish-card-mass-label svg {
  flex-shrink: 0;
}

.parish-card-mass-times {
  font-size: var(--text-small);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
  padding-left: 26px;
}

/* Notes */
.parish-card-notes {
  font-size: var(--text-small);
  color: var(--color-muted);
  font-style: italic;
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
}

/* Map button */
.parish-card-action {
  margin-top: auto;
}

.parish-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--color-blue-600);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-blue-600);
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.parish-card-btn:hover {
  background: var(--color-blue-600);
  color: #fff;
  text-decoration: none;
}

.parish-card-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 143, 206, 0.4);
}

.parish-card-btn svg {
  flex-shrink: 0;
}

/* ============================================
   NO RESULTS STATE
   ============================================ */

.parishes-no-results {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.parishes-no-results-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-muted);
}

.parishes-no-results h3 {
  font-family: var(--font-heading);
  font-size: var(--text-h4);
  color: var(--color-ink);
  margin: 0 0 var(--space-2);
}

.parishes-no-results p {
  color: var(--color-muted);
  margin: 0 0 var(--space-5);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .parishes-carousel {
    height: clamp(280px, 45vh, 400px);
  }

  .parishes-carousel-arrow {
    width: 40px;
    height: 40px;
  }

  .parishes-carousel-arrow--prev {
    left: var(--space-2);
  }

  .parishes-carousel-arrow--next {
    right: var(--space-2);
  }

  .parishes-hero-overlay h1 {
    font-size: 26px;
  }

  .parish-card {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .parishes-search-input {
    min-height: 48px;
    padding: 12px 44px 12px 40px;
    font-size: 16px; /* Prevents iOS zoom */
  }
}

/* ============================================
   KICKER (if not already defined)
   ============================================ */

.kicker {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-blue-600);
  margin-bottom: var(--space-2);
}

/* ============================================
   BACK TO TOP (ensure visibility)
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 200ms, visibility 200ms, transform 200ms;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
