/* ==========================================
   WORLD BANK GROUP — REGULATORY FRAMEWORKS EXPLORER
   Main stylesheet
   ==========================================
   File structure:
     1. TOKENS         — :root variables (colors, typography, layout)
     2. BASE           — html, body, reset
     3. HEADER         — Top bar and topic navigation
     4. NAVIGATION     — Internal menus and nav cards
     5. BANNER         — Hero banner
     6. CONTAINERS     — main-content, page-section, landing
     7. LANDING        — Landing page (photo + text + cards)
     8. TITLES         — page-title, page-subtitle, section-divider
     9. TOPIC CARDS    — Topic cards and per-topic backgrounds
    10. PAGES          — guide, info, countries
    11. BUTTONS        — .btn and variants
    12. FOOTER         — Footer
    13. RESPONSIVE     — Global media queries
    14. UTILITIES      — Helpers (text-center, hidden, margins)
    15. EXPLORE MORE   — Secondary horizontal cards
    16. EXTRAS         — Compact controls (selects, pill-buttons)
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Libre+Baskerville:wght@400;700&display=swap');

/* ==========================================
   1. TOKENS
   ========================================== */
:root {
  /* — Layout —
     --page-max is the LANDING page's reading width only. The header and the
     dashboards deliberately do NOT use it: they run the full width of the
     window (minus --page-pad), because a chart is worth every pixel it can
     get. The landing keeps a cap so its two paragraphs do not stretch into
     200-character lines on a wide monitor. */
  --page-max: 1400px;
  --page-pad: 40px;
  --header-height: 78px;   /* tallest visible logo (World Bank stacked lockup, 48px) + padding + air */

  /* — Fedesarrollo brand palette —
     Transcribed from the institutional kit: `fedebanner.cls` in
     ~/Documents/banner-fedesarrollo, whose own header states the palette is
     "identica a fedesarrollo.cls — kit de marca, assets/02Color/". These are
     the RAW brand values; the semantic tokens below are what the app uses.

     --fede-azul is THE brand colour and is reserved for interaction and brand
     identity (active pills, the header band, links). It is deliberately NOT a
     data colour: when the brand colour also fills a bar, "this is the brand"
     and "this is a value" stop being distinguishable. */
  --fede-azul: #081BFD;        /* azul vibrante — the brand */
  --fede-texto: #010D2B;       /* azul oscuro — darkest text ink */
  --fede-navy: #091C50;
  --fede-azul-deep: #032F9C;
  --fede-azul-medio: #5283FD;
  --fede-celeste: #86E7FF;     /* azul claro */
  --fede-hairline: #D0DDFE;    /* the thin rule of the banner */
  --fede-caja: #D8E1FA;
  --fede-gris-texto: #3D3D3D;  /* secondary body copy */
  /* Muted UI labels. NOT the kit's #7B7B7B/#A6A6A6: at the sizes this app
     uses them (0.875rem filter labels) those measure 3.5:1 and 2.2:1 on the
     page surface, under the 4.5:1 SC 1.4.3 asks of normal text. #6B7078 is
     4.98:1 and still reads as secondary. The old #b0b0b0 was 2.3:1.       */
  --fede-gris-medio: #6B7078;

  /* — Topic identity —
     ONE definition for the four topics, used by the landing chips and the
     topic cards. There used to be THREE copies of these hexes (inline styles
     in ui.r, the .topic-card-image rules below, and the *_ACCENT constants in
     global_aux/constants.R) and they had already drifted: .btax-img carried
     Firing Costs' tan. The R side still needs its own copy for the charts --
     CSS cannot reach plotly -- so keep these in step with the *_TOPIC block in
     global_aux/constants.R, which points back here.

     FOUR HUES OF THE KIT, not four steps of one. A monochrome ladder was tried
     and rejected: at chip size two adjacent steps of the same blue read as the
     same colour, which is the one thing a topic cue cannot do. Each of these is
     a kit secondary darkened to clear 4.5:1 with the white arrow on it.

     NOTE the overlap to keep in mind, not to "fix": --topic-btax is the same
     value as FED_REFERENCE in global_aux/constants.R, which inside a chart means
     "this mark is the reference". They never meet -- topic colours are chrome
     and never enter a chart -- but do not merge them into one token: one is an
     identity and the other is a data semantic, and they would then be forced to
     move together. */
  --topic-labor: var(--fede-azul-deep);    /* #032F9C — white on it 11.1:1 */
  --topic-minwage: var(--fede-teal-700);   /* #00808A — 4.7:1 */
  --topic-firing: var(--fede-lavanda-700); /* #5A62C4 — 5.3:1 */
  --topic-btax: var(--fede-referencia);    /* #C43C10 — 5.2:1 */
  --fede-gris: #F6F6F6;        /* page surface */

  /* Three shades DERIVED from the kit because the kit itself has a hole: every
     secondary it ships (teal #00AAB6, amber #F0A03C, lavender #A3A9F5, mint
     #A9F2D6) measures under 3:1 on the page surface, i.e. none of them can
     legally carry a mark. Each of these is the nearest darkening of a kit hex
     that clears the threshold; the ratio is against --fede-gris.  */
  --fede-referencia: #C43C10;  /* orange #ED501F darkened — 4.86:1 */
  --fede-teal-700: #00808A;    /* teal #00AAB6 darkened  — 4.36:1 */
  --fede-lavanda-700: #5A62C4; /* lavender #A3A9F5 darkened — 4.88:1 */

  /* — Semantic colours (these are what rules reference) — */
  /* The body surface is a pale tint of the brand blue, not a neutral grey: the
     page then reads as blue-on-blue-on-white (band, surface, cards) instead of
     blue chrome dropped on a grey app. Kept very light because every plotly
     canvas is transparent and therefore inherits it -- at this value the value
     labels still measure 9.9:1 on it. (Token name unchanged: 8 call sites.) */
  --light-gray: #EEF2FE;
  --border-gray: var(--fede-hairline);
  --solid-blue: var(--fede-navy);
  /* Muted body text. Was 0.6, which measured 4.2:1 on --light-gray and 4.4:1
     on white — both below the 4.5:1 that WCAG 2.2 SC 1.4.3 requires for
     normal-weight text. 0.72 measures 7.3:1 on the new surface. Do not lower
     it. (Name kept at -60 so its 10 call sites stay untouched.)           */
  --solid-blue-60: rgba(9, 28, 80, 0.72);
  --bright-blue: var(--fede-azul);
  --white: #FFFFFF;
  --text-dark: var(--fede-texto);

  /* — Type families —
     Inter is the kit's text face (OFL, so it can be served). The kit's display
     face is ES Face, which ships under a DESKTOP licence only and therefore
     cannot be published as a webfont; `fedebanner.cls` itself falls back to
     Libre Baskerville, so that fallback is the kit's own sanctioned substitute
     and not an invention of this app. --font-display is for headings ONLY: a
     high-contrast serif below ~16px loses more than it gains, and this app has
     a hard 13px floor. */
  /* ONE hairline for the whole app. Every line whose job is to SEPARATE two
     blocks uses this, at one width: they used to run 1px, 1.25px, 2px and 3px
     depending on which component drew them, which reads as four different
     kinds of line for one idea. Borders that are not separators -- the chevron
     glyphs built from ::after borders, and the left accent bars that mark a
     callout -- keep their own weights on purpose. */
  --hairline: 1px solid rgba(9, 28, 80, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;

  /* — Typography scale —
     1rem = 16px is THE STANDARD TEXT SIZE of the app: it is the size of
     .topic-subtitle, the descriptive paragraph under each dashboard title
     ("Non-salary labor costs for one country across wage levels..."), which is
     the reference everything else is set against. Body copy, table cells,
     descriptions and chart footnotes sit at 1rem; UI chrome (pills, small
     labels) sits one or two steps below at 0.9375rem / 0.875rem; nothing goes
     under 0.8125rem. Do not reintroduce the old 10-13px sizes.

     --type-scale is the root font size that all of those rem values resolve
     against, so it scales the whole interface at once. Keep it a PERCENTAGE,
     never a px value: a percentage inherits the reader's own browser font-size
     preference, which is what WCAG 2.2 SC 1.4.4 (Resize text) requires and
     what the previous hard-coded px sizes silently ignored.

     Raising it above 100% is possible but check the header first: the logo
     row and the topic nav share one line, and at 16px labels they already need
     ~1340px before the nav wraps.

     Two things this knob does NOT reach, and that must be kept in step by hand:
     Plotly chart text (SVG, sized numerically -- see PLOTLY_FONT_SCALE in
     global_aux/constants.R) and the landing page's --lp-* tokens, which are
     viewport-relative on purpose so the landing keeps fitting one screen. */
  --type-scale: 100%;

  --fs-page-title: 3.375rem;         /* 54px */
  --fs-page-subtitle: 1rem;          /* 16px */
  --fs-section-divider: 1rem;        /* 16px */
  --fs-topic-title: 2rem;            /* 32px */
  --fs-topic-desc: 1.125rem;         /* 18px */
  --fs-explore-card-title: 2rem;     /* 32px */
  --fs-explore-card-desc: 1.125rem;  /* 18px */

  /* — Topic cards — */
  --topic-card-band-height: 75px;
  --topic-card-content-height: 250px;

  /* — Landing page: fluid type + rhythm (tune here) —
     The landing must fit ONE screen with no scrolling, so its sizes track the
     viewport rather than being fixed. Read each clamp() as:
       clamp(floor, ideal-at-this-viewport-height, ceiling)
     The CEILING of each one is the page's original design size, so the landing
     never renders LARGER than it used to; the vh term only shrinks it, and only
     on short viewports where the alternative would be a scrollbar.

     These stay in px on purpose: they must track the viewport, not the
     --type-scale root, or the no-scroll guarantee would depend on the reader's
     browser font setting. Body copy floors at 16px.                          */
  --lp-title:       clamp(30px, 5.2vh, 46px);   /* original 46px */
  --lp-eyebrow:     clamp(16px, 2.7vh, 24px);   /* original 24px */
  --lp-body:        clamp(16px, 2.1vh, 18px);   /* original 18px */
  --lp-explore:     clamp(13px, 1.6vh, 16px);   /* was a 32px heading, now an overline */
  --lp-card:        clamp(15px, 2.4vh, 24px);   /* original 24px */
  --lp-card-icon:   clamp(44px, 5.6vh, 62px);   /* original 62px */

  --lp-gap-header:  clamp(6px,  1.0vh, 12px);   /* title → eyebrow          */
  --lp-gap-sub:     clamp(10px, 1.6vh, 20px);   /* eyebrow → body text      */
  --lp-gap-para:    clamp(8px,  1.4vh, 18px);   /* between body paragraphs  */
  --lp-gap-explore: clamp(12px, 2.0vh, 26px);   /* body text → "Explore"    */
  --lp-gap-cards:   clamp(8px,  1.2vh, 16px);   /* "Explore" → cards, and
                                                   the card grid's own gap  */
  --lp-padding-top: clamp(8px,  1.6vh, 20px);   /* space above the title    */
}


/* ==========================================
   2. BASE
   ========================================== */
html {
  margin: 0;
  padding: 0;
  overflow-y: auto;
  font-size: var(--type-scale);   /* see --type-scale in section 1 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

/* font-size here is not cosmetic: the app runs on Shiny's bundled Bootstrap 3
   (no bslib, no theme=), whose own `body` rule of 14px is what selectize
   controls, sliders, checkboxes and tab labels inherit. Restating it as 1rem
   is what puts those widgets under --type-scale too. */
body {
  background: var(--light-gray);
  color: var(--text-dark);
  font-size: 1rem;
  line-height: 1.6;
}


/* ==========================================
   3. HEADER & NAVIGATION
   ========================================== */

/* ONE SOLID BLUE BAR. Logos left, sections right, everything reversed out in
   white -- the brand's own treatment, and the reason all three partner marks
   are served in white (www/*-blanco.png; the two partner ones are DERIVED from
   the colour files, see the note on .wb-logo). Under --bp-nav the four sections
   collapse into a disclosure button (.nav-toggle). */
.header {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--fede-azul);
  z-index: 2000;
  padding: 0;
  box-shadow: none;
  min-height: auto;
  height: auto;
  border-bottom: none;
}

/* On the landing there are no sections to go to yet, so BOTH the nav and the
   button that discloses it are hidden -- a disclosure for an empty menu is a
   control that does nothing. header.js toggles this class. */
.header.header-nav-hidden-on-landing .header-topic-nav,
.header.header-nav-hidden-on-landing .nav-toggle {
  display: none;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: 100%;
  margin: 0 auto;
  padding: 10px var(--page-pad);
  min-height: var(--header-height);
}

/* ROW 1 of the blue band: the three marks, and on narrow screens the sections
   button pushed to the right. */
/* The logo strip is ONE link: the whole banner goes home, so it is a single
   tab stop with a single label rather than three links that all do the same
   thing. It is an <a>, hence the reset of the link defaults. */

.header-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  /* NEVER shrink: when this was allowed to, the nav took the space and drew its
     second row straight over the Uniandes mark. If the row does not fit, the
     answer is the menu, not a squeezed logo strip. */
  flex: 0 0 auto;
  text-decoration: none;
  border-radius: 3px;
}
.header-logos:hover,
.header-logos:focus {
  text-decoration: none;
}
.header-logos:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 4px;
}

