/* MOCK ONLY: light-mode top banner of waving red and white stripes behind the logo and menu. Loaded only by flag-mockup.html. */
html, body { overflow-x: clip; }
.flag-band { display: none; }
[data-theme="light"] body { border-top: 0; }

:root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side {
  position: relative; isolation: isolate; overflow: visible; flex: none; border: 0; min-height: 0; height: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: ". mark tools" "nav nav nav";
  align-items: center; row-gap: .8rem; padding: 1rem 0 1.1rem;
}
/* the banner, full width behind the header */
[data-theme="light"] .flag-band {
  display: block; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  overflow: hidden; background: #B22234;
  box-shadow: inset 0 -10px 18px -12px rgba(0,0,0,.45), inset 0 10px 18px -12px rgba(0,0,0,.35);
}
[data-theme="light"] .flag-svg { display: block; height: 100%; width: 5120px; animation: flag-drift 14s linear infinite; }
@keyframes flag-drift { to { transform: translateX(-640px); } }
@media (prefers-reduced-motion: reduce) { [data-theme="light"] .flag-svg { animation: none; } }

/* logo on a white plate, centred */
[data-theme="light"] .side > .mark { grid-area: mark; justify-self: center; margin: 0; background: #fff; padding: .35rem .9rem .4rem; border-radius: 8px; box-shadow: 0 3px 12px rgba(0,0,0,.3); }
/* X and the switch at the right */
[data-theme="light"] .side > .x-link, [data-theme="light"] .side > .toggle { grid-row: 1; margin: 0; position: static; transform: none; white-space: nowrap; box-shadow: 0 3px 12px rgba(0,0,0,.3); }
[data-theme="light"] .side > .x-link { grid-column: 3; justify-self: end; margin-right: 6.6rem; }
[data-theme="light"] .side > .toggle { grid-column: 3; justify-self: end; background: #fff; border-radius: 999px; padding: .3rem .4rem .3rem .8rem; }

/* tabs: solid navy buttons, the current page is white */
[data-theme="light"] .side nav { grid-area: nav; min-height: 0; flex: none; }
[data-theme="light"] .side nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin: 0; padding: 0; }
[data-theme="light"] .side nav li, [data-theme="light"] .side nav li:first-child { border: 0; }
[data-theme="light"] .side nav a, [data-theme="light"] .side nav a:hover {
  display: block; padding: .55rem 1.15rem; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; font-size: 1rem;
  line-height: 1.2; text-align: center; white-space: nowrap; text-decoration: none; border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
[data-theme="light"] .side nav a:hover { background: #3A4A75; }
[data-theme="light"] .side nav a[aria-current="page"] { background: #fff; color: var(--navy); border-color: #fff; }
[data-theme="light"] .side nav a[aria-current="page"]::before { display: none; }

/* below 1100: shorter X label, and the header gets side padding */
@media (max-width: 1099px) {
  :root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side { padding-left: 1rem; padding-right: 1rem; }
  [data-theme="light"] .side > .x-link { font-size: 0; padding: .5rem .8rem; margin-right: 6.3rem; }
  [data-theme="light"] .side > .x-link::after { content: "Follow on X"; font-size: .85rem; }
}
/* phones: logo left, X and switch right; tabs as an even 3 x 2 grid */
@media (max-width: 699px) {
  :root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side {
    grid-template-columns: auto 1fr auto; grid-template-areas: "mark . tools" "nav nav nav"; column-gap: .4rem; row-gap: .7rem; padding: .75rem .75rem .9rem; }
  [data-theme="light"] .side > .mark { justify-self: start; font-size: 1.05rem; padding: .3rem .6rem; }
  [data-theme="light"] .side > .x-link { grid-column: 2; margin: 0; padding: .45rem .65rem; }
  [data-theme="light"] .side > .x-link::after { font-size: .78rem; }
  [data-theme="light"] .side > .toggle { padding: .3rem; }
  [data-theme="light"] .side > .toggle #toggleLabel { display: none; }
  [data-theme="light"] .side nav ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  [data-theme="light"] .side nav a, [data-theme="light"] .side nav a:hover { padding: .55rem .25rem; font-size: clamp(.72rem, 3.3vw, .9rem); }
}

/* ---- wide screens: one-row header (logo left, tabs centred, X and the switch right) ---- */
@media (min-width: 1440px) {
  :root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side {
    grid-template-columns: 1fr auto 1fr; grid-template-areas: "mark nav tools"; padding: 1.1rem 0; }
  [data-theme="light"] .side > .mark { justify-self: start; }
  [data-theme="light"] .side nav { grid-area: nav; }
  [data-theme="light"] .side > .x-link { grid-area: tools; justify-self: end; margin-right: 6.9rem; }
  [data-theme="light"] .side > .toggle { grid-area: tools; justify-self: end; }
}

/* ---- Home on wide screens: use the whole width; News on the left, story and tracker in the middle, Immigration info on the right ---- */
@media (min-width: 1280px) {
  [data-theme="light"] .shell, [data-theme="light"] [data-page="home"] .shell { max-width: none; padding-left: clamp(1.5rem, 3.5vw, 5rem); padding-right: clamp(1.5rem, 3.5vw, 5rem); }
  [data-theme="light"] [data-page="home"] .shell { grid-template-columns: minmax(19rem, 21%) minmax(0, 1fr) minmax(19rem, 21%); column-gap: clamp(2rem, 3vw, 4rem); }
  [data-theme="light"] [data-page="home"] .page > [data-widget="main-story"] { grid-column: 2; grid-row: 2; }
  [data-theme="light"] [data-page="home"] .page > #tracker { grid-column: 2; grid-row: 3; }
  [data-theme="light"] [data-page="home"] .page > .home-news { grid-column: 1; grid-row: 2 / span 3; align-self: start; margin-top: 1.5rem; }
  [data-theme="light"] [data-page="home"] .page > .home-aside { grid-column: 3; grid-row: 2 / span 3; align-self: start; margin-top: 1.5rem; }
}
@media (min-width: 1280px) { [data-theme="light"] [data-page="home"] .tracker-map { height: clamp(24rem, 34vw, 38rem); } }
/* "Our story" with a solid, filled arrow (inline-block so the underline doesn't run through it) */
.banner-link .arr-full { display: inline-block; width: 1.35em; height: .9em; margin-right: .45em; vertical-align: -.08em; transition: transform .15s ease; }
.banner-link:hover .arr-full { transform: translateX(3px); }
/* every other page: centred in the window, at a comfortable reading width (wide pages get more room) */
@media (min-width: 900px) {
  [data-theme="light"] .shell > main, [data-theme="light"] .shell > .page { min-width: 0; }
  [data-theme="light"] .page:not(.page-home) { width: 100%; max-width: 50rem; margin-inline: auto; justify-self: center; }
  [data-theme="light"] .page.wide:not(.page-home) { max-width: 76rem; }
  [data-theme="light"] .page:not(.page-home) > * { max-width: none; }
  [data-theme="light"] .page:not(.page-home) > p, [data-theme="light"] .page:not(.page-home) > ul > li, [data-theme="light"] .page:not(.page-home) > ol > li { font-size: 1.08rem; }
}

/* ---- header row: logo at the left with the X button (full handle) beside it; the light/dark switch at the right ---- */
@media (min-width: 700px) {
  :root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side {
    grid-template-columns: auto auto 1fr auto; grid-template-areas: "mark x . toggle" "nav nav nav nav"; column-gap: .8rem;
    padding-left: clamp(1rem, 2.5vw, 2.5rem); padding-right: clamp(1rem, 2.5vw, 2.5rem); }
  [data-theme="light"] .side > .mark { grid-area: mark; justify-self: start; }
  [data-theme="light"] .side > .toggle { grid-area: toggle; justify-self: end; }
  [data-theme="light"] .side > .x-link { grid-area: x; justify-self: start; margin: 0; font-size: .9rem; padding: .5rem .9rem; }
  [data-theme="light"] .side > .x-link::after { content: none; }
}
@media (min-width: 1440px) {
  :root[data-theme="light"] body .side, :root[data-theme="light"] body [data-page] .side {
    grid-template-columns: auto auto 1fr auto; grid-template-areas: "mark x nav toggle"; }
  [data-theme="light"] .side nav { grid-area: nav; }
}
/* phones: the handle alone */
@media (max-width: 699px) {
  [data-theme="light"] .side > .x-link::after { content: "@nomoreh1bs_com"; }
}

/* Join ICE (and the certification button under it): the same solid, filled arrow as "Our story" on the Outsourced banner, in front of the words */
[data-theme="light"] .btn.btn-cta::after { content: none; }
[data-theme="light"] .btn.btn-cta::before {
  content: ""; display: inline-block; flex: none; width: 1.35em; height: .9em; margin-right: -.1em; background: currentColor; transition: transform .15s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M1 5.5h13V1l9 7-9 7v-4.5H1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M1 5.5h13V1l9 7-9 7v-4.5H1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-theme="light"] .btn.btn-cta:hover::before { transform: translateX(3px); }
/* "Read our comment" (blue; grey btn-soon while there is nothing to read): the same filled arrow and size as the red button */
[data-theme="light"] .btn.btn-read { display: inline-flex; align-items: center; padding: .9rem 1.9rem; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase; }
[data-theme="light"] .btn.btn-soon::after, [data-theme="light"] .btn.btn-read::after { content: none; }
[data-theme="light"] .btn.btn-read:hover::before { transform: translateX(3px); }
[data-theme="light"] .btn.btn-soon::before, [data-theme="light"] .btn.btn-read::before {
  content: ""; display: inline-block; flex: none; width: 1.35em; height: .9em; margin-right: -.1em; background: currentColor; transition: transform .15s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M1 5.5h13V1l9 7-9 7v-4.5H1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M1 5.5h13V1l9 7-9 7v-4.5H1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Take Action: the two comment buttons fit side by side on desktop (they still stack on phones) */
[data-theme="light"] .cta-pair { gap: 1.6rem; }
[data-theme="light"] .cta-pair .btn.btn-cta, [data-theme="light"] .cta-pair .btn.btn-read, [data-theme="light"] .cta-pair .btn.btn-soon { padding: .9rem 1.3rem; letter-spacing: .04em; white-space: nowrap; }
/* Take Action: one block per open rule */
.cmt { padding: 1.1rem 0 .4rem; border-top: 1px solid rgba(46,59,94,.15); }
.cmt:first-child { border-top: 0; padding-top: .2rem; }
.cmt h3 { margin: 0 0 .3rem; }
.cmt-meta { margin: 0 0 .5rem; font-size: .92rem; color: #4B5563; }
.cmt-prev { margin: 1rem 0 0; font-weight: 700; }
.cmt-table { width: 100%; border-collapse: collapse; }
.cmt-table th, .cmt-table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid rgba(46,59,94,.18); vertical-align: top; }
.cmt-table small { color: #6B7280; }
/* our position on each rule, next to its title */
.stance { display: inline-block; vertical-align: .15em; margin-left: .5rem; padding: .18rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: #fff; }
.stance-yes { background: #15803D; }
.stance-no { background: #C8102E; }
