/* ============================================
   Infotrade SICA — Custom CSS
   Estilos que theme.json no puede expresar.
   Usa tokens via var(--wp--preset--color--*)
   ============================================ */

/* --- Custom Properties (aliases for convenience) --- */
:root {
  --gov-red-hover: #A00D24;
  --gov-gold-hover: #e5a800;
  --nav-hover: rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 3px;
  --warning-text: #856404;
}

/* ========== WP 6.7 BLOCK SYSTEM RESETS ========== */

/* 1. Kill flow layout margins (margin-block-start: 1rem) inside our components.
      WP adds .is-layout-flow to every wp:group with type:default. */
.gob-bar > *,
.site-header > *,
.main-nav > *,
.hero > *,
.hero__content > *,
.site-footer > *,
.section__header > *,
.is-style-news-card > *,
.treaty-hero > *,
.sub-footer > * {
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

/* 2. In WP 6.7 there is no .wp-block-group__inner-container.
      The inner group is just a child .wp-block-group with is-layout-constrained.
      Override its display to flex and apply max-width centering (replaces .container).
      Horizontal padding comes from has-global-padding (root padding = 1rem in theme.json). */
.gob-bar > .wp-block-group,
.site-header > .wp-block-group,
.main-nav > .wp-block-group {
  display: flex !important;
  align-items: center;
  max-width: var(--wp--style--global--content-size, 1240px);
  margin: 0 auto !important;
  width: 100%;
}

/* 3. Kill constrained child centering inside flex containers.
      WP rule: .is-layout-constrained > :not(.align*) { max-width: 1240px; margin: auto !important }
      This breaks flex layout by centering each child individually. */
.gob-bar > .wp-block-group > *,
.site-header > .wp-block-group > *,
.main-nav > .wp-block-group > * {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 4. Remove the global link underline WP adds: a:not(.wp-element-button) { text-decoration: underline } */
.gob-bar a,
.site-header a,
.main-nav a,
.hero a,
.site-footer a,
.sub-footer a,
.treaty-item,
.quick-link,
.news-card a,
.is-style-news-card a,
.page-nav__link,
.doc-item__action,
.breadcrumb a,
.sidebar-nav a {
  text-decoration: none !important;
}

/* 5. (Root padding is 1rem in theme.json — has-global-padding now provides correct spacing.) */

/* 6. Sections should have no vertical margin between them */
.wp-site-blocks > .wp-block-template-part,
.wp-site-blocks > .wp-block-group,
.wp-site-blocks > section,
.wp-site-blocks > main {
  margin-block-start: 0;
}

/* 7. Hero inner content: override constrained centering for left-aligned content.
      hero__content is a constrained .wp-block-group — act as 1240px container,
      children limited to 620px and left-aligned (not centered). */
.hero__content {
  max-width: var(--wp--style--global--content-size, 1240px) !important;
  margin: 0 auto !important;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}
.hero__content > * {
  max-width: 620px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 8. Navigation submenu arrow SVG icon */
.main-nav .wp-block-navigation__submenu-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}
.main-nav .wp-block-navigation__submenu-icon svg {
  stroke: currentColor;
  width: 10px;
  height: 10px;
}
.main-nav .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-icon {
  color: rgba(255,255,255,0.5);
}
.main-nav .wp-block-navigation__submenu-container .wp-block-navigation__submenu-icon {
  display: none;
}

/* 9. Sections: padding, alt background, constrained children */
.section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}
.section--alt {
  background: var(--wp--preset--color--surface);
}
.section__header {
  margin-bottom: 1.5rem;
}
.section.is-layout-constrained > * {
  max-width: var(--wp--style--global--content-size, 1240px) !important;
  width: 100%;
}

/* 10. News post template grid */
.wp-block-post-template.is-layout-grid {
  gap: 1.25rem;
}

/* 11. Sidebar links should not be underlined */
.sidebar-nav .wp-block-navigation-item__content {
  text-decoration: none !important;
}

/* ========== GOVERNMENT BAR ========== */
.gob-bar {
  background: #000;
  color: #fff;
  font-size: 0.72rem;
  height: 30px;
  display: flex;
  align-items: center;
}
.gob-bar > .wp-block-group {
  justify-content: space-between;
}
.gob-bar__brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s;
}
.gob-bar__brand:hover {
  color: #fff;
}
.gob-bar__brand svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.gob-bar__links {
  display: flex;
  gap: 1.25rem;
}
.gob-bar__links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.68rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}
.gob-bar__links a:hover {
  color: #fff;
}

