:root {
  --meiras-ink: #0b1b2d;
  --meiras-ink-2: #153454;
  --meiras-gold: #d6ba7a;
  --meiras-sand: #f6f3ee;
  --meiras-pearl: #fbfcfe;
  --meiras-mist: #dce6f2;
  --meiras-line: rgba(11, 27, 45, .10);
  --meiras-shadow: 0 22px 60px rgba(11, 27, 45, .12);
}

[x-cloak] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

body {
  overflow-x: hidden;
  background: var(--meiras-pearl);
  color: var(--meiras-ink);
}

img { max-width: 100%; }

/* Fixed topbar + navigation safety for all inner pages. */
.meiras-page-top,
.meiras-inner-page {
  padding-top: 140px;
}

@media (min-width: 768px) {
  .meiras-page-top,
  .meiras-inner-page { padding-top: 170px; }
}

/* Mobile navigation is a contained panel rather than a stretched header. */
#navMenu {
  max-height: calc(100svh - 8.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

body.meiras-nav-open { overflow: hidden; }

@media (max-width: 1023px) {
  #navMenu:not(.hidden) {
    animation: meiras-menu-in .2s ease-out both;
  }
}

@keyframes meiras-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Unified, Safari-safe form system. */
.ui-form {
  --row-gap: 12px;
  --h: 46px;
}

.ui-form * { box-sizing: border-box; }

.ui-form .ui-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--row-gap);
}

@media (min-width: 768px) {
  .ui-form .ui-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ui-form .ui-field,
.ui-form .btn {
  width: 100%;
  min-height: var(--h);
}

.ui-field {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  border: 1px solid rgba(11, 27, 45, .12);
  border-radius: .875rem;
  padding: .7rem 1rem;
  font-size: 15px;
  line-height: 1.25;
  color: var(--meiras-ink);
}

.ui-field:focus {
  outline: 0;
  border-color: rgba(214, 186, 122, .85);
  box-shadow: 0 0 0 .2rem rgba(214, 186, 122, .20);
}

.ui-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%230B1B2D' stroke-opacity='.62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 14px;
  padding-right: 2.25rem;
}

input[type="date"].ui-field {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
}

input[type="date"].ui-field::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}

input[type="date"].ui-field::-webkit-calendar-picker-indicator { opacity: .75; }

.ui-label {
  display: block;
  margin-bottom: .25rem;
  color: rgba(11, 27, 45, .62);
  font-size: .75rem;
}

.ui-form .btn-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
}

@media (min-width: 768px) {
  .ui-form .btn-wrap { justify-content: end; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  border: 1px solid rgba(11, 27, 45, .08);
  border-radius: 999px;
  font-weight: 600;
}

/* Kept for legacy templates, recolored to Meiras identity. */
.btn-orange,
.bg-orange-500,
.bg-red-500 {
  background-color: var(--meiras-ink) !important;
  color: #fff !important;
}

.btn-orange:hover,
.hover\:bg-orange-600:hover,
.hover\:bg-red-600:hover {
  background-color: var(--meiras-ink-2) !important;
}

.text-orange-400,
.text-orange-500,
.text-orange-600,
.text-red-500 {
  color: var(--meiras-gold) !important;
}

.focus\:ring-orange-500:focus { --tw-ring-color: rgba(214, 186, 122, .35) !important; }

/* Rich text does not depend on Tailwind Typography plugin. */
.meiras-richtext {
  color: rgba(11, 27, 45, .72);
  font-size: 1rem;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.meiras-richtext > :first-child { margin-top: 0; }
.meiras-richtext > :last-child { margin-bottom: 0; }

.meiras-richtext h1,
.meiras-richtext h2,
.meiras-richtext h3,
.meiras-richtext h4 {
  margin: 1.7em 0 .65em;
  color: var(--meiras-ink);
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 1.12;
}

.meiras-richtext h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.meiras-richtext h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.meiras-richtext h3 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
.meiras-richtext h4 { font-size: 1.45rem; }

.meiras-richtext p,
.meiras-richtext ul,
.meiras-richtext ol,
.meiras-richtext blockquote,
.meiras-richtext table { margin: 1.05em 0; }

.meiras-richtext ul,
.meiras-richtext ol { padding-left: 1.35rem; }
.meiras-richtext ul { list-style: disc; }
.meiras-richtext ol { list-style: decimal; }
.meiras-richtext li + li { margin-top: .45rem; }

.meiras-richtext a {
  color: var(--meiras-ink-2);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(214, 186, 122, .75);
  text-underline-offset: 4px;
}

.meiras-richtext strong { color: var(--meiras-ink); }

.meiras-richtext blockquote {
  border-left: 3px solid var(--meiras-gold);
  border-radius: 0 1rem 1rem 0;
  background: var(--meiras-sand);
  padding: 1.1rem 1.35rem;
  color: rgba(11, 27, 45, .72);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.35rem;
}

.meiras-richtext img,
.meiras-richtext video,
.meiras-richtext iframe {
  max-width: 100%;
  border-radius: 1.5rem;
}

.meiras-richtext table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.meiras-richtext th,
.meiras-richtext td {
  border: 1px solid var(--meiras-line);
  padding: .8rem 1rem;
  text-align: left;
}

/* Safari/chromium clipping fix for scaled yacht images and featured cards. */
.meiras-yacht-card,
.meiras-media-card {
  isolation: isolate;
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  clip-path: inset(0 round 2rem);
}

.meiras-yacht-card img,
.meiras-media-card img { backface-visibility: hidden; }

/* Generic lightbox controls. */
.meiras-lightbox-control {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform .2s ease, background .2s ease;
}

.meiras-lightbox-control:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.20);
}

/* Quiz progress. */
.meiras-quiz-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--meiras-gold), #ead8ad);
  transition: width .25s ease;
}

/* Utility fixes. */
.min-w-0 { min-width: 0; }
summary::-webkit-details-marker { display: none; }

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

/* Home yacht filters: active state must remain readable regardless of utility order. */
.meiras-yacht-tab.bg-ink,
.meiras-yacht-tab[aria-selected="true"] {
  color: #fff !important;
}

/* Shared public form field used by contact and lead forms. */
.meiras-input {
  width: 100%;
  border: 1px solid rgba(11, 27, 45, .10);
  border-radius: 1rem;
  background: rgba(251, 252, 254, .92);
  padding: 1rem 1.2rem;
  color: var(--meiras-ink);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.meiras-input::placeholder { color: rgba(11, 27, 45, .35); }
.meiras-input:focus {
  border-color: rgba(214, 186, 122, .75);
  background: #fff;
  box-shadow: 0 0 0 .25rem rgba(214, 186, 122, .15);
}

/* Retire the old orange/black visual language in legacy public templates. */
.bg-gray-950 { background-color: var(--meiras-ink) !important; }
.bg-gray-900 { background-color: var(--meiras-ink-2) !important; }
.bg-gray-800 { background-color: rgba(255,255,255,.08) !important; }
.bg-black { background-color: var(--meiras-ink) !important; }
.border-gray-700,
.border-gray-800 { border-color: rgba(255,255,255,.12) !important; }
.text-orange-100 { color: rgba(255,255,255,.72) !important; }
.bg-orange-400\/20 { background-color: rgba(255,255,255,.10) !important; }
.border-orange-300 { border-color: rgba(255,255,255,.22) !important; }
