/* Pilim website: "Region & language" selector (region.js). Self-contained: also used by index-es.html, which has
   its own inline styles. Colours are the design tokens of styles.css. */
.region-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 0;
  border-radius: 12px; background: transparent; color: #1F105F; font: inherit; font-weight: 700; cursor: pointer; }
.region-trigger:hover { background: #F5F3FA; }
.region-trigger:focus-visible { outline: 3px solid #FEA500; outline-offset: 2px; }
.region-trigger svg { flex: none; }

.region-dialog { border: 0; padding: 0; width: min(920px, calc(100% - 32px)); max-height: calc(100% - 64px);
  border-radius: 22px; color: #2B2550; font-family: inherit; box-shadow: 0 24px 60px rgba(22, 11, 67, 0.25); }
.region-dialog::backdrop { background: rgba(22, 11, 67, 0.55); }
.region-dialog[open] { display: flex; flex-direction: column; }
.region-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 32px;
  border-bottom: 1px solid #E4E0EF; }
.region-head h2 { margin: 0; font-size: 26px; font-weight: 900; color: #1F105F; }
.region-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: #1F105F;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.region-close:hover { background: #F5F3FA; }
.region-close:focus-visible, .region-dialog a:focus-visible { outline: 3px solid #FEA500; outline-offset: 2px; }
.region-body { overflow-y: auto; padding: 8px 32px 32px; }
.region-group h3 { margin: 24px 0 12px; font-size: 14px; font-weight: 800; color: #5A5280; text-transform: uppercase;
  letter-spacing: 0.08em; }
.region-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; }
.region-country { border: 1px solid #E4E0EF; border-radius: 16px; padding: 16px 18px; }
.region-country.current { border-color: #1F105F; background: #F5F3FA; }
.region-country .name { margin: 0 0 6px; font-weight: 800; color: #1F105F; }
.region-country .languages { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.region-country a { display: inline-flex; align-items: center; min-height: 32px; color: #5A5280; font-weight: 600;
  text-decoration: none; }
.region-country a:hover { color: #1F105F; text-decoration: underline; }
.region-country a[aria-current="true"] { color: #1F105F; font-weight: 800; text-decoration: underline;
  text-decoration-color: #FEA500; text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (max-width: 760px) {
  /* Full screen on a phone */
  .region-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .region-head { padding: 16px 20px; }
  .region-body { padding: 0 20px 24px; }
  .region-list { grid-template-columns: 1fr; }
  .region-trigger .label { display: none; }
}

/* Country suggestion banner (region-banner.js): fixed at the bottom, so the page does not move when it appears */
.region-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 900;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: calc(100% - 32px); max-width: 720px; box-sizing: border-box;
  padding: 12px 48px 12px 20px; border-radius: var(--radius);
  background: #fff; color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(22, 11, 67, 0.28);
  font-size: 15px; line-height: 1.4;
}
.region-banner p { margin: 0; flex: 1 1 220px; }
.region-banner-go {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--orange); color: var(--indigo-deep); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.region-banner-go:hover, .region-banner-go:focus-visible { filter: brightness(1.05); outline: 2px solid var(--indigo); outline-offset: 2px; }
.region-banner-stay {
  background: none; border: 0; padding: 8px 4px; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer;
}
.region-banner-close {
  position: absolute; top: 6px; right: 8px; width: 32px; height: 32px;
  background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.region-banner-stay:hover, .region-banner-close:hover { color: var(--indigo); }
@media (max-width: 560px) {
  .region-banner { bottom: 0; width: 100%; border-radius: 0; border-width: 1px 0 0; padding: 14px 44px 16px 16px; }
}

/* Cookie consent (analytics.js): same place and look as the country banner, which waits for it */
.consent-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 950;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: calc(100% - 32px); max-width: 720px; box-sizing: border-box; padding: 14px 20px;
  border-radius: var(--radius); background: #fff; color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(22, 11, 67, 0.28); font-size: 15px; line-height: 1.4;
}
.consent-banner p { margin: 0; flex: 1 1 280px; }
.consent-banner button { font: inherit; font-weight: 700; padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.consent-yes { background: var(--orange); color: var(--indigo-deep); border: 0; }
.consent-no { background: #fff; color: var(--indigo); border: 1px solid var(--indigo); }
.consent-banner button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
@media (max-width: 560px) {
  .consent-banner { bottom: 0; width: 100%; border-radius: 0; border-width: 1px 0 0; }
  .consent-banner button { flex: 1 1 0; }
}
.consent-banner p a { color: var(--indigo); text-decoration: underline; white-space: nowrap; }
