/* Keryex Regional Editions — additive, theme-aware and mobile-safe. */
.edition-selector{position:relative;display:flex;align-items:center;min-width:0;z-index:45}
.edition-selector-dropdown>summary{display:flex!important;align-items:center;gap:10px;cursor:pointer;list-style:none;outline-offset:5px}
.edition-selector-dropdown>summary::-webkit-details-marker{display:none}
.edition-selector-dropdown>summary>svg{flex:0 0 16px;transition:transform .2s ease;color:var(--ink)}
.edition-selector-dropdown[open]>summary>svg{transform:rotate(180deg)}
.edition-selector-menu{position:absolute;top:calc(100% + 12px);left:0;z-index:160;min-width:245px;max-width:min(90vw,340px);background:var(--surface,#fff);color:var(--ink,#111b2f);border:1px solid var(--line,rgba(25,45,76,.2));border-radius:13px;box-shadow:0 18px 44px rgba(2,18,45,.20);padding:9px;display:grid;gap:2px}
.edition-selector-heading{padding:10px 11px 7px;color:var(--muted,#66748c);font:750 .68rem/1.2 Inter,system-ui,sans-serif;text-transform:uppercase;letter-spacing:.09em}
.edition-selector-menu a{display:flex;align-items:center;justify-content:space-between;min-height:39px;padding:10px 12px;border-radius:8px;color:inherit!important;font:600 .88rem/1.25 Inter,system-ui,sans-serif;text-decoration:none}
.edition-selector-menu a:hover,.edition-selector-menu a[aria-current="page"]{background:rgba(0,55,230,.09)}
.edition-selector-menu a[aria-current="page"]{color:var(--blue,#0037e6)!important}
html[data-theme="dark"] .edition-selector-menu{background:#101d30;color:#f1f4ff;border-color:#324864;box-shadow:0 18px 52px rgba(0,0,0,.45)}
html[data-theme="dark"] .edition-selector-menu a:hover,html[data-theme="dark"] .edition-selector-menu a[aria-current="page"]{background:rgba(138,171,255,.13);color:#dbe7ff!important}
.mobile-edition-links{display:none}
.editorial-tag-regional{display:inline-flex!important;align-items:center;max-height:32px;padding:2px 4px!important;overflow:visible!important;background:transparent!important;border:0!important}
.editorial-tag-regional img{display:block;max-width:112px;width:auto;height:25px;object-fit:contain;filter:none!important}
.editorial-tag-regional img.editorial-badge-white{display:none}
html[data-theme="dark"] .editorial-tag-regional img.editorial-badge-blue{display:none!important}
html[data-theme="dark"] .editorial-tag-regional img.editorial-badge-white{display:block!important}
.regional-editions-manager{display:grid;gap:14px}
.regional-editions-manager .region-admin-row{background:var(--ws-surface,#132035);border:1px solid var(--ws-line,#35506d);border-radius:12px;padding:16px;display:grid;gap:12px}
.regional-editions-manager .region-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.regional-editions-manager label{display:grid;gap:6px;min-width:0}
.regional-editions-manager input,.regional-editions-manager select{width:100%;min-width:0}
.regional-editions-manager .region-admin-tags{display:flex;flex-wrap:wrap;gap:9px;padding:6px 0}
.regional-editions-manager .region-admin-tags label{display:flex;flex-direction:row;align-items:center;gap:6px;font-size:.84rem}
.regional-editions-manager .region-admin-tags input{width:auto}
.regional-editions-manager .region-admin-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.regional-editions-manager .region-admin-brand img{max-width:150px;max-height:40px;object-fit:contain}
.region-breaking-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:14px}
.region-breaking-tabs button{border:1px solid var(--ws-line,#35506d);border-radius:9px;padding:9px 13px;background:transparent;color:inherit;cursor:pointer;font:600 .85rem/1.25 Inter,system-ui,sans-serif}
.region-breaking-tabs button[aria-selected="true"]{background:#0037e6;color:#fff;border-color:#0037e6}
.region-breaking-overrides{display:grid;gap:12px;margin:16px 0;padding:14px;border:1px solid var(--ws-line,#35506d);border-radius:10px}
.region-breaking-overrides .region-target-grid{display:flex;gap:8px;flex-wrap:wrap}
.region-breaking-overrides .region-target-grid label{display:inline-flex;align-items:center;gap:6px;padding:7px 9px;border:1px solid var(--ws-line,#35506d);border-radius:8px}
@media(max-width:1050px){
 .edition-selector-menu{top:calc(100% + 8px)}
 .mobile-edition-links{display:grid;gap:5px;padding:12px 14px;margin:8px 0;border:1px solid rgba(120,142,171,.25);border-radius:12px}
 .mobile-edition-links strong{font-size:.7rem;text-transform:uppercase;letter-spacing:.07em}
 .mobile-edition-links a{display:block;font-size:.88rem;padding:7px;border-radius:7px;color:inherit}
 .mobile-edition-links a[aria-current="page"]{background:rgba(0,55,230,.12);font-weight:750}
}
@media(max-width:640px){
 .edition-selector-menu{left:0;min-width:220px}
 .region-admin-grid,.regional-editions-manager .region-admin-grid{grid-template-columns:minmax(0,1fr)!important}
 .regional-editions-manager .region-admin-row{padding:12px}
 .editorial-tag-regional img{max-width:90px;height:22px}
}

/* Single uploaded SVG, identical asset URL for both themes. Preserve SVG
   transparency and resolve all visible vector pixels to the reader's theme. */
html:not([data-theme="dark"]) .editorial-tag-regional.regional-svg img.editorial-badge-blue,
html[data-theme="light"] .editorial-tag-regional.regional-svg img.editorial-badge-blue{
  filter:brightness(0)!important;
}
html[data-theme="dark"] .editorial-tag-regional.regional-svg img.editorial-badge-white{
  filter:brightness(0) invert(1)!important;
}
.region-svg-help{align-self:center;color:var(--muted,#8fa1b7);font-size:.81rem;line-height:1.45}
.region-logo-dual-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:min(100%,450px)}
.region-logo-light-preview,.region-logo-dark-preview{
  display:grid;align-items:center;justify-items:center;gap:9px;min-width:0;
  border-radius:9px;padding:13px;min-height:76px;
}
.region-logo-light-preview{background:#fff;color:#101b2c;border:1px solid #d6dfeb}
.region-logo-dark-preview{background:#071321;color:#f7f9ff;border:1px solid #374f6e}
.region-logo-dual-preview small{font-size:.69rem;font-weight:700;letter-spacing:.025em}
.region-logo-dual-preview img{display:block;max-width:100%;width:auto;max-height:40px;object-fit:contain}
.region-logo-light-preview img{filter:brightness(0)!important}
.region-logo-dark-preview img{filter:brightness(0) invert(1)!important}
#story-edition-preview{display:block;padding:8px 0}
.region-article-logo-preview .region-logo-dual-preview{max-width:310px}
@media(max-width:500px){.region-logo-dual-preview{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .region-logo-light-preview,.region-logo-dark-preview{padding:10px 7px}
 .region-logo-dual-preview img{max-height:30px}
}

/* The edition selector must not displace the Keryex wordmark at tablet/mobile sizes.
   Anchor the dropdown to its own centered trigger and keep the drawer close separate. */
@media (max-width:1050px){
  .site-header .container.nav{position:relative!important}
  .site-header .edition-selector{
    position:absolute!important;left:50%!important;top:50%!important;
    transform:translate(-50%,-50%)!important;margin:0!important;
    width:min(48vw,210px)!important;max-width:calc(100% - 160px)!important;
    min-width:0!important;display:flex!important;align-items:center!important;
    justify-content:center!important;z-index:42!important;
  }
  .site-header .edition-selector>a.edition-selector-home{
    display:flex!important;align-items:center!important;justify-content:center!important;
    gap:6px!important;max-width:100%!important;min-width:0!important;
    padding:4px!important;margin:0!important;
  }
  .site-header .edition-selector .brand-mark-header{
    display:flex!important;align-items:center!important;justify-content:center!important;
    flex:0 1 auto!important;min-width:0!important;
    max-width:min(38vw,175px)!important;margin:0 auto!important;
  }
  .site-header .edition-selector .brand-mark-header img{
    display:block!important;max-width:100%!important;object-fit:contain!important;
    object-position:center center!important;margin:0 auto!important;
  }
  .site-header .edition-selector-dropdown>summary>svg{flex:0 0 14px!important;width:14px!important;height:14px!important}
  .site-header .edition-selector-menu{left:50%!important;right:auto!important;transform:translateX(-50%)!important;max-width:min(90vw,330px)!important}
  .public-menu-layer .mobile-nav-drawer-head{
    position:relative!important;display:grid!important;grid-template-columns:1fr auto 1fr!important;
    align-items:center!important;min-height:58px!important;
  }
  .public-menu-layer .mobile-nav-drawer-brand{
    grid-column:2!important;grid-row:1!important;justify-self:center!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    min-width:0!important;max-width:min(55vw,220px)!important;width:auto!important;
    margin:0!important;padding:0!important;flex:initial!important;
  }
  .public-menu-layer .mobile-nav-drawer-brand .brand-mark-header{
    flex:initial!important;display:flex!important;align-items:center!important;
    justify-content:center!important;width:min(49vw,180px)!important;
    max-width:100%!important;margin:0!important;
  }
  .public-menu-layer .mobile-nav-drawer-brand img{
    display:block!important;width:100%!important;max-width:100%!important;
    object-fit:contain!important;object-position:center center!important;margin:0 auto!important;
  }
  .public-menu-layer .mobile-nav-drawer-head .mobile-nav-close{
    grid-column:3!important;grid-row:1!important;justify-self:end!important;
    margin:0!important;
  }
}

/* Regional logos placed over photographs respond to the photograph's pixels,
   NOT the website's dark/light preference. Difference blending inverts the
   underlying image through the white SVG mask, giving local contrast even
   when the image has mixed bright/dark areas. */
html .editorial-tags.photo-adaptive-tags{
  filter:none!important;
  -webkit-filter:none!important;
}
html .editorial-tags .editorial-tag-regional.photo-adaptive{
  isolation:auto!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  filter:none!important;
  -webkit-filter:none!important;
}
html .editorial-tags .editorial-tag-regional.photo-adaptive img.editorial-badge-blue,
html[data-theme="dark"] .editorial-tags .editorial-tag-regional.photo-adaptive img.editorial-badge-blue{
  display:block!important;
  filter:brightness(0) invert(1)!important;
  -webkit-filter:brightness(0) invert(1)!important;
  mix-blend-mode:difference!important;
}
html .editorial-tags .editorial-tag-regional.photo-adaptive img.editorial-badge-white,
html[data-theme="dark"] .editorial-tags .editorial-tag-regional.photo-adaptive img.editorial-badge-white{
  display:none!important;
}
/* Retain the original theme-aware treatment on non-photo surfaces. */
@media(forced-colors:active){
  html .editorial-tags .editorial-tag-regional.photo-adaptive img.editorial-badge-blue{
    mix-blend-mode:normal!important;
    filter:none!important;
  }
}

/* Logo and region arrow are separate keyboard-accessible click targets. */
.edition-selector>a.edition-selector-home{order:0;display:inline-flex;align-items:center;min-width:0;text-decoration:none;}
.edition-selector-dropdown>summary.edition-selector-toggle{order:1;display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 28px;min-width:28px;min-height:36px;margin-left:3px;border:0;border-radius:6px;padding:4px;cursor:pointer;background:transparent;color:inherit;}
.edition-selector-dropdown>summary.edition-selector-toggle:focus-visible,.edition-selector>a.edition-selector-home:focus-visible{outline:2px solid var(--blue,#0037e6);outline-offset:3px;}
.edition-selector-dropdown>summary.edition-selector-toggle>svg{flex:0 0 16px;pointer-events:none;}
.edition-selector-menu{order:2;}

/* Logo stays visible when the independent edition chooser is closed. */
.site-header .edition-selector{display:inline-flex!important;align-items:center!important;gap:0!important;min-width:0!important}
.site-header .edition-selector>a.edition-selector-home{
 display:inline-flex!important;position:static!important;transform:none!important;
 left:auto!important;top:auto!important;grid-column:auto!important;grid-row:auto!important;
 min-width:0!important;max-width:100%!important;width:auto!important;height:auto!important;
 margin:0!important;padding:0!important;z-index:auto!important;
 align-items:center!important;justify-content:center!important;
}
.site-header .edition-selector-dropdown{display:inline-flex;align-items:center;flex:0 0 auto;position:static;min-width:0}
.site-header .edition-selector-dropdown>summary.edition-selector-toggle{
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 flex:0 0 28px!important;width:28px!important;min-width:28px!important;height:36px!important;
 min-height:36px!important;margin:0 0 0 3px!important;padding:4px!important;
 background:transparent!important;border:0!important;border-radius:7px!important;
 color:inherit!important;box-shadow:none!important;list-style:none!important;
}
.site-header .edition-selector-dropdown>summary.edition-selector-toggle:hover{background:rgba(100,130,175,.1)!important}
.site-header .edition-selector-dropdown>summary.edition-selector-toggle::-webkit-details-marker{display:none}
.site-header .edition-selector-dropdown>summary.edition-selector-toggle:focus-visible,
.site-header .edition-selector>a.edition-selector-home:focus-visible{outline:2px solid var(--blue,#0037e6)!important;outline-offset:2px!important}
@media(max-width:1050px){
 .site-header .edition-selector>a.edition-selector-home{flex:0 1 auto!important;max-width:calc(100% - 30px)!important}
 .site-header .edition-selector-dropdown>summary.edition-selector-toggle{flex:0 0 26px!important;width:26px!important;min-width:26px!important}
}
