/*
Theme Name: World Flags
Theme URI: https://example.com/world-flags
Author: World Flags
Description: A lightning-fast, fully responsive flag encyclopedia theme. Every flag of the world gets its own Gutenberg-editable page with working multi-format downloads (SVG, PNG, JPG, WEBP, ICO, PDF) at any resolution, plus a light/system/dark mode switcher and full color customization.
Version: 2.4.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: worldflags
Tags: one-column, custom-colors, custom-logo, custom-menu, block-styles, wide-blocks, editor-style, full-width-template, translation-ready
*/

:root {
  --wf-accent: #0f766e;
  --wf-bg: #f4f6f9;
  --wf-surface: #ffffff;
  --wf-text: #0d1b26;
  --wf-muted: #5b6b78;
  --wf-border: #d3dfdc;
  --wf-shadow: 0 1px 2px rgba(16, 32, 44, .06), 0 8px 24px rgba(16, 32, 44, .06);
  --wf-radius: 10px;
  --wf-max: 1320px;
  --wf-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wf-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
  --wf-bg: #0b1218;
  --wf-surface: #131f27;
  --wf-text: #e8eef3;
  --wf-muted: #9bacb9;
  --wf-border: #27343f;
  --wf-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--wf-bg);
  color: var(--wf-text);
  font-family: var(--wf-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--wf-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wf-wrap { max-width: var(--wf-max); margin: 0 auto; padding: 0 20px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto;
  background: var(--wf-surface); color: var(--wf-text); padding: 10px 16px; z-index: 999;
  border-radius: var(--wf-radius);
}

/* ---------- Header ---------- */
.wf-header {
  background: var(--wf-surface);
  border-bottom: 1px solid var(--wf-border);
  position: sticky; top: 0; z-index: 50;
}
.wf-header-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 66px; flex-wrap: wrap;
}
.wf-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.wf-brand img { max-height: 44px; width: auto; }
.wf-site-title { font-family: var(--wf-serif); font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.1; }
.wf-site-title a { color: var(--wf-text); }
.wf-tagline { margin: 2px 0 0; font-size: .8rem; color: var(--wf-muted); }

.wf-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.wf-nav a { color: var(--wf-text); font-size: .93rem; font-weight: 600; }
.wf-nav .current-menu-item > a { color: var(--wf-accent); }

.wf-menu-toggle {
  display: none; background: none; border: 1px solid var(--wf-border); color: var(--wf-text);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
}

