/* =============================================================================
   Engawa Design System — blocks + patterns (Figma Engawa-Design-System)
   Tokens live in styles.css :root. NEVER invent colours/spacings; use tokens.
   ============================================================================= */

/* ---------- Page container (1680 max, 24 side padding) ---------- */
.ew-container {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--space-xl); /* 24 */
  box-sizing: border-box;
}

/* Full-bleed section padding (vertical rhythm from Figma patterns) */
.ew-section {
  padding-block: var(--space-2xl); /* 32 */
}
.ew-section--footer {
  padding-block: var(--space-4xl); /* 64 */
  background: var(--sunken);
}

/* Hairline divider aligned to container content edge */
.ew-rule {
  border: 0;
  height: 0;
  border-top: 1px solid var(--outline);
  max-width: 1632px;
  margin: 0 auto;
  width: calc(100% - 2 * var(--space-xl));
}

/* =============================================================================
   Typography utilities (fluid min → max; Figma /max styles as upper bound)
   ============================================================================= */
.ew-display-large {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-display-large-size);
  line-height: var(--text-display-large-line);
  letter-spacing: var(--text-display-large-tracking);
  color: var(--on-page);
  margin: 0;
}
.ew-headline-large {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-headline-large-size);
  line-height: var(--text-headline-large-line);
  letter-spacing: var(--text-headline-large-tracking);
  color: var(--on-page);
  margin: 0;
}
.ew-headline-medium {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-headline-small-size);
  line-height: var(--text-headline-small-line);
  letter-spacing: var(--text-headline-small-tracking);
  color: var(--on-page);
  margin: 0;
}
.ew-headline-small {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-headline-small-size);
  line-height: var(--text-headline-small-line);
  letter-spacing: var(--text-headline-small-tracking);
  color: var(--on-page);
  margin: 0;
}
.ew-title-medium {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-title-medium-size);
  line-height: var(--text-title-medium-line);
  letter-spacing: 0;
  color: var(--on-page-alt);
  margin: 0;
}
.ew-body-large {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-large-size);
  line-height: var(--text-body-large-line);
  letter-spacing: 0;
  color: var(--on-page-alt);
  margin: 0;
}
.ew-body-medium {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  letter-spacing: 0;
  color: var(--on-page-alt);
  margin: 0;
}
.ew-body-medium-bold {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page);
  margin: 0;
}
.ew-overline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-overline-size);
  line-height: var(--text-overline-line);
  letter-spacing: 0;
  color: var(--on-page-alt);
  margin: 0;
}
.ew-label-medium {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-label-medium-size);
  line-height: var(--text-label-medium-line);
  letter-spacing: var(--text-label-medium-tracking);
  margin: 0;
}

/* =============================================================================
   Icon (24 slot)
   ============================================================================= */
.ew-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: inherit;
  line-height: 0;
  overflow: hidden;
}
.ew-icon img,
.ew-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ew-icon--sm {
  width: 14px;
  height: 14px;
}
.ew-icon--tick img,
.ew-icon--tick svg {
  width: 14px;
  height: 12px;
}
.ew-icon--chevron img,
.ew-icon--chevron svg {
  width: 8px;
  height: 14px;
}
.ew-icon--house img,
.ew-icon--house svg {
  width: 15px;
  height: 14px;
}
.ew-icon--heart img,
.ew-icon--heart svg {
  width: 14px;
  height: 13px;
}

/* =============================================================================
   IconButton — primary (inverse fill) / secondary (page fill); 40 circle
   ============================================================================= */
.ew-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: var(--radius-full);
  background: var(--inverse);
  color: var(--on-accent);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.ew-icon-btn:hover,
.ew-icon-btn:focus-visible {
  background: color-mix(in srgb, var(--inverse) 88%, #fff);
}
.ew-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ew-icon-btn:disabled,
.ew-icon-btn[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}
.ew-icon-btn--secondary {
  background: var(--page);
  color: var(--on-page);
}
.ew-icon-btn--secondary:hover,
.ew-icon-btn--secondary:focus-visible {
  background: var(--raised);
}
/* On raised / sunken surfaces secondary needs a bit more contrast */
.ew-icon-btn--secondary.ew-icon-btn--on-raised {
  background: var(--page);
}
.ew-icon-btn--secondary.ew-icon-btn--on-raised:hover {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--outline);
}
/*
 * External SVG <img> cannot inherit currentColor. Primary (dark) IconButtons
 * need on-accent glyphs; invert dark strokes to white. Secondary keeps ink.
 */
