/* ==========================================================================
   State pages (.state-page) and the states overview (.states-page).
   Everything is scoped under those two wrappers on <main>, so nothing here reaches the header or footer.
   Values are the computed styles of the old templates (theme-redo/audit/baseline); approved changes:
   1300px container, one green (--c-green, --c-green-on-dark on navy/black), #555 for small grey text.
   ========================================================================== */

.state-page,
.states-page {
  --st-light: #f4f6f8;
  --st-text: #333;
  --st-heading: #222;
  --st-on-dark: #f5f5f5;
  --st-tint: color-mix(in srgb, var(--c-green-on-dark) 8%, transparent);
  font-weight: 600;
}

/* ---------- State page: shared type ---------- */
.state-page { line-height: 1.7; color: var(--st-on-dark); background: var(--c-navy-deep); }
.state-page :is(h1, h2, h3) { font-family: var(--f-head); font-weight: 700; line-height: 1.3; margin: 8px 0 16px; }
.state-page h2 { font-size: 32px; text-transform: uppercase; color: var(--c-heading); }
.state-page p { margin: 0 0 24px; color: var(--c-muted-on-dark); }
.state-page ul[role="list"] { list-style: none; margin: 0; padding: 0; }
.state-section { padding: 100px 0; }

/* Two-line call button */
.state-page .state-call { display: flex; flex-direction: column; justify-content: center; gap: 0; width: 200px; max-width: 100%; margin-inline: auto; transition: background-color .3s, transform .3s; }
.state-page .state-call:hover { transform: translateY(-2px); }
.state-call__label { font-size: 14px; text-transform: uppercase; margin-bottom: 5px; }
.state-call__number { font-size: 16px; font-weight: 700; }

/* ---------- Hero ---------- */
.state-hero,
.states-hero { position: relative; display: flex; align-items: center; text-align: center; background: var(--c-navy-deep); overflow: hidden; }
/* The class lands on the <img>, or on the <picture> Imagify wraps around it when it serves WebP. Both are covered. */
.state-hero__bg,
.states-hero__bg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
:is(.state-hero__bg, .states-hero__bg):is(img),
:is(.state-hero__bg, .states-hero__bg) img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; }
.state-hero::before,
.states-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(color-mix(in srgb, var(--c-navy-deep) 90%, transparent), color-mix(in srgb, var(--c-navy-deep) 80%, transparent));
}
.state-hero > .container,
.states-hero > .container { position: relative; z-index: 2; }
.state-hero { min-height: 70vh; padding: 80px 0; }
.state-hero__content { max-width: 800px; margin: 0 auto; }
.state-hero h1 { font-size: 75px; color: var(--c-white); margin: 8px 0 0; }
.state-page .state-hero__updated { margin: 0 0 15px; color: var(--st-on-dark); }
.state-page .state-hero__text { font-size: 20px; color: #ddd; margin-bottom: 32px; }

/* ---------- Market intro ---------- */
.state-intro { background: var(--c-white); color: var(--st-text); }
.state-intro h2 { color: var(--st-heading); margin-bottom: 30px; }
.state-intro__body { max-width: 900px; margin: 0 auto; }
.state-intro__body p { font-size: 17.6px; line-height: 1.8; color: var(--c-muted); margin: 0 auto 25px; }
.state-intro__body a { color: var(--c-green); }

/* ---------- Services ---------- */
.state-services { background: var(--c-navy); }
.state-services h2 { color: var(--c-white); }
.state-services__head { margin-bottom: 60px; }
.state-service { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-bottom: 80px; align-items: start; }
.state-service:last-child { margin-bottom: 0; }
/* The header block is the first child, so the first service is "even": image left, text right. */
.state-service:nth-child(even) .state-service__text { order: 2; }
.state-service:nth-child(even) .state-service__img { order: 1; }
.state-service h3 { font-size: 32px; color: var(--c-green-on-dark); margin-bottom: 10px; }
.state-page .state-service__sub { font-family: var(--f-head); font-size: 20.8px; font-weight: 400; line-height: 1.3; text-transform: uppercase; color: var(--c-white); margin: 8px 0 20px; }

/* Expander: 200px collapsed with a fade into the section colour; state.js opens it to its full height. */
.state-service__clip { position: relative; overflow: hidden; max-height: 200px; transition: max-height .5s ease-out; }
.state-service__clip::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 80px; pointer-events: none; opacity: 1; transition: opacity .4s ease;
  background: linear-gradient(to bottom, transparent, var(--c-navy));
}
.state-service__clip.is-open::after { opacity: 0; }
.state-service__clip.is-short { max-height: none; }
.state-service__clip.is-short::after { content: none; }
.state-service__more {
  display: inline-block; margin-top: 15px; padding: 0; background: none; border: 0;
  font-family: var(--f-body); font-size: 18px; font-weight: 400; line-height: 1.5; color: var(--c-white);
}
.state-service__more[hidden] { display: none; }
.state-service__more i { margin-left: 5px; transition: transform .3s; }
.state-service__more[aria-expanded="true"] i { transform: rotate(180deg); }
/* Without scripting there is nothing to open the text, so it is shown in full. */
@media (scripting: none) {
  .state-service__clip { max-height: none; }
  .state-service__clip::after { content: none; }
  .state-service__more { display: none; }
}