/* ---------- Mode switcher ---------- */
.wf-modes {
  display: inline-flex; background: var(--wf-bg); border: 1px solid var(--wf-border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.wf-modes button {
  border: 1px solid transparent; background: none; cursor: pointer; color: var(--wf-muted);
  width: 34px; height: 30px; border-radius: 999px; display: grid; place-items: center; padding: 0;
  transition: background .15s ease, color .15s ease;
}
.wf-modes button svg { width: 17px; height: 17px; }
.wf-modes button[aria-pressed="true"] {
  background: var(--wf-surface); color: var(--wf-text);
  border-color: var(--wf-border); box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* ---------- Hero ---------- */
.wf-hero {
  background: linear-gradient(180deg, color-mix(in srgb, var(--wf-accent) 10%, var(--wf-surface)), var(--wf-bg));
  border-bottom: 1px solid var(--wf-border);
  padding: 54px 0 40px;
}
.wf-hero h1 { font-family: var(--wf-serif); font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 10px; line-height: 1.08; }
.wf-hero p { margin: 0; color: var(--wf-muted); font-size: 1.05rem; max-width: 62ch; }
.wf-search { margin-top: 24px; max-width: 460px; position: relative; }
.wf-search input {
  width: 100%; padding: 13px 16px; font-size: 1rem; font-family: inherit;
  border-radius: 999px; border: 1px solid var(--wf-border);
  background: var(--wf-surface); color: var(--wf-text);
}
.wf-search input:focus { outline: 2px solid var(--wf-accent); outline-offset: 1px; }

/* ---------- Region sections ---------- */
.wf-regions { padding: 34px 0 60px; }
.wf-region { margin-bottom: 42px; scroll-margin-top: 90px; }
.wf-region h2 {
  font-family: var(--wf-serif); font-size: clamp(1.35rem, 3vw, 1.9rem); margin: 0 0 4px;
  padding-bottom: 10px; border-bottom: 2px solid var(--wf-text);
}
.wf-count { font-size: .78rem; color: var(--wf-muted); font-family: var(--wf-font); font-weight: 500; }

.wf-grid {
  display: grid; gap: 22px 18px; margin-top: 22px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.wf-card { text-align: center; }
.wf-card a { display: block; color: var(--wf-text); }
.wf-card a:hover { text-decoration: none; }
.wf-thumb {
  background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: 6px;
  padding: 6px; box-shadow: var(--wf-shadow); transition: transform .16s ease, box-shadow .16s ease;
}
.wf-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }
.wf-card a:hover .wf-thumb { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0, 0, 0, .16); }
.wf-card span {
  display: block; margin-top: 9px; font-weight: 700; font-size: .92rem;
  font-family: var(--wf-serif); color: var(--wf-accent);
}
.wf-empty { color: var(--wf-muted); }

/* ---------- Single flag ---------- */
.wf-single { padding: 34px 0 64px; }
.wf-breadcrumb { font-size: .85rem; color: var(--wf-muted); margin-bottom: 14px; }
.wf-flag-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 30px; align-items: start; }
.wf-flag-stage {
  background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: var(--wf-radius);
  padding: 18px; box-shadow: var(--wf-shadow);
}
.wf-flag-stage img { display: block; width: 100%; border-radius: 4px; }
.wf-flag-title { font-family: var(--wf-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 6px; }
.wf-flag-meta { color: var(--wf-muted); font-size: .92rem; margin: 0 0 20px; }

.wf-panel {
  background: var(--wf-surface); border: 1px solid var(--wf-border); border-radius: var(--wf-radius);
  padding: 20px; box-shadow: var(--wf-shadow); position: sticky; top: 86px;
}
.wf-panel h2 { margin: 0 0 4px; font-size: 1.15rem; font-family: var(--wf-serif); }
.wf-panel .wf-hint { margin: 0 0 16px; font-size: .82rem; color: var(--wf-muted); }
.wf-field { margin-bottom: 14px; }
.wf-field label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wf-muted); font-weight: 700; margin-bottom: 6px; }
.wf-field select,
.wf-field input {
  width: 100%; padding: 10px 12px; border-radius: 8px; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--wf-border); background: var(--wf-bg); color: var(--wf-text);
}
.wf-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* A [hidden] element must always stay hidden, even with a display rule above. */
[hidden] { display: none !important; }
.wf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 13px 18px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--wf-accent); color: #fff; font-size: 1rem; font-weight: 700; font-family: inherit;
}
.wf-btn:hover { filter: brightness(1.08); }
.wf-btn[disabled] { opacity: .6; cursor: progress; }
.wf-status { margin: 10px 0 0; font-size: .84rem; color: var(--wf-muted); min-height: 1.2em; }
.wf-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--wf-border); }
.wf-quick button {
  background: var(--wf-bg); border: 1px solid var(--wf-border); color: var(--wf-text);
  border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.wf-quick button:hover { border-color: var(--wf-accent); color: var(--wf-accent); }

.wf-facts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 8px; }
.wf-facts li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; border-bottom: 1px dashed var(--wf-border); padding-bottom: 8px; }
.wf-facts strong { color: var(--wf-muted); font-weight: 600; }

/* ---------- Content ---------- */
.wf-content { margin-top: 34px; }
.wf-content > * { max-width: 780px; }
.wf-content > .alignwide { max-width: 1100px; }
.wf-content > .alignfull { max-width: none; }
.wf-content h2, .wf-content h3 { font-family: var(--wf-serif); }
.wf-content blockquote { border-left: 4px solid var(--wf-accent); margin-left: 0; padding-left: 18px; color: var(--wf-muted); }
.wf-content table { border-collapse: collapse; }
.wf-content td, .wf-content th { border: 1px solid var(--wf-border); padding: 8px 12px; }
.entry-page { padding: 40px 0 64px; }
.entry-page .wf-content { margin-top: 0; }
.wf-page-title { font-family: var(--wf-serif); font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 0 0 20px; }

/* ---------- Neighbours ---------- */
.wf-related { margin-top: 48px; }
.wf-related h2 { font-family: var(--wf-serif); font-size: 1.4rem; border-bottom: 2px solid var(--wf-text); padding-bottom: 8px; }

/* ---------- Footer ---------- */
.wf-footer { background: var(--wf-surface); border-top: 1px solid var(--wf-border); padding: 30px 0; margin-top: auto; }
.wf-footer-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.wf-footer p { margin: 0; color: var(--wf-muted); font-size: .88rem; }
.wf-footer .wf-nav a { font-size: .88rem; }

