/* =========================================================================
   Shared page components
   Blocks used by more than one template: the section rhythm, the
   "Need immediate help?" band, the quote band and the case-evaluation form.
   Loaded on every page, after main.css and before the template stylesheet.
   ========================================================================= */

.section {
  padding-block: var(--space-section);

  &.section--tight {
    padding-block: clamp(2rem, 4vw, 3rem);
  }

  &.section--soft {
    background: var(--color-bg-soft);
  }
}


/* -------------------------------------------------------------------------
   "Need immediate help?" band
   ------------------------------------------------------------------------- */

.callout {
  padding-top: clamp(3.5rem, 9.3vw, 8rem);
  padding-bottom: clamp(1.5rem, 6.2vw, 5.5rem);
  background: linear-gradient(to bottom, #ffffff 0%, #000000 100%);
  color: var(--color-white);

  .callout__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(1rem, 3.7vw, 3.25rem);
  }

  .callout__avatar {
    width: clamp(4.5rem, 11.35vw, 10.5rem);
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgb(255 255 255 / 0.35);
  }

  .callout__title {
    color: var(--color-white);
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 2.8vw, 2.375rem);
    font-weight: 700;
    line-height: 1.25;
  }

  .callout__subtitle {
    color: var(--color-white);
    font-family: var(--font-sans);
    font-size: clamp(1.0625rem, 2.76vw, 2.375rem);
    font-weight: 400;
    line-height: 1.25;
  }

  .callout__phone {
    justify-self: end;
    color: var(--color-white);
    font-family: var(--font-sans);
    padding-block: 0.4rem;
    font-size: clamp(1.375rem, 3.1vw, 2.625rem);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 0.12em;

    &:hover {
      text-decoration: none;
    }
  }

  @media (max-width: 40rem) {
    background: linear-gradient(to bottom, #ffffff 0%, #000000 55%, #000000 100%);

    .callout__inner {
      grid-template-columns: auto 1fr;
      row-gap: 1.25rem;
    }

    .callout__phone {
      grid-column: 1 / -1;
      justify-self: center;
    }
  }
}


/* -------------------------------------------------------------------------
   Quote band
   ------------------------------------------------------------------------- */

.quote {
  display: grid;
  place-items: center;
  min-height: clamp(14rem, 33vw, 29rem);
  padding-block: clamp(2rem, 5vw, 4rem);
  background: #dcdcd6 url("../img/quote-mother-daughter-1200.jpg") center top / cover no-repeat;

  .quote__text {
    /* Centring the pair of lines leaves them mid-band; the comp sits them in
       the upper half, and the extra bottom margin is what lifts them. */
    margin: 0 auto clamp(0rem, 8vw, 7rem);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 6.22vw, 5.3125rem);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-wrap: wrap;
  }

  @media (min-width: 75rem) {
    background-image: url("../img/quote-mother-daughter.jpg");
  }
}


/* -------------------------------------------------------------------------
   Free case evaluation
   ------------------------------------------------------------------------- */

.evaluation {
  .evaluation__inner {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: clamp(2rem, 3vw, 2.5rem);

    /* The comp gives the form the wider of the two columns. */
    @media (min-width: 60rem) {
      grid-template-columns: 0.85fr 1fr;
      gap: clamp(1.5rem, 1.8vw, 2rem);
    }
  }

  .evaluation__title {
    max-width: 16em;
    margin-inline: auto;
    color: var(--color-black);
    font-size: clamp(1.5rem, 3.16vw, 2.6875rem);
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-wrap: wrap;

    /* Only meaningful beside the form: the comp drops the title below the top
       of the card rather than centring it against the whole column. Stacked,
       the same offset is just a hole between the copy above and the form. */
    @media (min-width: 60rem) {
      margin-block-start: min(9vw, 8rem);
    }
  }

  /* The comp breaks this heading by hand — line two is wider than line one
     plus its next word, so no measure reproduces it by wrapping. Below the
     two-column breakpoint the spans stay inline and the text reflows. */
  .evaluation__title-line {
    @media (min-width: 60rem) {
      display: block;
    }
  }
}