/* Shared base for the three partner logos. Heights are tuned PER LOGO below:
   WB is a single-line wordmark with large letters, while CEDE and Fedesarrollo
   are denser stacked marks (multi-line text + tagline), so they run taller to
   keep their wordmarks as readable as the World Bank one.

   The World Bank mark is the stacked lockup, so it runs taller than the two
   wordmarks beside it to match their optical size. */
.header-logo {
  width: auto;
  display: block;
}

/* Logo links (Uniandes, Fedesarrollo) wrap an img; hug it with no extra
   inline space and keep the flex row vertically centered. */
.header-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

/* All three marks are served in WHITE because the header is a solid blue band.
   Fedesarrollo's comes from the kit's vector; the World Bank and Uniandes files
   were supplied as dark-on-transparent artwork and reversed out by repainting
   the colour and KEEPING THE FILE'S OWN ALPHA as the shape -- which is exact,
   unlike deriving a mask from luminance (what the earlier white-boxed files
   needed).

   The World Bank mark is the STACKED lockup, globe over wordmark at 2.21:1, so
   its height is not comparable with the Fedesarrollo wordmark's: it runs taller
   to put its lettering at the same optical size. */
.wb-logo {
  height: 48px;
}

/* The Uniandes file is now cropped to its ink, so the negative margins that
   used to cancel CEDE.png's baked-in blank padding (and the 22 lines of
   arithmetic that derived them) are gone. If the file is ever replaced with a
   padded one, crop it rather than reinstating the margins. */
