/* Cross-browser fallbacks for the Turkey 2027 design. Loaded after the design CSS;
   every rule here only kicks in where a browser lacks the modern feature. */

/* Safari iOS: keep the page from zooming text on rotation. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Logo crest: unprefixed mask/mask-mode needs Chrome 120+, Safari 15.4+.
   Older engines get the prefixed mask with an alpha-channel copy of the mask. */
@supports not (mask-mode: luminance) {
  .brand img,
  #about-us .about-logo,
  #baisakhi-invite-design .crest,
  #regional-contacts-preview .contact-crest {
    -webkit-mask: url(assets/logo-mask-alpha.png) center / contain no-repeat;
  }
}

/* dvh units (Safari < 15.4, Chrome < 108): fall back to vh. */
@supports not (height: 1dvh) {
  #photo-dialog { height: 100vh; max-height: 100vh; }
  #photo-dialog img { max-height: calc(100vh - 190px); }
  @media (max-width: 600px) {
    #photo-dialog img { max-height: calc(100vh - 220px); }
  }
}

/* Safari < 18 only understands the prefixed backdrop blur. */
#tour-dialog::backdrop { -webkit-backdrop-filter: blur(4px); }

/* <dialog> fallback used by compat.js on browsers without HTMLDialogElement. */
dialog:not([open]) { display: none; }
dialog.compat-dialog-open {
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 1001;
}
.compat-dialog-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(8, 45, 36, .73);
  z-index: 1000;
}