/* ========== SITE HEADER ========== */
.site-header {
  background: var(--wp--preset--color--header-bg);
  padding: 0.75rem 0;
  border-bottom: none;
}
.site-header > .wp-block-group {
  justify-content: space-between;
  gap: 1rem;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-header__brand:hover {
  opacity: 0.85;
}
.site-header__logo {
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  letter-spacing: 0.05em;
}
.site-header__title {
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
}
.site-header__subtitle {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
  margin-top: 0.15rem;
}
.site-header__search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  transition: border-color 0.2s;
}
.site-header__search:focus-within {
  border-color: rgba(255,255,255,0.3);
}
.site-header__search input[type="search"] {
  border: none;
  background: transparent;
  color: #fff;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  width: 220px;
  outline: none;
  font-family: inherit;
  font-weight: 300;
}
.site-header__search input::placeholder {
  color: rgba(255,255,255,0.35);
}
.site-header__search button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}
.site-header__search button:hover {
  color: var(--wp--preset--color--gov-gold);
}

/* ========== MAIN NAVIGATION ========== */
.main-nav {
  background: var(--wp--preset--color--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.main-nav > .wp-block-group {
  align-items: stretch;
  padding: 0 !important;
}
.main-nav__home {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  color: rgba(255,255,255,0.6);
  background: none;
  text-decoration: none;
  transition: color 0.2s;
}
.main-nav__home:hover {
  color: var(--wp--preset--color--gov-gold);
}

/* WP Navigation block overrides inside .main-nav
   WP uses .wp-block-navigation-item__content.wp-block-navigation-item__content { color: inherit }
   (specificity 0,3,0) so we set color on the parent nav element for inheritance. */
.main-nav .wp-block-navigation {
  flex: 1;
  color: rgba(255,255,255,0.75);
}
.main-nav .wp-block-navigation__container {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.main-nav .wp-block-navigation-item__content {
  display: block;
  padding: 0.7rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  white-space: nowrap;
}
.main-nav .wp-block-navigation-item__content:hover,
.main-nav .wp-block-navigation-item--current .wp-block-navigation-item__content {
  color: var(--wp--preset--color--gov-gold);
}

/* Override Ollie parent theme's display:none on submenu containers.
   Ollie uses click-to-toggle (.wp-block-navigation-submenu__toggle) but our
   header uses wp:navigation-link with nested children — restore CSS hover dropdowns. */
.main-nav .wp-block-navigation .has-child > .wp-block-navigation__submenu-container {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
}
.main-nav .wp-block-navigation .has-child:hover > .wp-block-navigation__submenu-container,
.main-nav .wp-block-navigation .has-child:focus-within > .wp-block-navigation__submenu-container {
  display: flex;
  opacity: 1;
  visibility: visible;
  height: auto;
  width: auto;
  overflow: visible;
}

/* JS adds .dropdown-flip when the dropdown would overflow the viewport */
.main-nav .wp-block-navigation .has-child.dropdown-flip > .wp-block-navigation__submenu-container {
  left: auto !important;
  right: 0;
}

/* Dropdown visual styles */
.main-nav .wp-block-navigation__submenu-container {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--text-primary);
  min-width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-top: 2px solid var(--wp--preset--color--gov-gold);
  border-radius: 0 0 3px 3px;
  padding: 0.35rem 0;
}
.main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  padding: 0.5rem 1.1rem;
  color: #000;
  font-size: 0.85rem;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: none;
  transition: color 0.2s, background 0.2s;
}
.main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--gov-gold);
}