/* The HORIZONTAL lockup (4.65:1). The stacked one that was tried here reads at
   roughly half the letter size for the same bar height, because it spends the
   height on three text lines instead of spreading them across the width. */
.cede-logo {
  height: 42px;
}

/* 42px, not the 70px the OLD file needed. The kit's current mark is a
   single-line wordmark (5.43:1) where the retired one was a stacked block with
   a tagline (2.09:1); at 70px this one would run 380px wide and dwarf its two
   neighbours. 42px puts its lettering at the same optical size as the World
   Bank wordmark beside it. */
.fede-logo {
  height: 34px;
}

/* SECTIONS MENU (narrow screens only).
   Four labels plus three logos stop fitting under ~1160px (measured); rather
   than let the nav wrap to a second row and push the bar taller on every page,
   it collapses into this disclosure. The button is always in the DOM so
   header.js can wire it once; CSS decides when it is visible. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  color: var(--white);
  padding: 10px 12px;
  cursor: pointer;
}
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
}
.nav-toggle:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}
/* Three bars from three gradient layers, so the button stays one <span>. */
.nav-toggle-bars {
  display: inline-block;
  width: 18px;
  height: 12px;
  background:
    linear-gradient(var(--white), var(--white)) 0 0    / 18px 2px no-repeat,
    linear-gradient(var(--white), var(--white)) 0 5px  / 18px 2px no-repeat,
    linear-gradient(var(--white), var(--white)) 0 10px / 18px 2px no-repeat;
}


.header-logo-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.34);
  flex: 0 0 auto;
}

/* The tabs, to the right of the logo banner on the same blue bar.
   NO border-top and NO wrap: the border was the separator from when this was a
   second header row, and a wrapped nav is the failure mode the header collapses
   to a menu to avoid -- if it does not fit on one line, the menu takes over
   (see the measured breakpoints below), it never silently becomes two rows. */
.header-topic-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

/* Tabs on the blue band. The nav now has a row to itself, so the old
   single-line budget (logos + nav on one line, re-measured at every logo
   change) no longer applies -- the nav can use the full width. White on
   --fede-azul measures 8.1:1; the active tab inverts to blue on white, 7.5:1.
   Square, not rounded: they read as tabs sitting in the band, and the brand's
   own rectangle language has no rounded corners. */
.header-topic-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 22px;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-topic-link:hover,
.header-topic-link:focus {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.header-topic-link.active {
  color: var(--fede-azul);
  background: var(--white);
  box-shadow: none;
  font-weight: 700;
}

.header-topic-link.active:hover,
.header-topic-link.active:focus {
  color: var(--fede-azul);
  background: var(--white);
}

/* This block MUST come after the .header-topic-nav / .header-topic-link rules
   above. A media query adds no specificity, so when it sat before them the base
   `display: flex` won and the panel was permanently open on narrow screens --
   which is exactly what happened the first time it was written. */
@media (max-width: 1160px) {
  .nav-toggle { display: inline-flex; }

  /* The panel drops out of the bar, full width, and keeps the blue: it reads as
     an extension of the header rather than a floating card. */
  .header-topic-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--fede-azul);
    padding: 6px 0 10px;
    box-shadow: 0 12px 24px rgba(1, 13, 43, 0.28);
    z-index: 2100;
  }
  .header-topic-nav.open { display: flex; }
  .header-topic-link {
    justify-content: flex-start;
    padding: 12px var(--page-pad);
    width: 100%;
  }
}

