/* Styles added during the pre-launch review. Nothing here is ported from Duda.
 *
 * Kept separate from device.css — that file solves the three-documents-in-one
 * problem and says so; mixing review additions into it would blur what is
 * structural and what is editorial. Kept out of /styles/ entirely because
 * tools/emit-css.mjs regenerates that directory wholesale.
 */

/* --- 1. Body-text interlinks -------------------------------------------
 * The business name, linked to the homepage once per page. Scoped to the
 * gy-interlink class rather than to a container, so the treatment can never
 * leak onto headings, buttons, or header/footer links — which carry their own
 * styling and must not pick this up.
 */
.gy-interlink,
.gy-interlink:visited {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gy-interlink:hover,
.gy-interlink:focus-visible {
  text-decoration-thickness: 2px;
}

/* --- 2. Legal pages -----------------------------------------------------
 * The two legal pages clone /testimonials' cascade, which never had to lay out
 * a long run of prose: it styles cards and a slider. These rules give the
 * policy text ordinary document rhythm and cap the measure so lines do not run
 * the full width of a 1440px viewport.
 */
#gy-privacy-policy-body,
#gy-terms-and-conditions-body {
  max-width: 900px;
  margin: 0 auto;
}
#gy-privacy-policy-body h2,
#gy-terms-and-conditions-body h2 {
  margin: 1.6em 0 0.5em;
  font-size: 1.35rem;
  line-height: 1.35;
}
#gy-privacy-policy-body p,
#gy-terms-and-conditions-body p {
  margin: 0 0 1em;
  line-height: 1.7;
}
#gy-privacy-policy-body ul,
#gy-terms-and-conditions-body ul {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
  list-style: disc;
}
#gy-privacy-policy-body li,
#gy-terms-and-conditions-body li {
  margin: 0 0 0.4em;
  line-height: 1.6;
}
#gy-privacy-policy-body a,
#gy-terms-and-conditions-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- 3. Footer map ------------------------------------------------------
 * Full-bleed row, capped at 300px so it reads as a band rather than a panel.
 * The height attribute on the iframe covers no-CSS; this covers the case where
 * a ported rule tries to stretch a .dmCustomHtml child.
 */
#gy-footer-map-widget iframe {
  display: block;
  width: 100%;
  max-height: 300px;
  border: 0;
}

/* --- 4. Blog search empty state ---------------------------------------- */
.gy-blog-no-results {
  width: 100%;
  padding: 40px 0;
  text-align: center;
}

/* --- 5. Footer map row sizes to the map --------------------------------
 * The row inherited the generic .dmRespRow band padding, which left a tall
 * empty gutter above and below a 300px iframe. Collapse it so the column is
 * the map's height and nothing more.
 */
#gy-footer-map-row,
#gy-footer-map-cols,
#gy-footer-map-col,
#gy-footer-map-widget {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  line-height: 0 !important;   /* kills the inline-block descender gap */
  font-size: 0 !important;
}
#gy-footer-map-col { float: none !important; width: 100% !important; }
#gy-footer-map-widget iframe { height: 300px !important; vertical-align: bottom; }

/* --- 6. The contact form must not overlap the section below it ---------
 * Duda pulls the form row up into the following band with a NEGATIVE bottom
 * margin:
 *     #dm .dmBody div.u_1858292918 { margin: 50px 50px -250px !important }
 *
 * That -250px is a deliberate "card floats over the next section" effect, and
 * it is tuned to the exact height the form had when Duda rendered it. This
 * build's form is a different height — the reCAPTCHA block is gone (-72px) and
 * the legal line was added (+29px) — so the overlap no longer lands where it
 * was drawn and the form collides with the row beneath. Measured at 1440 on
 * /contact: the section ended at 1531 while its content reached 1741.
 *
 * Replacing the negative margin with a positive one lets the section size to
 * the form and leaves clear space underneath. Specificity is raised with
 * `div` so it outranks Duda's own `div.u_<id>` !important rule.
 *
 * The form row carries the same u_ id on every page that has a form, so this
 * is one rule rather than nineteen.
 */
#dm .dmBody div.dmRespRow:has(form) {
  margin-bottom: 40px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
