/* El Gravo 2.0 — home page composition.
   One bold gesture: the first screen ends in a smile-shaped curve.
   Everything after it is quiet: white space, hairlines, real people. */

.home-main {
  /* Depth of the smile curve, and the room the layout keeps for it. The curve
     is deeper than the room on purpose: its ends rise higher without making
     the first screen taller. */
  --eg-smile: clamp(92px, 13vw, 226px);
  --eg-smile-room: clamp(64px, 9vw, 156px);
  --eg-home-width: calc(var(--eg-max) + 2 * var(--eg-gutter));
}
.home-main .entry-content > * { margin-block: 0; }
.home-main :is(.eg-home-services, .eg-home-clinic, .eg-home-principles, .eg-home-visit, .eg-home-reviews, .eg-home-doctors) {
  max-width: var(--eg-home-width);
  margin: 0 auto !important;
  padding: var(--eg-section) var(--eg-gutter) 0;
}
.home-main .eg-home-departments { max-width: var(--eg-home-width); margin: 0 auto !important; padding: var(--eg-section) var(--eg-gutter) 0; }
.home-main .eg-home-departments > .eg-departments { margin: 0 !important; }
.home-main .eg-home-services { padding-top: calc(var(--eg-section) * 1.25); }
.home-main :is(.eg-home-services, .eg-home-clinic, .eg-home-principles, .eg-home-visit, .eg-home-reviews, .eg-home-doctors) :is(h2, h3, p, ul, ol) { margin-top: 0; }
.home-main .eg-eyebrow { margin: 0 0 18px; color: var(--eg-ink-soft); font-size: 15px; line-height: 1.4; font-weight: 450; letter-spacing: 0; text-transform: none; }

/* ——— First screen ——— */
.home-main .eg-home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  min-height: clamp(560px, 48vw, 740px);
  margin: 4px clamp(8px, 1vw, 16px) 0 !important;
  background: #fdf1e6;
  --eg-hero-curve: calc(var(--eg-smile) * var(--eg-hero-progress, 1));
  border-radius: 32px 32px 50% 50% / 32px 32px var(--eg-hero-curve) var(--eg-hero-curve);
  overflow: hidden;
  isolation: isolate;
}
.home-main .eg-home-hero > * { margin: 0 !important; }
.home-main .eg-hero-photo {
  position: absolute; inset: 0 0 0 auto; z-index: -1;
  width: 66%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%);
  mask-image: linear-gradient(90deg, transparent 0, #000 30%);
}
.home-main .eg-hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 64% 38%; border-radius: 0; }
.home-main .eg-hero-copy {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100%; max-width: var(--eg-home-width); margin: 0 auto !important;
  padding: clamp(48px, 6vw, 96px) var(--eg-gutter) calc(var(--eg-smile-room) + clamp(40px, 4vw, 64px));
}
.home-main .eg-hero-copy > * { margin: 0 !important; }
.home-main .eg-hero-copy .eg-eyebrow { max-width: 24em; margin-bottom: 22px !important; font-size: 30px; line-height: 1.3; }
.home-main .eg-hero-title {
  max-width: 9em;
  color: var(--eg-ink);
  font-size: var(--eg-fs-display);
  font-weight: 290;
  font-variation-settings: "CRSV" 1;
  line-height: .96;
  letter-spacing: -.045em;
}
.home-main .eg-hero-desc { max-width: 27em; margin-top: 30px !important; color: var(--eg-ink-soft); font-size: var(--eg-fs-lead); line-height: 1.55; }
.home-main .eg-hero-desc-mobile { display: none; }
.home-main .eg-hero-actions { gap: 12px; margin-top: 38px !important; }
.home-main .eg-hero-actions .wp-block-button__link { min-height: 60px; padding: 0 34px; font-size: 17px; }
.home-main .eg-hero-actions .is-style-outline .wp-block-button__link { background: rgba(255, 255, 255, .55); padding: 0 30px; }
.home-main .eg-hero-actions .is-style-outline .wp-block-button__link:hover { background: #fff; }

/* ——— Directions of treatment: a list, not a grid of boxes ——— */
.home-main .eg-services-intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 25px 64px; align-items: end; margin: 0 0 clamp(40px, 5vw, 70px) !important; padding: 0; background: none; color: inherit; }
.home-main .eg-services-intro > * { margin: 0 !important; }
.home-main .eg-services-intro .eg-section-title > * { margin: 0; }
.home-main .eg-services-intro .eg-section-title .eg-eyebrow { margin-bottom: 18px; }
.home-main .eg-services-intro h2 { max-width: 14em; }
.home-main .eg-services-intro > p { max-width: 34em; color: var(--eg-ink-soft); font-size: var(--eg-fs-lead); line-height: 1.55; }