/* The logo row runs out of width before anything else, so it steps down twice
   before the nav collapses. */
/* MEASURED, not guessed: at full size the row needs 1377px -- logos 568 + nav
   701 + the 28px gap + 2x40px of page padding. So the first step down happens
   BEFORE that, not after, and it buys ~220px by shrinking the marks and tightening
   the tabs: logos ~470 + nav ~600 + 24 + 64 = ~1158. Below that the nav collapses
   into the menu (the 1160px block further down). Re-measure all three numbers if
   the nav labels or the logo files change. */
@media (max-width: 1380px) {
  .header-content     { gap: 24px; padding: 8px 32px; }
  .header-logos       { gap: 14px; }
  .wb-logo            { height: 38px; }
  .fede-logo          { height: 26px; }
  .cede-logo          { height: 33px; }
  .header-logo-divider{ height: 30px; }
  .header-topic-nav   { gap: 4px; }
  .header-topic-link  { padding: 10px 12px; font-size: 0.9375rem; }
}

/* Below the nav breakpoint the bar carries the logos and ONE button, so the
   marks can shrink further without the row ever wrapping. */
@media (max-width: 1160px) {
  .header-logos       { gap: 12px; }
  .wb-logo            { height: 34px; }
  .fede-logo          { height: 24px; }
  .cede-logo          { height: 30px; }
  .header-logo-divider{ height: 26px; }
}

/* Phones: three marks and a button are the whole bar. The dividers go -- at this
   size they are noise -- and the button drops its label to an icon. */
@media (max-width: 760px) {
  .header-content     { gap: 12px; padding: 8px 16px; }
  .header-logos       { gap: 10px; min-width: 0; flex-shrink: 1; }
  .wb-logo            { height: 30px; }
  .fede-logo          { height: 21px; }
  .cede-logo          { height: 27px; }
  .header-logo-divider{ display: none; }
  .nav-toggle         { padding: 8px 10px; }
}

