:root {
  --bg: #eef2f3;
  --bg-soft: #f7f9fa;
  --panel: #ffffff;
  --panel-strong: #f8fafb;
  --text: #172033;
  --muted: #647084;
  --accent: #0f766e;
  --accent-strong: #0b4f4a;
  --accent-soft: #e1f2ef;
  --link: #0b5f86;
  --border: #d9e1e6;
  --shadow: 0 18px 38px rgba(15, 23, 42, 0.13);
  --font-ui: Inter, "Segoe UI", Arial, sans-serif;
  --font-display: Manrope, Inter, "Segoe UI", Arial, sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background: linear-gradient(180deg, #f9fbfc 0%, var(--bg) 100%);
  font-family: var(--font-ui);
}

.hidden {
  display: none !important;
}

#wrap {
  height: 100%;
  position: relative;
  background: linear-gradient(120deg, rgba(248, 250, 252, 0.82), rgba(226, 235, 237, 0.42));
  animation: app-fade-in 420ms var(--ease-out) both;
}

#map {
  position: absolute;
  inset: 0;
}

.leaflet-container {
  width: 100%;
  height: 100%;
}

#sidebar {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 390px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 36px);
  background: rgba(255, 255, 255, 0.96);
  box-sizing: border-box;
  z-index: 1000;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition:
    width 220ms ease,
    opacity 220ms ease,
    transform 260ms var(--ease-out),
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
  overflow: visible;
}

.sidebar-inner {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

#sidebar:not(.collapsed) .sidebar-inner {
  animation: panel-enter 320ms var(--ease-out) both;
}

.sidebar-toggle {
  position: absolute;
  top: 14px;
  left: -46px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms ease,
    filter 180ms ease;
}

.sidebar-toggle:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.sidebar-toggle:active {
  transform: translateY(1px);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

#sidebar:not(.collapsed) .icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23374459' d='M8.578 16.594l4.594-4.594-4.594-4.594 1.406-1.406 6 6-6 6z'/%3E%3C/svg%3E");
}

#sidebar.collapsed .icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23374459' d='M15.422 16.594l-1.406 1.406-6-6 6-6 1.406 1.406-4.594 4.594z'/%3E%3C/svg%3E");
}

#sidebar.collapsed {
  width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0.98;
}

#sidebar.collapsed .sidebar-inner {
  display: none;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.15;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

.status {
  margin: 8px 0 16px;
  padding: 8px 10px;
  border: 1px solid #e3e9ee;
  border-radius: 8px;
  background: #f8fafb;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: pre-wrap;
}

.details {
  font-size: 15px;
  line-height: 1.5;
}

.details > * {
  animation: rise-in 320ms var(--ease-out) both;
  animation-delay: var(--enter-delay, 0ms);
}

.details-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

.details-title-link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(11, 95, 134, 0.55);
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