#dm .dmBody div.dmRespCol:has(form),
#dm .dmBody div.dmRespColsWrapper:has(form) {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* --- 7. Drawer sub-pages need contrast on the dark panel ---------------
 * The tablet/phone drawer inherits the DESKTOP dropdown's colours, which were
 * chosen for a light dropdown panel opening below a light header. Dropped onto
 * the drawer's near-black background they were dark-on-dark and effectively
 * invisible — the sub-pages were there, focusable and clickable, just unreadable.
 * Scoped to the drawer so the desktop dropdown keeps its own palette.
 */
@media (max-width: 1024px) {
  .layout-drawer .unifiednav__container_sub-nav,
  .layout-drawer .unav-sub {
    background: transparent !important;
    box-shadow: none !important;
  }
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item,
  .layout-drawer .unifiednav__container_sub-nav .nav-item-text,
  .layout-drawer .unav-sub .unifiednav__item,
  .layout-drawer .unav-sub .nav-item-text {
    color: #ffffff !important;
    opacity: 1 !important;
  }
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item:hover,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item:hover .nav-item-text,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item:focus,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item:focus .nav-item-text,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item.currentPage,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item.currentPage .nav-item-text,
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item[aria-current="page"],
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item[aria-current="page"] .nav-item-text,
  .layout-drawer .unav-sub .unifiednav__item:hover,
  .layout-drawer .unav-sub .unifiednav__item:hover .nav-item-text,
  .layout-drawer .unav-sub .unifiednav__item.currentPage,
  .layout-drawer .unav-sub .unifiednav__item.currentPage .nav-item-text {
    color: #5AA9F8 !important;   /* the site's own link blue */
  }
  /* Indent the children so the hierarchy still reads once they are visible. */
  .layout-drawer .unifiednav__container_sub-nav .unifiednav__item { padding-left: 22px !important; }

  /* The panel itself: collapsed by Duda at max-height:0/opacity:0, opened by
   * initDrawerSubmenus adding .gy-sub-open. The `!important` is needed because
   * Duda's own collapsed rule carries it. */
  .layout-drawer .unifiednav__container_sub-nav {
    overflow: hidden !important;
    transition: max-height 0.3s ease-out, opacity 0.25s ease-out !important;
  }
  .layout-drawer .unifiednav__container_sub-nav.gy-sub-open {
    /* A generous fixed cap rather than a measured scrollHeight: while the panel
     * is collapsed its scrollHeight reads 0, so measuring it at open time
     * produced max-height:0 and nothing ever appeared. The cap only has to
     * exceed the tallest sub-menu (four items) for the transition to look right. */
    max-height: 1500px !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    height: auto !important;
    position: static !important;
    pointer-events: auto !important;
    transform: none !important;
  }
  /* The chevron is the toggle, so give it a real tap target without moving the
   * label it sits beside. */
  .layout-drawer .unifiednav__item_has-sub-nav .icon-angle-down,
  .layout-drawer .unifiednav__item_has-sub-nav > .nav-item-text > .icon {
    display: inline-block;
    padding: 10px 12px;
    margin: -10px -12px -10px 4px;
    cursor: pointer;
  }
}

/* --- 8. Photo gallery lightbox ----------------------------------------- */
.gy-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  padding: 4vh 4vw;
}
.gy-lightbox.gy-open { display: flex; }
.gy-lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gy-lb-img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.gy-lb-cap {
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  max-width: 70ch;
}
.gy-lightbox button {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.gy-lightbox button:hover,
.gy-lightbox button:focus-visible { background: rgba(90, 169, 248, 0.9); outline: none; }
.gy-lb-close { top: 16px; right: 16px; width: 46px; height: 46px; font-size: 30px; }
.gy-lb-prev,
.gy-lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 22px; }
.gy-lb-prev { left: 16px; }
.gy-lb-next { right: 16px; }
@media (max-width: 767px) {
  .gy-lightbox { padding: 2vh 2vw; }
  .gy-lb-prev, .gy-lb-next { width: 42px; height: 42px; font-size: 18px; }
  .gy-lb-prev { left: 6px; }
  .gy-lb-next { right: 6px; }
  .gy-lb-close { top: 8px; right: 8px; width: 40px; height: 40px; font-size: 26px; }
}