@media (max-width: 900px) {
  .wf-flag-layout { grid-template-columns: 1fr; }
  .wf-panel { position: static; }
}
@media (max-width: 782px) {
  .wf-menu-toggle { display: block; order: 3; }
  .wf-nav { display: none; width: 100%; order: 5; padding-bottom: 12px; }
  .wf-nav.is-open { display: block; }
  .wf-nav ul { flex-direction: column; gap: 12px; }
  .wf-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 14px; }
  .wf-hero { padding: 34px 0 28px; }
}


/* --- World Flags Hero --- */
.wf-hero-eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 800;
  color: var(--wf-accent); margin: 0 0 10px;
}
.wf-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 0; }
.wf-hero-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 8px; font-weight: 700; text-decoration: none;
  background: var(--wf-accent); color: #fff; border: 1px solid var(--wf-accent);
}
.wf-hero-btn:hover { filter: brightness(1.08); }
.wf-hero-btn-alt { background: transparent; color: var(--wf-text); border-color: var(--wf-border); }
.wf-hero-note { font-size: .85rem; opacity: .75; margin-top: 14px; }

/* --- Hero alignment + inline search row --- */
.wf-hero-searchrow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px;
}
.wf-hero-searchrow .wf-search { margin-top: 0; flex: 1 1 320px; min-width: 0; max-width: 460px; }
.wf-hero-searchrow .wf-hero-actions { margin: 0; flex: 0 0 auto; justify-content: inherit; }
.wf-hero-searchrow .wf-hero-btn { padding: 13px 26px; border-radius: 999px; }

.wf-hero.wf-align-left  .wf-wrap { text-align: left; }
.wf-hero.wf-align-center .wf-wrap { text-align: center; }
.wf-hero.wf-align-right .wf-wrap { text-align: right; }

.wf-hero.wf-align-center .wf-hero-text,
.wf-hero.wf-align-center p { margin-left: auto; margin-right: auto; }
.wf-hero.wf-align-right .wf-hero-text,
.wf-hero.wf-align-right p { margin-left: auto; margin-right: 0; }

.wf-hero.wf-align-left  .wf-hero-searchrow { justify-content: flex-start; }
.wf-hero.wf-align-center .wf-hero-searchrow { justify-content: center; }
.wf-hero.wf-align-right .wf-hero-searchrow { justify-content: flex-end; }
.wf-hero.wf-align-center .wf-hero-actions { justify-content: center; }
.wf-hero.wf-align-right .wf-hero-actions { justify-content: flex-end; }
.wf-hero.wf-align-right .wf-search input { text-align: right; }

@media (max-width: 640px) {
  .wf-hero-searchrow { flex-direction: column; align-items: stretch; justify-content: center; }
  .wf-hero-searchrow .wf-search { max-width: none; width: 100%; }
  .wf-hero-searchrow .wf-hero-actions { justify-content: center; width: 100%; }
  .wf-hero .wf-search input { text-align: left; }
}


/* =====================================================================
   World Flags 2.0 — refreshed theme, responsive header, article styles
   ===================================================================== */

:root {
  --wf-accent-soft: color-mix(in srgb, var(--wf-accent) 12%, transparent);
  --wf-header-h: 68px;
  --wf-radius-lg: calc(var(--wf-radius) + 6px);
}

body { font-size: 16.5px; letter-spacing: -.005em; }

/* ---------- Header (desktop) ---------- */
.wf-header {
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--wf-surface) 88%, transparent);
  box-shadow: 0 1px 0 var(--wf-border);
  border-bottom: 0;
}
.wf-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: var(--wf-header-h);
  flex-wrap: nowrap;
}
.wf-brand { min-width: 0; margin-right: 0; }
.wf-brand-text { min-width: 0; }
.wf-site-title { font-size: clamp(1.15rem, 3.4vw, 1.5rem); letter-spacing: -.02em; }
.wf-site-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-tagline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-header-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wf-nav { display: flex; align-items: center; gap: 22px; }
.wf-nav a { position: relative; padding: 6px 0; }
.wf-nav a:hover { color: var(--wf-accent); text-decoration: none; }
.wf-nav .current-menu-item > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  border-radius: 2px; background: var(--wf-accent);
}
.wf-nav-modes { display: none; }

@media (min-width: 861px) {
  .wf-header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
  .wf-nav { justify-self: end; }
}