/* Interior pages introduce the form with a heading and two paragraphs rather
   than the front page's two-line title, so the column stops being a caption
   and becomes copy: left-aligned, top-aligned, and an even split. */
.evaluation--intro {
  .evaluation__inner {
    @media (min-width: 60rem) {
      grid-template-columns: 1fr 1fr;
      gap: clamp(2rem, 4vw, 4rem);
    }
  }

  .evaluation__title {
    max-width: none;
    margin-inline: 0;
    text-align: left;

    @media (min-width: 60rem) {
      margin-block-start: 0;
    }
  }
}

.evaluation__intro {
  display: grid;
  gap: 1.125rem;
}

.evaluation__copy {
  color: var(--color-ink-soft);
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.75;
}

.evaluation__contacts {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
}

.evaluation__contact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-ink-soft);
  font-size: 1.0625rem;

  svg {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--color-heading);
  }

  .evaluation__contact-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--color-ink);
    word-break: break-word;
  }
}

/* Interior pages pull the same band in at a reading size — the front page's
   85px display setting is a hero treatment, not a pull-quote one. */
.quote--compact {
  min-height: clamp(11rem, 24vw, 20rem);
  background-position: center 35%;

  .quote__text {
    max-width: 20em;
    margin-bottom: 0;
    font-size: clamp(1.375rem, 3.2vw, 2.75rem);
    line-height: 1.3;
  }
}

/* This block mirrors the LeadConnector form embedded on markowiczlaw.com
   (widget/form/fnzJDtzkpPKioFr2oUl3), measured at 643px wide: 17px padding,
   16/500 labels, 42px inputs on a 6px radius, 18px between fields. The comp
   shows the same form, just pasted in at a reduced scale.
   Type is set in the site's DM Sans rather than the embed's Inter/Roboto, so
   the page keeps one sans family. */
.lead-form {
  display: grid;
  gap: 1.125rem;
  padding: 1.0625rem;
  border: 1px solid var(--color-white);
  border-radius: 0.5rem;
  background: var(--color-white);
  box-shadow: 0 4px 4px rgb(87 100 126 / 0.21);

  .lead-form__field {
    display: grid;
    gap: 0.5rem;
  }

  .lead-form__label {
    color: #344054;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.8;
  }

  .lead-form__required {
    color: #b42318;
  }

  .lead-form__control {
    position: relative;
    display: grid;
    align-items: center;

    > svg {
      position: absolute;
      left: 0.75rem;
      width: 1rem;
      height: 1rem;
      color: #667085;
      pointer-events: none;
    }
  }

  .lead-form__control--icon .lead-form__input {
    padding-left: 2.25rem;
  }

  .lead-form__input {
    width: 100%;
    min-height: 2.625rem;
    padding: 0.5rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.375rem;
    background: var(--color-white);
    color: #101828;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;

    &::placeholder {
      color: #667085;
    }

    &:focus-visible {
      border-color: var(--color-accent);
      outline-offset: 1px;
    }
  }

  .lead-form__consent {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1.25rem;
    color: #344054;
    font-size: 1rem;
    line-height: 1.25;
  }

  /* The embed draws its own box rather than using the native control. */
  .lead-form__checkbox {
    appearance: none;
    width: 1rem;
    height: 1rem;
    margin: 0.125rem 0 0;
    border: 1px solid #d0d5dd;
    border-radius: 0.25rem;
    background: var(--color-white);
    cursor: pointer;

    &:checked {
      border-color: #4299e1;
      background: #4299e1
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.5 2.5 2.5L12 5.5'/%3E%3C/svg%3E")
        center / 0.75rem no-repeat;
    }
  }

  .lead-form__submit {
    margin-top: 1.4375rem;
  }

  .lead-form__note {
    margin-top: 1rem;
    color: #607179;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;

    a {
      color: #0d6efd;
    }
  }
}


/* -------------------------------------------------------------------------
   Long-form copy
   Element selectors are intentional here: this is the one block WordPress
   fills from the editor, so it has to style tags it did not author.
   ------------------------------------------------------------------------- */