.state-service__img { height: 400px; border-radius: 8px; overflow: hidden; background: var(--c-navy-card); }
.state-service__img picture,
.state-closing__img picture { display: block; height: 100%; }
.state-service__img img { width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: .8; transition: opacity .3s, transform .3s; }
.state-service:hover .state-service__img img { opacity: 1; transform: scale(1.05); }

/* ---------- Featured lender ---------- */
.state-featured { background: var(--st-light); color: var(--st-text); }
.state-page .state-featured__sub { font-family: var(--f-head); font-size: 17.6px; font-weight: 700; line-height: 1.3; text-transform: uppercase; color: var(--st-heading); margin: 8px 0 20px; }
.state-page .state-featured__desc { max-width: 800px; margin: 0 auto 40px; line-height: 1.6; color: var(--c-muted); }
.state-featured__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; margin-bottom: 40px; }
.state-featured__grid--gap { margin-top: 40px; }
.state-featured__card { display: flex; flex-direction: column; justify-content: flex-start; height: 100%; padding: 30px 20px; text-align: center; background: var(--c-white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.state-featured__card h3 { font-size: 19.2px; color: var(--st-heading); margin-bottom: 15px; }
.state-featured__card p { font-size: 14.4px; line-height: 1.5; color: var(--c-muted); margin-bottom: 0; }

/* ---------- Thin rule between two light sections ---------- */
.state-rule { background: var(--c-white); }
.state-rule hr { width: 50%; height: 0; margin: 0 auto; border: 1px solid #9e9e9e; }

/* ---------- Why choose ---------- */
.state-why { background: var(--st-light); color: var(--st-text); }
.state-page .state-why__desc { max-width: 800px; margin: 10px auto 24px; color: var(--c-muted); }
.state-why__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr)); gap: 30px; margin-top: 50px; }
.state-why__card { display: flex; flex-direction: column; padding: 30px; background: var(--c-white); border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, .03); transition: transform .3s, box-shadow .3s, border-color .3s; }
.state-why__card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 0, 0, .08); border-color: var(--c-green); }
.state-why__card h3 { font-size: 20px; color: var(--c-green); margin-bottom: 15px; }
.state-why__card p { font-size: 15.2px; line-height: 1.6; color: var(--c-muted); margin-bottom: 0; }