.details-title-link:hover,
.details-title-link:focus-visible {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

/* Links out to the Sufi Shrines archive (drawer "Associated Shrine" row) */
.shrine-page-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.preview {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 0 14px;
  display: block;
  border: 1px solid var(--border);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.row {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid #e7edf1;
}

.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row b {
  display: block;
  color: #263244;
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.row a {
  font-weight: 700;
}

.coordinate-link-inline {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

.row-block {
  display: grid;
  gap: 8px;
}

.row-block b {
  margin-right: 0;
}

.row-block-body {
  white-space: pre-wrap;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.photo-thumb {
  width: 145px;
  text-decoration: none;
}

.photo-thumb img {
  width: 100%;
  height: 104px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms ease,
    filter 180ms ease;
}

.photo-thumb:hover img {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.15);
  filter: saturate(1.04);
}

.photo-thumb span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.photo-more-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.photo-more-thumb img {
  filter: brightness(0.72) saturate(0.96);
}

.photo-more-thumb:hover img {
  filter: brightness(0.66) saturate(1.02);
}

.photo-more-thumb .photo-more-overlay {
  position: absolute;
  inset: 0 0 auto;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  background: rgba(17, 24, 39, 0.46);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.photo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition:
    transform 160ms var(--ease-out),
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.photo-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  color: #0b4d74;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.12);
}

@media (max-width: 520px) {
  #sidebar {
    width: calc(100vw - 24px);
    right: 12px;
    top: 12px;
    max-height: calc(100vh - 24px);
  }
}

.leaflet-top.leaflet-left .shrine-table-btn {
  margin-top: 78px;
}

.leaflet-control.shrine-table-btn {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.shrine-table-btn button {
  width: 270px;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  box-shadow: var(--shadow);
  font: 700 13px var(--font-ui);
  color: var(--text);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.shrine-table-btn button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.shrine-table-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.shrine-drop {
  width: 270px;
  max-width: calc(100vw - 32px);
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shrine-drop.hidden {
  display: none;
}

.shrine-drop:not(.hidden) {
  animation: dropdown-enter 220ms var(--ease-out) both;
}

.shrine-drop .panel-search {
  padding: 10px 12px;
  border-bottom: 1px solid #e5ebef;
  background: var(--panel-strong);
}

.shrine-drop .panel-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  font: 600 13px var(--font-ui);
  color: #111827;
  outline: none;
}

.shrine-drop .panel-search input:focus {
  border-color: #8cb8c2;
  box-shadow: 0 0 0 3px rgba(140, 184, 194, 0.25);
}

.shrine-drop .panel-list {
  max-height: 46vh;
  overflow-y: auto;
}

.shrine-drop .panel-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #e5ebef;
  background: var(--panel);
  cursor: pointer;
  font: 600 13px var(--font-ui);
  color: #111827;
  animation: list-item-enter 260ms var(--ease-out) both;
  animation-delay: var(--item-delay, 0ms);
  transition:
    background 150ms ease,
    color 150ms ease,
    padding-left 150ms var(--ease-out);
}

.shrine-drop .panel-item:hover {
  background: #eef6f5;
  padding-left: 16px;
}

.group {
  border-bottom: 1px solid #e5ebef;
}

.group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--panel);
  border: 0;
  cursor: pointer;
  font: 800 13px var(--font-ui);
  color: #111827;
}

.group-header:hover {
  background: #eef6f5;
}

.group-header .count {
  font: 700 12px var(--font-ui);
  color: var(--muted);
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-chevron {
  width: 18px;
  height: 18px;
  margin-left: 10px;
  flex: 0 0 auto;
  opacity: 0.75;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23374459' d='M9.29 6.71a1 1 0 0 0 0 1.41L13.17 12l-3.88 3.88a1 1 0 1 0 1.41 1.41l4.59-4.59a1 1 0 0 0 0-1.41L10.7 6.71a1 1 0 0 0-1.41 0Z'/%3E%3C/svg%3E");
  transition: transform 160ms var(--ease-out);
}

.group.collapsed .group-chevron {
  transform: rotate(-90deg);
}

.group-items {
  padding: 0;
}

.group.collapsed .group-items {
  display: none;
}

.panel-empty {
  padding: 10px 12px;
  font: 600 13px var(--font-ui);
  color: var(--muted);
}

.shrine-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #0f766e;
  border: 2px solid #ffffff;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.24);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.shrine-dot-hit:hover .shrine-dot {
  transform: scale(1.24);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.shrine-dot.selected {
  background: #d97706;
  animation: selected-pulse 1800ms ease-out infinite;
}

.shrine-marker-hit {
  background: transparent !important;
  border: 0 !important;
}

.shrine-dot-hit {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .shrine-dot-hit {
    width: 34px;
    height: 34px;
  }

  .shrine-drop .panel-item,
  .group-header {
    min-height: 44px;
  }
}

.leaflet-tooltip {
  border-radius: 8px !important;
  padding: 6px 10px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14) !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  font: 600 12px var(--font-ui) !important;
}

.leaflet-tooltip-top:before {
  border-top-color: var(--panel) !important;
}

.leaflet-control-zoom,
.leaflet-control-layers {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.leaflet-bottom.leaflet-left .leaflet-control {
  margin-left: 18px;
  margin-bottom: 18px;
}

.leaflet-control-zoom a {
  width: 40px !important;
  height: 40px !important;
  line-height: 38px !important;
  border: 1px solid var(--border) !important;
  background: var(--panel) !important;
  color: var(--text) !important;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12) !important;
}

.leaflet-control-layers {
  background: var(--panel) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}

.leaflet-control-layers-toggle {
  width: 42px !important;
  height: 42px !important;
  background-color: var(--panel) !important;
}

.leaflet-control-layers-expanded {
  padding: 12px 14px !important;
  min-width: 220px;
}

.leaflet-control-layers label {
  color: var(--text);
  font: 700 13px var(--font-ui);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes app-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdown-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes list-item-enter {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes selected-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.3), 0 7px 16px rgba(0, 0, 0, 0.22);
  }

  70% {
    box-shadow: 0 0 0 9px rgba(217, 119, 6, 0), 0 10px 20px rgba(0, 0, 0, 0.28);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0), 0 7px 16px rgba(0, 0, 0, 0.24);
  }
}