.ew-icon-btn:not(.ew-icon-btn--secondary) .ew-icon img {
  filter: brightness(0) invert(1);
  opacity: 0.96;
}
.ew-icon-btn:not(.ew-icon-btn--secondary) .ew-icon svg {
  color: var(--on-accent);
}
.ew-icon-btn:not(.ew-icon-btn--secondary) .ew-icon svg [stroke] {
  stroke: currentColor;
}
.ew-icon-btn:not(.ew-icon-btn--secondary) .ew-icon svg [fill]:not([fill="none"]) {
  fill: currentColor;
}
.ew-icon-btn--secondary .ew-icon img {
  filter: none;
}

/* =============================================================================
   Button — primary (accent) / secondary (inverse); optional squiggle arrow
   Asymmetric radius: TL TR BL = 8, BR = 0 (Figma)
   ============================================================================= */
.ew-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg); /* 16 */
  min-height: 60px;
  padding: var(--space-sm) var(--space-xl); /* 8 24 */
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-label-medium-size);
  line-height: var(--text-label-medium-line);
  letter-spacing: var(--text-label-medium-tracking);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: filter 0.15s ease, background 0.15s ease;
}
.ew-btn:hover,
.ew-btn:focus-visible {
  filter: brightness(0.96);
}
.ew-btn:focus-visible {
  outline: 2px solid var(--on-page);
  outline-offset: 3px;
}
.ew-btn--secondary {
  background: var(--inverse);
  color: var(--on-accent);
}
.ew-btn-icon {
  display: inline-flex;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
  color: inherit;
  overflow: visible;
  line-height: 0;
}
.ew-btn-icon svg,
.ew-btn-arrow-svg {
  display: block;
  width: 38px;
  height: 21px;
  overflow: visible;
}
/* Exact Figma filled squiggle. Hover: low-fps hand-drawn shake (not outline). */
.ew-btn-arrow-shape {
  fill: currentColor;
}
.ew-btn-arrow-svg {
  transform-origin: 70% 50%;
}
.ew-btn:hover .ew-btn-arrow-svg,
.ew-btn:focus-visible .ew-btn-arrow-svg {
  /* steps() = few discrete frames, like redrawn cel animation */
  animation: ew-btn-arrow-shake 0.42s steps(4) infinite;
}
@keyframes ew-btn-arrow-shake {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(0.45px, -0.55px) rotate(-2.2deg);
  }
  50% {
    transform: translate(-0.5px, 0.35px) rotate(1.6deg);
  }
  75% {
    transform: translate(0.35px, 0.5px) rotate(-1.1deg);
  }
  100% {
    transform: translate(-0.25px, -0.3px) rotate(0.9deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ew-btn:hover .ew-btn-arrow-svg,
  .ew-btn:focus-visible .ew-btn-arrow-svg {
    animation: none;
  }
}

/* =============================================================================
   Badge — house icon + overline label on raised chip
   ============================================================================= */
.ew-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs); /* 4 */
  padding: var(--space-xs) var(--space-sm) var(--space-xs) var(--space-xs);
  background: var(--raised);
  color: var(--on-page-alt);
  border-radius: var(--radius-sm) var(--radius-sm) 0 var(--radius-sm); /* TL TR BR? Figma: bl/tl/tr sm */
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-overline-size);
  line-height: var(--text-overline-line);
  white-space: nowrap;
}
/* Badge icons are always brand accent (tick glyph hard-filled; see SVG). */
.ew-badge .ew-icon {
  color: var(--accent);
}
.ew-badge .ew-icon--tick {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.ew-badge .ew-icon--tick svg,
.ew-badge .ew-icon--tick img {
  width: 14px;
  height: 12px;
  /* img cannot use currentColor — force accent via CSS filter if fill baked wrong */
  color: var(--accent);
}

/* =============================================================================
   Eyebrow — accent mark + overline
   ============================================================================= */
.ew-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm); /* 8 */
  overflow: hidden;
}
.ew-eyebrow-mark {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}
.ew-eyebrow-mark img,
.ew-eyebrow-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* =============================================================================
   Statement — eyebrow + heading (+ optional link icon-btn) + body
   ============================================================================= */