.prose {
  /* Flow, not grid: grid items ignore `float`, and the service pages float
     their editor-placed figures beside the copy. flow-root contains the last
     float; the owl selector gives the block-level children the same rhythm the
     old grid gap did. */
  display: flow-root;
  max-width: 40rem;
  color: var(--color-ink-soft);
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.75;

  > * + * {
    margin-block-start: 1.25rem;
  }

  h2 {
    clear: both;
    margin-top: 2.25rem;
    color: var(--color-black);
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    font-weight: 700;
  }

  h3 {
    clear: both;
    margin-top: 2rem;
    color: var(--color-black);
    font-size: clamp(1.25rem, 1.9vw, 1.5rem);
    font-weight: 700;
  }

  strong {
    color: var(--color-ink);
    font-weight: 700;
  }

  a {
    color: var(--color-ink);
  }

  ul {
    display: grid;
    gap: 0.5rem;
  }

  /* The reset strips list markers site-wide; editor-authored numbered lists
     inside the_content() are the one place they have to come back. */
  ol {
    display: grid;
    gap: 0.5rem;
    padding-inline-start: 1.5rem;
    list-style: decimal outside;
  }

  ol li {
    display: list-item;
    padding-inline-start: 0;

    &::before {
      content: none;
    }
  }

  li {
    position: relative;
    padding-inline-start: 1.25rem;

    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      top: 0.75em;
      width: 0.4rem;
      height: 0.4rem;
      border-radius: 50%;
      background: var(--color-mark);
    }
  }

  /* Editor-placed images (the service pages): WordPress's own alignment
     classes on a <figure>, floated beside the copy from tablet width up and
     stacked, centred, at their natural size below it. */
  figure {
    margin-block: 0.25rem 1rem;
  }

  figure img {
    margin-inline: auto;
    border-radius: 0.75rem;
  }

  @media (min-width: 40rem) {
    .alignleft,
    .alignright {
      max-width: 50%;
      margin-block: 0.375rem 0.75rem;
    }

    .alignleft {
      float: left;
      margin-inline-end: 1.75rem;
    }

    .alignright {
      float: right;
      margin-inline-start: 1.75rem;
    }
  }

  /* Folded aside (the divorce page's "Five considerations"). */
  details {
    clear: both;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-rule);
    border-radius: var(--radius-card);
    background: var(--color-bg-soft);

    > * + * {
      margin-block-start: 1rem;
    }
  }

  summary {
    color: var(--color-ink);
    font-weight: 700;
    cursor: pointer;
  }

  /* Widened when the copy owns the full container rather than sitting
     beside a portrait or a form. */
  &.prose--wide {
    max-width: 46rem;
  }

  /* Centres the column and its headings but leaves the paragraphs ragged
     right — centred body copy costs the reader a new left edge every line. */
  &.prose--center {
    margin-inline: auto;

    h2,
    h3 {
      text-align: center;
    }
  }
}


/* -------------------------------------------------------------------------
   Practice areas — heading column beside a 3 x 2 card grid (front page);
   the Services page uses the same cards full-width (.practice--index).
   Moved here from home.css because two templates share it
   Comp: 296px cards on a 31px gutter, 385px tall.
   ------------------------------------------------------------------------- */

.practice {
  .practice__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);

    @media (min-width: 62rem) {
      grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
      gap: clamp(1.5rem, 2.3vw, 2rem);
    }
  }

  .practice__title {
    color: var(--color-black);
    font-size: clamp(1.75rem, 2.93vw, 2.5rem);
    font-weight: 400;
    line-height: 1.15;
  }

  .practice__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1rem, 2.3vw, 1.9375rem);

    @media (min-width: 34rem) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (min-width: 62rem) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}

.practice-card {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1rem;
  min-height: clamp(15rem, 28vw, 24rem);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  color: var(--color-black);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;

  .practice-card__icon {
    display: grid;
    place-items: center;
  }

  .practice-card__image {
    width: auto;
    max-width: 100%;
    height: clamp(4.5rem, 8vw, 7.5rem);
    object-fit: contain;
  }

  .practice-card__label {
    align-self: end;
    padding-bottom: clamp(0.5rem, 1.5vw, 1.25rem);
    font-family: var(--font-serif);
    font-size: clamp(1.0625rem, 1.54vw, 1.3125rem);
    font-weight: 700;
    line-height: 1.35;
  }

  &:hover {
    border-color: var(--color-black);
    box-shadow: 0 0.75rem 1.75rem rgb(0 0 0 / 0.08);
    transform: translateY(-2px);
  }
}