@media (max-width: 900px) {
  .header-content {
    gap: 12px;
  }

  .header-topic-nav {
    justify-content: flex-start;
  }

  .header-topic-link {
    white-space: normal;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: center;                  
  background: var(--light-gray);
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}


.nav-menu-center{
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 32px;
  width: fit-content;
  margin: 0 auto 40px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.nav-link {
  color: var(--solid-blue);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  padding: 12px 28px;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-link:hover {
  background: var(--light-gray);
  color: var(--bright-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(8, 27, 253, 0.12);
}

.nav-link.active {
  background: var(--bright-blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(8, 27, 253, 0.3);
}

.nav-card {
  color: var(--solid-blue);
  font-family: var(--font-sans);
  text-decoration: none;
  padding: 20px 26px;
  border-radius: 4px;
  background: var(--white);
  border: 1px solid var(--border-gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 240px;
  max-width: 280px;
  min-height: 260px;
  flex: 1 1 0;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: normal;
  box-shadow: 0 8px 20px rgba(9, 28, 80, 0.08);
  text-transform: none;
}

.nav-card:hover {
  background: var(--fede-caja);
  color: var(--solid-blue);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(8, 27, 253, 0.16);
  border-color: var(--bright-blue);
}

.nav-card.active {
  border-color: var(--bright-blue);
  box-shadow: 0 12px 24px rgba(8, 27, 253, 0.18);
}

.nav-link-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav-link-desc {
  font-size: 1rem;
  font-weight: 500;
  color: var(--solid-blue-60);
  line-height: 1.5;
}

.nav-link-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: var(--solid-blue-60);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.nav-link-cta {
  margin-top: auto;
  display: inline-block;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--solid-blue);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 12px rgba(9, 28, 80, 0.2);
}

.nav-link:hover .nav-link-cta {
  background: var(--bright-blue);
  box-shadow: 0 8px 16px rgba(8, 27, 253, 0.3);
}

/* ==========================================
   4. INTERNAL DASHBOARD NAVIGATION
   ========================================== */

.topic-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 8px;
  background: var(--white);
  border: var(--hairline);
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(9, 28, 80, 0.06);
}

.topic-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 3px;
  color: var(--solid-blue);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.topic-nav-link:hover,
.topic-nav-link:focus {
  color: var(--solid-blue);
  background: var(--fede-caja);
  text-decoration: none;
}

.topic-nav-link.active {
  color: var(--white);
  background: var(--solid-blue);
  box-shadow: 0 4px 10px rgba(9, 28, 80, 0.18);
}

.topic-nav-link.active:hover,
.topic-nav-link.active:focus {
  color: var(--white);
  background: var(--solid-blue);
}

.topic-nav-home {
  border: 1px solid rgba(9, 28, 80, 0.16);
}

.topic-template-page {
  background: var(--white);
  border: var(--hairline);
  border-radius: 4px;
  padding: 24px;
}

.topic-template-header {
  max-width: 900px;
  padding-bottom: 18px;
  border-bottom: var(--hairline);
}

.topic-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--fede-caja);
  color: var(--solid-blue);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.under-construction-panel {
  max-width: 760px;
  margin-top: 28px;
  padding: 20px 0 8px;
}

.under-construction-panel h2 {
  margin: 0 0 8px;
  color: var(--solid-blue);
  font-size: 1.625rem;
  font-weight: 700;
}

.under-construction-panel p {
  margin: 0;
  color: var(--solid-blue-60);
  font-size: 1rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .topic-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .topic-nav-link {
    justify-content: flex-start;
    white-space: normal;
  }

  .topic-template-page {
    padding: 18px;
  }
}


/* ==========================================
   5. HERO BANNER
   ========================================== */
.hero-banner {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, 
    var(--solid-blue) 0%, 
    var(--solid-blue-60) 50%, 
    rgba(8, 27, 253, 0.3) 100%);
  border-radius: 4px;
  margin-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: none;
}

/* ==========================================
   6. MAIN CONTAINERS
   ========================================== */
/* Full width on purpose: this used to be capped at --page-max, which left
   ~1100px unused on a 2560px monitor. The horizontal padding matches the
   header's, so the logos and the dashboard content share a left edge. The
   landing is unaffected — .landing-container keeps its own cap (section 7). */
.main-content {
  width: 100%;
  padding: 40px var(--page-pad);
}

/* ── FULL-HEIGHT SHELL ─────────────────────────────────────────────────────
   The landing page must fit one screen without scrolling. Rather than
   subtracting a hard-coded header height (which breaks the moment the logos
   grow or the topic nav wraps to two lines), the whole shell becomes a flex
   column and the landing pane simply takes whatever height is left over.

   The chain is: body > .container-fluid (from fluidPage) > .main-content >
   .tabbable > .tab-content > .tab-pane. Only the LANDING pane opts into
   flex; the content pane keeps Bootstrap's block flow.

   Do NOT add `overflow: hidden` anywhere in this chain — under browser zoom
   the page must still scroll (WCAG 1.4.4 / 1.4.12).                      */
body > .container-fluid {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.main-content,
.main-content > .tabbable,
.main-content > .tabbable > .tab-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* `.active` is required: without it this rule would override Bootstrap's
   `.tab-pane { display: none }` and show the landing on every tab. */
.tab-pane.active[data-value="landing"] {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  /* NO blue field and NO decorative rings here. They were tried and dropped:
     a full-bleed saturated field behind a page people read for minutes is a
     poster treatment, and the rings competed with the only illustration the
     page has. The brand lives in the header band, the type and the accents;
     the reading surface stays quiet. */
  padding: clamp(10px, 2.2vh, 28px) clamp(16px, 3.4vw, 56px) 0;
}

/* Footer sits at the bottom of the leftover space instead of 80px below
   the content (see .footer { margin-top: 80px } in section 12). */
.tab-pane.active[data-value="landing"] > .footer {
  margin-top: auto;
  background: transparent;
}

/* Trim the shell's vertical padding on the landing only. The horizontal
   padding goes to 0 here because .landing-container carries its own. */
/* ZERO padding here, and the blue frame is padded INSIDE the pane instead (see
   .tab-pane.active[data-value="landing"]). With the padding on this element the
   gap above the card showed .main-content's own light surface -- a pale strip
   between the header and the blue field. */
.main-content:has(> .tabbable > .tab-content > .tab-pane.active[data-value="landing"]) {
  padding: 0;
}

.page-section {
  min-height: calc(100vh - 200px);
  padding: 40px 0;
}

.page-section .container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

/* ============================================================
   7. LANDING PAGE
   ============================================================
   Layout structure — ONE row, sized to fit one screen:
     .landing-container
       ├─ .landing-left-col   (photo)
       └─ .landing-right-col  (title + eyebrow + body
                               + "Explore" + the 4 topic cards, 2×2)

   Type sizes and spacing come from the --lp-* clamp() tokens in :root at
   the top of the file — that is the single place to retune the fit. The
   full-height flex shell that gives this section its available height is
   in section 6 (FULL-HEIGHT SHELL).

   The "no scrolling" guarantee holds from ~800px of viewport height and
   above at widths ≥900px. Below 900px the photo stacks above the text, so
   the page scrolls normally — that is intentional, not a regression.
   Design reference: landing_page_design.html
   ============================================================ */

/* Width matters as much as height here: every extra 100px of text column
   removes a wrapped line from the paragraphs, which is the cheapest vertical
   space on the page. But unlike the header and the dashboards -- which run
   edge to edge -- the landing keeps a cap (--page-max) and stays centred: its
   two paragraphs would otherwise stretch to 200-character lines on a wide
   monitor. Do not put a max-width back on .landing-right-col, though; the cap
   belongs here, on the row. */
.landing-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: clamp(24px, 3vw, 60px);        /* ← horizontal gap between photo and text */
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--lp-padding-top) var(--page-pad) var(--lp-gap-sub);
  flex: 0 0 auto;                     /* natural height; slack goes to the footer */
  /* THE WHITE CARD. Square corners on purpose: the banner's card is a plain
     rectangle (a TikZ node with no `rounded corners`), and the brand's shape
     language has no radius. */
  background: var(--white);
  border-radius: 0;
}

/* LEFT COLUMN — photo
   To resize the photo column: change the last value of flex (currently 414px).
   To change the photo:        change url() in .landing-image-box below.       */
.landing-left-col {
  flex: 0 0 clamp(300px, 27vw, 460px);  /* ← photo column width                 */
  align-self: stretch;               /* column stretches to match text height   */
  padding-top: 16px;                 /* nudge: aligns photo top with title ink  */
}

/* PHOTO BOX
   background-image    → swap url() to change the photo
   background-position → 'center' shows the middle; 'top' shows the top, etc.
   border-radius       → corner roundness of the photo frame (px)              */
.landing-image-box {
  width: 100%;
  height: 100%;
  /* The photo reduced to ONE INK ON THE BRAND BLUE: its brightness is treated
     as coverage, so the globe prints white and the dark background falls away
     into a flat --fede-azul field -- the same blue as the header band, so the
     image reads as part of the identity rather than as a photograph placed on
     it. Two numbers in the curve do the work: a FLOOR that puts the background
     at exactly zero coverage (otherwise the field is a hazy near-blue instead
     of the brand value), and a CEILING well below white that makes the globe's
     dots saturate to PURE white instead of settling at a bluish grey -- without
     it the mark reads as a faint texture rather than as an image. Built from
     www/landing2.jpeg, which stays as the source; also ~230 KB against the
     original's 3.9 MB, since a 5760x3240 photo was being displayed in a column
     ~460px wide. */
  background-image: url('../img/landing-duotone.jpg');
  background-size: cover;
  background-position: center;
  /* Square, like every other surface in the brand: the card, the chips and the
     nav tabs all lost their radius, and a 20px-rounded photo inside a
     sharp-cornered card was the one thing left rounding. The drop shadow went
     with it -- the banner has no shadows, it separates planes with flat colour. */
  border-radius: 0;
  box-shadow: none;
}

/* RIGHT COLUMN — title, eyebrow, body paragraphs, "Explore" + the card grid.
   Deliberately uncapped: it takes whatever the photo column leaves, so the
   paragraphs wrap into as few lines as the screen allows. Do not put a
   max-width back on it -- that is exactly what left the sides of wide screens
   empty while the text stretched down into a scrollbar. */
.landing-right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
}

