/*
 * Rebel Riders IL — "Night ride" design (see design/README.md).
 * Mobile first, right-to-left. Sizes in rem (1rem = 16px at default settings) so the
 * reader's font-size setting applies. Logical properties only (inline = right/left).
 */

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url('/fonts/rubik-hebrew-wght-normal.woff2') format('woff2-variations'),
    url('/fonts/rubik-hebrew-wght-normal.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url('/fonts/rubik-latin-wght-normal.woff2') format('woff2-variations'),
    url('/fonts/rubik-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --color-bg: #111214;
  --color-surface: #1b1c20;
  --color-surface-hover: #212227;
  --color-surface-raised: #26272c;
  --color-border: #34363c;
  --color-border-control: #6b6e76;
  --color-text: #f3f1ec;
  --color-text-body: #e6e4df;
  --color-text-strong: #ffffff;
  --color-text-muted: #a5a7ad;
  --color-placeholder: #8c8e95;
  --color-accent: #ea5b0c;
  --color-on-accent: #111214;
  --color-danger: #ff8a7a;

  --gutter: 1.25rem;
  --radius-card: 1rem;
  --radius-tile: 1.125rem;
  --radius-panel: 1.25rem;
  --radius-control: 0.875rem;
  --touch-target: 2.75rem;
  --focus-ring: 3px solid var(--color-text);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Rubik', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--color-text);
}

a:hover {
  color: var(--color-text-strong);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

svg {
  display: block;
  flex: none;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--color-on-accent);
  outline-color: var(--color-text);
}

/* ---------- Page frame ---------- */

.page {
  max-width: 32rem;
  min-height: 100vh;
  margin-inline: auto;
  /* Room below the footer so the fixed accessibility button never covers content. */
  padding-block-end: 5rem;
  display: flex;
  flex-direction: column;
}

.page__main {
  flex: 1;
  padding-block-end: 0.5rem;
}

.page__main:focus {
  outline: none;
}

.page__footer {
  padding: 2.25rem var(--gutter) 1.75rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.page__footer p {
  margin: 0;
}

.footer-links__list {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.footer-links__list a {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
  font-size: 0.9375rem;
  text-underline-offset: 0.2em;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem var(--gutter);
}

.site-header__title {
  font-size: 1rem;
  font-weight: 600;
}

.site-header__spacer {
  width: var(--touch-target);
  height: var(--touch-target);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text);
  text-decoration: none;
}

.brand__mark {
  width: 2.625rem;
  height: 2.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 1.1875rem;
  font-weight: 800;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.brand__name {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand__tagline {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.1;
}

.icon-button {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--color-border);
}

/* ---------- Sections and headings ---------- */

.hero {
  padding: 1rem var(--gutter) 0;
}

.hero__title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.hero__lead,
.page-heading__lead {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.page-heading {
  padding: 1rem var(--gutter) 0;
}

.page-heading__icon {
  width: var(--touch-target);
  height: var(--touch-target);
  margin-block-end: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-accent);
}

.page-heading__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
}

.section {
  margin: 0;
  padding: 2rem var(--gutter) 0;
}

.section--tight {
  padding-block-start: 1.25rem;
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 0.875rem;
}

.section__title {
  margin: 0 0 0.875rem;
  font-size: 1.3125rem;
  font-weight: 700;
}

.section__header .section__title {
  margin: 0;
}

.section__title--small {
  font-size: 1.1875rem;
}

.section__link {
  color: var(--color-accent);
  font-size: 0.9375rem;
  font-weight: 500;
}

.section__link:hover {
  color: var(--color-text-strong);
}

/* ---------- Search ---------- */

.search-field {
  height: 3.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-inline: 1.125rem 0.375rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: 1.75rem;
  background: var(--color-surface);
}

.search-field:focus-within {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.search-field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 1.0625rem;
}

.search-field__input:focus-visible {
  outline: none;
}

.search-field__input::placeholder {
  color: var(--color-placeholder);
}

.search-field__button {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.search-field__button:hover {
  background: var(--color-surface-raised);
}

.popular {
  margin-block-start: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.popular__label {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.chip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-link {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: 1.375rem;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.9375rem;
  text-decoration: none;
}

/* ---------- Hub (home page) ---------- */

.hub-grid {
  display: grid;
  /* Two large tiles per row on a phone, one when text is enlarged; any number of tiles. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-tile {
  min-height: 10.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.125rem;
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.hub-tile:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.hub-tile__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-block-end: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.hub-tile__title {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.15;
}

.hub-tile__description {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

html[data-high-contrast] .hub-tile {
  box-shadow: inset 0 0 0 2px var(--color-text);
}

html[data-high-contrast][data-highlight-links] a.hub-tile {
  box-shadow: inset 0 0 0 2px var(--color-text), 0 0 0 0.1875rem #ffd500;
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  padding: 0.25rem var(--gutter) 0;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumbs__item a {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  color: var(--color-text);
}

.breadcrumbs__separator {
  color: var(--color-text-muted);
}

/* ---------- Categories ---------- */

.category-grid {
  display: grid;
  /* Two columns on a phone; one column when text is enlarged (rem-based minimum). */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tile {
  min-height: 7.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: var(--radius-tile);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.category-tile:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.category-tile__icon {
  width: var(--touch-target);
  height: var(--touch-target);
  margin-block-end: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-accent);
}

.category-tile__label {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
}

.category-tile__description {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

/* ---------- Tip cards ---------- */

.tip-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.tip-card:hover {
  background: var(--color-surface-hover);
}

.tip-card:focus-within {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.tip-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

.tip-card__link {
  color: var(--color-text);
  text-decoration: none;
}

/* Stretch the title link over the whole card: one link, named by the title. */
.tip-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tip-card__link:focus-visible {
  outline: none;
}

.tip-card__meta {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.tip-card__category {
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.tip-card__byline {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.pill {
  padding: 0.1875rem 0.5rem;
  border-radius: 0.5rem;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.78125rem;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar {
  width: 1.625rem;
  height: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ---------- Garage cards ---------- */

.garage-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  scroll-margin-block-start: 1rem;
}

.garage-card:target {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.garage-card__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
}

.garage-card__city {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.garage-card__notes {
  color: var(--color-text-body);
  font-size: 1rem;
  line-height: 1.6;
}

.garage-card__notes p {
  margin: 0 0 0.5rem;
}

.garage-card__call {
  align-self: flex-start;
  margin-block-start: 0.25rem;
}

html[data-high-contrast] .garage-card {
  box-shadow: inset 0 0 0 2px var(--color-text);
}

/* ---------- Videos ---------- */

.video {
  margin: 0 0 1.5rem;
}

.video__link,
.video__player {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-card);
  background: #000000;
}

.video__thumbnail,
.video-card__thumbnail {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video__play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 4.25rem;
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline-start: 0.25rem;
  border: 2px solid var(--color-on-accent);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  transform: translate(-50%, -50%);
}

/* The play triangle points right in both directions of text (media controls are not mirrored). */
.video__play .icon {
  transform: translateX(0.0625rem);
}

.video__play--small {
  width: 3rem;
  height: 3rem;
}

.video__link:hover .video__play {
  background: #f06a1f;
}

.video__caption {
  margin-block-start: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.video-card__media {
  position: relative;
  order: -2;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #000000;
}

.pill--video {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---------- Cost cards and sorting ---------- */

.cost-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1rem;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  scroll-margin-block-start: 1rem;
}

.cost-card:target {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cost-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

.cost-card__price {
  order: -1;
  margin: 0;
  color: var(--color-accent);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.cost-card__facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.875rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.cost-card__facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
}

.sort-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.chip-link--current {
  gap: 0.375rem;
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.chip-link--current:hover {
  color: var(--color-on-accent);
}

html[data-high-contrast] .cost-card {
  box-shadow: inset 0 0 0 2px var(--color-text);
}

/* ---------- Call to action, buttons, empty state ---------- */

.cta-panel {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.375rem;
  border-radius: var(--radius-panel);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.cta-panel :focus-visible {
  outline-color: var(--color-on-accent);
}

.cta-panel__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.cta-panel__text {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  line-height: 1.5;
}

.button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 1.625rem;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover {
  background: #f06a1f;
  color: var(--color-on-accent);
}

.button--dark {
  background: var(--color-bg);
  color: var(--color-text);
}

.button--dark:hover {
  background: #000000;
  color: var(--color-text-strong);
}

.button--secondary {
  border: 1.5px solid var(--color-border-control);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.button--block {
  width: 100%;
}

.empty-state {
  padding: 1.25rem;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.empty-state p {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ---------- Tip page ---------- */

.tip {
  padding: 0.75rem var(--gutter) 0;
}

.badge {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  border-radius: 1.375rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.badge:hover {
  color: var(--color-on-accent);
  background: #f06a1f;
}

.tip__title {
  margin: 0.875rem 0 1.125rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 1.5rem;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-border);
}

.meta-grid__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  background: var(--color-surface);
}

.meta-grid__item--wide {
  grid-column: 1 / -1;
}

.meta-grid dt {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.meta-grid dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Long-form text: a tip's body, and the terms and accessibility pages (.prose). */
.tip__body,
.prose {
  color: var(--color-text-body);
  font-size: 1.125rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.tip__body p,
.prose p {
  margin: 0 0 1rem;
}

.tip__body ul,
.prose ul {
  margin: 0 0 1.25rem;
  padding-inline-start: 1.375rem;
}

.tip__body ul li,
.prose ul li {
  margin-block-end: 0.5rem;
  line-height: 1.65;
}

.tip__body ul li::marker,
.prose ul li::marker {
  color: var(--color-accent);
}

.prose h2 {
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.3;
  scroll-margin-block-start: 1rem;
}

.prose h2:first-child {
  margin-block-start: 0;
}

.prose strong {
  color: var(--color-text);
  font-weight: 600;
}

.prose a {
  text-underline-offset: 0.2em;
}

.prose__contact a {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.prose__updated {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  margin: 0.5rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  line-height: 1.65;
}

.step-number {
  flex: none;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}

.tip-actions {
  padding: 1.75rem var(--gutter) 0;
}

.tip-actions .button {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Forms ---------- */

.tip-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field__label {
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
}

legend.field__label {
  margin-block-end: 0.5rem;
}

.field__hint {
  color: var(--color-text-muted);
  font-weight: 400;
}

.field__help {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.field__error {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  color: var(--color-danger);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
}

.field__error .icon {
  margin-block-start: 0.0625rem;
}

.field__input {
  width: 100%;
  min-height: 3.375rem;
  padding: 0 1rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 1.0625rem;
}

.field__input::placeholder {
  color: var(--color-placeholder);
}

/* Error-summary links jump to a field; keep its label and message in view above it. */
.field__input,
.choice__input {
  scroll-margin-block-start: 8rem;
}

.field__input:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.field__textarea {
  min-height: 12.5rem;
  padding-block: 0.875rem;
  line-height: 1.6;
  resize: vertical;
}

.field--error .field__input {
  border-color: var(--color-danger);
  border-width: 2px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choice {
  position: relative;
  display: inline-flex;
}

/* The radio stays in the page for keyboards and screen readers; the label is the visual. */
.choice__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__label {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 1rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: 1.375rem;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-size: 0.9375rem;
}

.choice__check {
  display: none;
}

.choice__input:checked + .choice__label {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.choice__input:checked + .choice__label .choice__check {
  display: block;
}

.choice__input:focus-visible + .choice__label {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.choice:hover .choice__label {
  border-color: var(--color-text-muted);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.error-summary {
  margin-block-end: 1.5rem;
  padding: 1rem 1.125rem;
  border: 2px solid var(--color-danger);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.error-summary:focus-visible,
.error-summary:focus {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.error-summary__title {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.error-summary__list {
  margin: 0;
  padding-inline-start: 1.25rem;
  color: var(--color-danger);
}

.error-summary__list li {
  margin-block-end: 0.25rem;
}

.error-summary__list a {
  color: var(--color-danger);
  font-weight: 500;
}

/* ---------- Admin ---------- */

.button--small {
  min-height: var(--touch-target);
  padding: 0 1rem;
  font-size: 0.9375rem;
}

.header-form {
  margin: 0;
}

.button--danger {
  background: var(--color-danger);
  color: var(--color-on-accent);
}

.button--danger:hover {
  background: #ffa597;
  color: var(--color-on-accent);
}

.admin-notice {
  margin: 0 var(--gutter);
  padding: 0.625rem 0.875rem;
  border: 1.5px dashed var(--color-border-control);
  border-radius: var(--radius-control);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.flash {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-card);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-weight: 600;
}

.flash .icon {
  color: var(--color-accent);
}

.count {
  color: var(--color-text-muted);
  font-weight: 400;
}

.section__note {
  margin: 0.75rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.status--approved .icon {
  color: var(--color-accent);
}

.back-link {
  margin: 0 0 0.75rem;
}

.back-link a {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text);
  font-weight: 500;
}

.privacy-check {
  margin-block-end: 1.5rem;
  padding: 1rem 1.125rem;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.privacy-check__title {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.privacy-check__title .icon {
  color: var(--color-accent);
}

.privacy-check ul {
  margin: 0;
  padding-inline-start: 1.25rem;
  line-height: 1.55;
}

.danger-zone {
  margin-block-start: 1rem;
  border-block-start: 1px solid var(--color-border);
}

/* ---------- Accessibility menu ---------- */

.a11y-menu__toggle {
  position: fixed;
  inset-block-end: 1rem;
  inset-inline-end: 1rem;
  z-index: 30;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--color-bg);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: 0 0.25rem 1rem rgb(0 0 0 / 45%);
  cursor: pointer;
}

.a11y-menu__toggle[aria-expanded='true'] {
  background: var(--color-text);
}

.a11y-panel {
  position: fixed;
  inset-block-end: 5rem;
  inset-inline-end: 1rem;
  z-index: 30;
  width: min(20rem, calc(100vw - 2rem));
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 55%);
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.a11y-panel__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.a11y-panel__group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.a11y-panel__label {
  font-weight: 600;
}

.a11y-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.a11y-stepper__button {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid var(--color-border-control);
  border-radius: 50%;
  background: var(--color-surface-raised);
  color: var(--color-text);
  cursor: pointer;
}

.a11y-stepper__button[aria-disabled='true'] {
  border-style: dashed;
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.a11y-stepper__value {
  min-width: 3.25rem;
  text-align: center;
  font-weight: 700;
}

.a11y-panel__options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a11y-option {
  width: 100%;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--color-border-control);
  border-radius: var(--radius-control);
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
  text-align: start;
  cursor: pointer;
}

.a11y-option__box {
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border-control);
  border-radius: 0.375rem;
}

.a11y-option__check {
  visibility: hidden;
}

.a11y-option[aria-pressed='true'] {
  border-color: var(--color-accent);
  font-weight: 600;
}

.a11y-option[aria-pressed='true'] .a11y-option__box {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.a11y-option[aria-pressed='true'] .a11y-option__check {
  visibility: visible;
}

/* ---------- Accessibility preferences (set on <html> by accessibility-init.js) ---------- */

html[data-text-scale='90'] {
  font-size: 90%;
}

html[data-text-scale='115'] {
  font-size: 115%;
}

html[data-text-scale='130'] {
  font-size: 130%;
}

html[data-text-scale='150'] {
  font-size: 150%;
}

/* High contrast: pure black and white with a yellow accent; every box gets a visible edge. */
html[data-high-contrast] {
  --color-bg: #000000;
  --color-surface: #000000;
  --color-surface-hover: #1a1a1a;
  --color-surface-raised: #000000;
  --color-border: #ffffff;
  --color-border-control: #ffffff;
  --color-text: #ffffff;
  --color-text-body: #ffffff;
  --color-text-strong: #ffffff;
  --color-text-muted: #ffffff;
  --color-placeholder: #c8c8c8;
  --color-accent: #ffd500;
  --color-on-accent: #000000;
  --color-danger: #ffb3b3;
}

html[data-high-contrast] :is(.tip-card, .category-tile, .empty-state, .meta-grid__item, .flash, .icon-button, .pill, .avatar, .page-heading__icon, .category-tile__icon) {
  box-shadow: inset 0 0 0 2px var(--color-text);
}

html[data-high-contrast] .tip-card__category,
html[data-high-contrast] .section__link {
  text-decoration: underline;
}

/* Highlighted links: underlined with a yellow frame (box-shadow, so focus rings still show). */
html[data-highlight-links] a {
  text-decoration: underline;
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.2em;
  box-shadow: 0 0 0 0.1875rem #ffd500;
}

html[data-highlight-links] .tip-card__link,
html[data-highlight-links] .category-tile__label {
  text-decoration: underline;
}

/* Both modes on: keep the high-contrast edge and add the link frame around it. */
html[data-high-contrast][data-highlight-links] :is(a.icon-button, a.category-tile) {
  box-shadow: inset 0 0 0 2px var(--color-text), 0 0 0 0.1875rem #ffd500;
}

/* More readable font: a plain system face with extra spacing. */
html[data-readable-font] body {
  font-family: Arial, 'Noto Sans Hebrew', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.02em;
  word-spacing: 0.12em;
  line-height: 1.7;
}

/* No animations or smooth scrolling, on request or when the device asks for it. */
html[data-reduce-motion] *,
html[data-reduce-motion] *::before,
html[data-reduce-motion] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .choice__input:checked + .choice__label {
    border-width: 3px;
  }

  .a11y-option[aria-pressed='true'] .a11y-option__box {
    border-width: 3px;
  }
}
