/* One grid contract for practice pages, blog posts and article archives. */
:root {
  --article-gap: 3rem;
  --sidebar-min-width: 20rem;
  --form-padding: clamp(1.25rem, 2.2vw, 1.875rem);
  --on-accent: var(--secondary);
}
.berke-practice-template__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(var(--sidebar-min-width), 1fr);
  gap: var(--article-gap);
  padding-block: 4rem;
  align-items: start;
}
.berke-practice-template__article,
.berke-practice-template__sidebar,
.berke-news__main { min-width: 0; width: 100%; }
.berke-practice-template__sidebar { position: static; grid-row: auto; }
.berke-practice-template__sidebar-form { display: block; width: 100%; margin-bottom: 2rem; }
.berke-practice-template__sidebar-form .case-review {
  width: 100%; max-width: none; margin: 0;
  padding: 2.5rem var(--form-padding); grid-column: auto; grid-row: auto;
}
.berke-practice-template__sidebar-form .case-review :is(h2,p) { text-align: center; }
.berke-practice-template__sidebar-section { width: 100%; max-width: none; }
.berke-practice-template__attorney-card { width: 100%; max-width: none; }
.berke-practice-template__article .entry-content :is(img,video,iframe) { max-width: 100%; }
.berke-practice-template__article .entry-content :is(pre,.wp-block-table) { max-width: 100%; overflow-x: auto; }
.berke-practice-template__article .entry-content li:last-child { margin-bottom: 0; }

/* Shared footer_form is identical on Home, practice pages, posts and other pages. */
.footer-form { padding: 0; }
.footer-form__layout {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--article-gap); align-items: stretch;
  padding-block: 4rem;
}
.footer-form__copy { display: flex; flex-direction: column; min-width: 0; }
.footer-form__copy :is(p,h2) { max-width: 46rem; }
.footer-form__copy a { color: var(--secondary); text-underline-offset: .2em; }
.footer-form__copy a:focus-visible { outline: 2px solid var(--secondary); outline-offset: 4px; }
.footer-form__map { display: grid; flex: 1; min-height: 22.5rem; }
.footer-form__map iframe { display: block; border: 0; width: 100%; height: 100%; min-height: 22.5rem; background: var(--white); }
.case-review.footer-form__form {
  width: 100%; min-width: 0; max-width: none; margin: 0;
  grid-column: auto; grid-row: auto;
  padding: 3rem var(--form-padding); border-radius: 0;
}
.footer-form__intro { text-align: center; }
.footer-form__intro h3 { color: var(--white); margin: 0 0 1rem; border: 0; padding: 0; text-align: center; }
.footer-form__intro p { margin: 0 0 1.5rem; text-align: center; }
.footer-form__form .footer-form__phone { display: flex; align-items: center; justify-content: center; gap: .625rem; min-height: 3rem; margin: 0 0 1.5rem; text-align: center; color: var(--white); text-decoration: none; cursor: pointer; }
.footer-form__phone svg { width: 1.125em; height: 1.125em; flex: 0 0 1.125em; color: var(--primary); }
.footer-form__phone span { white-space: nowrap; }
.footer-form__form .footer-form__phone:hover { color: var(--primary); }
.footer-form__phone:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.footer-form__divider { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.75rem; color: #d7e0e5; }
.footer-form__divider span { text-align: center; }
.footer-form__divider::before,.footer-form__divider::after { content: ""; flex: 1; height: 1px; background: rgb(255 255 255 / 35%); }
.footer-form__form .gform_wrapper .gform_fields { row-gap: 1.25rem; }
.footer-form__form .gform_wrapper .gform_footer { margin: 1.25rem 0 0; padding: 0; }
.case-review .gform_wrapper { min-width: 0; width: 100%; }
.case-review .gform_wrapper :is(input:not([type=checkbox]):not([type=radio]),textarea,select) { max-width: 100%; }

/* Accent surfaces use navy for text and icons, including interactive states. */
.bg-primary { background-color: var(--primary); color: var(--on-accent); }
.bg-primary :is(h1,h2,h3,h4,h5,h6,p,a,button,summary,.text-white) { color: var(--on-accent); }
.berke-practice-template .berke-practice-toc__icon { color: var(--on-accent); }
.bg-primary .slider-arrow { color: var(--on-accent); }
.hw-tabs__controls button { color: var(--on-accent); }
.hw-tabs__controls button:is(:hover,[aria-selected="true"]) { color: var(--white); }
/* Ring remains visible against both yellow buttons and white/navy surroundings. */
:is(a.btn,.wp-block-button__link,.case-review button.btn):focus-visible {
  outline: 2px solid var(--secondary); outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--white);
}