.ew-statement {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg); /* 16 */
  min-width: 0;
}
.ew-statement-heading-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm); /* 8 */
  width: 100%;
  min-width: 0;
}
.ew-statement-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  /* Heading text + optional IconButton sit together (Figma); no space-between */
  justify-content: flex-start;
}
.ew-statement-heading-row .ew-headline-large,
.ew-statement-heading-row .ew-display-large,
.ew-statement-heading-row .ew-headline-small {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.ew-statement-link {
  flex-shrink: 0;
  align-self: center;
}
/* Linked statement: entire heading (title + IconButton) is one hit target */
a.ew-statement-heading-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  max-width: 100%;
}
a.ew-statement-heading-link .ew-headline-large,
a.ew-statement-heading-link .ew-headline-small,
a.ew-statement-heading-link .ew-display-large {
  /* keep heading look; link inherits ink */
  color: inherit;
}
a.ew-statement-heading-link .ew-icon-btn {
  /* span acting as primary IconButton chrome */
  pointer-events: none; /* whole <a> is the control */
}
a.ew-statement-heading-link:hover .ew-icon-btn:not(.ew-icon-btn--secondary),
a.ew-statement-heading-link:focus-visible .ew-icon-btn:not(.ew-icon-btn--secondary) {
  background: color-mix(in srgb, var(--inverse) 88%, #fff);
}
a.ew-statement-heading-link:focus-visible {
  outline: none;
}
a.ew-statement-heading-link:focus-visible .ew-icon-btn {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =============================================================================
   Card — raised surface + outline + 24 pad + slot
   ============================================================================= */
.ew-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-xl); /* 24 */
  background: var(--raised);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md); /* 8 */
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.ew-card-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-lg);
  width: 100%;
  min-width: 0;
}
.ew-card .ew-title-medium {
  color: var(--on-page);
}
.ew-card .ew-body-large {
  color: var(--on-page);
}

/* =============================================================================
   PriceTag — yen bold + approx conversion (GBP)
   ============================================================================= */
.ew-price-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs); /* 4 */
}
.ew-price-tag-yen {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-body-large-size);
  line-height: var(--text-body-large-line);
  color: var(--on-page);
  white-space: nowrap;
  margin: 0;
}
.ew-price-tag-fx {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-overline-size);
  line-height: var(--text-overline-line);
  color: var(--on-page-alt);
  white-space: nowrap;
  margin: 0;
}

/* =============================================================================
   PropertyCard / LocationCard
   ============================================================================= */
.ew-property-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm); /* 8 */
  width: 288px;
  max-width: 100%;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-xl) var(--radius-xl) 0 var(--radius-xl); /* 16 TL TR BL? Figma bl/tl/tr xl */
}
.ew-property-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 var(--radius-lg); /* 12 */
  background: var(--sunken);
}
.ew-property-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ew-property-card:hover .ew-property-card-thumb img {
  transform: scale(1.04);
}
.ew-property-card-wish {
  position: absolute;
  top: var(--space-lg); /* 16 */
  right: var(--space-lg);
  z-index: 1;
}
.ew-property-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs); /* 4 */
  width: 100%;
  min-width: 0;
}
.ew-property-card-loc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page-alt);
  margin: 0;
  width: 100%;
}
.ew-property-attrs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs); /* 4 */
  width: 100%;
}
.ew-property-attr {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-overline-size);
  line-height: var(--text-overline-line);
  color: var(--on-page-alt);
  white-space: nowrap;
  margin: 0;
}
.ew-property-attr-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--on-page-alt);
  opacity: 0.45;
  flex-shrink: 0;
}

/* Wishlist as IconButton secondary on photo */
.ew-property-card .ew-icon-btn--secondary {
  background: var(--page);
  color: var(--on-page);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--on-page) 8%, transparent);
}
.ew-property-card .ew-icon-btn--secondary:hover {
  background: var(--raised);
}
.ew-property-card .ew-icon-btn.is-saved,
.ew-property-card .ew-icon-btn.saved {
  color: var(--accent);
}
.ew-property-card .ew-icon-btn.is-saved svg path[stroke],
.ew-property-card .ew-icon-btn.saved svg path[stroke] {
  fill: currentColor;
  stroke: none;
}

/* LocationCard reuses property-card shell */
.ew-location-card {
  /* same as property card without wishlist */
}

/* =============================================================================
   PropertyCarousel — first card flush with Statement (inset set in home.js
   from measured Statement left edge so it cannot drift from the container).
   ============================================================================= */
