/* DENTRISTOD responsive overrides. Loaded after the original styles. */
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { min-width: 0; overflow-x: clip; }
img, video, svg { max-width: 100%; }
iframe { max-width: 100%; }
.contentfrst { line-height: 1.55; overflow-wrap: anywhere; }
.contentfrst img:not(.icn):not(.icn2) { max-width: 100%; height: auto; }
.navigation { position: sticky; top: 0; z-index: 30; height: auto; min-height: 47px; }
.navigation.sticky { position: sticky; }
.navigation nav { position: relative; padding: 0; }
.navigation .mainnav { display: flex; align-items: stretch; justify-content: center; flex-wrap: nowrap; }
.navigation .mainnav > li { flex: 0 0 auto; }
.navigation .mainnav > li > a { padding: 9px clamp(7px, .75vw, 15px); }
.navigation .mainnav .dropdown { z-index: 35; }
.navigation .nav-mobile { display: none; }
.footer { position: static; width: 100%; margin-top: 0; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; padding: 12px 0; }
.footer-contact a { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.footer-credit { font-size: 11px; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.table-scroll table { width: 100%; }
.mobile-dive-sites { display: none; }
/* Modal galleries must appear above the sticky navigation. */
.modal { z-index: 1000; }
.modal img { max-width: 100%; height: auto; }
.modal-content, .modal-content2, .modal-content3, .modal-content4,
.modal-content5, .modal-content6, .modal-content7, .modal-content8,
.modal-content9, .modal-content10, .modal-content11 { max-width: 100%; }

@media (max-width: 1250px) {
  .navigation .nav-mobile { display: flex; align-items: center; justify-content: space-between; position: static; width: 100%; height: 52px; background: #536a9c; padding: 0 12px; }
  #nav-toggle { position: static; display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; background: #536a9c; border: 1px solid rgba(255,255,255,.5); border-radius: 5px; color: #fff; font: inherit; font-size: 17px; padding: 8px 12px; }
  .navigation .mobile-book { display: inline-flex; align-items: center; min-height: 44px; color: #fff; padding: 6px 10px; font-size: 15px; }
  .navigation .mainnav { display: none; position: absolute; top: 52px; left: 0; right: 0; width: 100%; max-width: none; padding: 4px 0 12px; margin: 0; flex-direction: column; align-items: stretch; background: #618cc3; max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 8px 16px #0004; }
  .navigation.menu-open .mainnav { display: flex; }
  .navigation .mainnav li, .navigation .mainnav .subs { width: 100% !important; float: none !important; position: static !important; display: block; margin: 0; padding: 0; border: 0 !important; background: #618cc3; }
  .navigation .mainnav li a, .navigation .mainnav li button { display: block; width: 100%; min-width: 0; min-height: 44px; text-align: left; color: #fff; line-height: 1.4; padding: 11px 18px; font-size: 16px; }
  .navigation .mainnav > li > a { padding: 11px 18px; }
  .navigation .mainnav li.hassubs > a::after { content: ' ▾'; margin-left: 6px; }
  .navigation .mainnav li.submenu-open > a::after { content: ' ▴'; }
  .navigation .mainnav .dropdown,
  .navigation .mainnav .hassubs .hassubs .dropdown { display: none; width: 100% !important; position: static !important; top: auto !important; left: auto !important; visibility: visible !important; opacity: 1 !important; transition: none; padding: 0 !important; box-shadow: none; }
  .navigation .mainnav li.submenu-open > .dropdown { display: block; }
  .navigation .mainnav .dropdown li a,
  .navigation .mainnav .dropdown li button { padding-left: 34px; background: #526f9b; }
  .navigation .mainnav .dropdown .dropdown li a,
  .navigation .mainnav .dropdown .dropdown li button { padding-left: 50px; background: #466184; }
  .navigation .mainnav li:hover { transition: none; }
  .navigation .mainnav li a:focus-visible,
  .navigation .mainnav li button:focus-visible,
  #nav-toggle:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
  .contentfrst { width: min(92%, 920px); }
}
@media (max-width: 800px) {
  .top-container { height: 32svh; min-height: 180px; max-height: 360px; padding: 0; background-position: center; }
  .parallax { min-height: 0; background-attachment: scroll; background-position: center top; }
  .contentfrst { width: calc(100% - 24px); padding: 16px; }
  h1 { font-size: clamp(26px, 7vw, 40px); }
  h2 { font-size: clamp(20px, 5vw, 25px); line-height: 1.4; margin-bottom: 12px; }
  h3, h4 { font-size: clamp(16px, 4.5vw, 21px); line-height: 1.5; }
  .regnav { margin-left: 20px; }
  .regnav .regnav { margin-left: 14px; }
  .contentfrst p img[style*="float:left"], .contentfrst p img[style*="float:right"] { width: min(38%, 170px) !important; height: auto !important; }
  .media-wrapper { width: 100%; height: auto; margin: 0 auto; }
  .media-sticky { width: 100%; }
  .slideshow-container, .slideshow-container2, .slideshow-container3, .slideshow-container4 { width: 100%; height: auto; max-width: 100%; margin: 0 auto; }
  .slideshow-container img, .slideshow-container2 img,
  .slideshow-container3 img, .slideshow-container4 img { display: block; width: 100% !important; height: auto !important; object-fit: cover; }
  .slideshow-container img { aspect-ratio: 528 / 352; }
  .slideshow-container2 img { aspect-ratio: 550 / 248; }
  .slideshow-container3 img { aspect-ratio: 500 / 284; }
  .slideshow-container4 img { aspect-ratio: 500 / 332; }
  .text { padding: 8px; }
  #body { position: relative; left: auto; width: 100%; height: auto; aspect-ratio: 609 / 405; margin: 0 auto; padding: 0; }
  #body .img-inner { width: 100%; height: 100%; }
  #body .img-inner img { object-fit: contain; }
  #body .sb-bignav { width: 17%; font-size: clamp(36px, 12vw, 64px); line-height: normal; height: 100%; background-color: #0005; opacity: .9; }
  #body input:checked + li > label.sb-bignav { display: flex; align-items: center; justify-content: center; }
  .popupcontainer { display: block; width: 100%; max-width: 100%; }
  .popupcontainer > img { display: block; width: 100%; max-width: 500px; height: auto; margin: 0 auto; }
  .popupcontainer map { display: none; }
  .mobile-dive-sites { display: block; margin: 14px 0 0; }
  .mobile-dive-sites h3 { color: #2c3e50; margin-bottom: 8px; }
  .mobile-dive-sites details { background: #eee9e4; border: 1px solid #aaa; border-radius: 4px; margin: 5px 0; }
  .mobile-dive-sites summary { font-weight: bold; padding: 12px 14px; min-height: 44px; cursor: pointer; }
  .mobile-dive-sites .site-description { padding: 6px 14px 14px; }
  .table-scroll #gettinghere { min-width: 620px; }
  .table-scroll th, .table-scroll td { white-space: normal; word-break: normal; overflow-wrap: anywhere; }
  table.center { margin: 0 auto; max-width: 100%; }
  .map-responsive, .map-responsive2 { padding-bottom: 65%; }
  .map-responsive iframe, .map-responsive2 iframe { width: 100%; height: 100%; }
  input[type=text], input[type=email], input[type=date], input[type=number],
  input[type=button], input[type=submit], input[type=reset], select, textarea { width: 100%; max-width: 100%; font-size: 16px; }
  .col-25, .col-75 { float: none; width: 100%; margin-top: 4px; }
  .container { padding: 14px; }
  input[type=button], input[type=submit], input[type=reset] { float: none; margin: 5px 0; min-height: 44px; border-radius: 5px; }
  input[type=button] { border: none; padding: 12px 20px; color: #fff; background: #536a9c; cursor: pointer; }
  .modal { padding: 58px 8px 24px; }
  .modal-content, .modal-content2, .modal-content3, .modal-content4,
  .modal-content5, .modal-content6, .modal-content7, .modal-content8,
  .modal-content9, .modal-content10, .modal-content11 { width: 100%; max-width: 760px; }
  .modal [class*="Slides"] > img { max-width: 100%; width: 100%; max-height: 62svh; object-fit: contain; }
  .modal .close { position: fixed; z-index: 1010; top: 8px; right: 14px; font-size: 42px; }
  .modal .prev, .modal .next { top: 35%; padding: 12px; font-size: 25px; background: #223a59aa; }
  .modal .column, .modal .column2 { width: 25%; }
  .footer { padding: 16px 12px; line-height: 1.45; }
  .footer-contact { gap: 10px 16px; font-size: 14px; }
  .imgbox:hover img, img.qr-resize:hover { transform: none; }
}
@media (max-width: 390px) {
  .contentfrst { width: calc(100% - 16px); padding: 12px; }
  .navigation .mobile-book { font-size: 13px; }
  .container { padding: 10px; }
  .g-recaptcha { transform: scale(.82); transform-origin: left top; margin-bottom: -13px; }
  .footer-contact { flex-direction: column; gap: 8px; }
  .modal .column, .modal .column2 { width: 33.333%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade, .fade2, .fade3, .fade4 { animation: none; }
}

/* 2026-10: Nested desktop Gallery menus. Only the hovered/focused/open
   branch is displayed; a hovered ancestor must not expose all descendants. */
@media (min-width: 1251px) {
  .navigation .mainnav li.hassubs { position: relative; }
  .navigation .mainnav li.hassubs > ul.dropdown {
    display: block; opacity: 0; visibility: hidden; pointer-events: none;
  }
  .navigation .mainnav li.hassubs:hover > ul.dropdown,
  .navigation .mainnav li.hassubs:focus-within > ul.dropdown,
  .navigation .mainnav li.hassubs.submenu-open > ul.dropdown {
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  .navigation .mainnav > li > ul.dropdown {
    position: absolute; left: 0; top: 100%; width: 225px;
  }
  .navigation .mainnav ul.dropdown > li {
    float: none; position: relative; left: auto; top: auto;
    width: 100%; padding: 0;
  }
  .navigation .mainnav ul.dropdown li.hassubs > ul.dropdown {
    position: absolute; top: 0; left: 100%; width: 225px;
  }
  .navigation .mainnav ul.dropdown > li > a,
  .navigation .mainnav ul.dropdown > li > button {
    width: 100%; min-width: 0; padding: 11px 14px; text-align: left;
  }
  .navigation .mainnav li.hassubs > a { cursor: pointer; }
}
/* Touchscreen submenu logic: open exactly the branch that was tapped. */
@media (max-width: 1250px) {
  .navigation .mainnav li.hassubs > ul.dropdown {
    display: none !important; visibility: hidden !important;
    opacity: 0 !important; pointer-events: none !important;
  }
  .navigation .mainnav li.hassubs.submenu-open > ul.dropdown {
    display: block !important; visibility: visible !important;
    opacity: 1 !important; pointer-events: auto !important;
  }
  .navigation.menu-open .mainnav { overflow-x: hidden; }
}
/* Banner: maintain source image proportions without cutting off its sides. */
@media (max-width: 800px) {
  .top-container {
    width: 100%; height: auto !important;
    min-height: 0 !important; max-height: none !important;
    aspect-ratio: var(--dentristod-hero-aspect, 3 / 1);
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    padding: 0 !important;
  }
  .top-container picture, .top-container > img,
  .top-container picture > img {
    display: block; width: 100%; height: auto; object-fit: contain;
  }
}