/* ---------- Mobile header ---------- */
.wf-menu-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  border-radius: 12px; border: 1px solid var(--wf-border);
  background: var(--wf-surface); color: var(--wf-text);
  align-items: center; justify-content: center; cursor: pointer;
}
.wf-burger { display: grid; gap: 4px; width: 20px; }
.wf-burger span {
  display: block; height: 2px; width: 100%; border-radius: 2px; background: currentColor;
  transition: transform .22s ease, opacity .18s ease;
}
.wf-menu-toggle.is-open { background: var(--wf-accent); color: #fff; border-color: var(--wf-accent); }
.wf-menu-toggle.is-open .wf-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.wf-menu-toggle.is-open .wf-burger span:nth-child(2) { opacity: 0; }
.wf-menu-toggle.is-open .wf-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .wf-header-inner { grid-template-columns: minmax(0, 1fr) auto; min-height: 62px; padding-top: 8px; padding-bottom: 8px; }
  .wf-menu-toggle { display: inline-flex; }
  .wf-desktop-modes { display: none; }
  .wf-nav-modes { display: flex; justify-content: center; padding-top: 6px; }

  .wf-nav {
    display: block; position: fixed; left: 0; right: 0; top: 62px;
    background: var(--wf-surface); border-top: 1px solid var(--wf-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
    padding: 10px 20px 20px; z-index: 60;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    max-height: calc(100dvh - 62px); overflow-y: auto;
  }
  .wf-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .wf-nav ul { flex-direction: column; gap: 0; }
  .wf-nav li { border-bottom: 1px solid var(--wf-border); }
  .wf-nav li:last-child { border-bottom: 0; }
  .wf-nav a { display: block; padding: 14px 4px; font-size: 1rem; }
  .wf-nav .current-menu-item > a::after { display: none; }
  .wf-nav .current-menu-item > a { color: var(--wf-accent); }
  body.wf-menu-open { overflow: hidden; }
  .wf-tagline { display: none; }
}

/* ---------- Hero + instant search ---------- */
.wf-hero {
  background:
    radial-gradient(1100px 420px at 12% -20%, var(--wf-accent-soft), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--wf-accent) 7%, var(--wf-surface)), var(--wf-bg));
  padding: clamp(34px, 6vw, 62px) 0 clamp(28px, 4vw, 44px);
}
.wf-hero h1 { letter-spacing: -.025em; }
.wf-hero-searchrow { display: flex; margin-top: 24px; }
.wf-hero-searchrow.wf-searchpos-left { justify-content: flex-start; }
.wf-hero-searchrow.wf-searchpos-center { justify-content: center; }
.wf-hero-searchrow.wf-searchpos-right { justify-content: flex-end; }
.wf-hero-searchrow .wf-search { margin: 0; flex: 1 1 420px; max-width: 520px; min-width: 0; }
.wf-search { position: relative; }
.wf-search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--wf-muted); pointer-events: none;
}
.wf-search input {
  padding: 14px 18px 14px 44px; text-align: left;
  box-shadow: var(--wf-shadow); border-radius: 999px;
}
.wf-search input::-webkit-search-cancel-button { cursor: pointer; }
.wf-hero-note { margin-top: 14px; }

@media (max-width: 640px) {
  .wf-hero-searchrow { justify-content: stretch; }
  .wf-hero-searchrow .wf-search { max-width: none; width: 100%; }
}

/* ---------- Cards ---------- */
.wf-thumb { border-radius: var(--wf-radius); padding: 8px; }
.wf-card a:hover .wf-thumb { transform: translateY(-4px); }
.wf-region h2 { border-bottom-color: color-mix(in srgb, var(--wf-text) 22%, transparent); }

/* ---------- Generated flag article ---------- */
.wf-article { max-width: 820px; }
.wf-article h2 {
  font-family: var(--wf-serif); font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  margin: 34px 0 10px; letter-spacing: -.015em;
}
.wf-article h2:first-child { margin-top: 0; }
.wf-article p { margin: 0 0 14px; line-height: 1.75; }
.wf-article p:first-of-type { font-size: 1.03rem; }
.wf-content > .wf-article { max-width: 820px; }


/* ---------- Hero search: no icon, tight spacing (2.1.0) ---------- */
.wf-search-icon { display: none !important; }
.wf-search input { padding: 13px 18px; text-align: inherit; }
.wf-hero-searchrow { margin-top: 18px; margin-bottom: 0; gap: 10px; }
.wf-hero-searchrow .wf-search { margin: 0; }
.wf-hero .wf-hero-note { margin-top: 8px; margin-bottom: 0; }

