/* Hallmark · page: book · genre: modern-minimal · theme: Furrow (by request)
 * critique: a paper record of one wedding, survey in the hero, choice kept in the index
 * waivers: map tiles only in the area dialog and the hall location panel; Noto Naskh Arabic for Arabic hall names because Red Hat has no Arabic glyphs
 */
.wrap {
  width: min(var(--measure), calc(100% - 3rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--space-md);
  top: -3rem;
  background: var(--color-paper-2);
  color: var(--color-ink);
  padding: var(--space-sm) var(--space-md);
}

.skip:focus { top: var(--space-md); }

.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 4.25rem;
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top);
  background: var(--color-paper);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.word {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
  text-decoration: none;
  font-size: 1.125rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.nav form { margin: 0; }

.nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-ink);
}

.nav a[aria-current="page"] {
  box-shadow: none;
  background: var(--color-paper-3);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.8rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  column-gap: var(--space-xl);
  align-items: center;
  padding-top: var(--space-xl);
}

.hero h1 { font-size: var(--text-display); }

.lede {
  margin-top: var(--space-md);
  font-size: 1.125rem;
  max-width: 34rem;
}

.page-head { padding-top: var(--space-xl); }

.page-head h1 { font-size: var(--text-display); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  align-items: center;
}

.btn {
  min-height: var(--control-height);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-lg);
  font-weight: 500;
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: inset 0 1px 0 var(--color-sheet), 0 1px 1px var(--color-rule);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms var(--ease-out), opacity 160ms var(--ease-out);
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink));
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-sheet) 32%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--color-ink) 10%, transparent);
}

.btn--quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-muted);
}

.btn--danger {
  background: var(--color-ink);
  color: var(--color-paper-2);
  border-color: var(--color-ink);
  box-shadow: none;
}

.btn:hover { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); }
}

.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn[aria-busy="true"] {
  background: var(--color-paper-3);
  color: var(--color-muted);
  border-color: var(--color-rule);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.page-head .chip { margin-top: var(--space-md); }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill);
  border: var(--rule-hair) solid var(--color-rule);
  background: var(--color-paper-2);
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
}

.chip[aria-current="page"] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink));
}

.chip--in {
  background: var(--color-green-soft);
  color: var(--color-ink);
  border-color: transparent;
}

.survey {
  position: relative;
  margin: 0;
  aspect-ratio: 2528 / 1696;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-paper-3);
}

.survey img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.survey-fallback .paper { fill: var(--color-paper-3); }
.survey-fallback .water { fill: var(--color-water); opacity: 0.85; }
.survey-fallback .contour { fill: none; stroke: var(--color-contour); stroke-width: 1.25; }
.survey-fallback .contour.heavy { stroke-width: 2.4; }
.survey-fallback .hedge { fill: none; stroke: var(--color-hedge); stroke-width: 2; stroke-dasharray: 1 7; stroke-linecap: round; }
.survey-fallback .lane { fill: none; stroke: var(--color-ink); stroke-width: 1.5; }
.survey-fallback .wall { fill: none; stroke: var(--color-ink); stroke-width: 1.5; }
.survey-fallback .holding { fill: none; stroke: var(--color-accent); stroke-width: 2.5; }

.ar,
h1.ar,
h2.ar {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  font-weight: 600;
  line-height: 1.35;
}

.num {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  color: var(--color-ink);
  white-space: nowrap;
}

.tally {
  font-size: 2.75rem;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.culture { margin: var(--space-2xl) 0 0; }

.culture img,
.gallery img,
.portrait {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-card);
  filter: contrast(0.92) saturate(0.94);
}

.culture img { max-height: 22rem; display: block; }

.culture figcaption,
.gallery figcaption {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.sheet { margin-top: var(--space-2xl); }

.sheet h2 { font-size: 1.75rem; margin-bottom: var(--space-md); }

.entry {
  border-radius: 18px;
  background: var(--color-paper-2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.entry-head {
  padding: var(--space-lg);
  border-bottom: var(--rule-hair) solid var(--color-ink);
}

.entry-head h2 { font-size: 1.75rem; }

.notebook {
  background: var(--color-paper-2);
  padding: var(--space-lg);
}

.facts {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-sm) var(--space-lg);
  margin: 0;
}

.facts dt {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
}

.facts dd { margin: 0; color: var(--color-ink); min-width: 0; }

.ruled { border-top: var(--rule-hair) solid var(--color-ink); }

.ruled > * { border-bottom: var(--rule-hair) solid var(--color-rule); }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto;
  gap: var(--space-lg);
  align-items: center;
  padding: 0.9rem 0;
}

.row-name {
  font-weight: 500;
  color: var(--color-ink);
  text-decoration: none;
  min-width: 0;
  overflow-wrap: break-word;
}

.row-score,
.row-end {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.halls .row-end { flex-wrap: nowrap; }

.form {
  display: grid;
  gap: var(--space-md);
  max-width: 36rem;
  margin-top: var(--space-lg);
}

.field {
  position: relative;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-muted);
  border-radius: 16px;
  min-height: 3.25rem;
}

.field label {
  position: absolute;
  left: var(--space-md);
  top: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 1.35rem var(--space-md) 0.45rem;
  border-radius: var(--radius-pill);
}

.field textarea { min-height: 6.5rem; resize: vertical; }

.field.is-error { border-color: var(--color-ink); }

.form-error { color: var(--color-ink); }

.flash { margin-top: var(--space-lg); color: var(--color-ink); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.gallery img,
.gallery video,
.family-item img,
.family-item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--color-paper-3);
}

