/* ========================================================================== 
   Euromaster homepage CSS
   Current: v2-balanced-services-area

   Purpose:
   - page-specific visual layer for the Euromaster homepage;
   - loaded after service-landing.css;
   - reuses the shared header, hero, buttons, feature cards, info cards,
     steps, FAQ, forms, footer, bottom sheet and mobile actions;
   - contains no styles for individual service landing pages.

   Rule for future edits:
   - keep shared components in service-landing.css;
   - keep only homepage composition and modifiers in this file;
   - update the relevant section instead of appending isolated patches.
   ========================================================================== */

/* 01. Homepage base / section rhythm
   ========================================================================== */
.em-home {
  background: #fff;
}

.em-home #services,
.em-home #master,
.em-home #home-repair,
.em-home #principles,
.em-home #area,
.em-home #steps,
.em-home #additional,
.em-home #faq,
.em-home #contacts {
  scroll-margin-top: calc(var(--em-header-height) + 24px);
}

.em-home-services,
.em-home-master,
.em-home-principles,
.em-home-area,
.em-home-additional,
.em-home-faq {
  position: relative;
  overflow: hidden;
}

/* 02. Homepage hero
   ========================================================================== */
.em-home-hero {
  --em-hero-object-position: 72% 48%;
  --em-hero-object-position-mobile: 66% 0%;
}

.em-home-hero .em-hero__stage,
.em-home-hero .em-hero__inner {
  min-height: 680px;
}

.em-home-hero .em-hero__stage {
  background: #f3f1ec;
}

.em-home-hero .em-hero__media::after {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .995) 0%, rgba(255, 255, 255, .96) 29%, rgba(255, 255, 255, .68) 51%, rgba(255, 255, 255, .12) 77%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 54%, rgba(255, 255, 255, .97) 100%);
}

.em-home-hero .em-hero__inner {
  grid-template-columns: minmax(0, 620px) minmax(330px, 1fr);
}

.em-home-hero .em-hero__content h1 {
  max-width: 720px;
}

.em-home-hero .em-master-card {
  max-width: 490px;
}

/* 03. Main service cards
   ========================================================================== */
.em-home-services {
  padding-top: clamp(76px, 8vw, 112px);
  padding-bottom: clamp(76px, 8vw, 112px);
  background:
    radial-gradient(circle at 92% 2%, rgba(255, 194, 61, .12), transparent 27%),
    #fff;
}

.em-home-services .em-section-head {
  max-width: 790px;
}

/*
   Equal, future-proof grid:
   - 3 services = three equal cards;
   - after adding a fourth service, it automatically becomes four equal cards
     when the container has enough width;
   - no card spans two rows, so there is no artificial empty space.
*/
.em-home-services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 22px;
  align-items: stretch;
}

.em-home-service {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(32, 36, 44, .10);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 54px rgba(28, 33, 42, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.em-home-service:hover {
  border-color: rgba(255, 138, 0, .20);
  box-shadow: 0 26px 68px rgba(28, 33, 42, .10);
  transform: translateY(-2px);
}

.em-home-service--featured {
  border-color: rgba(255, 138, 0, .18);
  background:
    radial-gradient(circle at 8% 96%, rgba(255, 194, 61, .10), transparent 34%),
    #fff;
}

.em-home-service__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eef0f2;
}

.em-home-service__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 64px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .10));
  pointer-events: none;
}

.em-home-service__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}

.em-home-service:hover .em-home-service__media img {
  transform: scale(1.018);
}

