/*
 * The state hubs: states/<state>.html, written by
 * build-state-program-pages.js, with their reading list from
 * build-articles.js. Loaded by those six pages only, after styles.css, so
 * the pages that share styles.css carry none of it.
 *
 * Read top to bottom the page goes: the state, its programmes by category,
 * the benefits with no page of their own here, the agencies that decide,
 * the reading list, and when the details were checked.
 */

.state-hub {
  --hub-navy: #0e2747;
  --hub-text: #4b5868;
  --hub-line: #dfe6ef;
  --hub-link: #1a4f9c;
  --hub-focus: #1f5fbf;
  --hub-shadow: 0 1px 2px rgba(14, 44, 76, 0.04);
  --hub-shadow-hover: 0 12px 26px -18px rgba(14, 44, 76, 0.4);
  --hub-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h13M12.4 6.6 17.8 12l-5.4 5.4'/%3E%3C/svg%3E");
  padding-bottom: 24px;
}

/* ---- the state ---------------------------------------------------------- */

.state-hero {
  padding: 24px 0 4px;
  background: linear-gradient(180deg, #eef4fb 0%, rgba(245, 247, 250, 0) 100%);
}
.state-hero__inner { display: grid; gap: 24px; align-items: center; }
.state-hero__title {
  margin: 12px 0;
  font-family: var(--font-body);
  font-size: clamp(1.7rem, 1.25rem + 1.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--hub-navy);
}
.state-hero__lede { max-width: 60ch; margin: 0; font-size: 1.05rem; line-height: 1.55; color: var(--hub-text); }
.state-hero .trust { margin: 18px 0 0; padding: 0; list-style: none; gap: 8px; }
.state-hero .trust li {
  padding: 6px 12px;
  background: var(--sheet);
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  font-size: 0.86rem;
  color: var(--hub-navy);
}
.state-hero .trust svg { color: #23885a; }
.state-hero__note { max-width: 62ch; margin-top: 12px; font-size: 0.86rem; }
.state-hero__media { margin: 0; }
.state-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 18px 40px -28px rgba(14, 44, 76, 0.5);
}

/* ---- a section: the programmes of a category, and the three after them -- */

.state-section { margin-top: 56px; }
.state-section__header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.state-section__title { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.2; color: var(--hub-navy); }
.state-section__intro { max-width: 70ch; margin: 4px 0 0; font-size: 1rem; line-height: 1.5; color: var(--hub-text); }
.state-section__eyebrow,
.state-hub .articles__eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2a66b8;
}
.state-section--more .state-section__title,
.state-section--official .state-section__title,
.state-hub .articles__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.25rem + 1.3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--hub-navy);
}
.state-section--more .state-section__intro,
.state-section--official .state-section__intro { margin-top: 8px; }