.mosque-body {
  --mosque-bg: #eef2f3;
  --mosque-bg-soft: #f8fafb;
  --mosque-surface: #ffffff;
  --mosque-border: rgba(21, 34, 30, 0.13);
  --mosque-border-soft: rgba(21, 34, 30, 0.1);
  --mosque-text: #182620;
  --mosque-muted: #5c6b64;
  --mosque-accent: #0d5c4c;
  --mosque-accent-strong: #08362c;
  --mosque-accent-soft: rgba(13, 92, 76, 0.09);
  --mosque-brass: #a3812f;
  --mosque-brass-strong: #7c611f;
  --mosque-brass-soft: rgba(163, 129, 47, 0.12);
  --mosque-shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.1);
  --mosque-shadow-md: 0 16px 32px rgba(15, 23, 42, 0.08);
  --mosque-shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.06);
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  height: auto;
  min-height: 100%;
  background: linear-gradient(180deg, #fbfcfb 0%, #f5f7f6 52%, var(--mosque-bg) 100%);
  color: var(--mosque-text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.mosque-body a {
  color: inherit;
}

.mosque-page {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 22px 64px;
  box-sizing: border-box;
}

.mosque-shell {
  display: grid;
  gap: 20px;
}

.mosque-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.mosque-toolbar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--mosque-border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--mosque-muted);
  text-decoration: none;
  font: 600 0.82rem var(--font-ui);
  letter-spacing: 0.01em;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.mosque-toolbar-link::before {
  content: "←";
  font-size: 0.9em;
}

.mosque-toolbar-link:hover {
  border-color: var(--mosque-accent);
  background: #ffffff;
  color: var(--mosque-accent-strong);
  text-decoration: none;
}

.mosque-hero {
  padding: 0;
  text-align: left;
  animation: mosque-fade-up 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mosque-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
  gap: 32px;
  align-items: start;
}

.mosque-hero-top-no-media {
  grid-template-columns: minmax(0, 1fr);
}

.mosque-hero-copy {
  min-width: 0;
}

.mosque-hero-media-wrap {
  display: block;
  width: 100%;
  height: 280px;
  padding: 7px;
  border: 1px solid var(--mosque-border-soft);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--mosque-shadow-md);
  box-sizing: border-box;
  overflow: hidden;
  text-decoration: none;
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.mosque-hero-media-wrap:hover {
  border-color: var(--mosque-brass);
  box-shadow: var(--mosque-shadow-lg);
  text-decoration: none;
}

.mosque-hero-media-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2px;
  object-fit: cover;
  transition:
    transform 320ms var(--ease-out),
    filter 320ms ease;
}