.home-main .eg-service-grid { display: block; margin: 0 !important; border-top: 1px solid var(--eg-line); }
.home-main .eg-service-card {
  --eg-icon-size: 83.2px;
  position: relative;
  display: grid;
  grid-template-columns: var(--eg-icon-size) minmax(0, 4.4fr) minmax(0, 6fr) 56px;
  grid-template-rows: auto auto;
  column-gap: clamp(20px, 2.6vw, 40px);
  align-items: center;
  min-height: 0;
  margin: 0 !important;
  padding: 32.5px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--eg-line);
  border-radius: 0;
}
.home-main .eg-service-card:hover { background: none; }
.home-main .eg-service-card > * { margin: 0 !important; }
.home-main .eg-service-card > .eg-service-icon { grid-column: 1; grid-row: 1 / 3; }
.home-main .eg-service-card > h3 { grid-column: 2; grid-row: 1; align-self: end; font-size: clamp(22px, 1.9vw, 28px); font-weight: 380; font-variation-settings: "CRSV" 1; letter-spacing: -.025em; line-height: 1.12; }
.home-main .eg-service-card > p:first-of-type { grid-column: 2; grid-row: 2; align-self: start; margin-top: 6px !important; color: var(--eg-ink-soft); font-size: 15px; line-height: 1.45; }
.home-main .eg-service-card > ul { grid-column: 3; grid-row: 1 / 3; position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.home-main .eg-service-card li { display: inline-flex; margin: 0; }
.home-main .eg-service-card li > a, .home-main .eg-service-card li:not(:has(a)) { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: var(--eg-r-pill); background: var(--eg-lilac); color: var(--eg-ink); font-size: 14px; line-height: 1.25; text-decoration: none; transition: color .22s ease .04s, background-color .22s ease .04s; }
.home-main .eg-service-card li > a:is(:hover, :focus-visible) { color: var(--eg-ink); background: var(--eg-apricot); }
.home-main .eg-service-card > p:last-of-type { grid-column: 4; grid-row: 1 / 3; justify-self: end; }
.home-main .eg-service-more { display: block; width: 52px; height: 52px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--eg-line-strong); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3E%3Cpath d='M3 9h12m-5-5 5 5-5 5' stroke='%232d2a47' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; font-size: 0; color: transparent; transition: background-color .18s, box-shadow .18s; }
.home-main .eg-service-more::after { content: ''; position: absolute; inset: 0; }
.home-main .eg-service-more img { display: none; }
.home-main .eg-service-card:hover .eg-service-more { background-color: var(--eg-apricot); box-shadow: none; }
.home-main .eg-service-card:hover > h3 { color: var(--eg-ink); }
.home-main .eg-service-more:focus-visible { outline-offset: 4px; border-radius: 50%; }

.home-main .eg-service-help {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 10px 48px; align-items: center;
  min-height: 0; margin: clamp(32px, 4vw, 48px) 0 0 !important; padding: clamp(28px, 3.4vw, 48px) clamp(28px, 4vw, 56px);
  background: var(--eg-ink); color: var(--eg-on-ink); border: 0; border-radius: var(--eg-r-l);
}
.home-main .eg-service-help > * { margin: 0 !important; }
.home-main .eg-service-help h3 { grid-column: 1; color: var(--eg-on-ink); font-size: clamp(26px, 2.4vw, 36px); font-weight: 340; font-variation-settings: "CRSV" 1; letter-spacing: -.03em; line-height: 1.1; }
.home-main .eg-service-help p { grid-column: 1; max-width: 46em; color: var(--eg-on-ink-soft); font-size: 16px; line-height: 1.55; }
.home-main .eg-service-help .wp-block-buttons { grid-column: 2; grid-row: 1 / 3; width: auto; }
.home-main .eg-service-help .wp-block-button, .home-main .eg-service-help .wp-block-button__link { width: auto; }
.home-main .eg-service-help .wp-block-button__link { min-height: 56px; padding: 0 30px; }
.home-main .eg-service-help :focus-visible { outline-color: var(--eg-apricot); }

