/* Rethink base: small reset, page ground, default form controls, and the fallback layout used
   only where Elementor Theme Builder has no template. Low specificity (:where) throughout so
   Elementor Site Settings and widget styles always win. */

:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(body) { margin: 0; background: var(--page); color: var(--ink-body); font-family: var(--font-sans); font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(img, svg, video, canvas, iframe) { max-width: 100%; }
:where(img, video) { height: auto; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(table) { border-collapse: collapse; }
::selection { background: var(--sage-light); color: var(--ink); }

/* Accessibility helpers */
.screen-reader-text, .rm-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rm-skip-link { position: absolute; left: var(--space-4); top: -100px; z-index: 100000; padding: var(--space-3) var(--space-5); border-radius: var(--radius-btn); background: var(--slate); color: var(--on-dark); font-weight: 700; font-size: 15px; text-decoration: none; }
.rm-skip-link:focus { top: var(--space-4); color: var(--on-dark); }

/* Default form controls (plugin forms: MemberPress, search, comments). Elementor forms style themselves.
   Generic submit buttons are slate; amber is kept for booking and the one main action on a view. */
:where(input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=range], [type=file], [type=color]), select, textarea) { min-height: var(--touch-min); max-width: 100%; padding: 10px 16px; border: 1px solid var(--line-control); border-radius: var(--radius-btn); background: var(--surface); color: var(--ink); font-size: 16px; line-height: 22px; }
:where(textarea) { min-height: 120px; }
:where(input, select, textarea):focus-visible { outline: 2px solid var(--slate); outline-offset: 1px; border-color: var(--slate); }
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--slate); width: 18px; height: 18px; }
:where(button, input[type=submit], input[type=button], .button) { display: inline-flex; align-items: center; justify-content: center; min-height: var(--touch-min); padding: var(--space-3) var(--space-5); border: 2px solid transparent; border-radius: var(--radius-btn); background: var(--slate); color: var(--on-dark); font-size: 15px; line-height: 20px; font-weight: 700; cursor: pointer; text-decoration: none; }
:where(button, input[type=submit], input[type=button], .button):hover { background: var(--slate-deep); color: var(--on-dark); }
:where(label) { font-size: 15px; font-weight: 600; color: var(--ink); }

/* WordPress core classes used in content */
:where(.alignleft) { float: left; margin: 6px 24px 12px 0; }
:where(.alignright) { float: right; margin: 6px 0 12px 24px; }
:where(.aligncenter) { display: block; margin-inline: auto; }
:where(.wp-caption-text, .wp-element-caption) { font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* Fallback layout (no Theme Builder template) */
.rm-container { width: 100%; max-width: calc(var(--container-max) + 2 * var(--space-9)); margin-inline: auto; padding-inline: var(--space-9); }
.rm-site-main { padding-block: var(--space-8) var(--space-10); }
.rm-site-main > .rm-container { display: flex; flex-direction: column; gap: var(--space-8); }
.rm-fallback-header .custom-logo-link { display: flex; align-items: center; }
.rm-fallback-header .custom-logo { display: block; width: clamp(150px, 20vw, 240px); height: auto; max-height: 72px; object-fit: contain; }
.rm-fallback-header .rm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.rm-fallback-header .rm-nav .sub-menu { display: none; }
.rm-fallback-header .rm-nav .current-menu-item > a { background: var(--sage-light); }
.rm-fallback-footer .rm-footer__legal { border-top: 0; padding-top: 0; }
.rm-page-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: var(--measure); }
.rm-page-head h1, .rm-site-main h1.entry-title { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 46px; letter-spacing: -0.005em; color: var(--ink); margin: 0; text-wrap: balance; }
.rm-page-head .rm-lead { font-size: 17px; line-height: 27px; color: var(--ink-muted); margin: 0; }
.rm-featured { aspect-ratio: 16 / 9; max-width: var(--measure); }
.rm-entry-content:not(.rm-prose) { max-width: var(--measure); }
.rm-pagination .nav-links { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.rm-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch-min); min-height: var(--touch-min); padding: 0 14px; border-radius: var(--radius-btn); background: var(--sage-light); color: var(--ink); font-weight: 700; font-size: 15px; text-decoration: none; }
.rm-pagination .page-numbers.current { background: var(--slate); color: var(--on-dark); }
.rm-search-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.rm-search-form input[type=search] { flex: 1 1 240px; }

/* Elementor pages: let Elementor own the width */
.rm-elementor-page .rm-site-main { padding: 0; }

@media (max-width: 1024px) {
  .rm-container { padding-inline: var(--space-6); max-width: calc(var(--container-max) + 2 * var(--space-6)); }
}
@media (max-width: 767px) {
  .rm-container { padding-inline: var(--space-4); }
  .rm-page-head h1, .rm-site-main h1.entry-title { font-size: 32px; line-height: 38px; }
  .rm-fallback-header { height: auto; min-height: 64px; flex-wrap: wrap; padding-block: var(--space-3); }
  :where(.alignleft, .alignright) { float: none; margin: 0 0 var(--space-4); }
}
@media (prefers-reduced-motion: reduce) { :where(*, *::before, *::after) { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