/* ---------- Stats band ---------- */
/* Flat black, as the old page rendered: its checker gradient was written in the CSS but never reached the screen. */
.state-stats { padding: 80px 0; color: var(--c-white); background: var(--c-black); }
.state-stats__grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px; }
.state-stats__item { flex: 1; min-width: 200px; text-align: center; }
.state-stats__value { display: block; margin-top: 8px; font-family: var(--f-head); font-size: 64px; font-weight: 700; line-height: 1; color: var(--c-green-on-dark); }
.state-stats__label { display: block; margin-top: 10px; font-size: 16px; text-transform: uppercase; letter-spacing: 1px; color: var(--c-white); }

/* ---------- Comparison table ---------- */
.state-compare { background: var(--c-navy-deep); }
.state-compare h2 { color: var(--c-white); }
.state-compare__scroll { margin-top: 60px; padding-bottom: 20px; overflow-x: auto; }
.state-compare__table { width: 100%; min-width: 800px; margin-bottom: 15px; border-collapse: separate; border-spacing: 0; font-size: 16px; line-height: 1.5; }
.state-compare__table thead th { padding: 20px; border: 0; text-align: left; font-family: var(--f-head); font-size: 19.2px; font-weight: 700; color: var(--c-muted-on-dark); }
.state-compare__table thead th:nth-child(2) { position: relative; text-align: center; font-size: 22.4px; color: var(--c-white); background: var(--c-green); border-radius: 10px 10px 0 0; }
.state-compare__table thead th:nth-child(2)::after { content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-width: 10px 10px 0; border-style: solid; border-color: var(--c-green) transparent transparent; }
.state-compare__table thead th:nth-child(3) { text-align: center; color: #888; }
.state-compare__table tbody :is(th, td) { padding: 25px 20px; vertical-align: top; text-align: left; color: #ccc; border: 1px solid rgba(128, 128, 128, .5); border-bottom-color: #333; }
.state-compare__table tbody tr:nth-child(odd) > :is(th, td) { background-color: rgba(128, 128, 128, .07); }
.state-compare__table tbody tr:hover > :is(th, td) { background-color: rgba(128, 128, 128, .1); }
.state-compare__table tbody th { width: 20%; font-family: var(--f-body); font-weight: 600; color: var(--c-white); }
.state-compare__table tbody tr > td:nth-child(2) { width: 40%; font-weight: 500; color: var(--c-white); background-color: var(--st-tint); border-left: 2px solid var(--c-green); border-right: 2px solid var(--c-green); }
.state-compare__table tbody tr:hover > td:nth-child(2) { background-color: var(--st-tint); }
.state-compare__table tbody tr:last-child td:nth-child(2) { border-bottom: 2px solid var(--c-green); border-radius: 0 0 10px 10px; }
.state-compare__table tbody td:nth-child(3) { width: 40%; font-style: italic; color: #999; }
.state-compare__action { margin-top: 40px; }

/* ---------- Market overview ---------- */
.state-market { background: var(--c-white); color: var(--st-text); }
.state-market h2 { color: var(--st-heading); }
.state-page .state-market__sub { color: var(--c-muted); }
.state-market__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr)); gap: 20px; margin-top: 50px; }
.state-market__card { padding: 30px; background: #f9f9f9; border-radius: 8px; box-shadow: 0 2px 4px rgba(0, 0, 0, .05); }
.state-market__card h3 { display: flex; align-items: center; font-size: 19.2px; color: var(--st-heading); }
.state-market__card h3 i { flex: 0 0 auto; margin-right: 12px; color: var(--c-green); }
.state-market__card p { font-size: 15.2px; color: var(--c-muted); margin-bottom: 0; }

/* ---------- Latest closings ---------- */
.state-closings { background: var(--st-light); color: var(--st-text); }
.state-closings__head { margin-bottom: 50px; }
.state-closings__head p { color: var(--c-muted); }
.state-closings__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 30px; justify-items: center; }
.state-page .state-closings__none { width: 100%; color: var(--c-muted); }
.state-closing { display: flex; flex-direction: column; width: 100%; max-width: 396px; overflow: hidden; background: var(--c-white); border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, .05); transition: transform .3s ease; }
.state-closing:hover { transform: translateY(-5px); }
.state-closing__img { position: relative; width: 100%; height: 306px; min-height: 306px; overflow: hidden; }
.state-closing__img img { width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .5s ease; }
.state-closing:hover .state-closing__img img { transform: scale(1.05); }
.state-closing__body { display: flex; flex-direction: column; flex-grow: 1; padding: 25px; text-align: left; }
.state-closing__body h3 { font-size: 22.4px; color: var(--st-heading); margin-bottom: 8px; }
.state-closing__meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 15px; }
.state-page .state-closing__meta p { margin: 0; font-size: 12px; line-height: 1.4; color: var(--c-muted); }
.state-closing__label { font-weight: 400; margin-right: 1px; }
.state-closing__value { font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.state-closing__value--type { font-weight: 700; color: var(--c-green); }
.state-page .state-closing__blurb { flex-grow: 1; font-size: 15.2px; line-height: 1.6; color: var(--c-muted); margin-bottom: 20px; }
.state-closing__link { align-self: flex-start; font-family: var(--f-head); font-size: 18px; font-weight: 400; text-transform: uppercase; text-decoration: none; color: var(--c-heading); }
.state-closing__link i { margin-left: 5px; transition: margin-left .3s; }
.state-closing__link:hover i { margin-left: 10px; }
.state-closings__action { margin-top: 50px; }
.state-page .state-closings__all { padding: 19px 17px; }

/* ---------- Market trends ---------- */
.state-trends { background: var(--c-green); color: var(--c-white); }
.state-trends h2 { color: var(--c-white); }
.state-page .state-trends__sub { font-size: 17.6px; color: var(--c-white); margin-bottom: 40px; }
.state-trends__grid { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 40px; text-align: center; }
.state-trends__item { flex: 1; min-width: min(250px, 100%); margin: 10px 0; }
.state-trends__value { display: block; margin: 8px 0 10px; font-family: var(--f-head); font-size: 64px; font-weight: 700; line-height: 1; color: var(--c-white); }
.state-trends__desc { display: block; margin-bottom: 24px; font-size: 16px; line-height: 1.4; color: #f0f0f0; }

/* ---------- FAQ: the shared accordion, dressed as the old bordered cards ---------- */
.state-faq { background: var(--st-light); color: var(--st-text); }
.state-faq h2 { color: var(--st-heading); margin-bottom: 40px; }
.state-faq .accordion { max-width: 900px; }
.state-faq .accordion__item { margin-bottom: 10px; overflow: hidden; background: var(--c-white); border: 1px solid #e0e0e0; border-radius: 6px; }
.state-faq .accordion__item.is-open { border-color: var(--c-green); }
.state-faq .accordion__heading { margin: 0; font: inherit; line-height: inherit; }
.state-faq .accordion__trigger { padding: 20px; font-family: var(--f-body); font-size: 16px; font-weight: 600; line-height: 1.7; color: var(--st-text); background: var(--c-white); transition: background-color .3s; }
.state-faq .accordion__trigger:hover { background: #f9f9f9; }
.state-faq .accordion__trigger:focus-visible { outline-offset: -3px; }
.state-faq .accordion__icon { width: auto; height: auto; background: none; border-radius: 0; font-size: 16px; color: var(--c-green); transition: transform .3s; }
.state-faq .accordion__trigger[aria-expanded="true"] .accordion__icon { transform: rotate(180deg); }
.state-faq .accordion__trigger[aria-expanded="true"] .accordion__icon::before { content: "\f067"; }
.state-faq .accordion__panel { padding: 20px; border-top: 1px solid #eee; background: var(--c-white); }
.state-faq .accordion__panel p { color: var(--c-muted); margin-bottom: 24px; }

/* ---------- Closing call to action ---------- */
.state-cta { background: var(--c-navy); }
.state-cta h2 { color: var(--c-white); }
.state-cta__action { margin-top: 51px; }
.state-cta__badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; margin-top: 60px; }
.state-cta__badge { text-align: center; }
.state-cta__badge i { display: block; margin: 0 auto 18px; font-size: 32px; line-height: 1; color: var(--c-green-on-dark); }
.state-cta__badge h3 { font-size: 16px; color: var(--c-white); margin-bottom: 5px; }
.state-cta__badge span { font-size: 13.6px; color: #888; }

@media (max-width: 900px) {
  .state-hero h1 { font-size: 48px; }
  .state-service { grid-template-columns: 1fr; gap: 20px; }
  .state-service:nth-child(even) .state-service__text { order: 0; }
  .state-service:nth-child(even) .state-service__img { order: 1; }
}

/* ==========================================================================
   States overview
   ========================================================================== */
.states-page { line-height: 1.6; color: var(--st-text); background: #e5e5e5; }
.states-page :is(h1, h2) { font-family: var(--f-head); font-weight: 700; line-height: 1.2; }

.states-hero { min-height: 400px; padding: 60px 0; }
.states-hero__content { max-width: 800px; margin: 0 auto; }
.states-hero h1 { font-size: 56px; color: var(--c-white); margin: 8px 0 16px; }
.states-hero p { font-size: 19.2px; color: #ddd; margin: 0 0 14.4px; }

.states-list { padding: 50px 0 80px; background: #e5e5e5; }
.states-search { margin-bottom: 40px; }
.states-search__input {
  width: 100%; max-width: 600px; padding: 8px 16px; font-family: var(--f-body); font-size: 17.6px; font-weight: 400; line-height: 1.5; color: var(--c-black);
  background: var(--c-white); border: 1px solid #666; border-radius: 3px; box-shadow: 0 10px 30px rgba(0, 0, 0, .1); transition: box-shadow .3s; -webkit-appearance: none; appearance: none;
}
.states-search__input:focus { box-shadow: 0 10px 30px color-mix(in srgb, var(--c-green) 20%, transparent); }
.states-search__input::placeholder { color: var(--c-muted); opacity: 1; }

.states-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 30px; list-style: none; margin: 0; padding: 0; }
.states-grid__item[hidden] { display: none; }
.states-card {
  display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 30px; text-decoration: none; color: inherit;
  background: var(--c-white); border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, .02); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.states-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 0, 0, .08); border-color: var(--c-green); }
.states-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 2px solid #f0f0f0; }
.states-page .states-card__title { margin: 0; font-size: 24px; text-transform: uppercase; color: var(--st-heading); }
.states-card__pin { font-size: 24px; color: #ccc; transition: color .3s; }
.states-card:hover .states-card__pin { color: var(--c-green); }
.states-card__text { flex-grow: 1; margin: 0 0 20px; font-family: var(--f-head); font-size: 15.2px; font-weight: 400; line-height: 1.6; color: var(--c-muted); }
.states-card__more { display: flex; align-items: center; gap: 8px; font-family: var(--f-head); font-size: 14.4px; font-weight: 700; text-transform: uppercase; color: var(--c-green); }
.states-card__more i { transition: transform .3s; }
.states-card:hover .states-card__more i { transform: translateX(5px); }

.states-none { margin-top: 40px; }
.states-none[hidden] { display: none; }
.states-none h2 { margin: 8px 0 16px; font-size: 28px; color: var(--c-muted); }
.states-none p { margin: 0 0 14.4px; }

.states-cta { padding: 80px 0 125px; text-align: center; color: var(--c-white); background: var(--c-navy); }
.states-cta h2 { margin: 8px 0 16px; font-size: 40px; color: var(--c-white); }
.states-cta p { margin: 10px 0 14.4px; color: #ccc; }

@media (max-width: 768px) {
  .states-hero h1 { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .state-page .state-call:hover,
  .state-why__card:hover,
  .state-closing:hover,
  .states-card:hover,
  .state-service:hover .state-service__img img,
  .state-closing:hover .state-closing__img img,
  .states-card:hover .states-card__more i { transform: none; }
}