.home-main .eg-medical-catalog { max-width: none; margin: clamp(56px, 6vw, 88px) 0 0 !important; padding: 0; }
.home-main .eg-medical-catalog > h2 { margin: 0 0 20px; font-size: clamp(24px, 2vw, 30px); font-weight: 380; }
.home-main .eg-medical-directions { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.home-main .eg-medical-directions > details { margin: 0 !important; padding: 0; border: 0; border-top: 1px solid var(--eg-line); border-radius: 0; background: none; }
.home-main .eg-medical-directions > details:nth-last-child(-n+2) { border-bottom: 1px solid var(--eg-line); }
.home-main .eg-medical-directions summary { position: relative; display: flex; align-items: center; min-height: 64px; padding: 14px 52px 14px 0; list-style: none; font-size: 17px; font-weight: 450; line-height: 1.35; cursor: pointer; }
.home-main .eg-medical-directions summary::-webkit-details-marker { display: none; }
.home-main .eg-medical-directions summary::after { content: ''; position: absolute; right: 0; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: var(--eg-lilac) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%232d2a47' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat; transition: transform .2s, background-color .15s; }
.home-main .eg-medical-directions summary:hover::after { background-color: var(--eg-lilac-strong); }
.home-main .eg-medical-directions details[open] > summary::after { transform: rotate(45deg); }
.home-main .eg-medical-directions details > :not(summary) { margin: 0 0 22px; padding: 0 52px 0 0; color: var(--eg-ink-soft); font-size: 15px; line-height: 1.65; }
.home-main .eg-medical-directions details ul { padding-left: 18px; }
.home-main .eg-medical-directions details li { margin: 0 0 4px; }
.home-main .eg-medical-directions details li::marker { color: var(--eg-apricot); }

/* ——— Fork after the directions: know your specialist → department; don't know → we help ——— */
.home-main .eg-departments { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: stretch; margin: clamp(40px, 5vw, 64px) 0 0 !important; }
.home-main .eg-departments > * { margin: 0 !important; min-width: 0; }
.home-main .eg-departments-index { padding: clamp(28px, 3.4vw, 48px); background: var(--eg-lilac); border-radius: var(--eg-r-l); }
.home-main .eg-departments-index > * { margin: 0 !important; }
.home-main .eg-departments-index h3, .home-main .eg-departments .eg-service-help h3 { font-size: clamp(26px, 2.4vw, 36px); font-weight: 340; font-variation-settings: "CRSV" 1; letter-spacing: -.03em; line-height: 1.1; }
.home-main .eg-departments-index > p { max-width: 34em; margin-top: 10px !important; color: var(--eg-ink-soft); font-size: 16px; line-height: 1.55; }
.home-main .eg-department-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(20px, 2.4vw, 32px); margin-top: 24px !important; padding: 0; list-style: none; }
.home-main .eg-department-list li { position: relative; margin: 0; padding: 14px 44px 16px 0; border-top: 1px solid var(--eg-line-strong); color: var(--eg-ink-soft); font-size: 14px; line-height: 1.45; }
.home-main .eg-department-list li a { color: var(--eg-ink); font-size: 18px; font-weight: 500; line-height: 1.6; text-decoration: none; }
.home-main .eg-department-list li a::after { content: ''; position: absolute; inset: 0; border-radius: 8px; }
.home-main .eg-department-list li::after { content: ''; position: absolute; right: 0; top: 50%; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: var(--eg-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Cpath d='M2.5 7h9m-3.5-3.5L11.5 7 8 10.5' stroke='%232d2a47' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat; transition: background-color .22s ease .04s; pointer-events: none; }
.home-main .eg-department-list li:hover::after { background-color: var(--eg-apricot); }
.home-main .eg-department-list li:is(:hover, :focus-within) a { color: var(--eg-link-hover); }
.home-main .eg-departments .eg-service-help { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; margin: 0 !important; padding: clamp(28px, 3.4vw, 48px); }
.home-main .eg-departments .eg-service-help p { max-width: 26em; }
.home-main .eg-departments .eg-service-help .wp-block-buttons { margin-top: auto !important; }
.home-main .eg-departments .eg-service-help p + p { margin-top: -6px !important; }
.home-main .eg-departments .eg-service-help a:not(.wp-block-button__link) { color: var(--eg-on-ink); font-weight: 500; white-space: nowrap; }
.home-main .eg-departments .eg-service-help a:not(.wp-block-button__link):is(:hover, :focus-visible) { color: var(--eg-apricot); }

/* ——— Founders: the people step out of the panel ——— */
.home-main .eg-home-clinic { padding-top: calc(var(--eg-section) + 40px); }
.home-main .eg-clinic-panel {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--eg-ink); color: var(--eg-on-ink);
  border-radius: 40px;
  overflow: visible;
}
.home-main .eg-clinic-panel > * { margin: 0 !important; min-width: 0; }
.home-main .eg-clinic-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding: clamp(36px, 5.5vw, 88px); }
.home-main .eg-clinic-copy > * { margin: 0 !important; }
.home-main .eg-clinic-copy .eg-eyebrow { display: none; }
.home-main .eg-clinic-copy h2 { margin-bottom: 28px !important; color: var(--eg-on-ink); }
.home-main .eg-clinic-copy p { max-width: 34em; color: var(--eg-on-ink-soft); font-size: 16px; line-height: 1.65; }
.home-main .eg-clinic-copy p + p { margin-top: 14px !important; }
.home-main .eg-clinic-copy .eg-eyebrow + h2 + p, .home-main .eg-clinic-copy h2 + p { color: var(--eg-on-ink); font-size: var(--eg-fs-lead); line-height: 1.5; }
.home-main .eg-clinic-copy .wp-block-buttons { margin-top: 32px !important; }
.home-main .eg-clinic-copy .is-style-outline .wp-block-button__link { background: transparent; color: var(--eg-on-ink); box-shadow: inset 0 0 0 1.5px var(--eg-on-ink-soft); }
.home-main .eg-clinic-copy .is-style-outline .wp-block-button__link:hover { background: var(--eg-apricot); color: var(--eg-ink); box-shadow: inset 0 0 0 1.5px var(--eg-apricot); }
.home-main .eg-clinic-panel :focus-visible { outline-color: var(--eg-apricot); }
.home-main .eg-clinic-portrait { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; margin-top: clamp(-96px, -6vw, -48px) !important; padding: 0; background: none; }
.home-main .eg-clinic-portrait figure { display: flex; justify-content: center; margin: 0 !important; }
.home-main .eg-clinic-portrait figure img { display: block; width: auto; max-width: 100%; height: clamp(440px, 44vw, 640px); object-fit: contain; object-position: bottom; border-radius: 0; }
.home-main .eg-founders-caption { position: absolute; right: clamp(16px, 2.4vw, 32px); bottom: clamp(16px, 2.4vw, 32px); margin: 0 !important; padding: 12px 18px; background: var(--eg-paper); border-radius: var(--eg-r-m); color: var(--eg-ink-soft); font-size: 13px; line-height: 1.45; text-align: left; box-shadow: 0 10px 30px -14px rgba(45, 42, 71, .35); }
.home-main .eg-founders-caption::first-line { color: var(--eg-ink); font-weight: 500; font-size: 14px; }