/* Nav toggle (mobile) */
.main-nav__toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 1.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
}

/* ========== HERO ========== */
.hero {
  background: var(--wp--preset--color--nav-bg);
  color: #fff;
  padding: 2.5rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.1) 0%, transparent 60%);
}
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 35%;
  background: linear-gradient(135deg, transparent 0%, rgba(250,188,40,0.06) 100%);
}
.hero__title {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: #fff;
}
.hero__text {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  font-weight: 300;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

/* ========== BUTTONS ========== */
.wp-block-button.is-style-outline-white .wp-block-button__link {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.35);
}
.wp-block-button.is-style-outline-white .wp-block-button__link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.wp-block-button.is-style-secondary .wp-block-button__link {
  background: var(--wp--preset--color--gov-dark);
  color: #fff;
  border: 2px solid var(--wp--preset--color--gov-dark);
}
.wp-block-button.is-style-secondary .wp-block-button__link:hover {
  background: var(--wp--preset--color--gov-gold);
  border-color: var(--wp--preset--color--gov-gold);
  color: #000;
}
.wp-block-button__link {
  padding: 0.55rem 1.25rem;
  border: 2px solid transparent;
  transition: all 0.15s;
}

/* ========== SECTION HEADERS ========== */
.is-style-section-title {
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--wp--preset--color--gov-gold);
  display: inline-block;
}

/* ========== TREATY LIST ========== */
.treaty-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.treaty-item,
.is-style-treaty-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border-light);
  border-left: 4px solid var(--wp--preset--color--success);
  margin-bottom: -1px;
  text-decoration: none;
  color: var(--wp--preset--color--text-primary);
  transition: background 0.15s;
}
.treaty-item:first-child,
.is-style-treaty-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}
.treaty-item:last-child,
.is-style-treaty-item:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}
.treaty-item:hover,
.is-style-treaty-item:hover {
  background: #f6f8fb;
}
.treaty-item--archived {
  border-left-color: var(--wp--preset--color--accent-gold);
}
.treaty-item__flag {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.treaty-item__info {
  flex: 1;
  min-width: 0;
}
.treaty-item__name {
  font-size: 0.9rem;
  font-weight: 700;
}
.treaty-item__type {
  font-size: 0.75rem;
  color: var(--wp--preset--color--text-secondary);
}
.treaty-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.treaty-item__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.treaty-item__badge--active {
  background: var(--wp--preset--color--success-bg);
  color: var(--wp--preset--color--success);
}
.treaty-item__badge--archived {
  background: var(--wp--preset--color--warning-bg);
  color: var(--warning-text);
}
.treaty-item__stats {
  font-size: 0.72rem;
  color: var(--wp--preset--color--text-secondary);
  white-space: nowrap;
}

/* ========== NEWS CARDS ========== */
/* .news-grid class on wp:query wrapper — actual grid is on wp-block-post-template inside */
.news-grid {
  /* Don't set grid here — WP handles grid on .wp-block-post-template.is-layout-grid */
}
.news-card,
.is-style-news-card {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border-light);
  border-top: 2px solid var(--wp--preset--color--gov-dark);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--wp--preset--color--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.news-card:hover,
.is-style-news-card:hover {
  border-top-color: var(--wp--preset--color--gov-gold);
  box-shadow: var(--shadow-sm);
  color: var(--wp--preset--color--text-primary);
}
.news-card__date {
  font-size: 0.7rem;
  color: var(--wp--preset--color--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.news-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.news-card__excerpt {
  font-size: 0.8rem;
  color: var(--wp--preset--color--text-secondary);
  line-height: 1.6;
}

/* ========== QUICK LINKS ========== */
.quick-links,
.is-style-quick-links {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0.5rem;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--wp--preset--color--text-primary);
  transition: border-color 0.15s;
}
.quick-link:hover {
  border-color: var(--wp--preset--color--gov-gold);
  color: var(--wp--preset--color--text-primary);
}
.quick-link__icon {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wp--preset--color--gov-dark);
  border-radius: 50%;
  color: #fff;
}
.quick-link__label {
  font-size: 0.75rem;
  font-weight: 700;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  display: flex;
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  color: var(--wp--preset--color--text-secondary);
  background: var(--wp--preset--color--surface);
  border-bottom: 1px solid var(--wp--preset--color--border-light);
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}
nav.breadcrumb {
  max-width: calc(var(--wp--style--global--content-size, 1240px) + 2rem);
  margin: 0 auto;
}
/* Center the breadcrumb content within max-width */
.breadcrumb.is-layout-flex {
  max-width: calc(var(--wp--style--global--content-size, 1240px) + 2rem);
  margin: 0 auto;
}
.breadcrumb a {
  color: var(--wp--preset--color--gov-dark);
  font-weight: 600;
}
.breadcrumb .separator {
  margin: 0 0.35rem;
  color: var(--wp--preset--color--border);
}
/* Post title inside breadcrumb should be inline */
.breadcrumb .wp-block-post-title,
.breadcrumb__current {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--wp--preset--color--text-primary);
  margin: 0;
}

