/* Heebo (SIL Open Font License, see fonts/Heebo-LICENSE.txt), self-hosted so the text looks the same on every device */
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/heebo-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: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/heebo-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 {
  /* Thickness of the regular text: 400 = normal, 500 = medium, 600 = semi-bold */
  --body-weight: 500;
  --bg: #f4ecdc;
  --surface: #fffdf8;
  --text: #2b2620;
  --muted: #5b5348;
  --accent: #2f5d4e;
  --accent-dark: #244a3e;
  --border: #ded2ba;
  --field-border: #8a7d68;
  --placeholder-bg: #e6dcc8;
  --focus: #1a4fa3;
  --error: #9b1c1c;
  --error-bg: #fdf1ef;
  --error-text: #6e1212;
  --success: #2f7d5b;
  --success-bg: #eef6f0;
  --success-text: #14412d;
  --radius: 18px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Heebo", "Assistant", "Noto Sans Hebrew", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: var(--body-weight);
  line-height: 1.75;
  text-align: right;
}

.page {
  max-width: 54rem;
  margin-inline: auto;
  padding: 0 1rem 3rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Top section ---------- */

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2rem;
  padding-block: 2.5rem 1.75rem;
}

/* RTL grid: column 1 is the right-hand side, so the portrait sits to the right of the title */
.hero__portrait {
  grid-column: 1;
  grid-row: 1;
  width: clamp(140px, 22vw, 200px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 25%;
  border-radius: 50%;
  background: var(--placeholder-bg);
  border: 4px solid var(--surface);
  box-shadow: 0 4px 18px rgba(80, 60, 30, 0.16);
}

.hero__text {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  /* Lets the headline size itself from the space next to the portrait (cqw units) */
  container-type: inline-size;
}

.hero__title {
  margin: 0;
  text-align: right;
  white-space: nowrap; /* the whole headline always stays on one line */
  font-size: clamp(1.1rem, 3vw, 2rem); /* fallback for browsers without container units */
  font-size: min(2.5rem, calc(100cqw / 16));
  line-height: 1.3;
  font-weight: 700;
}

@media (max-width: 599px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding-block: 1.75rem 1.25rem;
  }

  .hero__portrait {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .hero__text {
    grid-column: 1;
    grid-row: 2;
  }
}

/* ---------- Photo gallery ---------- */

/* Photos are never cropped. Each one takes a share of the row that matches its own shape
   (--ar = width / height, set by script.js once the photo has loaded), so all three end up
   the same height. */
.gallery__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.gallery__list li {
  flex: var(--ar, 1.3333) 1 0;
  min-width: 0;
}

.gallery__list img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--placeholder-bg);
}

@media (max-width: 559px) {
  .gallery__list {
    flex-direction: column;
  }

  .gallery__list li {
    flex: none;
    width: 100%;
  }
}

/* ---------- Cards ---------- */

.card {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card p {
  margin: 0 0 1rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.services {
  margin: 0 0 1rem;
  padding-inline-start: 1.5rem;
  list-style: disc;
}

.services li {
  margin-bottom: 0.4rem;
}

.services li::marker {
  color: var(--accent);
}

/* ---------- Links ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--accent-dark);
  text-decoration-thickness: 0.14em;
}

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.notice:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- Form ---------- */

.contact__intro {
  margin-bottom: 1.5rem !important;
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 1.5rem;
}

.form__hint {
  grid-column: 1 / -1;
  margin: 0 !important;
  font-size: 0.9rem;
  color: var(--muted);
}

.field {
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.req {
  color: var(--error);
}

input,
textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--field-border);
  border-radius: 10px;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline-offset: 2px;
  border-color: var(--focus);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
  border-width: 2px;
}

.field-error {
  margin: 0.35rem 0 0 !important;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--error);
}

.field-error[hidden] {
  display: none;
}

/* Spam trap, moved far off-screen */
.hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center; /* the send button sits in the middle of the form */
}

.btn {
  min-height: 3rem;
  padding: 0.75rem 3rem;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: var(--accent-dark);
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* ---------- Status messages ---------- */

.notice {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 12px;
  font-weight: 500;
}

.notice.is-visible {
  padding: 0.9rem 1.1rem;
  border: 1.5px solid;
}

.notice--success.is-visible {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success-text);
}

.notice--error.is-visible {
  background: var(--error-bg);
  border-color: var(--error);
  color: var(--error-text);
}

.notice--error a {
  color: var(--error-text);
}

@media (max-width: 639px) {
  .form {
    grid-template-columns: minmax(0, 1fr);
  }

  .btn {
    width: 100%;
    max-width: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