/* ——— The team (added after the founders by functions.php) ——— */
.home-main .eg-home-doctors .elgravo-doctors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-main .eg-home-doctors .eg-doctor-portrait { aspect-ratio: 1 / 1.1; }
.home-main .eg-all-doctors-link { display: flex; flex-direction: column; color: var(--eg-ink); text-decoration: none; border-radius: 28px; }
.home-main .eg-all-doctors-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: clamp(22px, 3vw, 40px); background: var(--eg-lilac); border-radius: 28px; aspect-ratio: 1 / 1.1; font-size: clamp(25px, 2.8vw, 40px); font-weight: 380; line-height: 1.15; transition: background-color .22s ease .04s; }
.home-main .eg-all-doctors-tile > span:last-child { align-self: flex-end; font-size: 36px; }
.home-main .eg-all-doctors-link:is(:hover, :focus-visible) .eg-all-doctors-tile { background: var(--eg-apricot); }

/* ——— Why El Gravo: generic layout in design-system.css; the heading stays in view here ——— */

/* ——— First visit: the only warm panel, where the booking happens ——— */
.home-main .eg-visit-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: clamp(32px, 5vw, 88px); align-items: start; padding: clamp(28px, 5.5vw, 88px); background: var(--eg-apricot-wash); border-radius: 40px; }
.home-main .eg-visit-layout > * { margin: 0 !important; min-width: 0; }
.home-main .eg-visit-copy > h2 { margin: 0 0 18px; }
.home-main .eg-visit-copy > p { max-width: 30em; margin: 0; color: var(--eg-ink-soft); font-size: var(--eg-fs-lead); line-height: 1.55; }
.home-main .eg-visit-steps { counter-reset: visit; display: grid; gap: 0; margin: clamp(32px, 4vw, 48px) 0 0 !important; padding: 0; list-style: none; }
.home-main .eg-visit-steps > li { counter-increment: visit; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px; padding: 22px 0 24px; background: none; border-top: 1px solid rgba(45, 42, 71, .12); border-radius: 0; }
.home-main .eg-visit-steps > li::before { content: counter(visit); grid-row: 1 / 3; width: auto; height: auto; display: block; background: none; color: var(--eg-ink); font-size: 46px; line-height: .9; font-weight: 230; font-variation-settings: "CRSV" 1; letter-spacing: -.04em; }
.home-main .eg-visit-steps strong { display: block; font-size: 19px; font-weight: 500; line-height: 1.3; }
.home-main .eg-visit-steps p { grid-column: 2; margin: 6px 0 0 !important; color: var(--eg-ink-soft); font-size: 15px; line-height: 1.55; }
.home-main .eg-visit-form { padding: 0; background: none; border: 0; border-radius: 0; }
.home-main .eg-visit-form > p { display: none; }
.home-main .eg-visit-form .wpcf7 { border: 0; box-shadow: 0 30px 60px -36px rgba(120, 72, 30, .35); }