@media (max-width: 640px) {
  .wf-hero-searchrow { margin-top: 14px; row-gap: 0; }
  .wf-hero .wf-hero-note { margin-top: 8px; }
  .wf-hero .wf-search input { text-align: left; }
}

/* ---------- Mobile: remove vertical gap under the instant search (2.2.0) ---------- */
@media (max-width: 782px) {
  .wf-hero { padding-bottom: 24px !important; }
  .wf-hero .wf-hero-searchrow {
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    row-gap: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
  }
  .wf-hero .wf-hero-searchrow .wf-search { margin: 0 !important; padding: 0 !important; }
  .wf-hero .wf-hero-searchrow > *:empty { display: none !important; }
  .wf-hero .wf-hero-note {
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
  }
  .wf-hero .wf-wrap > *:empty { display: none !important; }
}

/* ------------------------------------------------------------------
   Flag information tables (v2.3.0)
------------------------------------------------------------------ */
.wf-info-tables { margin: 2.5rem 0 0; display: grid; gap: 2rem; }
.wf-info-section { margin: 0; }
.wf-info-title {
	font-size: clamp(1.15rem, 1.6vw, 1.45rem);
	margin: 0 0 .75rem;
	line-height: 1.25;
}
.wf-table-wrap { overflow-x: auto; border: 1px solid var(--wf-border, rgba(128,128,128,.28)); border-radius: 14px; }
.wf-info-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.wf-info-table th,
.wf-info-table td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--wf-border, rgba(128,128,128,.2)); }
.wf-info-table tbody tr:last-child th,
.wf-info-table tbody tr:last-child td { border-bottom: 0; }
.wf-info-table thead th { font-weight: 700; background: rgba(128,128,128,.10); }
.wf-info-table tbody th { font-weight: 600; width: 38%; background: rgba(128,128,128,.04); }
.wf-info-table.wf-info-colors tbody th,
.wf-info-table.wf-info-history tbody th,
.wf-info-table.wf-info-other-flags tbody th { width: auto; }
.wf-swatch { display: inline-block; width: 46px; height: 20px; border-radius: 4px; border: 1px solid rgba(128,128,128,.45); }
.wf-zone { margin-block: 2rem; }
@media (max-width: 600px) {
	.wf-info-table { font-size: .9rem; }
	.wf-info-table tbody th { width: 45%; }
}


/* =====================================================================
   World Flags 2.4.0 — "Dimension" 3D box design system
   Purely visual layer: no markup, feature or behaviour changes.
   ===================================================================== */

:root {
  /* Palette */
  --wf-accent: #1f5eff;
  --wf-accent-2: #ff8a1f;
  --wf-bg: #eef1f8;
  --wf-surface: #ffffff;
  --wf-text: #10192b;
  --wf-muted: #5a6782;
  --wf-border: #cdd6ea;

  /* 3D system */
  --wf-radius: 18px;
  --wf-radius-lg: 24px;
  --wf-depth: #0c1730;
  --wf-edge: color-mix(in srgb, var(--wf-depth) 82%, transparent);
  --wf-lift: 0 2px 0 color-mix(in srgb, var(--wf-depth) 12%, transparent),
             6px 6px 0 color-mix(in srgb, var(--wf-depth) 10%, transparent),
             0 22px 44px -20px color-mix(in srgb, var(--wf-depth) 55%, transparent);
  --wf-lift-sm: 0 1px 0 color-mix(in srgb, var(--wf-depth) 10%, transparent),
                3px 3px 0 color-mix(in srgb, var(--wf-depth) 9%, transparent),
                0 12px 24px -14px color-mix(in srgb, var(--wf-depth) 50%, transparent);
  --wf-lift-hi: 0 2px 0 color-mix(in srgb, var(--wf-depth) 14%, transparent),
                12px 12px 0 color-mix(in srgb, var(--wf-accent) 20%, transparent),
                0 34px 60px -24px color-mix(in srgb, var(--wf-depth) 60%, transparent);
  --wf-shadow: var(--wf-lift);
  --wf-inner-top: inset 0 1px 0 rgba(255, 255, 255, .9);
  --wf-face: linear-gradient(160deg,
              color-mix(in srgb, var(--wf-surface) 100%, transparent) 0%,
              color-mix(in srgb, var(--wf-bg) 65%, var(--wf-surface)) 100%);
  --wf-ease: cubic-bezier(.2, .8, .25, 1);
}