.ew-carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl); /* 32 */
  width: 100%;
  min-width: 0;
}
.ew-carousel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  box-sizing: border-box;
  min-width: 0;
}
.ew-carousel-head .ew-statement {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 100px);
}
.ew-carousel-arrows {
  display: none;
  align-items: center;
  gap: var(--space-sm); /* 8 */
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .ew-carousel-arrows {
    display: flex;
  }
}
/*
 * Full-width scrollport. Track padding + viewport scroll-padding are set in JS
 * so card 1 lines up with the Statement.
 *
 * CRITICAL: do NOT use scroll-snap-type: mandatory without matching
 * scroll-padding. Snap aligns the first card to the viewport edge and
 * scrolls past the track padding, which undoes the Statement alignment.
 */
.ew-carousel-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  box-sizing: border-box;
  /* proximity snap only; padding applied via JS to match Statement inset */
  scroll-snap-type: x proximity;
}
.ew-carousel-viewport::-webkit-scrollbar {
  display: none;
}
.ew-carousel-track {
  display: flex;
  gap: var(--space-xl); /* 24 */
  width: max-content;
  box-sizing: content-box;
  /* Fallback until JS measures — page gutter only */
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}
.ew-carousel-track > * {
  scroll-snap-align: start;
}

/* Spotlight — raised surface (Figma) */
.ew-spotlight {
  padding-block: var(--space-2xl);
  background: var(--raised);
  overflow-x: clip;
}
.ew-spotlight-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl); /* 64 between carousels */
  width: 100%;
}

/* =============================================================================
   RichLink — whole tile link; optional description; hover state
   ============================================================================= */
.ew-rich-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs); /* 4 */
  flex: 1 1 0;
  min-width: min(100%, 280px);
  max-width: 100%;
  padding: var(--space-sm) 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, opacity 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
}
.ew-rich-link-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page);
  margin: 0;
  width: 100%;
  transition: color 0.15s ease;
}
.ew-rich-link-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page-alt);
  margin: 0;
  width: 100%;
}
.ew-rich-link:hover .ew-rich-link-title,
.ew-rich-link:focus-visible .ew-rich-link-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--on-page);
}
.ew-rich-link:hover .ew-rich-link-desc,
.ew-rich-link:focus-visible .ew-rich-link-desc {
  text-decoration: none;
}
.ew-rich-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* =============================================================================
   Tabs + TabsItem
   ============================================================================= */
.ew-tabs {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--outline);
  overflow-x: auto;
  scrollbar-width: none;
}
.ew-tabs::-webkit-scrollbar {
  display: none;
}
.ew-tabs-list {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xl); /* 24 */
  list-style: none;
  margin: 0;
  padding: 0;
}
.ew-tabs-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
}
.ew-tabs-btn {
  display: inline-flex;
  align-items: flex-start;
  padding: var(--space-sm) 0; /* 8 */
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-label-medium-size);
  line-height: var(--text-label-medium-line);
  letter-spacing: var(--text-label-medium-tracking);
  color: var(--on-page-alt);
  white-space: nowrap;
}
.ew-tabs-item.is-active .ew-tabs-btn {
  color: var(--on-page);
}
.ew-tabs-item.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
}
.ew-tabs-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.ew-tabs-panel[hidden] {
  display: none !important;
}

/* =============================================================================
   Hero (Figma 18:389)
   Container 1680 / 24 gutter. Primary (headline+CTA) flexes; secondary is a
   fixed 500px column (title/medium copy + badges) separated by a 1px rule.
   ============================================================================= */
.ew-hero {
  background: var(--page);
  padding-block: var(--space-2xl);
}
.ew-hero-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
  box-sizing: border-box;
  width: 100%;
}
@media (min-width: 1024px) {
  .ew-hero-inner {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-4xl); /* 64 between primary and secondary cluster */
  }
}
.ew-hero-primary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xl); /* 24 */
  flex: 1 1 0;
  min-width: 0;
  /* Keep display type from spanning the full remaining width alone */
  max-width: 100%;
}
@media (min-width: 1024px) {
  .ew-hero-primary {
    /* Remaining width after fixed 500px secondary + 64 gap */
    max-width: calc(100% - 500px - var(--space-4xl));
  }
}
.ew-hero-secondary {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}
@media (min-width: 1024px) {
  .ew-hero-secondary {
    width: 500px;
    flex: 0 0 500px;
    flex-direction: row;
    gap: var(--space-2xl); /* 32 divider → copy */
    align-items: stretch;
    align-self: stretch;
  }
}
.ew-hero-divider {
  display: none;
  width: 0;
  align-self: stretch;
  border-left: 1px solid var(--outline);
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .ew-hero-divider {
    display: block;
  }
}
.ew-hero-secondary-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-xl);
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}
.ew-hero-secondary-body .ew-title-medium {
  /* Full width of the 500 - 32 divider cluster */
  width: 100%;
  max-width: 100%;
}
.ew-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm); /* 8 */
  align-items: flex-start;
}