/* ——— Reviews: words first, names after ——— */
.home-main .eg-home-reviews { padding-bottom: var(--eg-section); background: none; border-radius: 0; }
.home-main .eg-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; margin: 0 0 clamp(28px, 3vw, 44px) !important; }
.home-main .eg-section-heading > * { margin: 0 !important; }
.home-main .eg-home-reviews .elgravo-section, .home-main .eg-home-reviews .wp-block-columns, .home-main .eg-home-reviews .wp-block-column { margin: 0 !important; padding: 0; display: block; }
.home-main .eg-home-reviews .elgravo-reviews { display: block; columns: 3 300px; column-gap: 20px; }
.home-main .eg-home-reviews .elgravo-review { break-inside: avoid; margin: 0 0 20px; }
.home-main .eg-home-reviews .elgravo-review-body { font-size: 16px; line-height: 1.6; }

@media (max-width: 1100px) {
  .home-main .eg-home-doctors .elgravo-doctors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-main .eg-home-hero { display: flex; flex-direction: column; min-height: 0; }
  .home-main .eg-hero-photo { position: relative; inset: auto; z-index: 0; order: -1; width: 100%; height: auto; aspect-ratio: 16 / 7; -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); border-radius: 0; }
  .home-main .eg-hero-photo img { object-position: 70% 40%; }
  .home-main .eg-hero-copy { padding-top: clamp(28px, 4vw, 48px); }
  .home-main .eg-hero-title { max-width: none; }
  .home-main .eg-service-card { grid-template-columns: 70.4px minmax(0, 1fr) 52px; --eg-icon-size: 70.4px; row-gap: 0; }
  .home-main .eg-service-card > ul { grid-column: 1 / 3; grid-row: 3; margin-top: 20px !important; }
  .home-main .eg-service-card > p:last-of-type { grid-column: 3; grid-row: 1 / 3; }
  .home-main .eg-visit-layout { grid-template-columns: 1fr; }
  .home-main .eg-visit-form { max-width: 560px; }
}
@media (max-width: 900px) {
  .home-main .eg-departments { grid-template-columns: 1fr; }
  .home-main .eg-services-intro { grid-template-columns: 1fr; }
  .home-main .eg-clinic-panel { grid-template-columns: 1fr; }
  .home-main .eg-clinic-portrait { order: -1; margin-top: -48px !important; }
  .home-main .eg-clinic-portrait figure img { height: clamp(360px, 70vw, 520px); }
  .home-main .eg-clinic-copy { padding-top: 12px; }
}
@media (max-width: 760px) {
  .home-main { --eg-smile: 92px; --eg-smile-room: 64px; }
  .home-main .eg-home-hero { margin: 0 8px !important; border-radius: 24px 24px 50% 50% / 24px 24px var(--eg-hero-curve) var(--eg-hero-curve); }
  .home-main .eg-hero-photo { aspect-ratio: 5 / 4; }
  .home-main .eg-hero-photo img { object-position: 74% 40%; }
  .home-main .eg-hero-copy { padding: 28px 20px calc(var(--eg-smile-room) + 32px); }
  .home-main .eg-hero-copy .eg-eyebrow { margin-bottom: 14px !important; font-size: 28px; }
  .home-main .eg-hero-title { font-size: clamp(34px, 10.6vw, 52px); }
  .home-main .eg-hero-desc-desktop { display: none; }
  .home-main .eg-hero-desc-mobile { display: block; margin-top: 18px !important; font-size: 17px; }
  .home-main .eg-hero-actions { width: 100%; margin-top: 26px !important; flex-wrap: nowrap; }
  .home-main .eg-hero-actions > .wp-block-button { flex: 1 1 0; }
  .home-main .eg-hero-actions > .wp-block-button.eg-hero-secondary { display: block; }
  .home-main .eg-hero-actions .wp-block-button__link { width: 100%; min-height: 54px; padding: 0 12px; font-size: 15.5px; white-space: nowrap; }

  .home-main .eg-service-card { --eg-icon-size: 51.2px; grid-template-columns: 51.2px minmax(0, 1fr); column-gap: 16px; padding: 27.5px 0; }
  .home-main .eg-service-card > .eg-service-icon { grid-row: 1 / 3; align-self: start; }
  .home-main .eg-service-card > h3 { font-size: 22px; }
  .home-main .eg-service-card > ul { grid-column: 1 / -1; grid-row: 3; margin-top: 17.5px !important; gap: 6px; }
  .home-main .eg-service-card li > a, .home-main .eg-service-card li:not(:has(a)) { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
  /* Title keeps the full width; «Подробнее» becomes its own row under the chips. */
  .home-main .eg-service-card > p:last-of-type { position: static; grid-column: 1 / -1; grid-row: 4; justify-self: start; margin-top: 14px !important; }
  .home-main .eg-service-more {
    display: inline-flex; align-items: center; gap: 12px; width: auto; height: auto; min-height: 40px;
    border-radius: 0; box-shadow: none; background: none;
    color: var(--eg-ink); font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none;
  }
  .home-main .eg-service-more::before {
    content: ''; order: 2; flex: none; width: 36px; height: 36px; border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--eg-line-strong);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none'%3E%3Cpath d='M3 9h12m-5-5 5 5-5 5' stroke='%232d2a47' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
    transition: background-color .18s, box-shadow .18s;
  }
  .home-main .eg-service-card:hover .eg-service-more { background: none; }
  .home-main .eg-service-card:hover .eg-service-more::before { background-color: var(--eg-apricot); box-shadow: none; }
  .home-main .eg-service-more:focus-visible { border-radius: var(--eg-r-pill); outline-offset: 4px; }
  .home-main .eg-service-help { grid-template-columns: 1fr; padding: 28px 24px; border-radius: 28px; }
  .home-main .eg-service-help .wp-block-buttons { grid-column: 1; grid-row: auto; margin-top: 12px !important; }
  .home-main .eg-service-help .wp-block-button, .home-main .eg-service-help .wp-block-button__link { width: 100%; }
  .home-main .eg-medical-directions { grid-template-columns: 1fr; }
  .home-main .eg-departments-index { padding: 28px 22px; border-radius: 28px; }
  .home-main .eg-department-list { grid-template-columns: 1fr; }
  .home-main .eg-departments .eg-service-help .wp-block-buttons { width: 100%; }
  .home-main .eg-medical-directions > details:nth-last-child(2) { border-bottom: 0; }

  .home-main .eg-home-clinic { padding-top: calc(var(--eg-section) + 24px); }
  .home-main .eg-clinic-panel { border-radius: 28px; }
  .home-main .eg-clinic-portrait figure img { height: 340px; }
  .home-main .eg-founders-caption { right: 12px; bottom: 12px; padding: 10px 14px; }
  .home-main .eg-clinic-copy { padding: 8px 22px 28px; }
  .home-main .eg-clinic-copy .wp-block-buttons, .home-main .eg-clinic-copy .wp-block-button, .home-main .eg-clinic-copy .wp-block-button__link { width: 100%; }

  .home-main .eg-visit-layout { padding: 28px 20px 20px; border-radius: 28px; margin-inline: -8px !important; }
  .home-main .eg-visit-steps > li { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; padding: 18px 0 20px; }
  .home-main .eg-visit-steps > li::before { font-size: 36px; }
  .home-main .eg-visit-steps strong { font-size: 17px; }
  .home-main .eg-visit-form .wpcf7 { padding: 22px 18px; border-radius: 22px; }
  .home-main .eg-section-heading .wp-block-buttons { width: 100%; }
  .home-main .eg-home-doctors { padding-inline: 0; }
  .home-main .eg-home-doctors .eg-section-heading { padding-inline: var(--eg-gutter); }
  .home-main .eg-home-doctors .elgravo-doctors { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--eg-gutter); padding: 0 var(--eg-gutter) 8px; scrollbar-width: none; }
  .home-main .eg-home-doctors .elgravo-doctors::-webkit-scrollbar { display: none; }
  .home-main .eg-home-doctors .elgravo-doctor { scroll-snap-align: start; }
}