html[data-theme="dark"] {
  --wf-bg: #0a1020;
  --wf-surface: #141d33;
  --wf-text: #e9eefb;
  --wf-muted: #9aa8c6;
  --wf-border: #2a3554;
  --wf-depth: #000000;
  --wf-inner-top: inset 0 1px 0 rgba(255, 255, 255, .08);
  --wf-face: linear-gradient(160deg, #1a2440 0%, #111a2e 100%);
}

/* ---------- Page canvas ---------- */
body {
  background-color: var(--wf-bg);
  background-image:
    radial-gradient(900px 480px at 8% -10%, color-mix(in srgb, var(--wf-accent) 16%, transparent), transparent 65%),
    radial-gradient(760px 420px at 96% 4%, color-mix(in srgb, var(--wf-accent-2) 14%, transparent), transparent 62%),
    linear-gradient(0deg, color-mix(in srgb, var(--wf-depth) 4%, transparent), transparent 40%);
  background-attachment: fixed;
}

/* Reusable 3D face */
.wf-3d,
.wf-thumb,
.wf-flag-stage,
.wf-panel,
.wf-table-wrap,
.wf-search input,
.wf-modes,
.wf-menu-toggle,
.wf-quick button,
.wf-field select,
.wf-field input {
  border: 1px solid var(--wf-border);
  border-bottom-width: 2px;
  background-image: var(--wf-face);
  box-shadow: var(--wf-lift-sm), var(--wf-inner-top);
}

/* ---------- Header ---------- */
.wf-header {
  background: color-mix(in srgb, var(--wf-surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--wf-border), 0 16px 34px -26px color-mix(in srgb, var(--wf-depth) 70%, transparent);
}
.wf-header-inner { min-height: 74px; }
.wf-site-title { font-weight: 800; letter-spacing: -.03em; }
.wf-site-title a {
  background: linear-gradient(120deg, var(--wf-text), color-mix(in srgb, var(--wf-accent) 70%, var(--wf-text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wf-nav a { font-weight: 700; letter-spacing: -.01em; }
.wf-nav > ul > li > a {
  padding: 8px 14px; border-radius: 12px;
  transition: transform .16s var(--wf-ease), box-shadow .16s var(--wf-ease), background .16s var(--wf-ease);
}
.wf-nav > ul > li > a:hover {
  background: var(--wf-surface);
  transform: translate(-1px, -2px);
  box-shadow: var(--wf-lift-sm);
}
.wf-nav .current-menu-item > a::after { bottom: 2px; left: 14px; right: 14px; height: 3px; }

/* ---------- Mode switcher ---------- */
.wf-modes { border-radius: 999px; padding: 4px; }
.wf-modes button { transition: transform .15s var(--wf-ease), box-shadow .15s var(--wf-ease); }
.wf-modes button[aria-pressed="true"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--wf-accent) 92%, #fff), var(--wf-accent));
  color: #fff; border-color: color-mix(in srgb, var(--wf-accent) 70%, var(--wf-depth));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--wf-depth) 35%, transparent), 0 8px 18px -8px var(--wf-accent);
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */
.wf-hero {
  background:
    radial-gradient(900px 380px at 14% -30%, color-mix(in srgb, var(--wf-accent) 24%, transparent), transparent 62%),
    radial-gradient(700px 340px at 88% -10%, color-mix(in srgb, var(--wf-accent-2) 20%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--wf-surface) 92%, transparent), transparent);
  border-bottom: 0;
  padding: clamp(46px, 7vw, 84px) 0 clamp(34px, 5vw, 58px);
  position: relative; overflow: hidden;
}
.wf-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--wf-depth) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--wf-depth) 6%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 80% at 50% 0%, #000, transparent 75%);
  opacity: .5;
}
.wf-hero .wf-wrap { position: relative; z-index: 1; }
.wf-hero h1 {
  font-weight: 800; letter-spacing: -.04em;
  text-shadow: 2px 3px 0 color-mix(in srgb, var(--wf-depth) 10%, transparent);
}
.wf-hero p { font-size: 1.1rem; }
.wf-search input { border-radius: 999px; padding: 15px 22px; font-weight: 600; }
.wf-search input:focus {
  outline: 0;
  border-color: var(--wf-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wf-accent) 22%, transparent), var(--wf-lift-sm);
}
.wf-hero-btn, .wf-btn {
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wf-accent) 88%, #fff), var(--wf-accent));
  border: 1px solid color-mix(in srgb, var(--wf-accent) 60%, var(--wf-depth));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--wf-accent) 45%, var(--wf-depth)),
              0 16px 28px -14px color-mix(in srgb, var(--wf-accent) 80%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .35);
  letter-spacing: -.01em;
  transition: transform .14s var(--wf-ease), box-shadow .14s var(--wf-ease), filter .14s var(--wf-ease);
}
.wf-hero-btn:hover, .wf-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--wf-accent) 45%, var(--wf-depth)),
              0 22px 34px -14px color-mix(in srgb, var(--wf-accent) 85%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, .35);
}
.wf-hero-btn:active, .wf-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--wf-accent) 45%, var(--wf-depth)), inset 0 2px 6px rgba(0, 0, 0, .25);
}
.wf-hero-btn-alt {
  background: var(--wf-face); color: var(--wf-text);
  border-color: var(--wf-border);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--wf-depth) 14%, transparent), var(--wf-lift-sm);
}
.wf-hero-btn-alt:hover {
  box-shadow: 0 7px 0 color-mix(in srgb, var(--wf-depth) 16%, transparent), var(--wf-lift);
}

