/**
 * Storefront styles for the EU GARAN label.
 *
 * The dialog mirrors the notice's, deliberately: a shopper who has opened one on this storefront
 * should recognise the other. What is different is the font.
 *
 * The Commission's GARAN artwork sets its three editable fields in Inter and ships no font data
 * with the file, so without an @font-face here the browser silently substitutes whatever it has and
 * the duration, brand and model stop matching the typography Annex II prescribes. Inter is served
 * from our own CDN under SIL OFL 1.1 rather than from a third-party font host, so no shopper on a
 * merchant's storefront is announced to anyone else.
 *
 * It is one variable file per subset covering both weights the label uses, Regular for the brand
 * and model and ExtraBold for the duration.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://cdn.clearmarkapp.com/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('https://cdn.clearmarkapp.com/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* The artwork names these two faces. Both resolve to the variable file above, at the weight the
   Commission's own stylesheet asks for. */
@font-face {
  font-family: 'Inter-Regular';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.clearmarkapp.com/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter-ExtraBold';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('https://cdn.clearmarkapp.com/fonts/inter-latin.woff2') format('woff2');
}

eu-garan-label {
  display: inline-block;
}

.eugl__trigger {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  /* The nested label is a fixed-proportion graphic, not text. Sized to stay legible at default
     display size, which the guidelines require, without dominating a product page. */
  width: min(240px, 100%);
}

.eugl__trigger svg {
  display: block;
  width: 100%;
  height: auto;
}

.eugl__trigger:hover {
  opacity: 0.85;
}

.eugl__dialog {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
}

.eugl__dialog.eugl--open {
  display: flex;
}

.eugl__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.eugl__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  /* White, not transparent: Annex II Note 5 requires the colour version online, and a dark theme
     showing through would tint it. */
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  padding: 20px;
  width: min(520px, 92vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.eugl__figure {
  width: 100%;
}

.eugl__figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
}

.eugl__figure[aria-busy='true'] {
  min-height: 240px;
}

.eugl__link {
  font-size: 14px;
  color: #0b4f9e;
  word-break: break-all;
  text-align: center;
}

.eugl__close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 26px;
  line-height: 1;
  background: none;
  border: 0;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
}

.eugl__close:hover {
  color: #000;
}
