/* ==========================================================================
   Millport Villas — WordPress integration styles
   Only what WordPress / Contact Form 7 markup needs to sit inside the approved
   design. The design itself lives in style.css and is not modified.
   ========================================================================== */

/* ---------- Rich-text field output ---------- */
.mv-rich > :last-child { margin-bottom: 0; }

/* ---------- Footer menus (wp_nav_menu output) ---------- */
.mv-footer-list.menu { list-style: none; padding-left: 0; }

/* ---------- Avatars with an uploaded photo ---------- */
.mv-quote__avatar img,
.mv-voice__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.mv-quote__avatar:has(img) { overflow: hidden; padding: 0; }

/* ---------- Contact Form 7 ---------- */
.wpcf7 .wpcf7-form-control-wrap { display: block; }

/* Checkbox group laid out like the design's three-column grid */
.wpcf7 .wpcf7-checkbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
}
@media (min-width: 576px) { .wpcf7 .wpcf7-checkbox { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .wpcf7 .wpcf7-checkbox { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wpcf7 .wpcf7-list-item { display: block; margin: 0; }
.wpcf7 .wpcf7-list-item > label { display: block; margin: 0; cursor: pointer; }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0; }

.wpcf7 fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.wpcf7 fieldset > legend { float: none; width: auto; }

/* Dropdowns drawn by assets/js/wp.js in place of the browser's own list.
   The real select stays in the form, hidden; the button shows its value. */
.wpcf7 .wpcf7-form-control-wrap:has(> .mv-select) { position: relative; }
.wpcf7 .mv-select__native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.mv-select { position: relative; }
.mv-select__button {
  display: block;
  width: 100%;
  text-align: left;
  padding-right: 2.75rem; /* long values stop short of the arrow */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.mv-select__button[aria-expanded="true"] {
  border-color: var(--mv-ink-soft);
  box-shadow: 0 0 0 4px rgba(28, 61, 117, .16);
}
.mv-select__button.mv-invalid { border-color: #B3261E; }
.mv-select__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: .35rem;
  list-style: none;
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 2px solid var(--mv-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(4, 18, 40, .16);
}
.mv-select.is-up .mv-select__list { top: auto; bottom: calc(100% + 6px); }
.mv-select__list[hidden] { display: none; }
.mv-select__option {
  padding: .6rem .8rem;
  border-radius: 6px;
  font-family: var(--mv-font-ui);
  font-size: .95rem;
  line-height: 1.35;
  color: var(--mv-charcoal);
  overflow-wrap: anywhere; /* long options wrap inside the field's width */
  cursor: pointer;
}
.mv-select__option.is-active { background: var(--mv-green-tint); }
.mv-select__option[aria-selected="true"] { color: var(--mv-green-deep); font-weight: 600; }
/* Unavailable (a tour slot that has already started today). */
.mv-select__option[aria-disabled="true"] {
  color: #93A0B2;
  text-decoration: line-through;
  background: none;
  cursor: not-allowed;
}

/* Validation — mirrors .invalid-feedback / .is-invalid in style.css */
.wpcf7 .wpcf7-not-valid.form-control,
.wpcf7 .wpcf7-not-valid.form-select { border-color: #B3261E; }
.wpcf7 .wpcf7-not-valid-tip {
  display: block;
  margin-top: .25rem;
  font-size: var(--mv-fs-xs);
  color: #B3261E;
}

/* Response line */
.wpcf7 form .wpcf7-response-output {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  font-size: var(--mv-fs-sm);
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
  border-color: #B3261E;
  background: #FDF3F2;
  color: #7A1B15;
}
.wpcf7 form.sent .wpcf7-response-output {
  border-color: var(--mv-sage);
  background: var(--mv-sage-soft);
  color: #0B3A2E;
}
/* The page's own success card replaces the plain "sent" line */
.mv-form-card.has-success .wpcf7 form.sent .wpcf7-response-output { display: none; }

.wpcf7 .wpcf7-spinner { vertical-align: middle; margin: 0 0 0 .75rem; }
.wpcf7 form.submitting .wpcf7-submit { opacity: .7; pointer-events: none; }

/* Phones: the submit button runs full width, like the site's other primary actions. */
@media (max-width: 575.98px) {
  .wpcf7 .wpcf7-submit { width: 100%; }
}
