/* PROPLY theme — size corrections only (font-size, line-height, letter-spacing, padding, horizontal scroll).
   Loaded right after proply-theme.css, behind the same flag (PROPLY_THEME=on). Each rule names the element and viewport it fixes. */

/* ── HIGH CONTRAST STAYS HIGH CONTRAST (decision (a), 05/10/2026) ─────────────────────────────────────────────────────
   Only while the accessibility menu's high-contrast mode is on (html.a11y-high-contrast). These restate globals.css's
   own high-contrast rules, value for value. The theme's !important rules are more specific than globals.css's, so
   they won; :is(html, #a11y-hc) gives these the weight of an id (no theme rule uses one), so high contrast wins again.
   No size, no layout: colours only, and only in this mode. */

/* Each selector is globals.css's own, one for one, with the same :is(html, #a11y-hc) prefix — so the rules keep their
   ranking against each other exactly as in globals.css (a gold-text link stays yellow, a card button stays black). */

/* restores: the black page and white text of high contrast (the theme's html background kept the page navy) */
html.a11y-high-contrast:is(html, #a11y-hc),
html.a11y-high-contrast:is(html, #a11y-hc) body { background: #000000 !important; color: #FFFFFF !important; }

/* restores: white text and white borders on everything */
html.a11y-high-contrast:is(html, #a11y-hc) * { color: #FFFFFF !important; border-color: #FFFFFF !important; }

/* restores: yellow headings and gold-accent text */
html.a11y-high-contrast:is(html, #a11y-hc) .text-proply-gold,
html.a11y-high-contrast:is(html, #a11y-hc) .text-proply-gold-light,
html.a11y-high-contrast:is(html, #a11y-hc) h1, html.a11y-high-contrast:is(html, #a11y-hc) h2, html.a11y-high-contrast:is(html, #a11y-hc) h3 { color: #FFFF00 !important; }

/* restores: cyan links and pink-accent text (the theme's link-button rules kept them navy / light) */
html.a11y-high-contrast:is(html, #a11y-hc) .text-proply-pink,
html.a11y-high-contrast:is(html, #a11y-hc) .text-proply-pink-light,
html.a11y-high-contrast:is(html, #a11y-hc) a { color: #00FFFF !important; }

/* restores: black cards */
html.a11y-high-contrast:is(html, #a11y-hc) .bg-proply-bg-card,
html.a11y-high-contrast:is(html, #a11y-hc) .bg-proply-bg-secondary { background: #000000 !important; }

/* restores: yellow buttons with black text and a white frame */
html.a11y-high-contrast:is(html, #a11y-hc) button,
html.a11y-high-contrast:is(html, #a11y-hc) .bg-proply-pink { background: #FFFF00 !important; color: #000000 !important; border: 2px solid #FFFFFF !important; }

/* ── INVERTED CONTRAST AND LINK HIGHLIGHTING STAY AS THEY ARE (decision (a) extended, 05/10/2026) ──────────────────────
   Same pattern as high contrast above: globals.css's own rules for each mode, one for one, active only while that mode
   is on, with an id-weight prefix so they outrank the theme. Nothing redesigned. */

/* restores: inverted contrast's white page background under the invert filter (the theme's html background kept it
   navy, so the inverted page showed light instead of black) */
html.a11y-invert:is(html, #a11y-mode) {
  filter: invert(1) hue-rotate(180deg);
  background: #FFFFFF !important;
}
/* restores: inverted contrast turns pictures back to normal */
html.a11y-invert:is(html, #a11y-mode) img,
html.a11y-invert:is(html, #a11y-mode) video,
html.a11y-invert:is(html, #a11y-mode) svg {
  filter: invert(1) hue-rotate(180deg);
}

/* restores: link highlighting's underline, pink and bold on every link (the theme's link-button rules kept some navy
   or light) */
html.a11y-highlight-links:is(html, #a11y-mode) a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  text-decoration-thickness: 2px !important;
  color: #FF6B9D !important;
  font-weight: 700 !important;
}
/* restores: link highlighting's colour for visited links */
html.a11y-highlight-links:is(html, #a11y-mode) a:visited {
  color: #FF8AB0 !important;
}

/* ── THE RENDER PICKER'S SELECTED TILE (property card → הדמיות, PropertyVideoBanner, 06/10/2026) ───────────────────────
   restores: the selection overlay's own intent — gold at 25%, translucent, the photo visible under the check mark.
   proply-theme.css paints every non-button element with a "bg-proply-gold/…" class solid (#F3F2F8 day / #171B38
   night), which turned the selected tile into a blank square with only the check. Day and night, every width.
   Scoped to exactly that overlay: the full-tile span inside a pressed (selected) tile button. */
:root:has(.min-h-screen[data-theme]) button[aria-pressed="true"] > span.absolute.inset-0[class*="bg-proply-gold/25"] {
  background-color: color-mix(in srgb, var(--color-proply-gold) 25%, transparent) !important;
}

/* ── THE GLOBAL SEARCH FIELD: NO RING ON A CLICK, A RING IN THE THEME'S COLOUR FROM THE KEYBOARD (06/10/2026) ──────────
   replaces: proply-theme.css paints every :focus-visible with a 3px !important ring — pink #D6245C at 35% by day
   (:134), lavender by night (:149 / :221) — which beat the field's inline outline:none, so a click opened the search
   inside a pink frame. Shown only while focused (measured). Ofer: a click or tap shows NO ring; the keyboard (Tab,
   Enter on the search button, Ctrl+K) shows a clear ring in the theme's own colour, never pink. :focus-visible matches
   every focus on a text input, so the field says how it was reached (data-focus-by, GlobalSearch.tsx), and the
   :focus-visible rule below always has its keyboard replacement. High contrast: yellow, that mode's accent (navy on its
   black page would vanish). Strong focus: its own yellow ring, below, on every focus — the user chose it. */
html:is(html, #a11y-mode):not(.a11y-high-focus) input[aria-label="חיפוש נכסים ולקוחות"][data-focus-by="pointer"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
html:is(html, #a11y-mode):not(.a11y-high-focus) input[aria-label="חיפוש נכסים ולקוחות"][data-focus-by="keyboard"]:focus-visible {
  outline: 2px solid var(--color-proply-gold) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
  border-radius: 6px;
}
html.a11y-high-contrast:is(html, #a11y-hc):not(.a11y-high-focus) input[aria-label="חיפוש נכסים ולקוחות"][data-focus-by="keyboard"]:focus-visible {
  outline-color: #FFFF00 !important;
}

/* ── STRONG FOCUS STAYS STRONG FOCUS (the fourth accessibility mode, 06/10/2026) ───────────────────────────────────────
   Same pattern as high contrast above: globals.css's own rule, value for value, active only while the mode is on, with
   an id-weight prefix so it outranks the theme's pink/lavender ring (which, more specific, had replaced the yellow one). */
html.a11y-high-focus:is(html, #a11y-mode) *:focus,
html.a11y-high-focus:is(html, #a11y-mode) *:focus-visible {
  outline: 4px solid #FFFF00 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(255, 255, 0, 0.3) !important;
}
