/* Direction B — The Village Register. Heritage / editorial.
   Desktop values follow the 1440px comp; breakpoints at 1024px and 640px. */

:root {
  --gutter: 80px;
  --page-max: 1440px;
  --rule-dotted: 1.5px dotted var(--line-strong);
  --sticky-top: 24px;
}

body { background: #FFFFFF; }

.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------ Top bar */

.topbar {
  background: var(--navy);
  color: var(--on-navy);
  font-size: 14px;
  font-weight: 500;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px 28px;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 0 var(--gutter);
}
.topbar__links { display: flex; gap: 28px; }
.topbar a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: #FFFFFF;
  text-decoration: none;
}
.topbar a:hover { text-decoration: underline; text-underline-offset: 3px; }
.topbar__phone { font-weight: 700; }

/* ------------------------------------------------------------ Masthead */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 36px var(--gutter) 0;
}
.masthead__logo { display: block; border-radius: 4px; }
.masthead__logo img { height: 150px; width: auto; }

.mainnav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 36px;
}
.mainnav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-family: var(--font-caps);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
}
.mainnav a:hover { color: var(--navy); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.mainnav a[aria-current="page"] { color: var(--royal-ink); }

.nav-toggle { display: none; }

.double-rule {
  align-self: stretch;
  height: 5px;
  border-top: 1.5px solid var(--navy);
  border-bottom: 1.5px solid var(--navy);
}

/* ------------------------------------------------------------ Title block */

.title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 64px var(--gutter);
  text-align: center;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-caps);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--royal-ink);
}
.swash { flex-shrink: 1; min-width: 0; color: var(--royal); }
.swash--flip { transform: scaleX(-1); }

h1 {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1.05;
  font-weight: 700;
  color: var(--navy);
}
.intro {
  max-width: 660px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}

/* ------------------------------------------------------------ Lead film */

.film {
  width: 100%;
  max-width: 800px;
  margin: 22px 0 0;
}
/* A thin double frame, echoing the masthead's double rule. */
.film__plate {
  padding: 6px;
  border: 1.5px solid var(--navy);
  border-radius: 8px;
}
.film .video {
  border-radius: 3px;
  box-shadow: 0 0 0 1.5px var(--navy);
}
.film__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 26px 8px 8px;
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 10px 30px rgba(6, 42, 85, .35);
  color: #FFFFFF;
  font-family: var(--font-caps);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.film__play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy);
}
.film__play-icon svg { margin-left: 3px; }
.video__poster:hover .film__play {
  background: var(--navy-deep);
  transform: translate(-50%, -50%) scale(1.04);
}
.film__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
}
.film__title {
  font-family: var(--font-caps);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--navy);
}
.film__meta { font-size: 14px; color: var(--muted); }
.film__meta a {
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
  font-weight: 700;
  color: var(--royal-ink);
}

/* ------------------------------------------------------------ Two columns */

.register {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 0 var(--gutter) 96px;
}
.register:focus { outline: none; }

.register__aside {
  flex-shrink: 0;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
@media (min-width: 1025px) and (min-height: 760px) {
  .register__aside { position: sticky; top: var(--sticky-top); }
}

.register__main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.register__sections {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

/* ------------------------------------------------------------ Contents */

.contents {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
}
.contents__title {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.contents__list { display: flex; flex-direction: column; gap: 6px; }

.contents__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: var(--tap);
  padding-top: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.contents__num {
  flex-shrink: 0;
  width: 30px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cat-text);
}
.contents__leader {
  flex-grow: 1;
  min-width: 12px;
  border-bottom: 2px dotted var(--line-strong);
  transition: border-color .2s var(--ease);
}
.contents__count { color: var(--muted); font-variant-numeric: tabular-nums; }

.contents__link:hover .contents__name { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.contents__link[aria-current="true"] .contents__name { color: var(--navy); font-weight: 700; }
.contents__link[aria-current="true"] .contents__leader { border-bottom-style: solid; border-bottom-color: var(--royal); }
.contents__link[aria-disabled="true"] { opacity: .5; cursor: default; }
.contents__link[aria-disabled="true"] .contents__name { text-decoration: none; }

/* ------------------------------------------------------------ Visit box */

.visit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--ice);
  border-radius: 6px;
}
.visit--after { display: none; }
.visit__label {
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--royal-ink);
}
.visit__address {
  font-style: normal;
  font-family: var(--font-caps);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--navy);
}
.visit__phone {
  display: flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--tap);
  font-size: 16px;
  font-weight: 700;
}
.visit__map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 4px;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s var(--ease);
}
.visit__map:hover { background: var(--navy-deep); color: #FFFFFF; }
.visit__lease {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.visit__lease a {
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
  font-weight: 700;
}

/* ------------------------------------------------------------ Search */

.search { display: flex; flex-direction: column; gap: 10px; }
.search__label {
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--royal-ink);
}
.search__field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 6px 0 18px;
  border: 1.5px solid var(--navy);
  border-radius: 6px;
  background: #FFFFFF;
  transition: box-shadow .15s var(--ease);
}
.search__field:focus-within { box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px var(--focus); }
.search__icon { flex-shrink: 0; color: var(--navy); }
.search__field input {
  flex-grow: 1;
  min-width: 0;
  min-height: 52px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 17px;
  color: var(--ink);
}
.search__field input::placeholder { color: #5E6C84; opacity: 1; }
.search__clear {
  flex-shrink: 0;
  min-height: var(--tap);
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--royal-ink);
  font-size: 14px;
  font-weight: 700;
}
.search__clear:hover { background: var(--ice); }
.search__status {
  min-height: 1.5em;
  font-size: 14px;
  color: var(--muted);
}
.search__status strong { color: var(--ink); }