/* ========== TREATY HERO ========== */
.treaty-hero {
  background: linear-gradient(135deg, var(--wp--preset--color--gov-dark) 0%, #1e242c 100%);
  color: #fff;
  padding: 2rem 0;
  border-bottom: 2px solid var(--wp--preset--color--gov-gold);
}
.treaty-hero__flags {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}
.treaty-hero__title {
  font-size: 1.6rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.35rem;
}
.treaty-hero__subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.75rem;
}
.treaty-hero__meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
}
.treaty-hero__meta strong {
  color: #fff;
  font-weight: 700;
}

/* ========== TWO COLUMN LAYOUT ========== */
.two-col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ========== SIDEBAR NAV ========== */
.sidebar-nav {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: var(--radius);
  padding: 0.75rem 0;
  position: sticky;
  top: 50px;
}
.sidebar-nav__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wp--preset--color--text-secondary);
  padding: 0.4rem 1rem;
}
.sidebar-nav .wp-block-navigation__container {
  display: flex;
  flex-direction: column;
}
.sidebar-nav .wp-block-navigation-item__content,
.sidebar-nav__link {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--wp--preset--color--text-primary);
  border-left: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-nav .wp-block-navigation-item__content:hover,
.sidebar-nav__link:hover {
  background: #f6f8fb;
  border-left-color: var(--wp--preset--color--gov-gold);
  color: var(--wp--preset--color--gov-dark);
}
.sidebar-nav .wp-block-navigation-item--current .wp-block-navigation-item__content,
.sidebar-nav__link--active {
  background: #f5f1e6;
  border-left-color: var(--wp--preset--color--gov-gold);
  color: var(--wp--preset--color--gov-dark);
  font-weight: 700;
}
.sidebar-nav__section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--wp--preset--color--border-light);
}

/* ========== POST META (single posts) ========== */
.post-meta {
  font-size: 0.78rem;
  color: var(--wp--preset--color--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--wp--preset--color--border-light);
}

/* ========== CONTENT AREA ========== */
.content-area,
.is-style-content-area {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.content-area h1,
.is-style-content-area h1 {
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--wp--preset--color--gov-gold);
  padding-bottom: 0.5rem;
}
.content-area h2,
.is-style-content-area h2 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--wp--preset--color--gov-dark);
}
.content-area h3,
.is-style-content-area h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.content-area p,
.is-style-content-area p {
  margin-bottom: 0.85rem;
  line-height: 1.7;
}
.content-area ul,
.content-area ol,
.is-style-content-area ul,
.is-style-content-area ol {
  margin-bottom: 0.85rem;
  padding-left: 1.5rem;
}
.content-area li,
.is-style-content-area li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