/* ——— The curve and photo follow scrolling in both directions ——— */
@media (prefers-reduced-motion: no-preference) {
  .home-main .eg-hero-photo img { transform: scale(calc(1 + (1 - var(--eg-hero-progress, 1)) * .09)); }
  .home-main .eg-hero-copy > * { animation: eg-rise .8s cubic-bezier(.22, .8, .24, 1) both; }
  .home-main .eg-hero-copy > :nth-child(2) { animation-delay: .08s; }
  .home-main .eg-hero-copy > :nth-child(3), .home-main .eg-hero-copy > :nth-child(4) { animation-delay: .16s; }
  .home-main .eg-hero-copy > :nth-child(5) { animation-delay: .24s; }
}
@keyframes eg-rise { from { opacity: 0; transform: translateY(16px); } }

/* Keep the broad hero bounded on large displays. */
.home-main .eg-home-hero { width: calc(100% - 32px); max-width: 1600px; margin: 4px auto 0 !important; }
.home-main .eg-review-all { display: none; }
.home-main .eg-home-reviews .elgravo-review h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 28px; }
.home-main .eg-home-reviews .elgravo-review:focus-within { outline: 2px solid var(--eg-ink); outline-offset: -2px; }
@media (max-width: 760px) {
 .home-main .eg-home-hero { width: calc(100% - 16px); }
 .home-main .eg-home-reviews { padding-inline: 0; }
 .home-main .eg-home-reviews .eg-section-heading { padding-inline: var(--eg-gutter); }
 .home-main .eg-home-reviews .elgravo-reviews { display: grid; columns: auto; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--eg-gutter); padding: 0 var(--eg-gutter) 16px; scrollbar-width: none; align-items: start; }
 .home-main .eg-home-reviews .elgravo-reviews::-webkit-scrollbar { display: none; }
 .home-main .eg-home-reviews .elgravo-review { margin: 0; scroll-snap-align: start; }
 .home-main .eg-home-reviews .eg-review-all { display: flex; align-items: center; justify-content: center; min-height: 280px; border-radius: 28px; background: var(--eg-lilac); color: var(--eg-ink); text-decoration: none; font-size: 22px; scroll-snap-align: start; }
 .home-main .eg-review-all span { margin-left: 12px; }
}