/* Services page: no heading column, the cards own the container. */
.practice--index {
  .practice__cards {
    @media (min-width: 62rem) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}



/* -------------------------------------------------------------------------
   Contact Form 7 inside .lead-form
   The form template (fields, labels) is authored in the CF7 admin with the
   lead-form__* classes; CF7 adds its own wrappers and control classes,
   which these rules absorb so the result matches the static mock-up.
   ------------------------------------------------------------------------- */

.lead-form {
  .wpcf7-form {
    display: grid;
    gap: 1.125rem;
  }

  /* CF7 wraps every control in this span. */
  .wpcf7-form-control-wrap {
    display: grid;
  }

  .lead-form__control input:not([type="checkbox"], [type="radio"], [type="submit"]),
  .lead-form__control textarea {
    width: 100%;
    min-height: 2.625rem;
    padding: 0.5rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.375rem;
    background: var(--color-white);
    color: #101828;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;

    &::placeholder {
      color: #667085;
    }

    &:focus-visible {
      border-color: var(--color-accent);
      outline-offset: 1px;
    }

    &.wpcf7-not-valid {
      border-color: #b42318;
    }
  }

  .lead-form__control--icon input {
    padding-left: 2.25rem;
  }

  .lead-form__control textarea {
    min-height: 6rem;
    resize: vertical;
  }

  /* Checkbox groups and the acceptance box. */
  .lead-form__choices {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .lead-form__choices legend {
    padding: 0;
    margin-bottom: 0.25rem;
  }

  .wpcf7-checkbox,
  .wpcf7-acceptance {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
  }

  .wpcf7-list-item {
    margin: 0;
  }

  .wpcf7-list-item label,
  .lead-form__consent label {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.75rem;
    color: #344054;
    font-size: 1rem;
    line-height: 1.25;
    cursor: pointer;
  }

  .wpcf7-list-item-label {
    text-transform: capitalize;
  }

  .wpcf7-acceptance .wpcf7-list-item-label {
    text-transform: none;
  }

  input[type="checkbox"] {
    appearance: none;
    width: 1rem;
    height: 1rem;
    margin: 0.125rem 0 0;
    border: 1px solid #d0d5dd;
    border-radius: 0.25rem;
    background: var(--color-white);
    cursor: pointer;

    &:checked {
      border-color: #4299e1;
      background: #4299e1
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 8.5 2.5 2.5L12 5.5'/%3E%3C/svg%3E")
        center / 0.75rem no-repeat;
    }
  }

  /* The folded disclaimer under the acceptance box. */
  .lead-form__disclaimer {
    color: #607179;
    font-size: 0.875rem;
    line-height: 1.5;

    summary {
      color: #344054;
      cursor: pointer;
    }

    p {
      margin-top: 0.5rem;
    }
  }

  .lead-form__submit-row {
    display: grid;
    margin-top: 0.3125rem;
  }

  .wpcf7-submit {
    width: 100%;
  }

  .wpcf7-spinner {
    display: none;
  }

  .wpcf7-form.submitting .wpcf7-spinner {
    display: block;
    margin: 0.5rem auto 0;
  }

  /* Validation. */
  .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.35rem;
    color: #b42318;
    font-size: 0.875rem;
  }

  .wpcf7-response-output {
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-rule);
    border-radius: 0.375rem;
    font-size: 0.9375rem;
  }

  .wpcf7-form.sent .wpcf7-response-output {
    border-color: #12b76a;
    color: #054f31;
  }

  .wpcf7-form.invalid .wpcf7-response-output,
  .wpcf7-form.failed .wpcf7-response-output,
  .wpcf7-form.aborted .wpcf7-response-output,
  .wpcf7-form.spam .wpcf7-response-output,
  .wpcf7-form.unaccepted .wpcf7-response-output {
    border-color: #b42318;
    color: #912018;
  }

  /* Shown when Contact Form 7 is not available. */
  .lead-form__fallback {
    color: #344054;
    font-size: 1rem;
    line-height: 1.6;
  }
}