/* ---------- Region sections as 3D slabs ---------- */
.wf-regions { padding: 44px 0 76px; }
.wf-region {
  background: color-mix(in srgb, var(--wf-surface) 62%, transparent);
  border: 1px solid var(--wf-border);
  border-bottom-width: 2px;
  border-radius: var(--wf-radius-lg);
  box-shadow: var(--wf-lift), var(--wf-inner-top);
  padding: clamp(18px, 3vw, 30px);
  margin-bottom: 34px;
  backdrop-filter: blur(6px);
}
.wf-region h2 {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 0; padding-bottom: 0; font-weight: 800; letter-spacing: -.03em;
}
.wf-region h2::before {
  content: ""; width: 14px; height: 26px; border-radius: 6px; flex: 0 0 auto;
  background: linear-gradient(180deg, var(--wf-accent), color-mix(in srgb, var(--wf-accent) 40%, var(--wf-accent-2)));
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--wf-depth) 18%, transparent);
}
.wf-count {
  background: color-mix(in srgb, var(--wf-accent) 12%, transparent);
  color: color-mix(in srgb, var(--wf-accent) 78%, var(--wf-text));
  border: 1px solid color-mix(in srgb, var(--wf-accent) 28%, transparent);
  border-radius: 999px; padding: 3px 10px; font-weight: 700;
}

/* ---------- Flag cards ---------- */
.wf-grid { gap: 26px 22px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); }
.wf-card { perspective: 900px; }
.wf-thumb {
  border-radius: var(--wf-radius);
  padding: 10px;
  transform-style: preserve-3d;
  transition: transform .22s var(--wf-ease), box-shadow .22s var(--wf-ease), border-color .22s var(--wf-ease);
}
.wf-thumb img { border-radius: 10px; box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--wf-depth) 45%, transparent); }
.wf-card a:hover .wf-thumb {
  transform: translate3d(-2px, -8px, 0) rotateX(7deg) rotateY(-6deg);
  border-color: color-mix(in srgb, var(--wf-accent) 45%, var(--wf-border));
  box-shadow: var(--wf-lift-hi), var(--wf-inner-top);
}
.wf-card span { margin-top: 12px; font-weight: 800; letter-spacing: -.015em; }
.wf-card a:hover span { color: color-mix(in srgb, var(--wf-accent) 80%, var(--wf-text)); }