/* ——— First-screen slider (blocks elgravo/hero-slider + elgravo/hero-slide) ———
   One H1 for the page, slides stacked in one grid cell and cross-faded.
   The progress line follows the smile curve; see assets/hero-slider.js. */
.home-main .eg-hero-slider { --eg-track-room: clamp(56px, 5vw, 84px); }
.home-main .eg-hero-inner {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  width: 100%; max-width: var(--eg-home-width); margin: 0 auto !important;
  padding: clamp(48px, 6vw, 96px) var(--eg-gutter) calc(var(--eg-smile-room) + var(--eg-track-room));
}
.home-main .eg-hero-kicker {
  max-width: 24em; margin: 0 0 22px !important;
  color: var(--eg-ink-soft); font-size: 24px; font-weight: 450; line-height: 1.3;
  letter-spacing: 0; font-variation-settings: "CRSV" 0; text-wrap: balance;
}
.home-main .eg-hero-slides { display: grid; width: 100%; }
.home-main .eg-hero-slide {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s;
}
.home-main .eg-hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s ease, visibility 0s; }
.home-main .eg-hero-slide > * { margin: 0; }
.home-main .eg-hero-slide > .eg-hero-title { margin: 0; }
.home-main .eg-hero-slide .eg-hero-photo { margin: 0; }

