/*
 * Our fixes on top of the verbatim design CSS (public/css/*, never edited).
 * Loaded last. Each rule fixes a bug that is also present in the prototype;
 * none changes the desktop design.
 */

/*
 * Below 64em these split layouts are a single implicit grid column, which
 * sizes to its widest content instead of the screen. On a 390px phone that
 * pushed the contact form 44px off the right edge (cutting off every field)
 * and clipped the home "Your Troika day" card and the About logo plate.
 * Capping the column at the container width fixes all of them. At 64em and
 * up, site.css sets explicit columns and this rule no longer applies.
 */
@media (max-width: 63.99em) {
  .page-hero__inner--split,
  .familiar,
  .join,
  .how,
  .how-head,
  .excluded,
  .reviews__top,
  .faq-wrap,
  .detail,
  .proj,
  .cs-hero__grid,
  .cs-story,
  .cs-said,
  .story,
  .why,
  .featured-case,
  .feature-post,
  .contact {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Form controls never wider than their field (long select options). */
.field__input {
  min-width: 0;
  max-width: 100%;
}

/* Home "Your Troika day" card: width min(100%, 30rem) plus its horizontal
   padding overflowed small phones. Identical wherever 30rem fits. */
.tday {
  width: min(100% - 2 * var(--space-3), 30rem);
}

/* Team photos: fill the design's 4:5 photo slot (.photo-ph), with the solid
   ink border used on the site's other framed elements. */
.team-photo {
  display: block;
  width: 9rem;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--tk-ink);
}

/* Services price cards: the tag ("Most popular", "No commitment") shrank and
   wrapped onto two lines beside the title, and only some cards had room for
   it. Put the tag on one line above the title on every card, so titles and
   prices line up across the row. (DOM order is unchanged: title first.) */
.price-card__head {
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-1);
}
.price-card__head .tag {
  flex: none;
  white-space: nowrap;
}

/* Select: the native arrow (appearance: auto in components.css) ignores the
   field's padding and sat against the right border. Draw the site's own
   chevron, inset by the same 1rem as the text, with room so long options
   don't run under it. */
select.field__input {
  appearance: none;
  padding-right: var(--space-6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  background-size: 1.25rem;
}

/* Small phones: long labels wrapped awkwardly (left-aligned, three lines,
   e.g. "See services and pricing" in the home panel). Tags and day toggles
   stay on one line; buttons take a little less side padding and, if a label
   still has to wrap, it wraps into balanced, centred lines. */
.tag,
.seg button {
  white-space: nowrap;
}
.btn {
  text-align: center;
  text-wrap: balance;
}
@media (max-width: 29.99em) {
  .btn {
    padding-inline: var(--space-3);
  }
  .seg button {
    padding-inline: var(--space-1);
  }
  /* Home "What's not included" card nests the orange panel, so the two
     paddings left the panel's button about 200px on a phone. */
  .excluded,
  .panel {
    padding: var(--space-3);
  }
  .panel .btn {
    width: 100%;
    box-sizing: border-box;
  }
  /* Interest options stack full width, so the long one wraps cleanly. */
  .radio-row {
    flex-direction: column;
  }
  .radio-pill {
    width: 100%;
    box-sizing: border-box;
    padding-block: var(--space-1);
    border-radius: var(--radius-md);
  }
}