.em-home-service__label {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 36px);
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(255, 138, 0, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #b96700;
  box-shadow: 0 10px 26px rgba(28, 33, 42, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.em-home-service__content {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  padding: 26px;
}

.em-home-service h3 {
  margin: 0 0 12px;
  font-size: clamp(28px, 2.35vw, 36px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.em-home-service p {
  margin: 0 0 22px;
  color: var(--em-muted);
  font-size: 16px;
  line-height: 1.58;
}

.em-home-service .em-link-btn {
  align-self: flex-start;
  margin-top: auto;
  text-align: left;
}

/* 04. Master / repair at home feature blocks
   ========================================================================== */
.em-home-master {
  background: #f6f8fb;
}

.em-feature-card--master {
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 194, 61, .14), transparent 33%),
    linear-gradient(180deg, #fff, #fbfcfd);
}

.em-feature-card--master .em-feature-card__media {
  min-height: 540px;
}

.em-feature-card--master .em-feature-card__media img {
  min-height: 540px;
  object-position: 52% 38%;
}

.em-info-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.em-info-grid--compact article {
  padding: 18px;
  border-radius: 20px;
  box-shadow: none;
}

.em-info-grid--compact h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.em-info-grid--compact p {
  font-size: 14px;
  line-height: 1.5;
}

.em-home-repair {
  background: #fff;
}

.em-home-repair .em-feature-card {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
}

.em-home-repair .em-feature-card__media {
  order: 2;
  min-height: 430px;
}

.em-home-repair .em-feature-card__media img {
  min-height: 430px;
}

/* 05. Work principles
   ========================================================================== */
.em-home-principles {
  padding-top: clamp(76px, 8vw, 108px);
  padding-bottom: clamp(76px, 8vw, 108px);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 194, 61, .11), transparent 28%),
    radial-gradient(circle at 90% 88%, rgba(255, 138, 0, .08), transparent 28%),
    #151d2b;
  color: #fff;
}

.em-home-principles .em-section-head {
  max-width: 790px;
}

.em-home-principles .em-section-head h2 {
  color: #fff;
}

.em-home-principles .em-section-head p {
  color: #c4ccd7;
}

.em-home-principles .em-kicker {
  border-color: rgba(255, 194, 61, .22);
  background: rgba(255, 255, 255, .08);
  color: #ffd071;
  box-shadow: none;
}

.em-home-principles .em-info-grid article {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .065);
  box-shadow: none;
}

.em-home-principles .em-info-grid h3 {
  color: #fff;
}

.em-home-principles .em-info-grid p {
  color: #c4ccd7;
}

/* 06. Service area
   ========================================================================== */
.em-home-area {
  padding-top: clamp(72px, 7vw, 102px);
  padding-bottom: clamp(72px, 7vw, 102px);
  background: #fff;
}

/* Dedicated homepage area component.
   It intentionally does not reuse .em-side-card, so shared service-page grid
   rules cannot pull the following section into this card or clip its content. */
.em-home-area__card {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(430px, 1.12fr);
  gap: clamp(30px, 4vw, 58px);
  align-items: stretch;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid rgba(32, 36, 44, .10);
  border-radius: 34px;
  background:
    radial-gradient(circle at 86% 8%, rgba(255, 194, 61, .17), transparent 30%),
    linear-gradient(180deg, #fff, #fbfcfd);
  box-shadow: 0 26px 72px rgba(28, 33, 42, .075);
}

.em-home-area__content {
  min-width: 0;
  align-self: center;
  max-width: 690px;
}

.em-home-area__content h2 {
  margin: 18px 0;
  font-size: clamp(38px, 4.3vw, 62px);
  line-height: 1.03;
  letter-spacing: -.045em;
}

.em-home-area__content p {
  margin: 0 0 16px;
  color: #4f5968;
  font-size: 18px;
  line-height: 1.62;
}

.em-home-area__content .em-link-btn {
  margin-top: 8px;
}

.em-home-area__places {
  min-width: 0;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(255, 138, 0, .20);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 194, 61, .22), transparent 34%),
    linear-gradient(180deg, #fff8eb, #fff);
  box-shadow: 0 18px 46px rgba(28, 33, 42, .06);
}

.em-home-area__places-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 15px;
  align-items: center;
  margin-bottom: 22px;
}

.em-home-area__places-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: rgba(255, 138, 0, .14);
  color: #c56d00;
  font-size: 24px;
  line-height: 1;
}

.em-home-area__places-label {
  display: block;
  margin-bottom: 4px;
  color: #c56d00;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.em-home-area__places h3 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.em-home-area__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.em-home-area__list li {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(32, 36, 44, .08);
  border-radius: 13px;
  background: rgba(255, 255, 255, .86);
  color: #3e4856;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
}

.em-home-area__note {
  margin: 16px 0 0;
  color: var(--em-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* 07. Steps
   ========================================================================== */
.em-home-steps {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 194, 61, .09), transparent 30%),
    #f6f8fb;
}

.em-home-steps .em-steps-grid article > h3,
.em-home-steps .em-steps-grid article > p {
  background: #fff;
}

/* 08. Additional directions
   ========================================================================== */
.em-home-additional {
  padding-top: clamp(72px, 7vw, 102px);
  padding-bottom: clamp(72px, 7vw, 102px);
  background: #fff;
}

.em-home-additional .em-section-head {
  max-width: 790px;
}

.em-home-additional__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.em-home-additional-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: clamp(26px, 3vw, 36px);
  border: 1px solid rgba(32, 36, 44, .10);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 194, 61, .12), transparent 31%),
    #fff;
  box-shadow: 0 20px 54px rgba(28, 33, 42, .065);
}