/* Progress line along the curve, from the text column to the pause button. */
.home-main .eg-hero-nav { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .6s ease .9s; }
.home-main .eg-hero-slider.is-ready .eg-hero-nav { opacity: 1; }
.home-main .eg-hero-track { position: absolute; inset: 0; overflow: visible; }
.home-main .eg-hero-track path { fill: none; stroke-linecap: round; transition: stroke .7s ease; }
.home-main .eg-hero-track-halo { stroke: rgba(255, 255, 255, .5); stroke-width: 9; }
.home-main .eg-hero-track-base { stroke: rgba(45, 42, 71, .2); stroke-width: 3; }
.home-main .eg-hero-track-fill { stroke: var(--eg-ink); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; }
.home-main .eg-hero-dot {
  position: absolute; height: 44px; padding: 0; border: 0; border-radius: var(--eg-r-pill);
  background: transparent; cursor: pointer; pointer-events: auto; transform-origin: 50% 50%;
}
.home-main .eg-hero-dot:focus-visible { outline: 2px solid var(--eg-ink); outline-offset: -8px; }
/* The pause button is the line's end cap: a solid ink knob, apricot on hover. */
.home-main .eg-hero-pause {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--eg-ink); color: var(--eg-on-ink); box-shadow: 0 8px 20px -8px rgba(45, 42, 71, .55);
  cursor: pointer; pointer-events: auto; transition: background-color .2s, color .2s, box-shadow .2s, transform .2s;
}
.home-main .eg-hero-pause:hover { background: var(--eg-apricot); color: var(--eg-ink); }
.home-main .eg-hero-pause:active { transform: translate(-50%, -50%) scale(.94); }
.home-main .eg-hero-pause svg { width: 20px; height: 20px; overflow: visible; }
.home-main .eg-hero-pause-bars { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.home-main .eg-hero-pause-play { fill: currentColor; display: none; }
.home-main .eg-hero-slider.is-paused .eg-hero-pause-bars { display: none; }
.home-main .eg-hero-slider.is-paused .eg-hero-pause-play { display: inline; }
.home-main .eg-hero-pause:focus-visible { outline: 2px solid var(--eg-ink); outline-offset: 3px; }

/* Dark slide: the whole first screen turns plum, text and line turn light. */
.home-main .eg-hero-slider { transition: background-color .7s ease; }
.home-main .eg-hero-slider.is-dark { background: var(--eg-ink); }
.home-main .eg-hero-slider.has-photo-bg { background: var(--eg-hero-bg, #fdf1e6); }
.home-main .eg-hero-kicker { transition: color .7s ease; }
.home-main .eg-hero-slider.is-dark .eg-hero-kicker { color: var(--eg-on-ink-soft); }
.home-main .eg-hero-slide.is-dark .eg-hero-title { color: var(--eg-on-ink); }
.home-main .eg-hero-slide.is-dark .eg-hero-desc { color: var(--eg-on-ink-soft); }
.home-main .eg-hero-slide.is-dark .eg-hero-actions .is-style-outline .wp-block-button__link {
  border-color: rgba(255, 255, 255, .45); background: transparent; color: var(--eg-on-ink);
}
.home-main .eg-hero-slide.is-dark .eg-hero-actions .is-style-outline .wp-block-button__link:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.home-main .eg-hero-slider.is-dark .eg-hero-track-halo { stroke: rgba(45, 42, 71, .45); }
.home-main .eg-hero-slider.is-dark .eg-hero-track-base { stroke: rgba(255, 255, 255, .28); }
.home-main .eg-hero-slider.is-dark .eg-hero-track-fill { stroke: #fff; }
.home-main .eg-hero-slider.is-dark .eg-hero-pause { background: #fff; color: var(--eg-ink); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }
.home-main .eg-hero-slider.is-dark .eg-hero-pause:hover { background: var(--eg-apricot); }
.home-main .eg-hero-slider.is-dark :is(.eg-hero-pause, .eg-hero-dot, .wp-block-button__link):focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .home-main .eg-hero-kicker { animation: eg-rise .8s cubic-bezier(.22, .8, .24, 1) both; }
  .home-main .eg-hero-slide.is-active > :not(figure) { animation: eg-rise .8s cubic-bezier(.22, .8, .24, 1) both; }
  .home-main .eg-hero-slide.is-active > :nth-child(2) { animation-delay: .06s; }
  .home-main .eg-hero-slide.is-active > :nth-child(3) { animation-delay: .14s; }
  .home-main .eg-hero-slide.is-active > :nth-child(4) { animation-delay: .22s; }
}
@media (prefers-reduced-motion: reduce) {
  .home-main .eg-hero-slide, .home-main .eg-hero-slide.is-active, .home-main .eg-hero-slider, .home-main .eg-hero-kicker, .home-main .eg-hero-track path { transition: none; }
}

@media (max-width: 1100px) {
  .home-main .eg-hero-slider .eg-hero-photo { position: absolute; inset: 0 0 auto 0; z-index: -1; width: 100%; height: auto; aspect-ratio: 16 / 7; order: 0; }
  .home-main .eg-hero-inner { padding-top: calc(43.75% + clamp(28px, 4vw, 48px)); }
}
@media (max-width: 760px) {
  .home-main .eg-hero-slider { --eg-track-room: 64px; }
  .home-main .eg-hero-pause { width: 40px; height: 40px; }
  .home-main .eg-hero-pause svg { width: 18px; height: 18px; }
  .home-main .eg-hero-slider .eg-hero-photo { aspect-ratio: 5 / 4; }
  .home-main .eg-hero-inner { padding: calc(80% + 24px) 20px calc(var(--eg-smile-room) + var(--eg-track-room)); }
  .home-main .eg-hero-kicker { margin-bottom: 12px !important; font-size: 17px; }
  .home-main .eg-hero-slide .eg-hero-desc { margin-top: 18px !important; font-size: 17px; }
}
