/* Phase 1, version 2: homepage. Loaded only when the Phase 1 switch is on for this visitor.
   Everything is inside .edc-p1, so the header, menu and footer aren't affected.
   Brand rules: docs/brand/EDC_Hub_Brand_Playbook_v5.0.md (solid buttons, no gradients). */

.edc-p1 {
  --p1-navy: #0B1F3A;
  --p1-teal: #028090;
  --p1-gold: #C9A86A;
  --p1-page: #F8FAFC;
  --p1-panel: #FFFFFF;
  --p1-text: #0B1F3A;
  --p1-muted: #42526A;
  --p1-line: #CBD5E1;
  --p1-link: #026B78;
  --p1-focus: #028090;
  --p1-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --p1-display: "Fraunces", Georgia, serif;
}
html[data-theme="dark"] .edc-p1 {
  --p1-page: #020617;
  --p1-panel: #0B1120;
  --p1-text: #F8FAFC;
  --p1-muted: #B6C2D2;
  --p1-line: #2B3A50;
  --p1-link: #7FD3DC;
  --p1-focus: #22D3EE;
}
.edc-p1[lang="ar"] {
  --p1-font: "IBM Plex Sans Arabic", system-ui, "Segoe UI", sans-serif;
  --p1-display: "Amiri", "Times New Roman", serif;
}
.edc-p1, .edc-p1 * { box-sizing: border-box; }
/* header.php sets the size and spacing of every <main> with !important */
main.edc-p1 {
  max-width: none !important; margin: 0 !important; padding: 0 !important;
  background: var(--p1-page); color: var(--p1-text);
  font: 400 1rem/1.6 var(--p1-font);
  text-align: start;
}
main.edc-p1[lang="ar"] { font-size: 1.0625rem; line-height: 1.8; }
.edc-p1[lang="ar"] * { letter-spacing: 0 !important; font-style: normal !important; }
.edc-p1 :focus-visible { outline: 3px solid var(--p1-focus); outline-offset: 3px; border-radius: 4px; }
.edc-p1-wrap { width: min(1280px, 100% - 32px); margin-inline: auto; }
.edc-p1-sec { padding-block: clamp(56px, 8vw, 96px); }

.edc-p1 h1, .edc-p1 h2, .edc-p1 h3 { margin: 0; color: inherit; text-wrap: balance; text-transform: none; }
.edc-p1 h1 { font: 600 clamp(2.5rem, 5.2vw, 4rem)/1.1 var(--p1-display); letter-spacing: -.025em; }
.edc-p1 h2 { font: 600 clamp(1.875rem, 3.2vw, 2.5rem)/1.2 var(--p1-display); letter-spacing: -.02em; }
.edc-p1 h3 { font: 600 1.25rem/1.35 var(--p1-font); }
.edc-p1[lang="ar"] h1 { font-size: clamp(2.625rem, 5vw, 3.75rem); font-weight: 700; line-height: 1.3; }
.edc-p1[lang="ar"] h2 { font-size: clamp(2rem, 3.2vw, 2.375rem); font-weight: 700; line-height: 1.4; }
.edc-p1 p { margin: 0; color: var(--p1-muted); text-wrap: pretty; }
.edc-p1 ul, .edc-p1 ol { margin: 0; padding: 0; list-style: none; }
.edc-p1 h2 + p { max-width: 52ch; margin-top: 12px; }

