/* FIX3F — Unified Language System · 21 languages · flags · consistent design */
:root{
  --am-fix3f-ink:#172338;
  --am-fix3f-gold:#e7b453;
  --am-fix3f-gold-2:#f5d489;
  --am-fix3f-soft:#fffaf0;
  --am-fix3f-line:rgba(176,139,81,.24);
}

/* Dropdown used by page_header language_switcher() */
.am-lang-panel{
  width:min(560px,92vw)!important;
  max-height:min(76vh,660px)!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}
.am-lang-picker.open .am-lang-panel{
  display:grid!important;
}
.am-lang-option{
  min-height:46px!important;
  grid-template-columns:32px 1fr auto!important;
}
.am-lang-option-name{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

/* Unified strip used on translated and index-like pages */
.am-unified-language-strip{
  width:min(1220px,calc(100% - 32px));
  margin:18px auto 20px;
  padding:14px;
  border-radius:26px;
  background:
    radial-gradient(circle at 90% 0%,rgba(231,180,83,.16),transparent 36%),
    linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,250,240,.88));
  border:1px solid var(--am-fix3f-line);
  box-shadow:0 18px 54px rgba(23,35,56,.10);
}
.am-unified-language-title{
  display:block;
  margin:0 0 10px;
  color:#9b7332;
  font-weight:950;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:.82rem;
}
.am-unified-language-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.am-unified-lang-pill,
.am-unified-lang-card{
  text-decoration:none!important;
  box-sizing:border-box;
}
.am-unified-lang-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  color:var(--am-fix3f-ink)!important;
  -webkit-text-fill-color:var(--am-fix3f-ink)!important;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(23,35,56,.14);
  font-weight:900;
  box-shadow:0 8px 22px rgba(23,35,56,.06);
}
.am-unified-lang-pill:hover,
.am-unified-lang-pill:focus-visible,
.am-unified-lang-pill.active,
.am-unified-lang-pill.is-active{
  background:linear-gradient(180deg,#172338,#0e1727)!important;
  color:#fff7df!important;
  -webkit-text-fill-color:#fff7df!important;
  border-color:rgba(245,212,137,.62)!important;
  box-shadow:0 12px 30px rgba(23,35,56,.20);
}
.am-unified-lang-code{
  font-weight:950;
  letter-spacing:.04em;
  line-height:1;
}
.am-unified-lang-name{
  font-weight:850;
  line-height:1.15;
  white-space:nowrap;
}

/* Unified grid used on mednarodno.php */
.am-unified-language-grid{
  width:min(1240px,calc(100% - 32px));
  margin:0 auto 26px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
}
.am-unified-lang-card{
  display:grid;
  grid-template-columns:34px 46px 1fr;
  grid-template-areas:
    "flag code name"
    "flag code title";
  gap:5px 10px;
  align-items:center;
  min-height:96px;
  padding:18px;
  border-radius:24px;
  background:rgba(255,255,255,.92);
  border:1px solid var(--am-fix3f-line);
  color:var(--am-fix3f-ink)!important;
  -webkit-text-fill-color:var(--am-fix3f-ink)!important;
  box-shadow:0 16px 44px rgba(23,35,56,.09);
}
.am-unified-lang-card .flag-badge{grid-area:flag}
.am-unified-lang-card .am-unified-lang-code{
  grid-area:code;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:34px;
  border-radius:12px;
  background:#172338;
  color:#f6d88f!important;
  -webkit-text-fill-color:#f6d88f!important;
}
.am-unified-lang-card .am-unified-lang-name{
  grid-area:name;
  font-size:1.05rem;
}
.am-unified-lang-card em{
  grid-area:title;
  min-width:0;
  font-style:normal;
  font-size:.84rem;
  color:#697389!important;
  -webkit-text-fill-color:#697389!important;
  line-height:1.25;
}
.am-unified-lang-card:hover,
.am-unified-lang-card:focus-visible,
.am-unified-lang-card.active,
.am-unified-lang-card.is-active{
  transform:translateY(-2px);
  border-color:rgba(231,180,83,.58);
  box-shadow:0 22px 60px rgba(23,35,56,.15);
}

/* Force older language surfaces to visually align with FIX3F */
.am-intl-language-switch{
  width:min(1220px,calc(100% - 32px))!important;
  margin:18px auto 20px!important;
}
.am-intl-language-switch > div{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
}
.am-intl-language-switch a{
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-height:38px!important;
  padding:8px 12px!important;
  border-radius:999px!important;
  font-weight:900!important;
}

/* Reference/fallback language pages */
.am-intl-reference-note{
  width:min(1220px,calc(100% - 32px));
  margin:18px auto;
  padding:24px;
  border-radius:28px;
  background:linear-gradient(180deg,rgba(23,35,56,.96),rgba(10,15,25,.96));
  color:#fff7df;
  border:1px solid rgba(245,212,137,.34);
  box-shadow:0 24px 70px rgba(23,35,56,.20);
}
.am-intl-reference-note h1{
  margin:.2rem 0 .6rem;
  color:#fffaf0;
  font-size:clamp(2.1rem,5vw,4.2rem);
  letter-spacing:-.04em;
}
.am-intl-reference-note p{
  max-width:880px;
  color:#f3ddad;
}

/* Reduce visual jumps from mixed legacy layers when language blocks appear */
.am-fix3f-language-hub .am-intl-hero,
.am-fix3f-language-page .am-intl-hero{
  width:min(1220px,calc(100% - 32px))!important;
}
.am-fix3f-language-hub .am-intl-rule,
.am-fix3f-language-hub .am-intl-note{
  width:min(1220px,calc(100% - 32px));
  margin-left:auto;
  margin-right:auto;
}

@media(max-width:780px){
  .am-lang-panel{
    grid-template-columns:1fr!important;
    width:min(340px,92vw)!important;
  }
  .am-unified-language-strip,
  .am-unified-language-grid{
    width:min(100% - 22px,720px);
  }
  .am-unified-language-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .am-unified-lang-pill{
    justify-content:flex-start;
    min-width:0;
  }
  .am-unified-lang-name{
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .am-unified-language-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:420px){
  .am-unified-language-list{
    grid-template-columns:1fr;
  }
}