.landing-right-col .landing-header-row      { margin-bottom: var(--lp-gap-header); }
.landing-right-col .landing-eyebrow         { margin-bottom: var(--lp-gap-sub); }
.landing-right-col .landing-desc-row        { margin-bottom: 0; }
.landing-right-col .landing-desc-row p      { margin-bottom: var(--lp-gap-para); }
.landing-right-col .landing-desc-row p:last-child { margin-bottom: 0; }
.landing-right-col .landing-desc-row hr     { margin: var(--lp-gap-para) 0; border: none; border-top: var(--hairline); }

/* "Explore" — a compact overline rather than a 32px heading: the four cards
   below it are self-explanatory, and the smaller label buys ~40px of height. */
.landing-explore-label {
  font-size: var(--lp-explore);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fede-azul);
  margin: var(--lp-gap-explore) 0 var(--lp-gap-cards);
  /* The banner underlines its kicker with a short rule; same device here. It is
     an ACCENT, not a separator, so it keeps the brand blue -- but it takes the
     hairline's 1px, because the app draws every line at one width. */
  padding-bottom: 6px;
  border-bottom: 1px solid var(--fede-azul);
  display: inline-block;
}

/* Card grid — 2×2 inside the text column */
.landing-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--lp-gap-cards);
  width: 100%;
}

/* ── CARD DESIGN: unified component (current design)
   The icon and card are ONE visual piece — outer corners rounded,
   inner corners square.
   See landing_page_design.html for alternative designs (square icon
   top-left, icon above text, classic separate card, etc.)

   To change icon width: edit --lp-card-icon in :root (used by BOTH the grid
                         track and .widget-icon's width — they must match).
   To change text size:  edit --lp-card in :root.
   To change corners:    edit border-radius (currently 14px).                    ── */
.landing-cards-grid .landing-widget-grid {
  grid-template-columns: var(--lp-card-icon) 1fr;   /* ← icon | card text */
  gap: 0;
  align-items: stretch;              /* icon stretches to full card height */
}
.landing-cards-grid .widget-icon {
  width: var(--lp-card-icon);        /* ← must match grid-template-columns above */
  height: auto;
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 4px 0 0 14px;      /* rounded left side only */
}
.landing-cards-grid .icon-arrow-mask { width: 48%; height: 48%; }
.landing-cards-grid .widget-card {
  padding: clamp(10px, 1.6vh, 20px) clamp(12px, 1.2vw, 18px);
  border-radius: 0 14px 14px 0;      /* rounded right side only */
  border-left: none;                 /* no gap between icon and card */
  display: flex;
  align-items: center;
}
.landing-cards-grid .widget-card h3 { font-size: var(--lp-card); margin-bottom: 0; line-height: 1.25; }
.landing-cards-grid .widget-card p  { font-size: 1.5rem; }

/* ── RESPONSIVE ──
   Below 900px the photo stacks above the text, so the landing no longer fits
   one screen and scrolls normally. The --lp-* clamps still apply; these media
   queries only override the layout, not the type scale. */

/* Tablet (< 900px): photo stacks above text; cards stay 2 across */
@media (max-width: 900px) {
  .landing-container   { flex-direction: column; gap: 32px; }
  .landing-left-col    { flex: none; width: 100%; align-self: auto; padding-top: 0; }
  .landing-image-box   { height: 320px; }
}

/* Mobile (< 520px): cards → 1 column; tighter padding */
@media (max-width: 520px) {
  .landing-container       { padding: var(--lp-padding-top) 20px 24px; }
  .landing-image-box       { height: 240px; }
  .landing-cards-grid      { grid-template-columns: 1fr; }
}

/* A. HEADER (Welcome | Title) */
.landing-header-row {
  display: grid;
  align-items: start;
  width: 100%;
}


/* The banner's headline is the one place the display serif earns its keep:
   ES Face Regular there, Libre Baskerville here (the kit's own named fallback).
   Weight drops from 800 to 400 because a transitional serif carries emphasis
   through contrast, not through mass -- bolding it closes the counters and
   loses the very thing the face was chosen for. */
.landing-title h1 {
  margin-left: 0px;
  font-weight: 400;
  font-size: var(--lp-title) !important;
  line-height: 1.15;
  color: var(--fede-texto);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  width: 100%;
}
/* The kicker of the banner: uppercase, tracked, in the brand blue. There it is
   PP Neue Machina Bold, which is desktop-licensed; Inter SemiBold with the same
   tracking is the closest thing that can be served. */
.landing-eyebrow {
  margin-left: 0px;
  font-size: var(--lp-eyebrow) !important;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--fede-azul);
  padding-top: 6px;
}

/* B. DESCRIPTION */
.landing-desc-row {
  margin-left: 0px;
}

.landing-desc-row p {
  font-size: var(--lp-body) !important;
  line-height: 1.5;
  color: var(--solid-blue-60);
  margin: 0;
}

.link-blue {
  color: var(--bright-blue);
  text-decoration: underline;
}

/* ==========================================
   C. WIDGET GRID (final design)
   ========================================== */

.landing-widget-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  grid-template-rows: auto;
  grid-template-areas: "icon card";
  gap: 20px;
  column-gap: 0px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
}