/* ------------------------------------------------------------ Sections */

.reg-section { display: flex; flex-direction: column; scroll-margin-top: 24px; }
.reg-section:focus { outline: none; }

.reg-section__head {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 4px double var(--navy);
}
.reg-section__head::before {
  content: "";
  position: absolute;
  inset: -12px -16px 0;
  z-index: -1;
  border-radius: 6px 6px 0 0;
  background: var(--cat-tint, var(--mist));
  opacity: 0;
}
.reg-section.is-flash .reg-section__head::before { animation: flash 1.8s var(--ease); }
@keyframes flash {
  0%, 35% { opacity: 1; }
  100% { opacity: 0; }
}

.reg-section__numeral {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  font-weight: 700;
  color: var(--cat-text);
}
.reg-section__titles { display: flex; flex-direction: column; gap: 4px; }
.reg-section__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--navy);
}
.reg-section__tagline { font-size: 15px; color: var(--muted); }

/* ------------------------------------------------------------ Partner rows */

.reg-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 200px;
  grid-template-areas: "name desc contact";
  gap: 32px;
  align-items: start;
  padding: 22px 0;
  border-bottom: var(--rule-dotted);
}
.reg-row__name {
  grid-area: name;
  font-family: var(--font-caps);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--navy);
}
.reg-row__desc {
  grid-area: desc;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.reg-row__contact {
  grid-area: contact;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.reg-row__phone,
.reg-row__web {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}
.reg-row__phone {
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.reg-row__phone:hover { text-decoration: underline; text-underline-offset: 3px; }
.reg-row__web {
  font-size: 14px;
  font-weight: 600;
  color: var(--royal-ink);
}
.reg-row__web:hover { color: var(--navy-deep); }
.reg-row__web svg { flex-shrink: 0; }
.reg-row__none {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 14px;
  color: var(--muted);
}

/* ------------------------------------------------------------ Empty / notices */

.empty,
.notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 32px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--ice);
}
.empty__title {
  font-family: var(--font-caps);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.empty__hint,
.notice p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.notice a { font-weight: 700; }
.empty__reset {
  margin-top: 6px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 4px;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
}
.empty__reset:hover { background: var(--navy-deep); }

/* ------------------------------------------------------------ Footer */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px var(--gutter) 44px;
  background: var(--navy);
  color: var(--on-navy);
  text-align: center;
}
.footer__mark { display: flex; align-items: center; justify-content: center; gap: 18px; max-width: 100%; }
.swash--footer { color: var(--sky); }
.footer__name {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: #FFFFFF;
}
.footer__note { max-width: 620px; font-size: 15px; line-height: 1.6; }
.footer__nav ul { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 28px; }
.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.footer__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__legal { font-size: 13px; color: #A9BFD9; }

/* Leave room so the fixed preview ribbon never covers the last line. */
.footer { padding-bottom: 88px; }

/* ------------------------------------------------------------ Touch */

@media (pointer: coarse) {
  .reg-row__phone,
  .reg-row__web,
  .reg-row__none { min-height: var(--tap); }
}

/* ============================================================ ≤ 1024px */

@media (max-width: 1024px) {
  :root { --gutter: 40px; }

  .masthead__logo img { height: 120px; }
  .mainnav ul { column-gap: 24px; }
  .title-block { padding-block: 48px; }
  h1 { font-size: 60px; }

  /* The sidebar folds into a sticky, horizontally scrolling chip row. */
  .register {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding-bottom: 72px;
  }
  .register__aside {
    position: sticky;
    top: 0;
    z-index: 5;
    width: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding: 10px var(--gutter);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1.5px solid var(--line);
    backdrop-filter: blur(6px);
  }
  .visit--aside { display: none; }
  .visit--after { display: flex; }

  .contents { padding: 0; border: 0; border-radius: 0; }
  .contents__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .contents__list {
    position: relative; /* contain the visually-hidden labels inside the scroller */
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    margin: -4px;
    padding: 4px;
  }
  .contents__list::-webkit-scrollbar { display: none; }
  .contents__list li { flex-shrink: 0; scroll-snap-align: start; }
  .contents__link {
    align-items: center;
    gap: 8px;
    padding: 0 16px 0 12px;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    background: #FFFFFF;
    white-space: nowrap;
  }
  .contents__num { width: auto; min-width: 20px; text-align: center; }
  .contents__leader { display: none; }
  .contents__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--ice);
    font-size: 13px;
    font-weight: 700;
  }
  .contents__link[aria-current="true"] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
  .contents__link[aria-current="true"] .contents__name { color: #FFFFFF; }
  .contents__link[aria-current="true"] .contents__num { color: var(--sky); }
  .contents__link[aria-current="true"] .contents__count { background: rgba(255, 255, 255, .16); color: #FFFFFF; }
  .contents__link:focus-visible { outline-offset: 2px; border-radius: 999px; }

  .reg-section { scroll-margin-top: 88px; }

  .reg-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name contact"
      "desc contact";
    gap: 8px 32px;
  }
}

/* ============================================================ ≤ 640px */

@media (max-width: 640px) {
  :root { --gutter: 20px; }

  .topbar { font-size: 13px; }
  .topbar__inner { flex-wrap: wrap; justify-content: center; padding-top: 8px; }
  .topbar__address { text-align: center; }
  .topbar__links { gap: 20px; }

  .masthead { padding-top: 20px; gap: 6px; }
  .masthead__logo img { height: 96px; }

  .nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 0 18px;
    border: 1.5px solid var(--navy);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--navy);
    font-family: var(--font-caps);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
  }
  .js .nav-toggle { display: inline-flex; }
  .nav-toggle[aria-expanded="true"] { background: var(--navy); color: #FFFFFF; }
  .js .mainnav { display: none; width: 100%; }
  .js .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; align-items: center; column-gap: 0; padding: 4px 0 8px; }
  .mainnav li { width: 100%; text-align: center; }
  .mainnav a { justify-content: center; width: 100%; }

  .title-block { padding-block: 36px 40px; gap: 14px; }
  .kicker { gap: 8px; font-size: 12px; letter-spacing: .1em; white-space: nowrap; }
  .kicker .swash { width: 30px; }
  h1 { font-size: clamp(34px, 10vw, 48px); }
  .intro { font-size: 17px; }

  .film { margin-top: 12px; }
  .film__plate { padding: 4px; }
  .film__play { gap: 10px; padding: 6px 18px 6px 6px; font-size: 14px; }
  .film__play-icon { width: 40px; height: 40px; }
  .film__title { font-size: 15px; }

  .register { padding-bottom: 56px; }
  .register__sections { gap: 48px; }
  .reg-section { scroll-margin-top: 80px; }
  .reg-section__head { gap: 14px; }
  .reg-section__numeral { font-size: 34px; }
  .reg-section__title { font-size: 24px; }

  .reg-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 0;
  }
  .reg-row__contact {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 20px;
    text-align: left;
  }
  .reg-row__phone,
  .reg-row__web,
  .reg-row__none { min-height: var(--tap); }

  .visit,
  .empty,
  .notice { padding: 24px 20px; }

  .footer { padding-top: 44px; }
  .footer__mark .swash { width: 40px; }
  .footer__name { font-size: 22px; }
  .footer__nav ul { column-gap: 20px; }
}