.edc-p1 .edc-p1-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  border: 1px solid transparent; border-radius: 10px;
  font: 600 1rem/1.4 var(--p1-font); text-align: center; text-decoration: none;
}
.edc-p1 .edc-p1-btn--gold { background: var(--p1-gold); color: var(--p1-navy); }
.edc-p1 .edc-p1-btn--gold:hover { background: #E6CD95; }
.edc-p1 .edc-p1-btn--teal { background: var(--p1-teal); color: #FFFFFF; }
.edc-p1 .edc-p1-btn--teal:hover { background: #026B78; }
.edc-p1 .edc-p1-btn--line { border-color: #8FA3BC; color: #FFFFFF; }
.edc-p1 .edc-p1-btn--line:hover { border-color: #FFFFFF; background: rgba(255, 255, 255, .08); }
.edc-p1 .edc-p1-link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--p1-link); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
}
.edc-p1 .edc-p1-link:hover { text-decoration-thickness: 2px; }

/* ---------- Hero: the search and the 3D dental arch ---------- */
.edc-p1-hero, .edc-p1-pro { --p1-focus: #22D3EE; background: var(--p1-navy); color: #FFFFFF; }
html[data-theme="dark"] .edc-p1-hero, html[data-theme="dark"] .edc-p1-pro { --p1-focus: #22D3EE; }
.edc-p1-hero p, .edc-p1-pro p { color: #D3DCE8; }
.edc-p1-hero { overflow: clip; }
/* The empty first and last rows keep the text centred beside the arch */
.edc-p1-hero__grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr repeat(5, auto) 1fr; column-gap: 24px;
  min-height: min(820px, 100svh); padding-block: 120px 56px;
}
.edc-p1-hero__grid > * { grid-column: 1; }
.edc-p1-hero h1 { grid-row: 2; }
.edc-p1 .edc-p1-offer {
  grid-row: 3; justify-self: start; display: inline-flex; align-items: center;
  min-height: 44px; margin-top: 10px;
  color: #E6CD95; font-weight: 600; line-height: 1.4; text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 5px;
}
.edc-p1 .edc-p1-offer:hover { color: #FFFFFF; }
.edc-p1-hero__lead { grid-row: 4; max-width: 46ch; margin-top: 8px !important; font-size: 1.125rem; }
.edc-p1-hero .edc-p1-search { grid-row: 5; }
.edc-p1-hero__help { grid-row: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px !important; }
.edc-p1-hero__grid > .edc-p1-stage {
  position: relative; grid-column: 2; grid-row: 1 / -1; align-self: center;
  width: calc(100% + 48px); height: clamp(480px, 46vw, 640px); margin-inline-start: -16px;
}
.edc-p1-stage img, .edc-p1-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; transition: opacity .7s; }
/* Turned so its front teeth face the same way as the 3D arch */
.edc-p1-stage img { padding: 40px; object-fit: contain; rotate: 180deg; }
.edc-p1-stage canvas { opacity: 0; pointer-events: none; touch-action: pan-y; cursor: grab; }
.edc-p1-stage canvas:active { cursor: grabbing; }
.edc-p1-stage.is-3d img { opacity: 0; }
.edc-p1-stage.is-3d canvas { opacity: 1; pointer-events: auto; }
/* Sits in the open space inside the arch */
.edc-p1 .edc-p1-hint {
  position: absolute; top: 30%; left: 50%; max-width: 14ch; translate: -50% 0;
  color: #A9BACD; font-size: .875rem; line-height: 1.4; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
.edc-p1-stage.is-3d .edc-p1-hint { opacity: 1; }
.edc-p1-stage.is-3d.is-used .edc-p1-hint, .edc-p1.is-still .edc-p1-stage .edc-p1-hint { opacity: 0; }
/* The implant's crown lifts into this space */
.edc-p1-hero:has(input[value="implant"]:checked) .edc-p1-stage .edc-p1-hint { opacity: 0; }
.edc-p1 .edc-p1-motion {
  position: absolute; inset-inline-start: calc(50% + 12px); bottom: 12px;
  min-height: 44px; padding: 8px 14px;
  border: 0; border-radius: 10px; background: transparent; color: #D3DCE8;
  font: 600 .875rem/1.4 var(--p1-font); text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.edc-p1 .edc-p1-motion:hover { color: #FFFFFF; }
.edc-p1 .edc-p1-motion[hidden] { display: none; }

.edc-p1-search { max-width: 600px; margin: 26px 0 0; }
.edc-p1-search fieldset { min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.edc-p1-search legend, .edc-p1-search__label { display: block; margin: 0 0 8px; padding: 0; color: #FFFFFF; font-weight: 600; }
.edc-p1-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.edc-p1-picks label { position: relative; display: block; }
.edc-p1-picks input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.edc-p1-picks span {
  display: flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid #8FA3BC; border-radius: 10px;
  color: #FFFFFF; font-weight: 600; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.edc-p1-picks input:hover + span { border-color: #FFFFFF; background: rgba(255, 255, 255, .08); }
.edc-p1-picks input:checked + span { border-color: #FFFFFF; background: #FFFFFF; color: var(--p1-navy); }
.edc-p1-picks input:focus-visible + span { outline: 3px solid var(--p1-focus); outline-offset: 3px; }
.edc-p1-search__row { display: flex; gap: 10px; }
.edc-p1 .edc-p1-search select {
  flex: 1 1 auto; min-width: 0; min-height: 56px; padding-block: 8px; padding-inline: 16px 44px;
  border: 1px solid #FFFFFF; border-radius: 10px; appearance: none;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%230B1F3A' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: #0B1F3A; font: 400 1.0625rem/1.4 var(--p1-font);
}
.edc-p1[dir="rtl"] .edc-p1-search select { background-position: left 14px center; }
.edc-p1 .edc-p1-search option, .edc-p1 .edc-p1-search optgroup { background: #FFFFFF; color: #0B1F3A; }
.edc-p1 .edc-p1-search button {
  flex: none; min-height: 56px; padding: 8px 26px;
  border: 0; border-radius: 10px;
  background: var(--p1-gold); color: var(--p1-navy);
  font: 600 1.0625rem/1.4 var(--p1-font); cursor: pointer;
}
.edc-p1 .edc-p1-search button:hover { background: #E6CD95; }

.edc-p1 .edc-p1-search__note { font-size: .9375rem; }
.edc-p1 .edc-p1-search__note:not(:empty) { margin-top: 8px; }

/* ---------- Free diagnosis: the offer and the 3D ticket ---------- */
.edc-p1-free { border-bottom: 1px solid var(--p1-line); background: var(--p1-panel); scroll-margin-top: 72px; overflow: clip; }
.edc-p1-free__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px 72px; }
.edc-p1 #p1-free:focus { outline: none; }
.edc-p1 .edc-p1-free h2 + p { font-size: 1.125rem; }
.edc-p1-free__terms { margin: 24px 0 28px; }
.edc-p1-free__terms > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 20px; padding-block: 12px; border-top: 1px solid var(--p1-line); }
.edc-p1-free__terms > div:last-child { border-bottom: 1px solid var(--p1-line); }
.edc-p1-free__terms dt { font-weight: 600; }
.edc-p1-free__terms dd { margin: 0; color: var(--p1-muted); }
.edc-p1 .edc-p1-free .edc-p1-note { margin-top: 14px; }
.edc-p1-ticket__stage { perspective: 1300px; }
.edc-p1 .edc-p1-ticket { display: block; width: 100%; max-width: 540px; margin-inline: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; transform-style: preserve-3d; cursor: pointer; }
.edc-p1 .edc-p1-ticket:focus-visible { border-radius: 18px; outline-offset: 8px; }
.edc-p1-ticket__body {
  display: grid; width: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(calc(var(--tilt-y, 0deg) + var(--turn, 0deg)));
}
.edc-p1-ticket[aria-pressed="true"] .edc-p1-ticket__body { --turn: 180deg; }
.edc-p1-ticket__face {
  grid-area: 1 / 1; min-height: 270px; overflow: hidden;
  border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.edc-p1-ticket__face.is-front { display: grid; grid-template-columns: minmax(0, 1fr) 34%; background: var(--p1-gold); color: var(--p1-navy); }
.edc-p1-ticket__main { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px 28px; font-weight: 600; line-height: 1.5; }
.edc-p1-ticket__main strong { font: 600 clamp(2.125rem, 4vw, 3.25rem)/1.05 var(--p1-display); letter-spacing: -.02em; }
.edc-p1[lang="ar"] .edc-p1-ticket__main strong { font-weight: 700; line-height: 1.3; }
/* The tear line, with a notch cut into the top and bottom */
.edc-p1-ticket__stub {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 14px;
  border-inline-start: 2px dashed var(--p1-gold); background: var(--p1-navy); color: #FFFFFF;
  font-size: .9375rem; font-weight: 600; line-height: 1.45; text-align: center;
}
.edc-p1-ticket__stub img { width: 88px; height: 88px; max-width: none; }
.edc-p1-ticket__stub::before, .edc-p1-ticket__stub::after {
  content: ""; position: absolute; inset-inline-start: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--p1-panel);
}
.edc-p1-ticket__stub::before { top: -14px; }
.edc-p1-ticket__stub::after { bottom: -14px; }
.edc-p1-ticket__face.is-back { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 28px; border: 3px solid var(--p1-gold); background: var(--p1-navy); color: #FFFFFF; transform: rotateY(180deg); }
.edc-p1-ticket__face.is-back strong { color: var(--p1-gold); font: 600 1.625rem/1.3 var(--p1-display); }
.edc-p1-ticket__step { display: flex; align-items: center; gap: 14px; font-weight: 600; line-height: 1.5; }
.edc-p1-ticket__step b { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--p1-gold); color: var(--p1-navy); }
.edc-p1 .edc-p1-ticket__hint { margin-top: 18px; font-size: .9375rem; text-align: center; }

/* ---------- Show us where it hurts ---------- */
.edc-p1-pain { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 48px; margin-top: 36px; }
.edc-p1 [hidden] { display: none !important; }
.edc-p1-mouth { overflow: hidden; border-radius: 18px; background: var(--p1-navy); color: #FFFFFF; --p1-focus: #22D3EE; }
html[data-theme="dark"] .edc-p1 .edc-p1-mouth { --p1-focus: #22D3EE; }
/* The picker only takes up space when 3D is working */
.edc-p1-mouth__stage { position: relative; height: 0; overflow: hidden; }
.edc-p1-mouth__stage.is-3d { height: clamp(320px, 34vw, 440px); }
/* No padding here: it would stretch the model and move the tap points away from the teeth */
.edc-p1-mouth__stage canvas { position: absolute; inset: 48px 0 auto; display: block; width: 100%; height: calc(100% - 48px); max-width: none; padding: 0; touch-action: pan-y; }
.edc-p1 .edc-p1-mouth__tip { position: absolute; inset: 16px 20px auto; color: #D3DCE8; font-size: .9375rem; text-align: center; pointer-events: none; }
.edc-p1-mouth__side { position: absolute; bottom: 10px; color: #A9BACD; font-size: .875rem; pointer-events: none; }
.edc-p1-mouth__side.is-left { left: 20px; }
.edc-p1-mouth__side.is-right { right: 20px; }
.edc-p1-mouth__fields { padding: 24px; }
.edc-p1-pain fieldset { min-width: 0; margin: 0 0 20px; padding: 0; border: 0; }
.edc-p1-pain legend, .edc-p1 .edc-p1-field { display: block; margin: 0 0 8px; padding: 0; color: inherit; font-weight: 600; }
.edc-p1 .edc-p1-pain select {
  width: 100%; min-height: 52px; padding-block: 8px; padding-inline: 16px 44px;
  border: 1px solid #64748B; border-radius: 10px; appearance: none;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%230B1F3A' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: #0B1F3A; font: 400 1rem/1.4 var(--p1-font);
}
.edc-p1[dir="rtl"] .edc-p1-pain select { background-position: left 14px center; }
.edc-p1 .edc-p1-pain option, .edc-p1 .edc-p1-pain optgroup { background: #FFFFFF; color: #0B1F3A; }
.edc-p1-talk .edc-p1-picks span { border-color: #64748B; color: var(--p1-text); white-space: normal; }
.edc-p1-talk .edc-p1-picks input:hover + span { border-color: var(--p1-teal); background: transparent; }
.edc-p1-talk .edc-p1-picks input:checked + span { border-color: var(--p1-teal); background: var(--p1-teal); color: #FFFFFF; }
.edc-p1-danger { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-block: 20px; font-weight: 600; line-height: 1.5; cursor: pointer; }
.edc-p1-danger input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: #B42318; }
.edc-p1-alert { padding: 24px; border-radius: 18px; background: #9F1D14; color: #FFFFFF; --p1-focus: #FFFFFF; }
html[data-theme="dark"] .edc-p1 .edc-p1-alert { --p1-focus: #FFFFFF; }
.edc-p1-alert strong { display: block; font-size: 1.25rem; }
.edc-p1 .edc-p1-alert p { margin-block: 6px 18px; color: #FFFFFF; }
.edc-p1 .edc-p1-alert .edc-p1-btn { background: #FFFFFF; color: #8A1710; }
.edc-p1 .edc-p1-bubble {
  margin-bottom: 16px; padding: 14px 18px;
  border-radius: 18px; border-end-end-radius: 4px;
  background: #DDF3EC; color: #0B1F3A; white-space: pre-line; overflow-wrap: anywhere;
}
.edc-p1-pain .edc-p1-note { margin-top: 14px; }
/* Two sections on the same background don't need double spacing */
[data-p1-pain] + .edc-p1-after-pain { padding-top: 0; }

/* ---------- Photos ---------- */
.edc-p1-photo { overflow: hidden; border-radius: 18px; background: var(--p1-line); }
.edc-p1-photo img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.edc-p1-photo--tall { min-height: 380px; }

/* ---------- Treatments ---------- */
.edc-p1-care { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px 40px; margin-top: 40px; }
.edc-p1-care h3 { margin-top: 18px; }
.edc-p1-care h3 + p { max-width: 54ch; margin-top: 6px; }
.edc-p1-care article { min-width: 0; }
.edc-p1-care__implant { grid-row: span 2; display: flex; flex-direction: column; }
.edc-p1-care__implant .edc-p1-photo { flex: 1 1 auto; min-height: 340px; }
.edc-p1-care__braces .edc-p1-photo, .edc-p1-care__whitening .edc-p1-photo { aspect-ratio: 2 / 1; }
.edc-p1 .edc-p1-care__links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 4px; }
/* Shown only when the 3D arch is working */
.edc-p1 .edc-p1-show { display: none; }
.edc-p1:has(.edc-p1-stage.is-3d) .edc-p1-show {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 8px 16px;
  border: 1px solid #64748B; border-radius: 10px; background: transparent; color: inherit;
  font: 600 .9375rem/1.4 var(--p1-font); cursor: pointer;
}
.edc-p1:has(.edc-p1-stage.is-3d) .edc-p1-show:hover { border-color: var(--p1-teal); }
.edc-p1:has(.edc-p1-stage.is-3d) .edc-p1-care__emergency .edc-p1-show { border-color: #C9B8A8; }
.edc-p1 #p1-title { scroll-margin-top: 112px; }
.edc-p1 #where-it-hurts { scroll-margin-top: 72px; }
.edc-p1-care__emergency {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 0 40px;
  overflow: hidden; border-radius: 18px; background: #1B1511; color: #FFFFFF;
}
.edc-p1-care__emergency .edc-p1-photo { height: 100%; min-height: 320px; border-radius: 0; }
.edc-p1-care__emergency > div:last-child { padding-block: 32px; padding-inline-end: 32px; }
.edc-p1-care .edc-p1-care__emergency h3 { margin-top: 0; font-size: 1.5rem; }
.edc-p1-care .edc-p1-care__emergency p { color: #E9DFD6; }
.edc-p1 .edc-p1-care__emergency .edc-p1-link { color: #E6CD95; }
.edc-p1 .edc-p1-care__emergency :focus-visible { outline-color: #22D3EE; }
.edc-p1-more { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 72px; margin-top: 56px; }
.edc-p1-more ul { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 8px; }
.edc-p1 .edc-p1-more .edc-p1-link { min-width: 44px; font-weight: 400; }
.edc-p1 .edc-p1-note { margin-top: 24px; font-size: .875rem; }

/* ---------- Free consultation steps ---------- */
.edc-p1-how, .edc-p1-guides, .edc-p1-faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 72px; }
.edc-p1-faq { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.edc-p1-how .edc-p1-steps, .edc-p1-how .edc-p1-btn { margin-top: 32px; }
.edc-p1-steps { counter-reset: p1-step; }
.edc-p1-steps li { position: relative; padding-block: 0 32px; padding-inline-start: 72px; counter-increment: p1-step; }
.edc-p1-steps li:last-child { padding-bottom: 0; }
.edc-p1-steps li::before {
  content: counter(p1-step);
  position: absolute; inset-inline-start: 0; top: -2px; z-index: 1;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 2px solid var(--p1-teal); border-radius: 50%;
  background: var(--p1-page); color: var(--p1-text); font: 600 1.125rem/1 var(--p1-font);
}
.edc-p1-steps li:not(:last-child)::after {
  content: ""; position: absolute; inset-inline-start: 21px; top: 42px; bottom: 2px; width: 2px; background: var(--p1-line);
}
.edc-p1-steps h3 { padding-top: 6px; }
.edc-p1-steps p { max-width: 58ch; margin-top: 6px; }

/* ---------- Areas and the city photos ---------- */
.edc-p1-areas { border-block: 1px solid var(--p1-line); background: var(--p1-panel); }
.edc-p1-cities { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 48px; margin-top: 40px; }
.edc-p1 .edc-p1-city__top { display: block; color: var(--p1-text); text-decoration: none; }
.edc-p1-city__name { display: block; margin-top: 18px; font: 600 1.375rem/1.4 var(--p1-font); text-decoration: underline; text-decoration-color: var(--p1-teal); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.edc-p1-city__top:hover .edc-p1-city__name { color: var(--p1-link); }
.edc-p1-city__photo { display: block; aspect-ratio: 16 / 9; }
html[data-theme="dark"] .edc-p1-city__photo img { filter: brightness(.8); }
.edc-p1 .edc-p1-credit { display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; margin-top: 4px; font-size: .8125rem; line-height: 1.5; }
.edc-p1 .edc-p1-credit a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; color: var(--p1-link); text-decoration: underline !important; text-underline-offset: 3px; }
/* Alexandria's photo licence needs this credit */
.edc-p1-credits { padding-bottom: 24px; color: var(--p1-muted); font-size: .8125rem; }
.edc-p1-credits summary { display: flex; align-items: center; width: fit-content; min-width: 44px; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.edc-p1-cities ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: 12px; }
.edc-p1-cities li a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding-block: 6px;
  border-bottom: 1px solid var(--p1-line);
  color: var(--p1-text); text-decoration: none;
}
.edc-p1-cities li a:hover { border-color: var(--p1-teal); color: var(--p1-link); }
.edc-p1-count { color: var(--p1-muted); font-size: .9375rem; font-variant-numeric: tabular-nums; }
.edc-p1-rest summary { display: inline-flex; align-items: center; min-height: 48px; color: var(--p1-link); font-weight: 600; text-decoration: underline; text-underline-offset: 5px; cursor: pointer; list-style: none; }
.edc-p1-rest summary::-webkit-details-marker { display: none; }
.edc-p1-rest[open] ul { margin-top: 0; }

/* ---------- Guides ---------- */
.edc-p1-guides ul { margin-top: 24px; }
.edc-p1-guides .edc-p1-link { margin-top: 8px; }
.edc-p1-guides li + li { border-top: 1px solid var(--p1-line); }
.edc-p1-guides li a { display: block; padding-block: 18px; color: var(--p1-text); text-decoration: none; }
.edc-p1-guides li:first-child a { padding-top: 4px; }
.edc-p1-guides li strong { display: block; font: 600 1.1875rem/1.45 var(--p1-font); text-align: start; }
.edc-p1-guides li a:hover strong { color: var(--p1-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.edc-p1[dir="rtl"] .edc-p1-guides li strong { text-align: right; }
.edc-p1-guides li span { display: block; margin-top: 4px; color: var(--p1-muted); font-size: .9375rem; }

/* ---------- For dentists ---------- */
.edc-p1-pro__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px 72px; }
.edc-p1-pro__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Questions ---------- */
.edc-p1-faq details { border-bottom: 1px solid var(--p1-line); }
.edc-p1-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 60px; padding-block: 14px;
  color: var(--p1-text); font-weight: 600; font-size: 1.0625rem; cursor: pointer; list-style: none;
}
.edc-p1-faq summary::-webkit-details-marker { display: none; }
.edc-p1-faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin: -5px 6px 0;
  border: solid var(--p1-link); border-width: 0 2px 2px 0; rotate: 45deg;
}
.edc-p1-faq details[open] summary::after { margin-top: 5px; rotate: 225deg; }
.edc-p1-faq details p { max-width: 62ch; padding-bottom: 20px; }

/* ---------- Movement ----------
   Nothing moves while the page is paused or the device is set to reduce motion.
   Photos are always visible. Browsers that support it gently zoom them while scrolling. */
@media (prefers-reduced-motion: no-preference) {
  .edc-p1:not(.is-still) :is(.edc-p1-care article, .edc-p1-city__top) .edc-p1-photo img { transition: scale .6s cubic-bezier(.2, .7, .2, 1); }
  .edc-p1:not(.is-still) :is(.edc-p1-care article, .edc-p1-city__top):hover .edc-p1-photo img { scale: 1.035; }
  @supports (animation-timeline: view()) {
    .edc-p1:not(.is-still) .edc-p1-photo--tall img { animation: p1-zoom linear both; animation-timeline: view(); }
    /* A gentler zoom, so it doesn't cut off the minarets or the flag */
    .edc-p1:not(.is-still) .edc-p1-city__photo img { animation: p1-zoom-soft linear both; animation-timeline: view(); }
  }
}
@media (prefers-reduced-motion: no-preference) {
  .edc-p1:not(.is-still) .edc-p1-ticket__body { transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
  .edc-p1:not(.is-still) .edc-p1-ticket:hover .edc-p1-ticket__body { transition-duration: .35s; }
  @supports (animation-timeline: view()) {
    .edc-p1:not(.is-still) .edc-p1-ticket { animation: p1-ticket linear both; animation-timeline: view(); animation-range: entry 0% cover 32%; }
  }
}
@media (prefers-reduced-motion: reduce) { .edc-p1 * { transition: none !important; } }
@keyframes p1-ticket { from { transform: rotateX(18deg) rotateY(-24deg); } to { transform: none; } }
@keyframes p1-zoom { from { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes p1-zoom-soft { from { transform: scale(1.07); } to { transform: scale(1); } }

@media (max-width: 900px) {
  /* The arch sits above the search, so it's visible while choosing a treatment */
  .edc-p1-hero__grid { display: flex; flex-direction: column; min-height: 0; padding-block: 108px 64px; }
  .edc-p1-hero__grid > .edc-p1-stage { width: 100%; height: clamp(190px, 44vw, 380px); margin: 4px 0 0; }
  .edc-p1-stage img { padding: 8px; }
  .edc-p1 .edc-p1-hint { top: 14%; font-size: .8125rem; }
  .edc-p1-mouth__stage.is-3d { height: clamp(330px, 80vw, 520px); }
  .edc-p1-pain { gap: 32px; }
  .edc-p1-hero .edc-p1-search { margin-top: 4px; }
  .edc-p1-hero__lead { order: 1; }
  .edc-p1-hero__help { order: 2; }
  .edc-p1 .edc-p1-motion { inset-inline-start: 0; bottom: 8px; padding-inline: 0; }
  .edc-p1[dir] .edc-p1-hero__grid > .edc-p1-motion { margin: 0; }
  .edc-p1-how, .edc-p1-guides, .edc-p1-faq, .edc-p1-cities, .edc-p1-pro__grid, .edc-p1-more, .edc-p1-care, .edc-p1-care__emergency, .edc-p1-pain, .edc-p1-free__grid { grid-template-columns: minmax(0, 1fr); }
  .edc-p1-photo--tall, .edc-p1-care__implant .edc-p1-photo, .edc-p1-care__emergency .edc-p1-photo { min-height: 0; height: auto; aspect-ratio: 16 / 9; }
  .edc-p1-care__implant .edc-p1-photo { flex: none; }
  .edc-p1-care__emergency > div:last-child { padding: 24px; }
}
@media (max-width: 560px) {
  .edc-p1 h1 { font-size: 2rem; }
  .edc-p1[lang="ar"] h1 { font-size: 2.125rem; line-height: 1.25; }
  .edc-p1-search fieldset { margin-bottom: 12px; }
  .edc-p1-picks { gap: 6px; }
  .edc-p1-picks span { padding-inline: 11px; font-size: .9375rem; }
  .edc-p1-search__row { flex-direction: column; }
  .edc-p1 .edc-p1-offer { margin-top: 4px; font-size: .9375rem; }
  .edc-p1-free__terms > div { grid-template-columns: minmax(0, 1fr); }
  .edc-p1-ticket__face { min-height: 220px; }
  .edc-p1-ticket__main { padding: 18px; }
  .edc-p1-ticket__main strong { font-size: 2rem; }
  .edc-p1-ticket__face.is-back { padding: 18px; gap: 10px; }
  .edc-p1-ticket__stub { padding-inline: 10px; font-size: .8125rem; }
  .edc-p1-hero__help .edc-p1-btn, .edc-p1-how .edc-p1-btn, .edc-p1-free .edc-p1-btn, .edc-p1-pain .edc-p1-btn, .edc-p1-pro__links, .edc-p1-pro__links .edc-p1-btn { width: 100%; }
  .edc-p1-cities ul { gap: 0 20px; }
  .edc-p1-steps li { padding-inline-start: 60px; }
}
@media (max-width: 340px) { .edc-p1-cities ul { grid-template-columns: 1fr; } }