/* ========== DOCUMENT LIST ========== */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}
.doc-item,
.is-style-doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--wp--preset--color--border-light);
  border-left: 3px solid var(--wp--preset--color--gov-dark);
  margin-bottom: -1px;
  transition: background 0.15s;
}
.doc-item:hover,
.is-style-doc-item:hover {
  background: #f6f8fb;
}
.doc-item__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  color: var(--wp--preset--color--gov-red);
}
.doc-item__info {
  flex: 1;
}
.doc-item__name {
  font-weight: 700;
  font-size: 0.82rem;
}
.doc-item__meta {
  font-size: 0.7rem;
  color: var(--wp--preset--color--text-secondary);
}
.doc-item__action {
  font-size: 0.75rem;
  color: var(--wp--preset--color--gov-dark);
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
}

/* ========== TABLE (institutional style) ========== */

/* --- Responsive wrapper: any table inside post content scrolls --- */
.entry-content,
.wp-block-post-content {
  overflow-x: visible; /* let children handle scroll */
}
.entry-content table,
.wp-block-post-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

/* --- Base table styles --- */
.wp-block-table.is-style-institutional table,
.table-responsive table,
.entry-content table,
.wp-block-post-content table {
  border-collapse: collapse;
  font-size: 0.82rem;
  border: 1px solid var(--wp--preset--color--border);
  margin: 1.25rem 0;
  min-width: 400px; /* force scroll rather than squish */
}

/* --- All cells: grid borders + padding --- */
.wp-block-table.is-style-institutional th,
.wp-block-table.is-style-institutional td,
.table-responsive th,
.table-responsive td,
.entry-content table th,
.entry-content table td,
.wp-block-post-content table th,
.wp-block-post-content table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border: 1px solid var(--wp--preset--color--border-light);
  vertical-align: top;
  line-height: 1.45;
}

/* --- Header row: first row with <th> gets navy --- */
.wp-block-table.is-style-institutional tr:first-child th,
.table-responsive tr:first-child th,
.entry-content table tr:first-child th,
.wp-block-post-content table tr:first-child th {
  background: var(--wp--preset--color--gov-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-color: rgba(255,255,255,0.15);
}

/* --- Sub-header <th> in body rows: lighter blue, not navy --- */
.entry-content table tr:not(:first-child) th,
.wp-block-post-content table tr:not(:first-child) th {
  background: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--text-primary);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: normal;
}

/* --- Striping --- */
.wp-block-table.is-style-institutional tr:nth-child(even),
.table-responsive tr:nth-child(even),
.entry-content table tr:nth-child(even):not(:first-child),
.wp-block-post-content table tr:nth-child(even):not(:first-child) {
  background: #f8fafb;
}

/* --- Hover --- */
.wp-block-table.is-style-institutional tr:hover,
.table-responsive tr:hover,
.entry-content table tr:hover:not(:first-child),
.wp-block-post-content table tr:hover:not(:first-child) {
  background: #eef2f7;
}

/* --- .table-responsive legacy wrapper --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border: 1px solid var(--wp--preset--color--border-light);
}
.table-responsive table {
  display: table; /* undo block inside wrapper */
  margin: 0;
  border: 0;
}