.review,
.family-item { padding: var(--space-md) 0; }

.review-text { white-space: pre-wrap; color: var(--color-ink); margin-top: var(--space-sm); }

.hall-map {
  height: 16rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-paper-3);
}

.sheet-actions { margin-top: var(--space-lg); }

.area-dialog {
  width: min(60rem, calc(100vw - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  border: var(--rule-hair) solid var(--color-ink);
  border-radius: var(--radius-entry);
  background: var(--color-paper);
  color: var(--color-ink);
  padding: 0;
}

.area-dialog::backdrop {
  background: color-mix(in oklab, var(--color-ink) 40%, transparent);
}

.area-help,
.map-note {
  padding: var(--space-md) var(--space-md) 0;
  font-size: var(--text-sm);
}

.area-map { height: 28rem; background: var(--color-paper-3); }

.area-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: end;
  padding: var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.area-bar .field { flex: 1 1 14rem; }

.foot {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.home {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-xl);
  align-items: center;
  margin-top: var(--space-xl);
}

.home .survey { border-radius: 18px; box-shadow: var(--shadow-card); }

.home-copy h1 { font-size: var(--text-display); }

.board {
  margin-top: var(--space-xl);
  background: var(--color-paper-2);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: auto;
}

.halls {
  width: 100%;
  border-collapse: collapse;
}

.halls th {
  text-align: start;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  padding: 0.9rem 1rem;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.halls td {
  padding: 0.95rem 1rem;
  border-bottom: var(--rule-hair) solid var(--color-rule);
  vertical-align: middle;
}

.halls td:nth-child(3) { white-space: nowrap; }

.halls tbody tr:last-child td { border-bottom: 0; }

.halls tbody tr:hover { background: color-mix(in oklab, var(--color-paper-3) 70%, transparent); }

.halls .btn { min-height: 2rem; padding-inline: 0.85rem; }

.score {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.score-num {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  color: var(--color-ink);
}

.score-count,
.score-none {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.hall-name {
  display: block;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
}

.hall-address,
.hall-alt {
  display: block;
  margin-top: 0.15rem;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.finder {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
}

.finder-bar {
  display: flex;
  flex: 1 1 18rem;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--control-height);
  padding: 0.2rem 0.2rem 0.2rem 0.95rem;
  background: var(--color-paper-2);
  border: var(--rule-hair) solid var(--color-muted);
  border-radius: var(--radius-pill);
}

.finder-bar label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
}

.finder-bar input {
  flex: 1 1 8rem;
  min-width: 0;
  min-height: 2.4rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
}

.finder-bar input:focus,
.finder-bar input:focus-visible { outline: none; }

.finder-bar:focus-within {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.finder-bar .btn { min-height: 2.35rem; }

.empty { margin-top: var(--space-xl); }

.quiet { color: var(--color-muted); font-size: var(--text-sm); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.confirm {
  position: fixed;
  inset: 0;
  width: min(22rem, calc(100vw - 1.5rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  height: fit-content;
  margin: auto;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: var(--space-lg);
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: var(--shadow-lift);
}

.confirm p { color: var(--color-ink); }

.confirm .actions { margin-top: var(--space-md); }

.portrait-block { max-width: 16rem; }

@media (max-width: 800px) {
  .hero,
  .home { grid-template-columns: minmax(0, 1fr); }
  .survey { aspect-ratio: 2528 / 1696; }
  .row,
  .gallery { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .area-map { height: 18rem; }
  .board {
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .halls thead { display: none; }
  .halls,
  .halls tbody,
  .halls tr,
  .halls td { display: block; width: 100%; }
  .halls tr {
    margin-bottom: var(--space-md);
    padding: 0.85rem 0 1rem;
    background: var(--color-paper-2);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
  }
  .halls td {
    border: 0;
    padding: 0.2rem 1rem;
  }
  .halls td.row-end {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-top: 0.7rem;
  }
  .halls tbody tr:last-child td { border-bottom: 0; }
  .mast {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding-bottom: 0.65rem;
  }
  .word { font-size: 1rem; }
  .nav {
    width: 100%;
    justify-content: flex-start;
  }
  .nav a,
  .nav .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 0.8rem;
  }
  .home { margin-top: var(--space-md); }
  .home .survey,
  .hero .survey {
    width: calc(100% + 2rem);
    max-width: none;
    max-height: none;
    margin-inline: -1rem;
    aspect-ratio: 2528 / 1696;
  }
  .finder-bar { width: 100%; }
  input,
  select,
  textarea { font-size: 16px; }
  .halls .btn,
  .finder-bar .btn,
  .chip,
  .actions .btn { min-height: 44px; }
  .page-head h1,
  .home-copy h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
}
