/*
 * Shared mobile footer rules for the exported pages.
 *
 * The desktop footer is intentionally outside this media query.  This file is
 * loaded after the existing export overrides, so the compact mobile order and
 * the 18px rhythm are consistent on every HTML route without changing the
 * source markup.
 */

/* Legal links expose one label per mode while keeping both approved texts in
   the DOM for the shared HTML footer. */
.legal-mobile-label {
  display: none;
}

@media screen and (max-width: 767px) {
  :root {
    --mobile-footer-rhythm: 1.125rem;
    --mobile-footer-brand-top: 1.75rem;
    --mobile-footer-legal-row-gap: .4625rem;
    --mobile-footer-line: rgb(245 227 196 / 38%);
    --mobile-footer-text: #f5e3c4;
    --mobile-footer-heading: #fff3e0;
    --mobile-footer-navigation: #debb81;
  }

  section.is-footer-1st,
  section.is-footer-2nd {
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
  }

  section.is-footer-1st,
  body > section.section.is-footer-1st {
    padding: var(--mobile-footer-brand-top) 0 0 !important;
  }

  section.is-footer-2nd {
    padding: var(--mobile-footer-rhythm) 0 0 !important;
  }

  .cont-is-footer-1st,
  .cont-is-footer-2nd {
    width: min(100%, 74rem);
    min-width: 0;
    padding-inline: clamp(1rem, 5.5vw, 2rem);
    box-sizing: border-box;
    font-family: "Instrument Sans", sans-serif !important;
  }

  .cont-is-footer-1st *,
  .cont-is-footer-2nd * {
    font-family: "Instrument Sans", sans-serif !important;
  }

  /* Brand, services and the four patient links are one vertical stack. */
  .grid_footer_1st {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
    row-gap: var(--mobile-footer-rhythm) !important;
    margin: 0;
  }

  .grid_footer_1st > * {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    min-width: 0;
    margin: 0;
  }

  .area-2_grid_ft_1st_map_wrp,
  .area-5_grid_ft_1st {
    display: none !important;
  }

  .area-1_grid_ft_1st {
    display: flex;
    align-items: center;
    gap: .75rem;
  }

  .logo_wrapper_footer_1st,
  .logo_img_footer_1st {
    width: 2.5rem;
    height: 2.5rem;
  }

  .logo_wrapper_footer_1st {
    flex: 0 0 2.5rem;
  }

  .logo_img_footer_1st {
    display: block;
    object-fit: contain;
  }

  .compname_wrapper_footer_1st {
    min-width: 0;
    margin: 0;
    text-align: left;
  }

.compname_h2_footer_1st {
  margin: 0;
  color: var(--mobile-footer-heading) !important;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
}

.txt_dmc_footer_1st {
  margin: 0;
  color: var(--mobile-footer-heading) !important;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
}

  .area-3_grid_ft_1st,
  .area-4_grid_ft_1st {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    min-width: 0;
  }

  .div-1_area-3_grid_ft_1st,
  .div-1_area-4_grid_ft_1st-copy {
    margin: 0;
  }

  .txt_area-3-grid-footer_1st,
  .area-4_grid_ft_1st > .div-1_area-4_grid_ft_1st-copy .txt_phone_footer_1st {
    color: var(--mobile-footer-navigation) !important;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: left;
  }

  .area-3_grid_ft_1st > .link_serv_01_footer_1st,
  .area-4_grid_ft_1st > .link_serv_01_footer_1st {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: var(--mobile-footer-navigation) !important;
    font-size: .7rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
  }

  .area-3_grid_ft_1st .txt_link_serv_01_footer_1st,
  .area-4_grid_ft_1st .txt_link_serv_01_footer_1st {
    color: var(--mobile-footer-navigation) !important;
    font-size: .7rem !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
  }

  .area-3_grid_ft_1st > .link_serv_01_footer_1st:focus-visible,
  .area-4_grid_ft_1st > .link_serv_01_footer_1st:focus-visible,
  .link-1_grid_footer_2nd:focus-visible,
  .area-6_grid_footer_2nd a:focus-visible {
    border-radius: .2rem;
    outline: 2px solid var(--mobile-footer-heading);
    outline-offset: 3px;
  }

  /* The export has the full patient list in every page.  Keep only the four
     approved destinations and order them by their stable hrefs. */
  .area-4_grid_ft_1st > .link_serv_01_footer_1st {
    display: none;
  }

  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="team.html"],
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="chiefdoctor.html"],
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="faq.html"],
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="actions.html"] {
    display: block;
  }

  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="team.html"] { order: 1; }
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="chiefdoctor.html"] { order: 2; }
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="faq.html"] { order: 3; }
  .area-4_grid_ft_1st > .link_serv_01_footer_1st[href="actions.html"] { order: 4; }

  .patient-desktop-label { display: none; }
  .patient-mobile-label { display: inline; }

  /* Legal list, social row and their three separate thin dividers. */
  .footer-2nd-line {
    display: none !important;
    height: 0 !important;
  }

  .footer-2nd-line-bottom,
  .area-1_grid-2_footer_2nd,
  .area-5_grid_footer_2nd,
  .footer-mobile-attention {
    display: none !important;
  }

  .grid_footer_2nd_wrapper {
    margin: 0;
    padding: var(--mobile-footer-rhythm) 0 0;
    border-top: 1px solid var(--mobile-footer-line);
    border-bottom: 0;
  }

  .grid_footer_2nd {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
    row-gap: var(--mobile-footer-legal-row-gap);
    margin: 0;
  }

  .grid_footer_2nd > [class*="area-"] {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100%;
    min-width: 0;
  }

  .area-2_grid_footer_2nd,
  .area-3_grid_footer_2nd,
  .area-4_grid_footer_2nd {
    border: 0;
  }

  .link-1_grid_footer_2nd {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
  }

  .txt_link_grid_footer_2nd {
    color: #a27228 !important;
    font-size: .65rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left !important;
  }

  .area-2_grid_footer_2nd {
    display: grid;
    gap: .5rem;
  }

  .legal-desktop-label {
    display: none !important;
  }

  .legal-mobile-label {
    display: inline !important;
  }

  .area-6_grid_footer_2nd {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: .75rem;
    min-height: 3.25rem;
    margin-top: calc(var(--mobile-footer-rhythm) - var(--mobile-footer-legal-row-gap));
    padding: var(--mobile-footer-rhythm) 0;
    border-top: 1px solid var(--mobile-footer-line);
    border-bottom: 1px solid var(--mobile-footer-line);
  }

  .text-1_grid_footer_2nd {
    flex: 0 1 auto;
    color: #a27228 !important;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: nowrap;
  }

  .link-soc-1_grid_footer_2nd,
  .link-soc-2_grid_footer_2nd {
    display: inline-flex;
    flex: 0 0 1.875rem;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
  }

  .img_link-soc-1_grid_footer_2nd,
  .img_link-soc-2_grid_footer_2nd {
    display: block;
    width: 1.875rem;
    height: 1.875rem;
    object-fit: contain;
    filter: none;
  }

  /* Copyright and the final MakArt row use the same 18px token. */
  .grid-2_footer_2nd {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: none !important;
    row-gap: 0;
    margin: 0;
  }

  .grid-2_footer_2nd > [class*="area-"] {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .area-2_grid-2_footer_2nd {
    display: block;
    width: 100%;
    min-width: 0;
    padding: var(--mobile-footer-rhythm) 0;
    text-align: center;
  }

  .footer-2nd_img_bg_16x16,
  .txt_copyright_footer_2nd-copy {
    display: none !important;
  }

  .footer-2nd_copyright_bg {
    display: block;
    width: 100%;
    height: auto;
    color: var(--mobile-footer-text);
    font-size: .65rem;
    line-height: 1.35;
    text-align: center;
  }

  .footer-mobile-copyright {
    display: block !important;
    width: 100%;
    color: #a27228 !important;
    font-size: .5rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
  }

  .area-3_grid-2_footer_2nd {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0 var(--mobile-footer-rhythm);
    text-align: center;
  }

  .area-3_grid-2_footer_2nd::before {
    content: "";
    display: block;
    width: 30%;
    height: 1px;
    margin: 0 auto var(--mobile-footer-rhythm);
    background: var(--mobile-footer-line);
  }

  .txt_area-3_grid-2_footer_2nd {
    color: #a27228 !important;
    font-size: .425rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
  }
}