/* ========== PAGE NAVIGATION ========== */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--wp--preset--color--border-light);
}
.page-nav__link {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--wp--preset--color--border-light);
  border-left: 3px solid var(--wp--preset--color--gov-dark);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--wp--preset--color--text-primary);
  transition: all 0.15s;
  max-width: 45%;
}
.page-nav__link:hover {
  border-left-color: var(--wp--preset--color--gov-gold);
  background: #f6f8fb;
  color: var(--wp--preset--color--text-primary);
}
.page-nav__link--next {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
  border-left: 1px solid var(--wp--preset--color--border-light);
  border-right: 3px solid var(--wp--preset--color--gov-dark);
}
.page-nav__link--next:hover {
  border-right-color: var(--wp--preset--color--gov-gold);
}
.page-nav__label {
  font-size: 0.7rem;
  color: var(--wp--preset--color--text-secondary);
  margin-bottom: 0.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.page-nav__title {
  font-size: 0.82rem;
  font-weight: 700;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--wp--preset--color--gov-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0 0;
  margin-top: 2.5rem;
}
/* Kill constrained centering inside footer children */
.site-footer > * {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  max-width: var(--wp--style--global--content-size, 1240px);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.footer-col__title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--wp--preset--color--gov-gold);
}
.footer-col p,
.footer-col li {
  font-size: 0.78rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-col a:hover {
  color: #fff;
}
.footer-col__social {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.footer-col__social a {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}
.footer-col__social a:hover {
  background: var(--wp--preset--color--gov-gold);
  color: #fff;
}
.sub-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.85rem 1rem;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}
.sub-footer a {
  color: rgba(255,255,255,0.4);
  margin: 0 0.6rem;
  text-decoration: none;
}
.sub-footer a:hover {
  color: #fff;
}

/* ========== FOCUS STATES ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--wp--preset--color--gov-gold);
  outline-offset: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .sidebar-nav {
    position: static;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-links,
  .is-style-quick-links {
    grid-template-columns: repeat(3, 1fr);
  }
  .news-grid .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {

  /* Prevent any horizontal scroll on mobile */
  html, body {
    overflow-x: hidden !important;
  }

  /* --- MOBILE NAVIGATION --- */

  /* Inner container wraps so nav drops below the bar */
  .main-nav > .wp-block-group {
    flex-wrap: wrap;
  }

  /* Home icon fills the row, pushes toggle to the right */
  .main-nav__home {
    flex: 1;
  }

  /* Hamburger toggle button */
  .main-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px;
    font-size: 1.35rem;
    color: rgba(255,255,255,0.9);
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .main-nav__toggle:hover,
  .main-nav__toggle:active {
    background: var(--nav-hover);
  }
  .main-nav__toggle[aria-expanded="true"] {
    background: rgba(0,0,0,0.25);
  }

  /* The <nav> goes full-width on a new row */
  .main-nav {
    overflow-x: hidden;
  }
  .main-nav .wp-block-navigation {
    flex: none !important;
    width: 100%;
    order: 3;
  }

  /* Menu list hidden by default */
  .main-nav .wp-block-navigation__container,
  .main-nav .wp-block-navigation .wp-block-navigation__container {
    display: none !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    background: var(--wp--preset--color--nav-bg);
    border-top: 1px solid rgba(255,255,255,0.06);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Slide-down animation */
  .main-nav .wp-block-navigation__container.is-open,
  .main-nav .wp-block-navigation .wp-block-navigation__container.is-open {
    display: flex !important;
    animation: navSlideDown 0.25s ease-out;
  }

  /* Top-level items full width */
  .main-nav .wp-block-navigation-item {
    width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Top-level links */
  .main-nav .wp-block-navigation-item__content {
    padding: 0.8rem 1.1rem !important;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: normal;
  }

  /* Chevron indicator for items with children */
  .main-nav .wp-block-navigation .has-child {
    position: relative;
  }
  .main-nav .wp-block-navigation .has-child > .wp-block-navigation__submenu-icon {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    transition: transform 0.2s, color 0.2s;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
  }
  .main-nav .wp-block-navigation .has-child > .wp-block-navigation__submenu-icon svg {
    width: 12px;
    height: 12px;
  }
  .main-nav .wp-block-navigation .has-child.submenu-open > .wp-block-navigation__submenu-icon {
    transform: rotate(180deg);
    color: rgba(255,255,255,0.8);
  }

  /* Submenus hidden by default, static positioning, revealed by JS toggle */
  .main-nav .wp-block-navigation .has-child > .wp-block-navigation__submenu-container {
    position: static !important;
    display: none !important;
    flex-direction: column;
    box-shadow: none;
    border-top: none;
    border-radius: 0;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Override desktop hover — on mobile only JS toggle opens submenus */
  .main-nav .wp-block-navigation .has-child:hover > .wp-block-navigation__submenu-container,
  .main-nav .wp-block-navigation .has-child:focus-within > .wp-block-navigation__submenu-container {
    display: none !important;
  }
  /* JS opens submenus via .submenu-open */
  .main-nav .wp-block-navigation .has-child.submenu-open > .wp-block-navigation__submenu-container {
    display: flex !important;
    animation: submenuFadeIn 0.2s ease-out;
  }

  /* Submenu link styles */
  .main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    padding: 0.65rem 1.1rem 0.65rem 1.8rem !important;
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.8rem;
    font-weight: 400;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: none;
    white-space: normal !important;
    word-break: break-word;
  }
  .main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
  .main-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:active {
    background: rgba(255,255,255,0.05) !important;
    color: #fff !important;
  }
  /* Hide nested submenu icons */
  .main-nav .wp-block-navigation__submenu-container .wp-block-navigation__submenu-icon {
    display: none !important;
  }

  /* --- OTHER MOBILE OVERRIDES --- */
  .site-header > .wp-block-group {
    flex-direction: column;
    text-align: center;
  }
  .site-header__search {
    width: 100%;
  }
  .site-header__search input[type="search"] {
    width: 100%;
  }
  .hero__title {
    font-size: 1.4rem;
  }
  .treaty-item {
    flex-wrap: wrap;
  }
  .treaty-item__meta {
    width: 100%;
    padding-top: 0.35rem;
  }
  .news-grid .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
  .quick-links,
  .is-style-quick-links {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .page-nav {
    flex-direction: column;
  }
  .page-nav__link {
    max-width: 100%;
  }
  .page-nav__link--next {
    align-items: flex-start;
    text-align: left;
    border-left: 3px solid var(--wp--preset--color--gov-dark);
    border-right: 1px solid var(--wp--preset--color--border-light);
  }
  .gob-bar__links {
    display: none;
  }
  .treaty-hero__title {
    font-size: 1.3rem;
  }
}

/* Mobile nav animations */
@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes submenuFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 480px) {
  .hero {
    padding: 1.75rem 0 2rem;
  }
  .hero__title {
    font-size: 1.2rem;
  }
  .hero .wp-block-buttons {
    flex-direction: column;
  }
  .quick-links,
  .is-style-quick-links {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-area,
  .is-style-content-area {
    padding: 1.25rem;
  }
  .treaty-item {
    padding: 0.6rem 0.75rem;
  }
  .treaty-item__flag {
    font-size: 1.4rem;
    width: 30px;
  }
}

/* ============================================
   TREATY SWITCHER
   Compact horizontal pill navigation
   ============================================ */
.treaty-switch {
  background: var(--wp--preset--color--gov-dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.treaty-switch__inner {
  max-width: var(--wp--style--global--content-size, 1240px);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.treaty-switch__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  flex-shrink: 0;
}
.treaty-switch__list {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 0;
}
.treaty-switch__list::-webkit-scrollbar {
  display: none;
}
.treaty-switch__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-decoration: none !important;
  border-radius: 3px;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.treaty-switch__pill:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.treaty-switch__pill.is-active {
  color: #000;
  background: var(--wp--preset--color--gov-gold);
  border-color: rgba(255,255,255,0.15);
}
.treaty-switch__flag {
  font-size: 0.85rem;
  line-height: 1;
}

/* ============================================
   TREATY HERO — SUBSITE VARIANT
   Wider, more prominent, with gradient mesh
   ============================================ */
.treaty-hero--subsite {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(250,188,40,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%),
    linear-gradient(160deg, var(--wp--preset--color--gov-dark) 0%, #1e242c 100%);
  color: #fff;
  padding: 2.5rem 0 2rem;
  border-bottom: 2px solid var(--wp--preset--color--gov-gold);
  position: relative;
  overflow: hidden;
}
.treaty-hero--subsite::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 12px,
    rgba(255,255,255,0.01) 12px,
    rgba(255,255,255,0.01) 24px
  );
  pointer-events: none;
}
.treaty-hero--subsite__inner {
  max-width: var(--wp--style--global--content-size, 1240px);
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}
.treaty-hero--subsite .treaty-hero__flags {
  font-size: 2.5rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.6rem;
}
.treaty-hero--subsite .treaty-hero__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 500;
  color: #fff;
  margin: 0 0 0.3rem;
  letter-spacing: -0.01em;
}
.treaty-hero--subsite .treaty-hero__subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin: 0 0 1rem;
  max-width: 600px;
}
.treaty-hero--subsite .treaty-hero__meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}
.treaty-hero--subsite .treaty-hero__meta strong {
  color: rgba(255,255,255,0.8);
}
.treaty-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.treaty-hero__badge--vigente {
  background: rgba(13,124,63,0.25);
  color: #6EE7A0;
  border: 1px solid rgba(13,124,63,0.3);
}
.treaty-hero__badge--archivado {
  background: rgba(184,146,47,0.2);
  color: #F5D76E;
  border: 1px solid rgba(184,146,47,0.3);
}

/* ============================================
   TREATY DASHBOARD
   Section cards grid
   ============================================ */
.treaty-dash {
  padding: 2rem 0 1rem;
}
.treaty-dash__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--wp--preset--color--border-light);
  border: 1px solid var(--wp--preset--color--border-light);
  border-radius: 4px;
  overflow: hidden;
  max-width: var(--wp--style--global--content-size, 1240px);
  margin: 0 auto;
}
.treaty-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--wp--preset--color--surface);
  text-decoration: none !important;
  color: var(--wp--preset--color--text-primary);
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
}
.treaty-card:hover {
  background: #f6f8fb;
  z-index: 1;
  box-shadow: 0 0 0 1px var(--wp--preset--color--gov-gold);
}
.treaty-card--primary {
  background: linear-gradient(135deg, var(--wp--preset--color--gov-dark) 0%, #1e242c 100%);
  color: #fff;
}
.treaty-card--primary:hover {
  background: linear-gradient(135deg, #3d4550 0%, #272d36 100%);
}
.treaty-card--primary .treaty-card__desc {
  color: rgba(255,255,255,0.6);
}
.treaty-card--primary .treaty-card__icon {
  background: rgba(255,255,255,0.1);
  color: var(--wp--preset--color--gov-gold);
  border-color: rgba(255,255,255,0.15);
}
.treaty-card--primary .treaty-card__arrow {
  color: rgba(255,255,255,0.4);
}
.treaty-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--wp--preset--color--tertiary);
  border: 1px solid var(--wp--preset--color--border-light);
  color: var(--wp--preset--color--gov-dark);
}
.treaty-card__icon svg {
  width: 22px;
  height: 22px;
}
.treaty-card__body {
  flex: 1;
  min-width: 0;
}
.treaty-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  line-height: 1.3;
}
.treaty-card__desc {
  font-size: 0.72rem;
  color: var(--wp--preset--color--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.treaty-card__arrow {
  font-size: 1.1rem;
  color: var(--wp--preset--color--border);
  flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}
.treaty-card:hover .treaty-card__arrow {
  transform: translateX(3px);
  color: var(--wp--preset--color--gov-gold);
}
.treaty-card--primary:hover .treaty-card__arrow {
  color: var(--wp--preset--color--gov-gold);
}

/* ============================================
   RESPONSIVE — Treaty Dashboard & Switcher
   ============================================ */
@media (max-width: 1024px) {
  .treaty-dash__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .treaty-dash__grid {
    grid-template-columns: 1fr;
  }
  .treaty-card {
    padding: 1rem 1.25rem;
  }
  .treaty-switch__label {
    display: none;
  }
}
@media (max-width: 480px) {
  .treaty-card__desc {
    display: none;
  }
  .treaty-card__icon {
    width: 36px;
    height: 36px;
  }
  .treaty-card__icon svg {
    width: 18px;
    height: 18px;
  }
}