.em-home-additional-card__mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffe39a, var(--em-accent));
  color: #1e232b;
  box-shadow: 0 14px 30px rgba(255, 138, 0, .18);
  font-size: 19px;
  font-weight: 950;
  letter-spacing: .03em;
}

.em-home-additional-card__content {
  min-width: 0;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
}

.em-home-additional-card h3 {
  margin: 4px 0 12px;
  font-size: clamp(25px, 2.3vw, 34px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.em-home-additional-card p {
  margin: 0 0 22px;
  color: var(--em-muted);
  line-height: 1.6;
}

.em-home-additional-card .em-link-btn {
  margin-top: auto;
}

/* 09. FAQ / final CTA
   ========================================================================== */
.em-home-faq {
  padding-top: clamp(72px, 7vw, 102px);
  padding-bottom: clamp(72px, 7vw, 102px);
  background: #f7f8fa;
}

.em-home-faq .em-section-head {
  max-width: 760px;
}

.em-home-faq .em-faq-item {
  box-shadow: 0 12px 30px rgba(28, 33, 42, .04);
}

.em-home-final .em-final__inner {
  background:
    radial-gradient(circle at 4% 6%, rgba(255, 194, 61, .13), transparent 30%),
    #fff;
}

/* 10. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .em-home-hero .em-hero__inner {
    grid-template-columns: minmax(0, 560px) minmax(280px, 1fr);
    gap: 30px;
  }

  .em-feature-card--master,
  .em-home-repair .em-feature-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .em-feature-card--master .em-feature-card__media,
  .em-feature-card--master .em-feature-card__media img {
    min-height: 470px;
  }

  .em-info-grid--compact {
    grid-template-columns: 1fr;
  }

  .em-home-area__card {
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 30px;
  }

  .em-home-area__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .em-home-area__card {
    grid-template-columns: 1fr;
  }

  .em-home-additional-card {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
  }

  .em-home-additional-card__mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .em-home-hero {
    --em-hero-object-position-mobile: 68% 0%;
  }

  .em-home-hero .em-hero__stage,
  .em-home-hero .em-hero__inner {
    min-height: 660px;
  }

  .em-home-hero .em-hero__media::after {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, .995) 0%, rgba(255, 255, 255, .88) 50%, rgba(255, 255, 255, .14) 88%),
      linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .28) 57%, #fff 100%);
  }

  .em-home-hero .em-hero__inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .em-home-hero .em-hero__content h1 {
    font-size: clamp(38px, 11.4vw, 52px);
    line-height: 1;
  }

  .em-home-services {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .em-home-services__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .em-home-service {
    border-radius: 24px;
  }

  .em-home-service__media {
    aspect-ratio: 16 / 10;
  }

  .em-home-service__content {
    padding: 22px;
  }

  .em-home-service h3 {
    font-size: 30px;
  }

  .em-home-service p {
    font-size: 16px;
  }

  .em-feature-card--master,
  .em-home-repair .em-feature-card {
    grid-template-columns: 1fr;
  }

  .em-feature-card--master .em-feature-card__media,
  .em-feature-card--master .em-feature-card__media img {
    min-height: 270px;
  }

  .em-home-repair .em-feature-card__media {
    order: initial;
    min-height: 230px;
  }

  .em-home-repair .em-feature-card__media img {
    min-height: 230px;
  }

  .em-info-grid--compact {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .em-home-principles {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .em-home-principles .em-section-head {
    text-align: left;
  }

  .em-home-area__card {
    gap: 22px;
    padding: 20px;
    border-radius: 28px;
  }

  .em-home-area__content h2 {
    font-size: 36px;
  }

  .em-home-area__content p {
    font-size: 16px;
  }

  .em-home-area__places {
    padding: 20px;
    border-radius: 24px;
  }

  .em-home-area__places-head {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
  }

  .em-home-area__places-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 21px;
  }

  .em-home-area__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .em-home-additional__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .em-home-additional-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 15px;
    padding: 22px;
    border-radius: 24px;
  }

  .em-home-additional-card__mark {
    width: 54px;
    height: 54px;
    border-radius: 17px;
  }

  .em-home-additional-card h3 {
    margin-top: 2px;
    font-size: 26px;
  }

  .em-home-faq {
    padding-top: 58px;
    padding-bottom: 58px;
  }
}

@media (max-width: 430px) {
  .em-home-hero .em-hero-title span:last-child {
    white-space: normal;
  }

  .em-home-area__list {
    grid-template-columns: 1fr;
  }

  .em-home-additional-card {
    grid-template-columns: 1fr;
  }

  .em-home-additional-card__mark {
    width: 50px;
    height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .em-home-service,
  .em-home-service__media img {
    transition: none;
  }
}