/* The category's mark: the home page's glyph for it, in a soft circle. */
.state-section__icon,
.state-more__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cat-wash);
}
.state-section__icon svg,
.state-more__icon svg { width: 28px; height: 28px; fill: var(--cat-ink); }
.state-hub .g-soft { fill: var(--cat-soft); }
.state-hub .g-fill { fill: #fff; }
.state-hub .g-line { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.state-hub .g-line--ink { stroke: var(--cat-ink); stroke-width: 3.4; }
.state-hub .g-text { fill: #fff; font-family: var(--font-body); font-size: 10.5px; font-weight: 600; }

/* Soft, one colour per category, for recognition only. */
.state-section--health-insurance, .state-more__card--health-insurance { --cat-wash: #e6f4ec; --cat-ink: #23885a; --cat-soft: #8fd0ae; }
.state-section--food-family, .state-more__card--food-family { --cat-wash: #e2f3f1; --cat-ink: #128078; --cat-soft: #86cdc6; }
.state-section--employment-income, .state-more__card--work-income { --cat-wash: #ebeafb; --cat-ink: #5546c2; --cat-soft: #aea6ec; }
.state-section--housing-utilities, .state-more__card--housing-utilities { --cat-wash: #fdf1dc; --cat-ink: #c27a12; --cat-soft: #f1c983; }
.state-section--tax-benefits, .state-more__card--tax-benefits { --cat-wash: #f1e8fb; --cat-ink: #7a45c2; --cat-soft: #c7a8ee; }
.state-more__card--social-security { --cat-wash: #e5eefb; --cat-ink: #2563c4; --cat-soft: #93b8ef; }

/* ---- a programme card: what it is, what it does, where it goes --------- */

.state-tool-grid { display: grid; gap: 16px; }
.state-tool-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  grid-template-areas: "body" "foot";
  column-gap: 20px;
  padding: 20px 20px 0;
  background: var(--sheet);
  border: 1px solid var(--hub-line);
  border-radius: 12px;
  box-shadow: var(--hub-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.state-tool-card:hover { border-color: #b9cbe2; box-shadow: var(--hub-shadow-hover); }
.state-tool-card__body { grid-area: body; }
.state-tool-card__badge-row { margin-bottom: 10px; }
.state-tool-card__title { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.3; color: var(--hub-navy); }
.state-tool-card__desc { margin: 6px 0 16px; font-size: 0.95rem; line-height: 1.5; color: var(--hub-text); }
.state-tool-card__img { grid-area: img; display: none; }
.state-tool-card__foot {
  grid-area: foot;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  padding-top: 4px;
  border-top: 1px solid var(--hub-line);
}
.state-tool-card__outcome { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #5b6878; }
.state-tool-card__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
  white-space: nowrap;
  font-weight: 700;
  color: var(--hub-link);
  text-decoration: none;
}
/* The whole card is the link's target; the words stay the link's name. */
.state-tool-card__link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.state-tool-card:hover .state-tool-card__link { text-decoration: underline; text-underline-offset: 3px; }
.state-tool-card__link:focus-visible { outline: none; }
.state-tool-card__link:focus-visible::after { outline: 3px solid var(--hub-focus); outline-offset: 2px; }

/* ---- the benefits with no page of their own in this state -------------- */

.state-more { display: grid; gap: 16px; }
.state-more__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 20px;
  background: var(--sheet);
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  box-shadow: var(--hub-shadow);
}
.state-more__about { display: flex; align-items: flex-start; gap: 16px; }
.state-more__title { margin: 6px 0 4px; font-size: 1.2rem; font-weight: 700; line-height: 1.25; color: var(--hub-navy); }
.state-more__desc { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--hub-text); }
.state-more__links { margin: 0; padding: 0; list-style: none; }
.state-more__links li + li { border-top: 1px solid var(--hub-line); }
.state-more__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 4px;
  font-weight: 600;
  color: var(--hub-navy);
  text-decoration: none;
}
.state-more__link:hover { color: var(--hub-link); }
.state-more__link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.state-more__link:focus-visible { outline: 3px solid var(--hub-focus); outline-offset: 1px; border-radius: 6px; }
.state-more__arrow { flex: none; width: 20px; height: 20px; }
.state-more__img { display: none; }

/* ---- the agencies ------------------------------------------------------- */

.state-resources-grid { display: grid; gap: 16px; }
.state-resource-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 20px;
  background: var(--sheet);
  border: 1px solid #d3e0f0;
  border-radius: 12px;
  box-shadow: var(--hub-shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.state-resource-card:hover { border-color: #9fbbe0; box-shadow: var(--hub-shadow-hover); }
.state-resource-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--res-wash);
  color: var(--res-ink);
}
.state-resource-card__svg { width: 24px; height: 24px; }
.state-resource-card--doc { --res-wash: #e5eefb; --res-ink: #2563c4; }
.state-resource-card--briefcase { --res-wash: #ebeafb; --res-ink: #5546c2; }
.state-resource-card--heart { --res-wash: #e6f4ec; --res-ink: #23885a; }
.state-resource-card--family, .state-resource-card--home { --res-wash: #fdf1dc; --res-ink: #b46f0c; }
.state-resource-card--bottle { --res-wash: #e2f3f1; --res-ink: #128078; }
.state-resource-card--flame { --res-wash: #fde9e2; --res-ink: #c4501d; }
.state-resource-card__title { margin: 2px 0 6px; font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.state-resource-card__title a { color: var(--hub-navy); text-decoration: none; }
.state-resource-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.state-resource-card:hover .state-resource-card__title a { text-decoration: underline; text-underline-offset: 3px; }
.state-resource-card__title a:focus-visible { outline: none; }
.state-resource-card__title a:focus-visible::after { outline: 3px solid var(--hub-focus); outline-offset: 2px; }
.state-resource-card__sub { display: block; margin-top: 2px; font-size: 0.92rem; font-weight: 600; color: var(--hub-link); }
.state-resource-card__desc { margin: 0; font-size: 0.93rem; line-height: 1.5; color: var(--hub-text); }
.state-resource-card__arrow { width: 20px; height: 20px; margin-top: 4px; color: var(--hub-navy); }

/* ---- the reading list (build-articles.js) ------------------------------- */

.state-hub .articles { margin-top: 56px; padding: 0; }
.articles__head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.articles__intro { max-width: 70ch; margin: 8px 0 0; font-size: 1rem; line-height: 1.5; color: var(--hub-text); }
.state-hub .articles__all { margin: 0; }
.state-hub .articles__all a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  background: var(--sheet);
  border: 1px solid #9fbbe0;
  border-radius: 999px;
  font-weight: 600;
  color: var(--hub-link);
  text-decoration: none;
}
.state-hub .articles__all a::after,
.state-hub .articles__item::after {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--hub-arrow) center / contain no-repeat;
  mask: var(--hub-arrow) center / contain no-repeat;
}
.state-hub .articles__all a:hover { background: #eef4fc; }
.state-hub .articles__all a:focus-visible { outline: 3px solid var(--hub-focus); outline-offset: 2px; }
.state-hub .articles__list { margin: 0; padding: 4px 20px; list-style: none; background: var(--sheet); border: 1px solid var(--hub-line); border-radius: 12px; }
.state-hub .articles__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 14px 0;
  border: 0;
  color: var(--hub-navy);
}
.state-hub .articles__item + .articles__item { border-top: 1px solid var(--hub-line); }
.state-hub .articles__item::after { grid-column: 2; grid-row: 1 / span 2; }
.state-hub .articles__tag {
  justify-self: start;
  padding: 4px 10px;
  background: var(--tag-wash, #eef2f7);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tag-ink, #4b5868);
}
.state-hub .articles__link {
  grid-column: 1;
  min-height: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--hub-navy);
  text-decoration: none;
}
.state-hub .articles__link::after { content: ""; position: absolute; inset: 0; }
.state-hub .articles__item:hover .articles__link { color: var(--hub-link); text-decoration: underline; text-underline-offset: 3px; }
.state-hub .articles__link:focus-visible { outline: none; }
.state-hub .articles__link:focus-visible::after { outline: 3px solid var(--hub-focus); outline-offset: 2px; border-radius: 8px; }
.articles__tag[data-i18n="navGroupFoodFamily"] { --tag-wash: #e3f4e9; --tag-ink: #1d6f43; }
.articles__tag[data-i18n="navGroupWorkIncome"] { --tag-wash: #ecebfb; --tag-ink: #4a3db0; }
.articles__tag[data-i18n="navGroupHousingUtilities"] { --tag-wash: #fdf1dc; --tag-ink: #8a5508; }
.articles__tag[data-i18n="navGroupHealthInsurance"] { --tag-wash: #e6f4ec; --tag-ink: #1d6f43; }
.articles__tag[data-i18n="navGroupTaxBenefits"] { --tag-wash: #f1e8fb; --tag-ink: #6a37b0; }
.articles__tag[data-i18n="navGroupSocialSecurity"] { --tag-wash: #e5eefb; --tag-ink: #1f55aa; }

/* ---- when the details were checked: a quiet line, last ------------------ */

.state-hub .state-updated { margin-top: 40px; padding: 0 0 8px; }
.state-hub .state-updated p { font-size: 0.82rem; line-height: 1.5; color: #5b6878; }

/* ---- wider ---------------------------------------------------------------- */

@media (min-width: 600px) {
  .state-hero__media img { aspect-ratio: 3 / 1; }
  .state-tool-card { grid-template-columns: minmax(0, 1fr) 132px; grid-template-areas: "body img" "foot foot"; }
  .state-tool-card__img {
    display: block;
    width: 132px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
  }
  .state-tool-grid--single .state-tool-card { grid-template-columns: minmax(0, 1fr) 240px; }
  .state-tool-grid--single .state-tool-card__img { width: 240px; height: 120px; }
}

@media (min-width: 768px) {
  .state-more__card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 0 28px; padding: 22px 26px; }
  .state-more__links { padding-left: 26px; border-left: 1px solid var(--hub-line); }
  .articles__head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .state-hub .articles__all { flex: none; }
  .state-hub .articles__item { grid-template-columns: 190px minmax(0, 1fr) auto; }
  .state-hub .articles__item::after { grid-column: 3; grid-row: 1; }
  .state-hub .articles__link { grid-column: 2; padding-left: 16px; border-left: 1px solid var(--hub-line); }
}

/* The home banner's proportions: the words on the left half, the state's
   photograph filling the right of the band from top to bottom, out to the
   window's edge, and fading into the band on its left. It is 48% of the
   shell plus the margin beyond it, and never wider than 760px, so the 640px
   picture is not stretched past what it can carry. */
@media (min-width: 900px) {
  .state-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 340px;
    padding: 36px 0;
    overflow: hidden;
    background: #eef4fb;
  }
  .state-hero__inner { display: block; width: 100%; }
  .state-hero__text { position: relative; z-index: 1; max-width: 52%; }
  .state-hero__media {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(760px, calc(min(100vw, var(--shell)) * 0.48 + max(0px, (100vw - var(--shell)) / 2)));
  }
  .state-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #eef4fb 0%, rgba(238, 244, 251, 0.85) 8%, rgba(238, 244, 251, 0) 32%);
  }
  .state-hero__media img { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .state-section { margin-top: 72px; }
  .state-hero + .shell > .state-section:first-child { margin-top: 48px; }
  .state-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .state-tool-grid--single { grid-template-columns: minmax(0, 1fr); }
  .state-resources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .state-hub .articles { margin-top: 72px; }
}

@media (min-width: 1100px) {
  .state-tool-card { padding: 22px 24px 0; grid-template-columns: minmax(0, 1fr) 156px; }
  .state-tool-card__img { width: 156px; height: 116px; }
  .state-tool-grid--single .state-tool-card { grid-template-columns: minmax(0, 1fr) 300px; }
  .state-tool-grid--single .state-tool-card__img { width: 300px; height: 132px; }
  .state-more__card { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 260px; padding: 8px 8px 8px 28px; }
  .state-more__img {
    display: block;
    align-self: stretch;
    width: 260px;
    height: 100%;
    min-height: 140px;
    object-fit: cover;
    border-radius: 10px;
  }
}

/* A state whose programmes are still being added says so in a card. */
.state-notice-card {
  padding: 24px;
  background: var(--sheet);
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--hub-text);
}