/* ---------- Single flag ---------- */
.wf-breadcrumb {
  display: inline-flex; flex-wrap: wrap; align-items: center;
  background: color-mix(in srgb, var(--wf-surface) 70%, transparent);
  border: 1px solid var(--wf-border); border-radius: 999px;
  padding: 7px 16px; box-shadow: var(--wf-lift-sm); font-weight: 600;
}
.wf-flag-title { font-weight: 800; letter-spacing: -.035em; }
.wf-flag-stage { border-radius: var(--wf-radius-lg); padding: 22px; }
.wf-flag-stage img {
  border-radius: 12px;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--wf-depth) 14%, transparent),
              0 28px 50px -22px color-mix(in srgb, var(--wf-depth) 60%, transparent);
}
.wf-panel { border-radius: var(--wf-radius-lg); padding: 24px; box-shadow: var(--wf-lift), var(--wf-inner-top); }
.wf-panel h2 { font-weight: 800; letter-spacing: -.02em; }
.wf-field select, .wf-field input { border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.wf-field select:focus, .wf-field input:focus {
  outline: 0; border-color: var(--wf-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--wf-accent) 20%, transparent);
}
.wf-quick button {
  border-radius: 999px; font-weight: 700;
  transition: transform .14s var(--wf-ease), box-shadow .14s var(--wf-ease), color .14s var(--wf-ease);
}
.wf-quick button:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--wf-accent) 50%, var(--wf-border));
  box-shadow: var(--wf-lift-sm);
}
.wf-facts {
  background: color-mix(in srgb, var(--wf-surface) 65%, transparent);
  border: 1px solid var(--wf-border); border-bottom-width: 2px;
  border-radius: var(--wf-radius); padding: 16px 18px;
  box-shadow: var(--wf-lift-sm), var(--wf-inner-top);
}
.wf-facts li { border-bottom-style: solid; border-bottom-color: color-mix(in srgb, var(--wf-border) 70%, transparent); }
.wf-facts li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------- Content & tables ---------- */
.wf-content h2, .wf-content h3, .wf-page-title, .wf-info-title { letter-spacing: -.03em; font-weight: 800; }
.wf-content blockquote {
  background: color-mix(in srgb, var(--wf-surface) 70%, transparent);
  border-left-width: 6px; border-radius: var(--wf-radius);
  padding: 16px 18px; box-shadow: var(--wf-lift-sm);
}
.wf-table-wrap { border-radius: var(--wf-radius); overflow: hidden; overflow-x: auto; }
.wf-info-table thead th { background: color-mix(in srgb, var(--wf-accent) 12%, transparent); }
.wf-info-table tbody th { background: color-mix(in srgb, var(--wf-depth) 4%, transparent); }
.wf-swatch {
  border-radius: 6px; height: 22px;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--wf-depth) 25%, transparent);
}
.wf-related h2 { border-bottom: 0; }

/* ---------- Footer ---------- */
.wf-footer {
  margin-top: 40px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--wf-accent) 8%, transparent));
  border-top: 1px solid var(--wf-border);
}
.wf-footer-inner {
  background: color-mix(in srgb, var(--wf-surface) 70%, transparent);
  border: 1px solid var(--wf-border); border-bottom-width: 2px;
  border-radius: var(--wf-radius-lg);
  box-shadow: var(--wf-lift), var(--wf-inner-top);
  padding: 22px clamp(18px, 3vw, 28px);
  margin-top: 28px; margin-bottom: 28px;
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .wf-card a:hover .wf-thumb,
  .wf-hero-btn:hover, .wf-btn:hover, .wf-quick button:hover, .wf-nav > ul > li > a:hover { transform: none; }
}

/* =====================================================================
   2.4.1 — Mobile fixes: hero search spacing + responsive info tables
   ===================================================================== */

@media (max-width: 782px) {
  .wf-hero { padding-bottom: 20px !important; }
  .wf-hero .wf-hero-searchrow {
    display: block !important;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    row-gap: 0 !important;
    min-height: 0 !important;
    line-height: 0 !important;
  }
  .wf-hero .wf-hero-searchrow .wf-search {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
    max-width: none !important;
    width: 100% !important;
  }
  .wf-hero .wf-hero-searchrow .wf-search input { display: block !important; margin: 0 !important; }
  .wf-hero .wf-hero-note {
    margin: 8px 0 0 !important;
    padding: 0 !important;
    line-height: 1.45 !important;
  }
  .wf-hero .wf-wrap > br,
  .wf-hero .wf-wrap > p:empty,
  .wf-hero .wf-hero-searchrow > *:empty { display: none !important; }
}

/* ---------- Info tables: never wider than the screen ---------- */
.wf-info-tables { max-width: 100%; }
.wf-table-wrap { max-width: 100%; }
.wf-info-table { table-layout: fixed; width: 100%; max-width: 100%; }
.wf-info-table th,
.wf-info-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

@media (max-width: 700px) {
  .wf-single, .entry-page, .wf-content, .wf-article { max-width: 100%; min-width: 0; }
  .wf-content > *, .wf-article > * { max-width: 100%; }
  .wf-table-wrap { overflow-x: hidden; border-radius: 14px; }
  .wf-info-table { font-size: .86rem; }
  .wf-info-table th,
  .wf-info-table td { padding: .55rem .6rem; }
  .wf-info-table tbody th { width: 42%; }
  .wf-info-table.wf-info-colors tbody th,
  .wf-info-table.wf-info-history tbody th,
  .wf-info-table.wf-info-other-flags tbody th { width: 40%; }
  .wf-swatch { width: 34px; height: 18px; }
}
