/* The marina index at /marinas/: the "Find a marina by name" picker and the map that stays folded until asked for.
   Loaded after berths.css and marina-guide.css. The picker is a plain select until static/js/marina-find.js
   turns it into a type-ahead box. */
.mi-find {
  position: relative;
  z-index: 5;
  margin: 0;
  padding: 24px;
  background: #0b1220;
  border: 1px solid #0b1220;
  color: #fff;
}
.mi-find__label {
  display: block;
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
}
.mi-find__row { display: flex; gap: 12px; align-items: stretch; }
.mi-find__box { position: relative; flex: 1 1 auto; min-width: 0; }
.mi-find__box select,
.mi-find__box input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #c9a96a;
  border-radius: 0;
  background: #fff;
  color: #0b1220;
  font: inherit;
  font-size: 17px;
  box-sizing: border-box;
}
.mi-find__box select:focus-visible,
.mi-find__box input:focus-visible { outline: 3px solid #c9a96a; outline-offset: 2px; }
.mi-find .berth-btn { flex: 0 0 auto; min-height: 52px; background: #c9a96a; border-color: #c9a96a; color: #0b1220; }
.mi-find .berth-btn:hover { background: #d8bc85; color: #0b1220; }
.mi-find .berth-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mi-find__hint { margin: 12px 0 0; color: #c9cfda; font-size: 14px; line-height: 1.5; }

/* The type-ahead list: every marina by country when the box is empty, the matches once something is typed. */
.mi-find__list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: min(380px, 55vh);
  margin: 4px 0 0;
  padding: 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: #fff;
  border: 1px solid #cfc8b6;
  box-shadow: 0 18px 40px rgba(11, 18, 32, 0.28);
  color: #0b1220;
  -webkit-overflow-scrolling: touch;
}
.mi-find__list[hidden] { display: none; }
.mi-find__group {
  padding: 12px 14px 4px;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mi-find__option { margin: 0; }
.mi-find__option a {
  display: block;
  padding: 10px 14px;
  color: #0b1220;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.mi-find__option strong { display: block; font-size: 16px; font-weight: 600; }
.mi-find__option span { display: block; margin-top: 1px; color: #6e6e73; font-size: 13px; }
.mi-find__option a:hover,
.mi-find__option[aria-selected="true"] a { background: #f4efe2; }
.mi-find__option[aria-selected="true"] a { box-shadow: inset 3px 0 0 #c9a96a; }
.mi-find__none { padding: 12px 14px; color: #424245; font-size: 15px; }

.mi-filters { margin-top: 20px; }
.mi-filters__title {
  grid-column: 1 / -1;
  margin: 0;
  color: #0b1220;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* The Google map, folded away under one modest button so the list of names comes first. */
.mi-map { margin: 16px 0 0; }
.mi-map > summary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid #cfc8b6;
  color: #0b1220;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.mi-map > summary::-webkit-details-marker { display: none; }
.mi-map > summary:hover { border-color: #c9a96a; }
.mi-map > summary:focus-visible { outline: 2px solid #c9a96a; outline-offset: 2px; }
.mi-map__close, .mi-map[open] .mi-map__open { display: none; }
.mi-map[open] .mi-map__close { display: inline; }
.mi-map .mi-google { margin-top: 16px; scroll-margin-top: 80px; }
.mi-map .mi-google .mg-map__frame { height: clamp(280px, 40vw, 440px); }
.mi-map .mg-map__place { margin-top: 0; }
.mi-regions { margin-top: 28px; }

@media (max-width: 520px) {
  .mi-find { padding: 20px 16px; }
  .mi-find__label { font-size: 25px; }
  .mi-find__row { flex-direction: column; }
  .mi-find .berth-btn { width: 100%; }
  .mi-map > summary { width: 100%; justify-content: center; box-sizing: border-box; }
  .mi-map .mi-google .mg-map__frame { height: 340px; }
  .mi-google__title { font-size: 21px; }
}

/* Phones: length and draught share a row, so the list of names starts sooner. */
@media (max-width: 520px) {
  .mi-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .mi-filters > .berth-field:nth-of-type(4), .mi-filters > .berth-field--submit { grid-column: 1 / -1; }
  .mi-filters__checks { min-height: 0; }
}

/* Filters folded on phones (marina-find.js opens them on wider screens). */
.mi-filterbox > .mi-filterbox__toggle {
  cursor: pointer;
  list-style: none;
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-weight: 600;
}
.mi-filterbox > .mi-filterbox__toggle::-webkit-details-marker { display: none; }
.mi-filterbox > .mi-filterbox__toggle::after { content: " +"; }
.mi-filterbox[open] > .mi-filterbox__toggle::after { content: " 2"; }
@media (min-width: 700px) {
  .mi-filterbox > .mi-filterbox__toggle { display: none; }
}
