/* WordPress integration: retain the approved mockup and adapt generated markup. */
img { height: auto; }
.hero-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 54% center; }
.patient-menu,.primary-menu,.footer-menu { list-style: none; margin: 0; padding: 0; }
.patient-menu { display: flex; gap: 16px; }
.primary-menu { display: flex; align-items: center; gap: clamp(15px,2vw,30px); }
.primary-nav { gap: 0; }
.primary-menu > li { position: relative; }
.primary-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; padding: 14px; margin: 0; list-style: none; background: white; box-shadow: var(--shadow); }
.primary-menu li:hover > .sub-menu,.primary-menu li:focus-within > .sub-menu { display: block; }
.sub-menu a { display: block; padding: 8px; }
.admin-bar .site-header { top: 32px; }
section[id],footer[id] { scroll-margin-top: 155px; }
.page-content { color: var(--ink); }
.page-content > h1 { color: var(--teal); }
.appointment-form { display: block; }
.appointment-form .gform_wrapper { --gf-color-primary: var(--teal); --gf-color-primary-darker: var(--teal-deep); --gf-color-in-ctrl-primary: var(--teal); --gf-font-family-primary: var(--font-body); }
.appointment-form .gform_fields { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 18px; }
.appointment-form .gfield { grid-column: span 12; min-width: 0; }
.appointment-form .gfield.cary-half { grid-column: span 6; }
.appointment-form .gfield_label { display: block; color: var(--teal); font-size: .84rem; font-weight: 800; margin: 0 0 8px; }
.appointment-form .gfield_required { margin-left: 4px; color: var(--copper-deep); }
.appointment-form .gfield_description,.appointment-form .gform_required_legend { font-size: .78rem; color: var(--gray); }
.gform_wrapper .gform_required_legend { display: none !important; }
.appointment-form input:not([type=submit]):not([type=checkbox]),.appointment-form select,.appointment-form textarea {
  width: 100%; max-width: 100%; min-height: 50px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); background: white; font: 400 16px/1.5 var(--font-body); box-shadow: none;
}
.appointment-form textarea { min-height: 140px; resize: vertical; }
.appointment-form input[type=submit],.appointment-form button[type=submit] {
  display: inline-flex; width: auto; min-height: 50px; padding: 13px 22px; border: 0; border-radius: 7px;
  color: white; background: var(--copper); font: 800 .84rem/1.5 var(--font-body); cursor: pointer;
}
.appointment-form input[type=submit]:hover,.appointment-form button[type=submit]:hover { background: var(--copper-deep); }
.appointment-form .gform_footer { margin-top: 24px; padding: 0; }
.appointment-form .gform_validation_errors { padding: 16px; margin-bottom: 20px; border: 1px solid #b32d2e; border-radius: 8px; }
.appointment-form .gform_validation_errors h2 { font: 700 1rem/1.5 var(--font-body); margin: 0; color: #8a2424; }
.appointment-form .validation_message { color: #8a2424; }
.appointment-form .gform_confirmation_message { color: var(--teal); font-size: 1.1rem; }
.appointment-form .gform_validation_container { display: none !important; }
#main-content .appointment-form .gform_fields { gap: 18px; }
#main-content .appointment-form .gfield { margin: 0; padding: 0; }
#main-content .appointment-form .gfield_label { font: 800 .84rem/1.5 var(--font-body); color: var(--teal); margin-bottom: 8px; }
#main-content .appointment-form input:not([type=hidden]):not([type=submit]):not([type=checkbox]),
#main-content .appointment-form select,#main-content .appointment-form textarea {
  min-height: 50px; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px;
  background-color: white; color: var(--ink); font: 400 16px/1.5 var(--font-body); box-shadow: none;
}
#main-content .appointment-form select { padding-right: 40px; }
#main-content .appointment-form textarea { height: 140px; }
#main-content .appointment-form .gform_footer { margin-top: 24px; padding: 0; }
#main-content .appointment-form button[type=submit] {
  min-height: 50px; border: 0; border-radius: 7px; padding: 13px 22px;
  background: var(--copper); color: white; font: 800 .84rem/1.5 var(--font-body); box-shadow: none;
}
#main-content .appointment-form button[type=submit]:hover { background: var(--copper-deep); }
:focus-visible { outline: 3px solid var(--copper-deep); outline-offset: 4px; }
/* Keep Gravity Forms' active field ring on brand, including its theme overrides. */
#main-content .gform_wrapper input:not([type=submit]):not([type=button]):focus,
#main-content .gform_wrapper select:focus,
#main-content .gform_wrapper textarea:focus {
  border-color: var(--copper-deep) !important;
  outline: 2px solid var(--copper-deep) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgb(119 68 28 / 18%) !important;
}
@media (min-width:1181px) {
  .hero-copy-inner { width: auto; margin-right: 30px; }
}
@media (min-width:1051px) and (max-width:1180px) {
  .brand { width: 220px; }
  .nav-row { gap: 20px; }
  .primary-menu { gap: 13px; }
  .primary-nav a { font-size: .78rem; }
}
@media (max-width:1050px) {
  .insurance-card,.membership-card { min-height: auto; }
  .primary-nav { position: absolute; top: 100%; bottom: auto; max-height: calc(100dvh - 130px); overflow-y: auto; }
  .primary-menu { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .primary-menu a { display: block; }
  .primary-menu .sub-menu { display: block; position: static; box-shadow: none; padding: 0 0 0 20px; }
}
@media (max-width:1100px) {
  #wpadminbar #wp-admin-bar-search,#wpadminbar #wp-admin-bar-my-account .display-name { display: none; }
}
@media (max-width:782px) {
  body.admin-bar #wpadminbar #wp-admin-bar-new-content,body.admin-bar #wpadminbar #wp-admin-bar-edit,
  body.admin-bar #wpadminbar #wp-admin-bar-customize,body.admin-bar #wpadminbar #wp-admin-bar-gform-forms { display: none !important; }
}
@media (max-width:782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width:700px) {
  .nav-row { gap: 16px; }
  .hero-place { white-space: normal; }
  .keep-together { white-space: normal; }
  .hero-image img { object-position: 61% center; }
  .second-opinion { padding: 28px 24px; }
  .appointment-form .gfield.cary-half { grid-column: span 12; }
  .appointment-form input[type=submit],.appointment-form button[type=submit] { width: 100%; }
  .feature-photo img { height: 480px; }
  .section-pad { padding: 64px 0; }
}
@media (max-width:600px) { .admin-bar .site-header { top: 0; } }

/* Homepage sections adapt to the available reading and image widths on tablets. */
@media (min-width: 601px) and (max-width: 1050px) {
  .home main .section-pad { padding-block: clamp(38px, 5vw, 52px); }
  .home .section-pad h2 { font-size: clamp(1.85rem, 3.5vw, 2.35rem); }
  .home .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .trust-grid div { min-height: 0; padding: 16px 20px; border: 0; }
  .home .trust-grid div:nth-child(even) { border-left: 1px solid rgb(255 255 255 / 16%); }
  .home .trust-grid div:nth-child(n+3) { border-top: 1px solid rgb(255 255 255 / 16%); }

  .home .intro-grid, .home .appointment-grid { gap: 24px; }
  .home .intro-heading h2 { margin-bottom: 0; }
  .home .smile-line { width: 110px; height: 12px; margin-top: 16px; }
  .home .intro-copy p:last-child { margin-bottom: 0; }

  .home .feature-grid { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 14px 24px; align-items: start; }
  .home .feature-copy { display: contents; }
  .home .feature-copy > :is(h2, p, a) { grid-column: 2; margin: 0; }
  .home .feature-copy > a { justify-self: start; }
  .home .feature-photo { grid-column: 1; grid-row: 1 / span 4; align-self: stretch; }
  .home .feature-photo img, .home .care-image img { position: absolute; inset: 0; height: 100%; min-height: 0; }
  .home .photo-note { inset: auto 0 0; position: absolute; margin: 0; padding: 14px 18px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .home .qualification-card { grid-column: 1 / -1; margin-top: 10px; padding: 22px 26px; }
  .home .qualification-card ul { columns: 2; column-gap: 28px; }
  .home .qualification-card li { break-inside: avoid; margin: 0 0 8px; }

  .home .care-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 26px; }
  .home .care-copy { grid-area: 1 / 1; padding-left: 18px; }
  .home .care-image { grid-area: 1 / 2; align-self: stretch; }
  .home .second-opinion { grid-column: 1 / -1; gap: 12px; padding: 24px; }
  .home .second-opinion .text-link { max-width: none; }

  .home .section-heading-row { gap: 14px 28px; margin-bottom: 24px; }
  .home .section-heading-row p { margin: 0; }
  .home .service-grid, .home .membership-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .home .service-with-image { grid-template-rows: clamp(135px, 18vw, 185px) 1fr; }
  .home .service-card-copy, .home .service-callout .service-card-copy { padding: 22px; }
  .home .service-card h3 { font-size: 1.65rem; }
  .home .service-callout { grid-column: 1 / -1; }
  .home .insurance-card, .home .membership-card { padding: clamp(20px, 3vw, 32px); }
  .home .insurance-logos, .home .membership-links { margin-top: 18px; }
  .home .membership-links { flex-flow: row wrap; gap: 8px; }
  .home .membership-links .button { width: auto; }

  .home .gallery-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
  .home .reviews-grid { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 24px; }
  .home .reviews-link { margin-top: 16px; }
  .home .reviews blockquote p { font-size: clamp(1.15rem, 2.25vw, 1.45rem); }
  .home .appointment-copy { padding-top: 0; }
  .home .appointment-reminder { margin: 16px 0; padding: 14px 18px; }
  .home .appointment-locations { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
  .home .appointment-form { padding: 24px; }
  .home .associations { padding: 24px 0; }
  .home .association-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
  .home .association-row img { max-height: 62px; }
}

@media (min-width: 800px) and (max-width: 1050px) {
  .home .trust-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home .trust-grid div:nth-child(n+2) { border-top: 0; border-left: 1px solid rgb(255 255 255 / 16%); }
  .home .intro-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 32px; }
  .home .second-opinion { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-content: center; align-items: end; gap: 12px 28px; }
  .home .second-opinion-details { grid-area: 1 / 2 / span 2; align-self: center; }
  .home .second-opinion .text-link { align-self: start; }
  .home .appointment-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  .home .association-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Previously approved care-needs layout. */
@media (min-width: 601px) and (max-width: 1050px) {
  .home .needs-section { padding-block: clamp(40px, 6vw, 60px); }
  .home .needs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px clamp(16px, 3vw, 32px);
  }
  .home .needs-title {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 24px;
    padding: 0 0 20px;
    border-bottom: 1px solid rgb(255 255 255 / 23%);
  }
  .home .needs-title h2 { margin: 0; }
  .home .need-card { padding: 0; border: 0; }
  .home .need-card h3 { margin-bottom: 10px; text-wrap: balance; }
}

/* Keep the couple visible beside the copy in the tablet homepage hero. */
@media (min-width: 601px) and (max-width: 1050px) {
  .home .hero { isolation: isolate; }
  .home .hero-image {
    position: absolute;
    inset: 0 0 0 27%;
    min-height: 0;
    z-index: -1;
  }
  .home .hero-image img { object-position: 39% center; }
  .home .hero-copy {
    min-height: clamp(420px, 50vw, 485px);
    padding: 40px clamp(24px, 4vw, 42px);
    background: linear-gradient(90deg, var(--warm) 27%, rgb(246 242 235 / 96%) 39%, rgb(246 242 235 / 85%) 48%, rgb(246 242 235 / 0%) 65%);
  }
  .home .hero-copy-inner { width: 53%; margin: 0; }
  .home .hero-copy h1 { font-size: clamp(2rem, 4vw, 2.65rem); }
  .home .hero-lead { text-wrap: balance; }
  .home .hero-points { gap: 4px 16px; margin-bottom: 22px; }
  .home .hero-actions { flex-flow: row wrap; gap: 10px; }
  .home .hero-actions .button { width: auto; padding-inline: 16px; }
  .home .hero-actions .button-secondary { background: rgb(246 242 235 / 88%); }
}

@media (min-width: 1051px) {
  .home .hero { grid-template-columns: 1.04fr .96fr; isolation: isolate; }
  .home .hero-image {
    position: absolute;
    grid-column: auto;
    inset: 0 0 0 27%;
    min-height: 0;
    z-index: -1;
    /* Fade the photo into the hero's cream background at the same stops as tablet. */
    mask-image: linear-gradient(90deg, transparent, rgb(0 0 0 / 4%) 16.4%, rgb(0 0 0 / 15%) 28.8%, black 52%);
  }
  .home .hero-image img { object-position: 39% center; }
}