.widget-icon {
  grid-area: icon;
  width: 90px; 
  height: 90px;
  background-color: var(--solid-blue); /* dark square background */
  border-radius: 4px;
  display: flex; 
  justify-content: center; 
  align-items: center;
  overflow: hidden;
}

.icon-arrow-mask {
  display: block;
  width: 64px;  /* larger arrow */
  height: 64px;

  /* arrow color */
  background-color: var(--white);

  /* SVG mask application */
  -webkit-mask: url('../img/Flecha-mask.svg') no-repeat center;
  mask: url('../img/Flecha-mask.svg') no-repeat center;
  
  -webkit-mask-size: contain;
  mask-size: contain;
  
  transition: all 0.3s ease;
}

/* Hover effect: colors invert on mouse-over */
.landing-widget-grid:hover .widget-icon {
  background-color: var(--solid-blue);
}

.landing-widget-grid:hover .icon-arrow-mask {
  background-color: var(--white); /* arrow stays white */
  transform: translateX(5px);
}

/* Widget content card */
.widget-card {
  grid-area: card;
  width: 100%;
  background: var(--white);
  border: var(--hairline);
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
  text-decoration: none !important;
  display: flex; 
  flex-direction: column;
  transition: all 0.3s ease;
}

.widget-card h3 {
  color: var(--solid-blue);
  font-size: 2rem;
  margin: 0 0 15px 0;
  line-height: 1.1;
}

.widget-card p {
  color: var(--solid-blue-60);
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0;
}

/* Action button */
.widget-btn {
  grid-area: btn;
  justify-self: start; 
  background-color: var(--solid-blue);
  color: white !important;
  padding: 14px 35px;
  border-radius: 4px;
  font-size:1rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: all 0.3s ease;
}

/* --------------------------------------------------
   INTERACTIVITY (widget hover)
   -------------------------------------------------- */

/* On hover: the whole block shifts together */
.landing-widget-grid:hover {
  transform: translateX(5px);
}

.landing-widget-grid:hover .widget-card {
  box-shadow: 0 20px 40px rgba(9, 28, 80, 0.12);
}

.landing-widget-grid:hover .widget-btn {
  background-color: var(--bright-blue);
  box-shadow: 0 8px 20px rgba(8, 27, 253, 0.3);
}

/* ==========================================
   8. PAGE TITLES
   ========================================== */
.page-title {
  font-family: var(--font-sans);
  font-size: var( --fs-page-title);
  font-weight: 700;
  color: var(--solid-blue);
  margin-bottom: 20px;
  text-align: left;
}

.page-subtitle {
  font-family: var(--font-sans);
  font-size: var( --fs-page-subtitle);
  color: var(--solid-blue-60);
  line-height: 1.8;
  max-width: 800px;
  margin-bottom: 60px;
}

.section-divider {
  font-family: var(--font-sans);
  font-size: var(--fs-section-divider);
  font-weight: 600;
  color: var(--solid-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  text-align: center;
  margin: 60px 0 30px 0;
  padding-bottom: 0;
}

/* ==========================================
   9. TOPIC CARDS (Landing)
   ========================================== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;

  /* clave para que todas puedan estirarse */
  align-items: stretch;
}

@media (max-width: 768px) {
  .topic-grid { grid-template-columns: 1fr; }
}

/* if cards are <a> tags, this prevents them from "shrinking" */
.topic-card {
  display: flex;
  flex-direction: column;

  height: calc(var(--topic-card-band-height) + var(--topic-card-content-height));

  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  cursor: pointer;

  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(9, 28, 80, 0.08);
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(9, 28, 80, 0.18);
  border-color: var(--bright-blue);
}

.topic-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.topic-card.disabled:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(9, 28, 80, 0.08);
  border-color: var(--border-gray);
}

/* Top band of the card (solid color per topic) */
.topic-card-image {
  width: 100%;
  height: var(--topic-card-band-height);

  position: relative;
  overflow: hidden;

  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.topic-card-image::after {
  content: none;
}

/* =========================
   Topic band color (solid brand color per topic)
   ========================= */
/* Four topics, four rules: .firing-img was missing and .btax-img was carrying
   Firing Costs' colour, so Business Taxes had no identity of its own here. */
.topic-card-image.labor-img   { background-color: var(--topic-labor); }
.topic-card-image.minwage-img { background-color: var(--topic-minwage); }
.topic-card-image.firing-img  { background-color: var(--topic-firing); }
.topic-card-image.btax-img    { background-color: var(--topic-btax); }

/* The landing chips. These carry the same four colours through classes rather
   than the inline styles ui.r used to write. */
.widget-icon--labor   { background-color: var(--topic-labor); }
.widget-icon--minwage { background-color: var(--topic-minwage); }
.widget-icon--firing  { background-color: var(--topic-firing); }
.widget-icon--btax    { background-color: var(--topic-btax); }

/* Card body — centered text */
.topic-card-body {
  padding: 22px 22px 26px;

  flex: 0 0 auto;
  height: var(--topic-card-content-height);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  text-align: center;
}

.topic-card-title {
  font-family: var(--font-sans);
  font-size: var(--fs-topic-title);
  font-weight: 700;
  color: var(--solid-blue);
  margin-bottom: 12px;
}

.topic-card-description {
  font-family: var(--font-sans);
  font-size: var(--fs-topic-desc);
  color: var(--solid-blue-60);
  line-height: 1.6;
  margin-bottom: 15px;
}

.topic-card-badge {
  display: inline-block;
  background: var(--light-gray);
  color: var(--solid-blue);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 auto;
}

/* ==========================================
   10. GUIDE PAGE — QUESTIONS LIST
   ========================================== */
.questions-list {
  max-width: 900px;
  margin: 40px 0;
}

.question-item {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-left: 4px solid var(--bright-blue);
  padding: 20px 30px;
  margin-bottom: 15px;
  border-radius: 3px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.question-item:hover {
  background: var(--light-gray);
  transform: translateX(5px);
}

.question-text {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--solid-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================
   10b. ABOUT PAGE — INFO SECTIONS
   ========================================== */
.info-sections {
  max-width: 900px;
}

.info-section {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  padding: 30px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.info-section:hover {
  box-shadow: 0 4px 12px rgba(9, 28, 80, 0.1);
}

.info-section-title {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--solid-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: var(--hairline);
}

.info-section-content {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--solid-blue-60);
  line-height: 1.8;
}

/* ==========================================
   10c. COUNTRY SELECTION PAGE
   ========================================== */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.country-card {
  background: var(--white);
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.country-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(9, 28, 80, 0.15);
  border-color: var(--bright-blue);
}

.country-name {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--solid-blue);
}

/* ==========================================
   11. BUTTONS
   ========================================== */
.btn {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--bright-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--solid-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 27, 253, 0.3);
}

.btn-secondary {
  background: var(--white);
  color: var(--solid-blue);
  border: 2px solid var(--solid-blue);
}

.btn-secondary:hover {
  background: var(--solid-blue);
  color: var(--white);
}

.btn-back {
  background: transparent;
  color: var(--solid-blue);
  padding: 10px 20px;
  margin-bottom: 30px;
  border: 1px solid var(--border-gray);
}

.btn-back:hover {
  background: var(--light-gray);
}

/* ==========================================
   12. FOOTER
   ========================================== */

.footer {
  background: var(--light-gray);
  padding: 14px 40px;
  text-align: left;
  border-top: none;
  margin-top: 80px;
  box-shadow: none;
  clip-path: none;
}

.footer-text {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-dark);
}