.mosque-hero-media-wrap:hover .mosque-hero-media-img {
  transform: scale(1.015);
  filter: saturate(1.03);
}

.mosque-eyebrow {
  position: relative;
  display: inline-block;
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--mosque-accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mosque-eyebrow::before,
.mosque-eyebrow::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--mosque-brass);
  transform: translateY(-50%);
}

.mosque-eyebrow::after {
  transform: translateY(-50%) rotate(45deg);
}

.mosque-title {
  margin: 0;
  max-width: 940px;
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.mosque-title-compact {
  font-size: 2.4rem;
  line-height: 1.16;
}

.mosque-location-line {
  margin: 12px 0 0;
  color: var(--mosque-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mosque-lede {
  margin: 14px 0 0;
  max-width: 820px;
  color: #4d5c70;
  font-size: 1.08rem;
  line-height: 1.7;
}

.mosque-hero-divider {
  height: 0;
  margin: 20px 0 0;
}

.mosque-section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 30px;
  border-bottom: 1px solid var(--mosque-border-soft);
}

.mosque-section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 0 2px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--mosque-muted);
  text-decoration: none;
  font: 700 0.78rem var(--font-ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.mosque-section-tab:hover {
  color: var(--mosque-text);
  border-bottom-color: var(--mosque-border);
  text-decoration: none;
}

.mosque-section-tab-active {
  color: var(--mosque-accent-strong);
  border-bottom-color: var(--mosque-brass);
}

.mosque-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(290px, 0.7fr);
  gap: 36px;
  align-items: start;
}

.mosque-main {
  display: grid;
  gap: 42px;
}

.mosque-aside {
  display: grid;
  gap: 26px;
}

.mosque-article-section {
  padding: 0;
  animation: mosque-fade-up 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
  scroll-margin-top: 28px;
}

.mosque-section-heading {
  margin-bottom: 16px;
}

.mosque-section-heading h2,
.mosque-sidebar-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mosque-richtext {
  display: grid;
  gap: 18px;
  max-width: 840px;
}

.mosque-richtext p {
  margin: 0;
  color: #4d5c70;
  font-size: 1.05rem;
  line-height: 1.75;
}

.mosque-shrine-note {
  margin: 0;
  color: #4d5c70;
  font-size: 1.05rem;
  line-height: 1.75;
}

.mosque-shrine-note-link,
.mosque-fact-link {
  color: var(--mosque-accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.mosque-shrine-note-link:hover,
.mosque-fact-link:hover {
  color: var(--mosque-accent-strong);
}

.mosque-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.mosque-action-row-compact {
  margin-top: 0;
}

.mosque-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--mosque-border);
  border-radius: 4px;
  background: #ffffff;
  color: var(--mosque-text);
  text-decoration: none;
  font: 700 0.8rem var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.mosque-btn:hover {
  border-color: var(--mosque-accent);
  box-shadow: var(--mosque-shadow-sm);
  text-decoration: none;
}

.mosque-btn-primary {
  border-color: var(--mosque-accent-strong);
  background: var(--mosque-accent);
}

.mosque-btn-primary:hover {
  background: var(--mosque-accent-strong);
  border-color: var(--mosque-accent-strong);
}

.mosque-sidebar-card {
  padding: 24px 24px 26px;
  border: 1px solid var(--mosque-border-soft);
  border-top: 3px solid var(--mosque-brass);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--mosque-shadow-sm);
  position: relative;
  z-index: 3;
  animation: mosque-fade-up 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 180ms ease;
}

.mosque-aside {
  position: relative;
  z-index: 2;
}

.mosque-aside .mosque-sidebar-card:first-child {
  position: sticky;
  top: 20px;
  align-self: start;
}

.mosque-aside .mosque-sidebar-card + .mosque-sidebar-card {
  position: static;
}

.mosque-sidebar-brand {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
  padding-left: 18px;
  color: var(--mosque-accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mosque-sidebar-brand::before,
.mosque-sidebar-brand::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  background: var(--mosque-brass);
  transform: translateY(-50%);
}

.mosque-sidebar-brand::after {
  transform: translateY(-50%) rotate(45deg);
}

.mosque-sidebar-card h3 {
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.mosque-fact-list {
  margin: 0;
  display: grid;
  gap: 0;
}

.mosque-fact {
  padding: 14px 0;
  border-top: 1px solid rgba(23, 39, 57, 0.08);
}

.mosque-fact dt {
  margin: 0 0 5px;
  color: #5d6c80;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mosque-fact dd {
  margin: 0;
  color: var(--mosque-text);
  font-size: 1rem;
  line-height: 1.5;
}

.mosque-gallery-section {
  display: grid;
  gap: 22px;
}

.mosque-map-section {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.mosque-map-section-head h2,
.mosque-map-section-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mosque-location-tools {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mosque-coordinate-card {
  flex: 0 1 260px;
  min-width: 220px;
  padding: 17px 18px;
  border: 1px solid var(--mosque-border-soft);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--mosque-shadow-sm);
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.mosque-address-card {
  flex: 1 1 320px;
}

.mosque-coordinate-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--mosque-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mosque-coordinate-card code {
  color: var(--mosque-text);
  font: 700 0.98rem/1.4 var(--font-mono);
}

.mosque-address-text {
  margin: 0;
  color: var(--mosque-text);
  font: 700 0.98rem/1.4 var(--font-ui);
}

.mosque-coordinate-link {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.mosque-coordinate-link:hover {
  text-decoration: none;
}

.mosque-coordinate-link small {
  color: var(--mosque-accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.mosque-coordinate-link:hover code,
.mosque-coordinate-link:hover small {
  color: var(--mosque-accent-strong);
}

.mosque-map-wrap {
  border: 1px solid var(--mosque-border-soft);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--mosque-shadow-sm);
  overflow: hidden;
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.mosque-map-frame {
  width: 100%;
  height: 360px;
  display: block;
  border: 0;
}

.mosque-nearby-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.mosque-nearby-card {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
  border: 1px solid var(--mosque-border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  text-decoration: none;
  box-shadow: var(--mosque-shadow-sm);
  animation: mosque-fade-up 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.mosque-nearby-card:hover {
  border-color: var(--mosque-accent);
  box-shadow: var(--mosque-shadow-md);
  text-decoration: none;
}

.mosque-nearby-name {
  color: var(--mosque-text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.mosque-nearby-meta {
  color: var(--mosque-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

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

.mosque-gallery-item {
  display: block;
  border: 1px solid var(--mosque-border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  text-decoration: none;
  box-shadow: var(--mosque-shadow-sm);
  overflow: hidden;
  animation: mosque-fade-up 760ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 180ms ease;
}

.mosque-gallery-item:hover {
  box-shadow: var(--mosque-shadow-lg);
  text-decoration: none;
}

.mosque-gallery-media {
  position: relative;
  width: 100%;
  min-height: 320px;
  background: linear-gradient(180deg, #f6faf8, #eef4f1);
}

.mosque-gallery-img {
  width: 100%;
  height: 320px;
  display: block;
  object-fit: cover;
  transition:
    transform 260ms var(--ease-out),
    filter 260ms ease;
}

.mosque-gallery-item:hover .mosque-gallery-img {
  transform: scale(1.025);
  filter: saturate(1.04);
}

.mosque-body .mosque-btn,
.mosque-body .mosque-gallery-item {
  color: var(--mosque-text);
}

.mosque-body .mosque-btn-primary,
.mosque-body .mosque-btn-primary:hover {
  color: #ffffff;
}

.mosque-gallery-item span {
  display: block;
  padding: 14px 16px 16px;
  color: var(--mosque-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.mosque-main > *:nth-child(1) {
  animation-delay: 90ms;
}

.mosque-main > *:nth-child(2) {
  animation-delay: 150ms;
}

.mosque-main > *:nth-child(3) {
  animation-delay: 210ms;
}

.mosque-aside > *:nth-child(1) {
  animation-delay: 130ms;
}

.mosque-aside > *:nth-child(2) {
  animation-delay: 190ms;
}

.mosque-sidebar-card:hover,
.mosque-coordinate-card:hover,
.mosque-map-wrap:hover {
  box-shadow: var(--mosque-shadow-md);
}

@keyframes mosque-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-on-scroll {
  animation: none !important;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms var(--ease-out),
    transform 520ms var(--ease-out),
    box-shadow 180ms ease,
    border-color 180ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .shrine-dot.selected {
    animation: none !important;
  }

  .mosque-hero,
  .mosque-article-section,
  .mosque-sidebar-card,
  .mosque-nearby-card,
  .mosque-gallery-item {
    animation: none !important;
  }

  .mosque-toolbar-link,
  .mosque-section-tab,
  .mosque-btn,
  .mosque-sidebar-card,
  .mosque-coordinate-card,
  .mosque-map-wrap,
  .mosque-nearby-card,
  .mosque-gallery-item {
    transition: none !important;
    transform: none !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.mosque-empty-state {
  padding: 28px 0 0;
}

.mosque-empty-state p {
  margin: 0;
  color: var(--mosque-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

@media (max-width: 1024px) {
  .mosque-hero-top {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 26px;
  }

  .mosque-title {
    font-size: 2.6rem;
  }

  .mosque-section-heading h2,
  .mosque-map-section-head h2,
  .mosque-sidebar-card h3 {
    font-size: 1.55rem;
  }

  .mosque-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .mosque-sidebar-card,
  .mosque-aside .mosque-sidebar-card + .mosque-sidebar-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .mosque-page {
    padding: 20px 14px 44px;
  }

  .mosque-shell {
    gap: 22px;
  }

  .mosque-hero-top {
    grid-template-columns: 1fr;
  }

  .mosque-hero-media-wrap {
    max-width: 600px;
    height: auto;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
  }

  .mosque-title {
    font-size: 2.25rem;
  }

  .mosque-lede {
    font-size: 1.02rem;
  }

  .mosque-section-nav {
    flex-wrap: nowrap;
    gap: 22px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mosque-section-tab {
    flex: none;
    white-space: nowrap;
  }

  .mosque-gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mosque-location-tools {
    flex-direction: column;
  }

  .mosque-nearby-grid {
    grid-template-columns: 1fr;
  }

  .mosque-action-row {
    flex-direction: column;
  }

  .mosque-btn,
  .mosque-toolbar-link {
    width: 100%;
  }

  .mosque-sidebar-card {
    padding: 22px 20px 24px;
  }
}

/* --- Mobile hardening (v=shrine-links-20260731): prevent horizontal scroll on
   phones. Scoped to the mosque detail page. --- */
.mosque-body {
  overflow-x: clip;
}

.mosque-page {
  max-width: min(1220px, 100vw);
}

.mosque-shell,
.mosque-layout > *,
.mosque-main > *,
.mosque-hero-top > *,
.mosque-aside > * {
  min-width: 0;
}

.mosque-page img,
.mosque-page iframe {
  max-width: 100%;
}

.mosque-richtext p,
.mosque-shrine-note,
.mosque-fact dd,
.mosque-address-text,
.mosque-nearby-name,
.mosque-nearby-meta,
.mosque-title {
  overflow-wrap: break-word;
}

.mosque-coordinate-card code {
  overflow-wrap: anywhere;
}

@media (max-width: 430px) {
  .mosque-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mosque-title {
    font-size: 2rem;
  }

  .mosque-coordinate-card {
    flex: 1 1 100%;
    min-width: 0;
  }

  .mosque-hero-media-wrap {
    max-width: 100%;
  }
}