/* =============================================================================
   Trust — Text + Media
   ============================================================================= */
.ew-trust {
  padding-block: var(--space-2xl);
}
.ew-trust-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--space-xl);
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  .ew-trust-inner {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4xl); /* 64 */
  }
}
.ew-trust-text {
  flex: 0 1 auto;
  min-width: 0;
  width: 100%;
}
@media (min-width: 1024px) {
  .ew-trust-text {
    width: min(681px, 42%);
  }
}
.ew-trust-media {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--sunken);
}
.ew-trust-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 519px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* =============================================================================
   Process
   ============================================================================= */
.ew-process {
  padding-block: var(--space-2xl);
}
.ew-process-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--space-xl);
  box-sizing: border-box;
}
.ew-process-text {
  max-width: 681px;
}
.ew-process-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl); /* 32 */
  width: 100%;
}
@media (min-width: 768px) {
  .ew-process-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================================================
   Footer (Airbnb-style tabbed explore)
   ============================================================================= */
.site-footer.ew-footer {
  background: var(--sunken);
  border-top: none;
  margin-top: 0;
  padding-block: var(--space-4xl); /* 64 */
}
.ew-footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl); /* 32 */
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--space-xl);
  box-sizing: border-box;
}
.ew-footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); /* → 36 */
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--on-page);
  margin: 0;
}
/* Equal-width cells: 2 → 3 → 5 columns as the viewport grows.
   Grid (not flex) so every link shares the same column width. */
.ew-footer-menus {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl); /* 24 */
  width: 100%;
  align-items: start;
}
@media (min-width: 640px) {
  .ew-footer-menus {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .ew-footer-menus {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.ew-footer-menus .ew-rich-link {
  flex: none;
  min-width: 0;
  max-width: none;
  width: 100%;
}
/* Show-more is a button painted as a rich link (expand only, no collapse). */
button.ew-footer-show-more {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  margin: 0;
  color: inherit;
}
button.ew-footer-show-more .ew-rich-link-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ew-footer-rule {
  border: 0;
  border-top: 1px solid var(--outline);
  margin: 0;
  width: 100%;
}
.ew-footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl); /* 24 */
  align-items: flex-start;
}
.ew-footer-tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page-alt);
  margin: 0;
  max-width: 40rem;
}
.ew-footer-legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: flex-start;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--text-body-medium-size);
  line-height: var(--text-body-medium-line);
  color: var(--on-page-alt);
}
@media (min-width: 640px) {
  .ew-footer-legal {
    flex-direction: row;
    align-items: center;
  }
}
.ew-footer-legal-left,
.ew-footer-legal-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-lg); /* 16 */
}
.ew-footer-legal a {
  color: var(--on-page-alt);
  text-decoration: none;
}
.ew-footer-legal a:hover,
.ew-footer-legal a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--on-page);
}
.ew-footer-legal a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Footer logo size (small lockup) */
.ew-footer .site-logo-lockup--footer {
  height: 40px;
  width: auto;
}

/* =============================================================================
   Body font stack for DS pages
   ============================================================================= */
body {
  font-family: var(--font-body), "Noto Sans JP", system-ui, sans-serif;
}
h1, h2, .display-serif {
  font-family: var(--font-display), "Noto Serif JP", Georgia, serif;
}

/* Mobile: property cards a bit narrower so 1.2 peek shows */
@media (max-width: 640px) {
  .ew-property-card {
    width: min(288px, 78vw);
  }
  .ew-display-large {
    word-break: break-word;
  }
  .ew-carousel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ew-carousel-arrows {
    display: flex;
    align-self: flex-end;
  }
  .ew-hero-primary .ew-display-large {
    max-width: none;
  }
}


/* =============================================================================
   Page intro (Statement pattern for SSR / browse shells)
   ============================================================================= */
.ew-page-intro {
  padding-block: var(--space-2xl);
  max-width: 52rem; /* legible measure for long copy pages */
}
.ew-page-intro--wide {
  max-width: none;
}
.ew-page-intro .ew-headline-large,
.ew-page-intro .ew-headline-small {
  margin: 0;
}
.ew-page-intro .ew-body-large {
  margin: 0;
}