.footer p {
  color: var(--text-dark);
}

/* The partner links live here now (the header logos go home instead), so they
   have to read as links without shouting: underlined, in the brand blue rather
   than Bootstrap's default. */
.footer a {
  color: var(--solid-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer a:hover,
.footer a:focus {
  color: var(--solid-blue);
  text-decoration-thickness: 2px;
}

/* ==========================================
   13. RESPONSIVE DESIGN (global)
   ========================================== */
@media (max-width: 768px) {
  .header {
    padding: 10px 20px;
    height: auto;
  }

  .header-content {
    row-gap: 12px;
  }

  /* Logo sizes at this width come from the 1100px / 760px steps above. They
     used to be repeated here at LARGER values, so a 700px window rendered
     bigger marks than an 1000px one. */
  
  .nav-menu {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .page-title {
    font-size: 2rem;
  }
  
  .topics-grid {
    grid-template-columns: 1fr;
  }
  
  .countries-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .main-content {
    padding: 20px;
  }
}

/* ==========================================
   14. UTILITY CLASSES
   ========================================== */
.text-center {
  text-align: center;
}

.mt-40 {
  margin-top: 40px;
}

.mb-40 {
  margin-bottom: 40px;
}

.hidden {
  display: none !important;
}

.router-hidden {
  display: none !important;
}


/* ==========================================
   15. EXPLORE MORE (horizontal cards)
   Works with the existing ui.R structure:
     .landing-card-grid.small > a.landing-card
   ========================================== */

/* Keep the grid from deforming */
.landing-card-grid.small {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}

@media (max-width: 768px) {
  .landing-card-grid.small {
    grid-template-columns: 1fr;
  }
}

/* The card is now horizontal */
.landing-card-grid.small .landing-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;

  width: 100%;
  min-height: 140px;

  background: var(--white);
  border: 1px solid rgba(9, 28, 80, 0.10);
  border-radius: 4px;

  padding: 0;
  text-decoration: none;
  overflow: hidden;

  box-shadow: 0 8px 18px rgba(9, 28, 80, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.landing-card-grid.small .landing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(9, 28, 80, 0.14);
  border-color: rgba(9, 28, 80, 0.18);
}

/* Image on the left */
.landing-card-grid.small .landing-card-image {
  flex: 0 0 132px;
  width: 132px;
  height: 100%;

  border-radius: 4px 0 0 12px;
  overflow: hidden;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Text on the right */
.landing-card-grid.small .landing-card-body {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.landing-card-grid.small .landing-card-body h3 {
  margin: 0 0 6px 0;
  font-size: calc(var(--fs-explore-card-title) - 1pt);
  line-height: 1.1;
  color: var(--solid-blue);
}

.landing-card-grid.small .landing-card-body p {
  margin: 0;
  font-size: calc(var(--fs-explore-card-desc) - 1pt);
  line-height: 1.35;
  color: var(--solid-blue-60);
}

/* ==========================================
   16. EXTRAS — Compact controls
   ==========================================
   Styles for small pill-buttons, styled selects, and compact
   selectors used in the filter panels.
   ========================================== */

/* Horizontal container — always one row */
.horizontal-container {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  width:100%;
  gap:20px;
}


/* ----------------------------------------------------------
   Very small buttons (compact component-btn / pill-button)
-----------------------------------------------------------*/
.component-buttons-container {
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  width:auto;
  align-items:flex-start;
}

.component-wrapper-fixed {
  margin-top: 8px;
  margin-left: 12px;
}

.option2-group {
  margin-left: 0;
}

.option2-group .pill-button {
  padding: 4px 14px !important;
  font-size: 0.9375rem !important;
  min-width: 0;
  width: auto;
  align-self: flex-start;
}

.component-btn {
  padding: 6px 12px !important;
  font-size: 0.875rem !important;
  min-height: 32px !important;
  line-height: 1.2 !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  text-align: left;
  width: auto;
  align-self: flex-start;
}


/* ----------------------------------------------------------
   Very small select (.small-select)
-----------------------------------------------------------*/
.small-select {
  min-width: 50px;
}

/* Label above the select */
.small-select label {
  font-size: 0.8125rem !important;
  margin-bottom: 2px !important;
  display: block !important;
}

/* Text inside the select */
/* The three selectize widget families that used to be skinned here
   (.small-select, .pretty-select, .mw-select) are gone with Shiny. They
   re-styled Bootstrap 3 selectize DOM for `compare_mode` and
   `country_selection`, both of which were HIDDEN inputs kept only so Shiny
   would bind them -- the visible country picker has always been the flag
   row. Recoverable from git if a real <select> is ever needed. */