@media (max-width: 64rem) {
  :root { --article-gap: 2rem; }
  .berke-practice-template__layout,.footer-form__layout { grid-template-columns: minmax(0,1fr); }
  .berke-practice-template__sidebar { grid-row: auto; }
  .berke-practice-template__sidebar-form { display: block; }
  .berke-practice-template__sidebar-section { display: block; }
  .footer-form__copy { display: block; }
  .footer-form__map { display: block; min-height: 0; }
  .footer-form__map iframe { height: 22.5rem; }
}
@media (max-width: 47.99rem) {
  .berke-practice-template__layout,.footer-form__layout { padding-block: 3rem; }
  .case-review.footer-form__form { padding-block: 2.5rem; }
  .footer-form__map iframe { height: 20rem; min-height: 20rem; }
}

/* Native article lists: circular arrows and numbered circles in Berke navy.
 * Keep list spacing separate from the shared typography utilities. */
.berke-practice-template__article .entry-content :is(ul,ol) {
  margin: 0 0 1.5em; padding: 1.5rem 2rem 1.5rem 4.375rem;
  background: var(--gray); clear: both;
}
.berke-practice-template__article .entry-content ul { list-style: none; }
.berke-practice-template__article .entry-content ol { list-style: none; }
.berke-practice-template__article .entry-content li { position: relative; margin: 0 0 1rem; padding: 0; }
.berke-practice-template__article .entry-content li:last-child { margin-bottom: 0; }
.berke-practice-template__article .entry-content ul > li::before {
  content: ""; position: absolute; inset-inline-start: -2.5rem; top: .15em;
  width: 1.625rem; height: 1.625rem; background: var(--secondary);
  -webkit-mask: url("../icons/article-list/article-arrow-circle.svg") center / contain no-repeat;
  mask: url("../icons/article-list/article-arrow-circle.svg") center / contain no-repeat;
}
/* Use the native list-item counter so start, reversed, and item values keep their meaning. */
.berke-practice-template__article .entry-content ol > li::before {
  content: counter(list-item); position: absolute; inset-inline-start: -2.5rem; top: .15em;
  display: grid; place-items: center; width: 1.625rem; height: 1.625rem;
  border: 1px solid var(--secondary); border-radius: 50%; color: var(--secondary);
  background: transparent; font-family: var(--font-body); font-size: var(--font-size-14);
  font-weight: var(--font-weight-semibold); line-height: 1; font-variant-numeric: tabular-nums;
}
.berke-practice-template__article .entry-content li > :is(ul,ol) {
  background: transparent; margin: 1rem 0 0; padding: 0 0 0 2.5rem;
}
.berke-practice-template__article .entry-content li > p { margin: 0 0 .75rem; }
.berke-practice-template__article .entry-content li > p:last-child { margin-bottom: 0; }
@media (max-width: 47.99rem) {
  .berke-practice-template__article .entry-content :is(ul,ol) { padding: 1.25rem 1rem 1.25rem 3.5rem; }
  .berke-practice-template__article .entry-content :is(ul,ol) > li::before { inset-inline-start: -2.25rem; }
  .berke-practice-template__article .entry-content li > :is(ul,ol) { padding: 0 0 0 2.25rem; }
}

/* Accessible social links in the Gutenberg-owned footer. */
.berke-footer__tagline { max-width: none; }
.berke-footer__social { margin-top: 1rem; }
.berke-footer__social a { width: 2.25rem; height: 2.25rem; padding: 0; color: var(--secondary); cursor: pointer; }
.berke-footer__social svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.berke-footer__social a:is(:hover, :focus-visible) { background: var(--white); border-color: var(--white); color: var(--secondary); }
