/*
 * Chicago location page (page-chicogo.php) - WordPress-only additions.
 *
 * The Chicago design ships header.css, footer.css and chicago.css, which are
 * byte-identical to the static reference (appagentixliveui2/chicago). Inside
 * WordPress the same markup is also affected by things the static reference
 * does not have. This file only patches those differences; it never restyles
 * the Chicago sections themselves.
 */

/* 1. Shared WordPress footer: social icon row.
 *    These classes only exist in assets/css/home/footer.css, which is not loaded
 *    on the Chicago template, so the SVG icons rendered at their natural size. */
.footer__social-links {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
}

.footer__social-link {
  display: inline-flex;
  width: 40px !important;
  min-width: 40px;
  max-width: 40px;
  height: 40px !important;
  min-height: 40px;
  max-height: 40px;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.footer__social-link img {
  display: block;
  width: 22px !important;
  min-width: 22px;
  max-width: 22px;
  height: 22px !important;
  min-height: 22px;
  max-height: 22px;
  flex: 0 0 22px;
  object-fit: contain;
}

/* 2. WordPress global styles (theme.json) and Appagentix-atlanta-mobile.css put
 *    font-size: large, line-height: 1.4/1.65, letter-spacing: -0.1px and
 *    -webkit-font-smoothing: antialiased on <body> and letter-spacing: -0.1px
 *    on headings. The static reference uses browser defaults, and the
 *    -0.1px tracking alone changed paragraph line breaks across the page.
 *    Same specificity (0,0,1), loaded later, so these win; chicago.css class
 *    rules that set their own values are unaffected. */
body {
  background-color: #fff; /* theme.json sets the off-white "base" preset; reference is white */
  font-size: 16px;
  line-height: normal;
  letter-spacing: normal;
  -webkit-font-smoothing: auto;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: normal;
}

/* 3. Parent theme (twentytwentyfive) injects `h1..h6, p { text-wrap: pretty }`
 *    inline, which changes line breaks against the reference. Restore browser
 *    default wrapping at the same specificity (0,0,1); chicago.css class rules
 *    that set text-wrap-style: balance / pretty still win. */
body :where(blockquote, caption, figcaption, h1, h2, h3, h4, h5, h6, p) {
  text-wrap-style: auto;
}

/* 4. "Apps We Built for Chicago Businesses" tabs (chicago-case-studies.js).
 *    chicago.css hard-codes the third tab dark and the first two light, as in
 *    the Figma frame. Once the tabs switch on hover/focus/click (home page
 *    behaviour) the dark pill has to follow the .is-active class instead.
 *    Selectors sit above the (0,1,0) chicago.css rules; nothing is removed. */
.case-study__tab-list-case-studies > [role="tab"] {
  cursor: pointer;
  user-select: none;
  transition: background-color 160ms ease;
}

.case-study__tab-list-case-studies > [role="tab"]:focus-visible {
  outline: 3px solid #6E47FF;
  outline-offset: -3px;
}

.case-study__tab-list-case-studies > [role="tab"]:not(.is-active) {
  background: transparent;
}

.case-study__tab-list-case-studies > [role="tab"].is-active {
  background: #1A182B;
}

.case-study__tab-list-case-studies > [role="tab"]:not(.is-active) :is(.case-study__text-2, .case-study__text-3, .case-study__text-4) {
  color: #1A182B;
  transition: color 160ms ease;
}

.case-study__tab-list-case-studies > [role="tab"].is-active :is(.case-study__text-2, .case-study__text-3, .case-study__text-4) {
  color: #FFF;
  transition: color 160ms ease;
}

/* Tab icons: activity/wallet SVGs are dark-stroked, the truck SVG is white-stroked. */
.case-study__tab-list-case-studies > :is(.case-study__tab, .case-study__tab-2).is-active .case-study__icon {
  filter: brightness(0) invert(1);
}

.case-study__tab-list-case-studies > .case-study__tab-3:not(.is-active) .case-study__icon {
  filter: brightness(0);
}

/* Swapped case images: the per-tab PNGs share the card's 624:560 ratio but may
 * be exported at 444x399, so scale them to fill the card. */
.case-study__image-4[data-chicago-case-image] {
  object-fit: cover;
  object-position: center;
}

.case-study__text-5[hidden] {
  display: none;
}

/* Metric labels: chicago.css sets white-space: nowrap on the first two label
 * classes for the Figma copy; swapped labels of a different length must wrap
 * like the third one instead of being clipped by the pill. */
.case-study__list [data-chicago-case-metric-label] {
  white-space: normal;
}

/* 5. FAQ answers with a checklist ("How do I choose a mobile app developer in
 *    Chicago?"). chicago.css only styles .chx-faq__a p, so the intro paragraph
 *    drops its bottom padding and the list takes the same type and spacing. */
.chx-faq__a p:has(+ .chx-faq__checklist) {
  padding-bottom: 12px;
}

.chx-faq__a .chx-faq__checklist {
  max-width: 640px;
  margin: 0;
  padding: 0 0 26px 22px;
  color: #5b5870;
  font-size: 15.5px;
  line-height: 26.35px;
  list-style: disc;
}

.chx-faq__a .chx-faq__checklist li {
  margin: 0 0 4px;
}

.chx-faq__a .chx-faq__checklist li:last-child {
  margin-bottom: 0;
}

.chx-faq__a .chx-faq__checklist strong {
  color: #1A182B;
  font-weight: 600;
}

@media (max-width: 1199px) {
  .chx-faq__a .chx-faq__checklist {
    font-size: 15px;
    line-height: 1.65;
    padding-bottom: 20px;
  }
}

/* The Figma frame fixes the panel at 740px / 628px for three bullets per list.
 * The approved copy has four, so on desktop the panel grows with its text and
 * pushes the next section down instead of spilling over it. Below 1200px the
 * chicago.css responsive rules already make these heights automatic. */
@media (min-width: 1200px) {
  /* Section (1150px) and its absolute stack (971px) are fixed too; let both
   * follow the panel so the following section is pushed down, never overlapped. */
  .case-study:has([data-chicago-case-panel]) {
    height: auto;
    min-height: 1150px;
  }

  .case-study:has([data-chicago-case-panel]) > .case-study__stack {
    position: relative;
    left: 0;
    top: 0;
    height: auto;
    min-height: 971px;
  }

  .case-study__tab-panel-margin:has([data-chicago-case-panel]) {
    height: auto;
    min-height: 740px;
    padding-bottom: 28px; /* the gap the 740px frame left under a 628px panel */
  }

  .case-study__row[data-chicago-case-panel] {
    height: auto;
    min-height: 628px;
    justify-content: flex-start;
  }

  .case-study__row[data-chicago-case-panel] > .case-study__stack-2 {
    position: relative;
    top: 0;
    left: 0;
    margin-top: -25.44px;
    height: auto;
    min-height: 628px;
  }
}

/* 6. Live forms: hero "Get a free quote" and #contact "Book a Free Consultation"
 *    (chicago-forms.js + inc/chicago-forms.php). The Figma export drew the fields
 *    as <div><p>placeholder</p></div>; they are now real <input>/<select>/<textarea>
 *    elements carrying the same classes, so the chicago.css boxes (size, radius,
 *    border, padding) still apply. These rules only give the form controls the
 *    typography the placeholder <p> had, reset the browser control chrome and
 *    add the states (focus, busy, error, status line) a live form needs. */

/* Honeypot wrapper: never shown (inline style is the fallback). */
.chx-form .chx-form__hp {
  display: none !important;
}

/* The chicago.css boxes are border-box inside .chicago-hero (scoped reset);
 * #contact has no such reset, so the controls set it themselves. */
.chx-form :is(input, select, textarea, button) {
  box-sizing: border-box;
  margin: 0;
  font-family: inherit;
}

.chx-form :is(input, select, textarea) {
  display: block;
  color: #1A182B;
  font-weight: 400;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
}

.chx-form :is(input, select, textarea):focus-visible {
  border-color: rgba(26, 24, 43, 0.35);
}

.chx-form :is(input, select, textarea).is-invalid,
.chx-form :is(input, select, textarea)[aria-invalid="true"] {
  border-color: #b42318;
}

.chx-form select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231A182B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chx-form select:required:invalid {
  color: #9693A3; /* the "Select a country" / "Choose one" placeholder option */
}

.chx-form select option {
  color: #1A182B;
}

.chx-form textarea {
  resize: none;
  overflow: auto;
}

.chx-form button[type="submit"] {
  cursor: pointer;
}

.chx-form button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chx-form button[type="submit"]:focus-visible {
  outline: 3px solid #6E47FF;
  outline-offset: 3px;
}

/* Status line: empty until the submit finishes. */
.chx-form__status {
  margin: 0;
  color: #1A182B;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.chx-form__status:empty {
  display: none;
}

.chx-form__status.is-success {
  color: #176b3a;
}

.chx-form__status.is-error {
  color: #b42318;
}

/* 6a. Hero: 14px/22px Manrope, placeholder color(srgb .6627 .651 .7373) = #A9A6BC. */
.chicago-hero .chx-form :is(.chicago-hero__text-input, .chicago-hero__email-input, .chicago-hero__phone-input, .chicago-hero__dropdown, .chicago-hero__text-area) {
  font-size: 14px;
  line-height: 22px;
}

.chicago-hero .chx-form :is(input, textarea)::placeholder {
  color: #A9A6BC;
  opacity: 1;
}

.chicago-hero .chx-form select.chicago-hero__dropdown {
  display: block;
  padding: 14px 40px 14px 17px; /* text sits where .chicago-hero__label-2 sat */
  text-align: left;
}

.chicago-hero .chx-form .chicago-hero__text-area {
  padding: 13px 16px;
}

.chicago-hero .chx-form .chicago-hero__button {
  border: 0;
}

.chicago-hero .chx-form__status--hero {
  width: 424.33px;
  max-width: 100%;
  padding-top: 10px;
  text-align: center;
}

/* The Figma card is a fixed 575.39px box with overflow hidden. It only needs
 * to grow when a status message is showing; it is absolutely positioned, so
 * nothing else moves. Below 1200px chicago.css already makes it height: auto. */
@media (min-width: 1200px) {
  .chicago-hero__card-2:has(.chx-form__status:not(:empty)) {
    height: auto;
    min-height: 575.39px;
  }
}

/* 6b. #contact: 16px/22px weight 500, placeholder #9693A3. */
#contact .chx-form :is(.have-a-challenge__text-input, .have-a-challenge__email-input, .have-a-challenge__dropdown, .have-a-challenge__dropdown-2, .have-a-challenge__text-area) {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

#contact .chx-form :is(input, textarea)::placeholder {
  color: #9693A3;
  opacity: 1;
}

