/* audit-mobile-20261015: navigation, conversion and legibility fixes. */
/* Dubai Asset — document scrolling, section anchors and project snapshot.
 * Load after all Signature bundles. The JS applies da-document-scroll only
 * to the public Signature interface. No modal/menu inline styles are reset.
 */
html.da-document-scroll {
  scroll-padding-top: 0;
}

/* One source of anchor clearance; do not also add root scroll padding. */
body.da-signature main[id],
body.da-signature main [id],
body.da-signature main :is(#overview, #gallery, #payment-plan, #location, #faq, #contact, #projects, #highlights, #project-specifications) {
  scroll-margin-top: var(--da-anchor-offset, 92px);
}

@media (max-width: 640px) {
  html.da-document-scroll {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.da-signature {
    height: auto;
  }

  /* overflow-x:hidden on a 100%-high body created a second scroll container.
   * Keep the document as the scrolling element, except during existing locks. */
  body.da-signature:not(.menu-open):not(.da-dialog-open) {
    overflow-x: visible;
    overflow-y: visible;
  }

  @supports (overflow: clip) {
    html.da-document-scroll {
      overflow-x: clip;
      overflow-y: visible;
    }

    body.da-signature:not(.menu-open):not(.da-dialog-open) {
      overflow-x: clip;
      overflow-y: visible;
    }
  }
}

/* Only the document scrollbar is suppressed on touch devices. The horizontal
 * scrollbar of galleries, tabs and comparison tables remains available. */
@media (hover: none) and (pointer: coarse) {
  html.da-document-scroll {
    scrollbar-width: none;
  }

  html.da-document-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

@media (max-width: 760px) {
  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 6px 12px;
    padding: 18px 0;
    text-align: left;
    list-style: none;
  }

  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__head::-webkit-details-marker {
    display: none;
  }

  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__head .section-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    text-align: left;
  }

  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__update {
    display: inline-flex;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
  }

  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__head::after {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin: 0;
    line-height: 1;
  }

  body.da-signature .project-page.signature-project-page .signature-specification .project-sheet__head:focus-visible {
    outline: 2px solid var(--da-gold, #8c7044);
    outline-offset: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.da-document-scroll {
    scroll-behavior: auto;
  }
}

/* Fixed contact controls live outside skipped/contained profile sections. */
body.da-signature > .mobile-cta-bar[data-mobile-cta] { display:none !important; }

@media (max-width:820px) {
  body.da-signature.da-has-cta-dock {
    padding-bottom:var(--da-mobile-cta-height,80px) !important;
  }
  body.da-signature > .mobile-cta-bar[data-mobile-cta] {
    position:fixed;
    display:grid !important;
    grid-template-columns:minmax(96px,.7fr) minmax(0,1.3fr);
    align-items:stretch;
    gap:8px;
    inset:auto 0 0;
    width:auto;
    max-width:none;
    margin:0;
    padding:10px max(12px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    box-sizing:border-box;
    background:var(--da-paper,#fffefd);
    border:0;
    border-top:1px solid var(--da-line,#e0e2df);
    border-radius:0;
    box-shadow:0 -5px 24px rgb(19 43 56 / 8%);
    z-index:80;
  }
  body.da-signature > .mobile-cta-bar[data-mobile-cta] > .btn {
    display:flex;
    align-items:center;
    justify-content:center;
    min-width:0;
    min-height:48px;
    width:auto;
    padding:10px 12px;
    margin:0;
    box-sizing:border-box;
    font-size:13px;
    line-height:1.35;
    text-align:center;
    white-space:normal;
    overflow-wrap:break-word;
  }
  body.da-signature > .mobile-cta-bar[data-mobile-cta] > .btn:focus-visible {
    outline:3px solid var(--da-ink,#132b38);
    outline-offset:2px;
  }
  body.da-signature.da-has-cta-dock .wa-float { display:none !important; }
}

@media (max-width:1100px) {
  html:has(> body.da-fixed-ui-ready) {
    scroll-padding-bottom:calc(var(--da-mobile-cta-height,0px) + 80px);
  }
  body.da-signature.da-fixed-ui-ready :is(a,button,input,select,textarea,[tabindex]) {
    scroll-margin-bottom:calc(var(--da-mobile-cta-height,0px) + 80px);
  }
  body.da-signature.da-fixed-ui-ready .da-compare-launch {
    left:auto;
    right:max(12px,env(safe-area-inset-right));
    bottom:calc(12px + env(safe-area-inset-bottom));
    max-width:calc(100vw - 96px - env(safe-area-inset-left) - env(safe-area-inset-right));
    min-height:44px;
    padding:10px 12px;
    font-size:12px;
    line-height:1.3;
    white-space:normal;
    box-sizing:border-box;
    z-index:79;
  }
  body.da-signature.da-fixed-ui-ready .wa-float {
    left:max(12px,env(safe-area-inset-left));
    right:auto;
    bottom:calc(12px + env(safe-area-inset-bottom));
    width:46px;
    min-width:46px;
    height:46px;
    min-height:46px;
    padding:0;
    justify-content:center;
    border-radius:50%;
    z-index:79;
  }
  body.da-signature.da-fixed-ui-ready .wa-float__text { display:none; }
  body.da-signature.da-has-cta-dock .da-compare-launch {
    left:max(12px,env(safe-area-inset-left));
    right:auto;
    max-width:calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    bottom:calc(var(--da-mobile-cta-height,0px) + 12px);
  }
  body.da-signature.da-fixed-ui-ready:not(.da-has-cta-dock):has(.mobile-cta-bar) .wa-float { display:flex; }
  body.da-signature .da-compare-launch[hidden] { display:none !important; }
  body.da-signature.da-fixed-ui-blocked :is(.mobile-cta-bar,.wa-float,.da-compare-launch),
  body.da-signature.menu-open :is(.mobile-cta-bar,.wa-float,.da-compare-launch),
  body.da-signature.da-dialog-open :is(.mobile-cta-bar,.wa-float,.da-compare-launch),
  body.da-signature.filters-open :is(.mobile-cta-bar,.wa-float,.da-compare-launch),
  body.da-signature:has(dialog[open]) :is(.mobile-cta-bar,.wa-float,.da-compare-launch) {
    visibility:hidden !important;
    pointer-events:none !important;
  }
}

/* Dubai Asset: audit mobile/tablet refinements, 15 October 2026.
   Intentionally scoped to <=1100px; the desktop composition remains independent. */
@media (max-width:1100px) {
  /* Distinguish editorial selection from the profile label below the logo. */
  body.da-signature .sig-company-card .catalog-card__badge {
    display:inline-block;
    align-self:flex-start;
    margin:0 0 12px;
    padding:5px 10px;
    border:1px solid var(--da-gold,#8c7044);
    border-radius:3px;
    background:var(--da-gold,#8c7044);
    color:var(--da-paper,#fffefd);
    font:500 12px/1.45 Manrope,Arial,sans-serif;
    letter-spacing:.025em;
    text-transform:none;
  }

  /* Give the contact link its own visual target, separate from the address. */
  body.da-signature .sig-home .da-about-contact a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    max-width:100%;
    min-height:44px;
    margin-top:14px;
    padding:11px 16px;
    border:1px solid var(--da-ink,#132b38);
    border-radius:3px;
    background:transparent;
    color:var(--da-ink,#132b38);
    font:500 13px/1.5 Manrope,Arial,sans-serif;
    text-decoration:none;
  }
  body.da-signature .sig-home .da-about-contact a::after { content:'↗'; }
  body.da-signature .sig-home .da-about-contact a:focus-visible {
    outline:2px solid var(--da-gold,#8c7044);
    outline-offset:4px;
  }

  /* Readable supporting text without changing the main type hierarchy. */
  body.da-signature .offplan-page.signature-catalog-page .offplan-metric-card > span,
  body.da-signature :is(.section-kicker,.catalog-card__eyebrow,.da-eyebrow,.catalog-toggle__count),
  body.da-signature .sig-directory .catalog-card__eyebrow,
  body.da-signature .da-catalog-card.signature-project-card :is(.catalog-card__eyebrow,.da-card-plan),
  body.da-signature .da-catalog-card.signature-project-card .da-card-price > span,
  body.da-signature .da-catalog-card.signature-project-card [data-compare-project],
  body.da-signature .project-page.signature-project-page .project-header-badges .badge,
  body.da-signature .sig-home :is(.da-path-number,.da-eyebrow),
  body.da-signature .sig-home .da-paths .card .pill,
  body.da-signature .sig-home .da-areas .card .pill,
  body.da-signature .sig-home .da-home-contact .section-kicker,
  body.da-signature .da-signature-insights .da-insight-card .pill,
  body.da-signature .sig-city-figure figcaption,
  body.da-signature .sig-home .sig-home-photo figcaption {
    font-size:12px;
    line-height:1.55;
  }
  body.da-signature .sig-home .da-commitments strong { font-size:13px;line-height:1.55; }
  body.da-signature .sig-home .da-commitments span { font-size:12px;line-height:1.55; }
  body.da-signature .project-page.signature-project-page .breadcrumbs { font-size:12px; }
  body.da-signature .sig-home .sig-home-photo figcaption { letter-spacing:.025em; }

  /* Consistent breathing room even when a payment plan is unavailable. */
  body.da-signature .da-catalog-card.signature-project-card .project-card__facts-wrap {
    padding:12px 0;
  }
  body.da-signature .da-catalog-card.signature-project-card .project-card__facts-wrap:not(:has(*)),
  body.da-signature .da-catalog-card.signature-project-card .project-card__facts-wrap:has(>.project-card__facts):not(:has(.project-card__facts>*)) {
    display:none;
  }
}

/* Two comfortable columns on narrow tablets, with the final card centred.
   Only small curated groups are centred: catalogue ordering is unchanged. */
@media (min-width:681px) and (max-width:959px) {
  body.da-signature .sig-home :is(.da-featured-grid,.da-areas .list-grid,.da-paths .cards),
  body.da-signature .sig-profile-page :is(.developer-projects-grid,.area-projects-grid) {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:28px 22px;
  }
  body.da-signature .sig-home .da-featured-grid > :last-child:nth-child(odd),
  body.da-signature .sig-home .da-areas .list-grid > :last-child:nth-child(odd),
  body.da-signature .sig-home .da-paths .cards > :last-child:nth-child(odd),
  body.da-signature .sig-profile-page :is(.developer-projects-grid,.area-projects-grid) > :last-child:nth-child(odd) {
    grid-column:1/-1;
    justify-self:center;
    width:calc((100% - 22px)/2);
  }
}

/* The page has enough usable width for three cards on wider tablets. */
@media (min-width:960px) and (max-width:1100px) {
  body.da-signature .sig-home :is(.da-featured-grid,.da-areas .list-grid,.da-paths .cards),
  body.da-signature .signature-project-results > .list-grid,
  body.da-signature .sig-profile-page :is(.developer-projects-grid,.area-projects-grid) {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:28px 20px;
  }
}

@media (max-width:680px) {
  body.da-signature .da-signature-insights .da-insight-card h3 {
    font-size:22px;
    line-height:1.25;
  }
}

/* Reviewed language labels: audit-atelier-final. */

/* Audit follow-up: keep collections of exactly three cards on one tablet row.
 * Load after audit-mobile-20261015.css. No type, mobile or desktop changes.
 * Full catalogues and directory grids keep their existing column counts.
 */
@media (min-width: 768px) and (max-width: 959px) {
  body.da-signature .sig-home :is(.da-featured-grid, .da-areas .list-grid, .da-paths .cards):has(> :nth-child(3):last-child),
  body.da-signature .sig-profile-page :is(.developer-projects-grid, .area-projects-grid):has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 16px;
  }

  /* Undo the narrow-tablet rule that spans/centres the last odd card. */
  body.da-signature .sig-home :is(.da-featured-grid, .da-areas .list-grid, .da-paths .cards):has(> :nth-child(3):last-child) > :last-child:nth-child(3),
  body.da-signature .sig-profile-page :is(.developer-projects-grid, .area-projects-grid):has(> :nth-child(3):last-child) > :last-child:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    width: auto;
  }
}