/* chicago.css pads the dropdown boxes on the right to the width of the absolute
 * placeholder text (171px / 512px); a real <select> needs room for its text. */
#contact .chx-form select.have-a-challenge__dropdown,
#contact .chx-form select.have-a-challenge__dropdown-2 {
  display: block;
  padding: 12.666px 40px 13.167px 16.668px;
  text-align: left;
}

/* The textarea keeps the Figma absolute placement inside .have-a-challenge__row-4
 * on desktop (chicago.css turns it static below 1200px). */
#contact .chx-form .have-a-challenge__text-area {
  padding: 12px 16px;
}

#contact .chx-form .have-a-challenge__button {
  border: 0;
}

#contact .chx-form__status--contact {
  width: 100%;
}

/* The form grid's last row (button + caption) is a fixed 88px; let it grow
 * only while a status message is showing so the message is not clipped. */
@media (min-width: 1200px) {
  #contact .have-a-challenge__form:has(.chx-form__status:not(:empty)) {
    height: auto;
    min-height: 490.333px;
    grid-template-rows: 71.83px 71.83px 71.83px 122.83px auto;
  }
}

/* =====================================================
 * 7. Top Industries: "Chicago's working economy" card
 *
 * chicago.css draws the indigo gradient with a 705px-wide image that starts
 * 57px to the left of the 592px card. On the WP page the global
 * `.chicago-page img { max-width: 100% }` rule capped that image to the
 * card width, so its right 57px were never covered and the CSS fallback
 * gradient showed through as a hard dark band. Restore the design width.
 * Desktop only: the <=767px rule in chicago.css already stretches the
 * image to the whole card with inset: 0 / width: 100%.
 * ===================================================== */
@media (min-width: 768px) {
  #industries .top-industries__article-6 > img.top-industries__image {
    max-width: none;
    width: 705px;
    height: 231px;
  }
}
