/* =========================================================
   in-time.co.il — stylesheet
   RTL-first, logical properties throughout.
   All values come from tokens in theme.css — avoid hard-coding
   colours or sizes here so the theme stays changeable in one place.
   ========================================================= */

/* ---------- reset ---------- */

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

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote { margin: 0; }

ul, ol { padding: 0; list-style: none; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- base ---------- */

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-page-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--c-heading); }

h1 {
  font-size: var(--fs-h1);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.3;
}

/* h3 is italic in the original theme */
h3 {
  font-size: var(--fs-h3);
  font-weight: 400;
  font-style: italic;
  line-height: 1.7;
}

h4 {
  font-size: var(--fs-h4);
  font-weight: 700;
  line-height: 1.2;
}

h5 {
  font-size: var(--fs-h5);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 1.2px;
  color: var(--c-gray);
}

h6 {
  font-size: var(--fs-h6);
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-primary);
}

a {
  color: var(--c-primary);
  text-decoration: none;
}

a:hover,
a:focus-visible { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
}

.skip-link:focus {
  inset-inline-start: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
}

/* ---------- top bar ---------- */

.topbar {
  background: var(--c-topbar-bg);
  color: var(--c-topbar-text);
  font-size: var(--fs-topbar);
  font-weight: 700;
}

.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem var(--gap);
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
}

.topbar a { color: var(--c-topbar-text); }
.topbar a:hover { color: #fff; }

.topbar__links {
  display: flex;
  gap: var(--gap);
}

/* ---------- header ---------- */

.header {
  background: var(--c-header-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: var(--menu-height);
  padding-block: 10px;
}

.header__logo img { width: auto; max-height: 60px; }

/* ---------- navigation ---------- */

.nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.nav__item { position: relative; }

.nav__link {
  display: block;
  padding: 0.6rem 0.85rem;
  font-size: var(--fs-menu);
  font-weight: 500;
  color: var(--c-heading);
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link.is-current {
  color: var(--c-primary);
  text-decoration: none;
}

.nav__link--static { cursor: default; }

.nav__sub {
  position: absolute;
  inset-inline-start: 0;
  top: 100%;
  min-width: 16rem;
  background: var(--c-submenu-bg);
  box-shadow: var(--shadow);
  display: none;
  z-index: 60;
}

.nav__item--has-children:hover > .nav__sub,
.nav__item--has-children:focus-within > .nav__sub { display: block; }

.nav__sublink {
  display: block;
  padding: 0.5rem 1rem;
  font-size: var(--fs-submenu);
  font-weight: 400;
  color: var(--c-topbar-text);
  letter-spacing: -0.2px;
}

.nav__sublink:hover,
.nav__sublink:focus-visible,
.nav__sublink.is-current {
  background: var(--c-primary);
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: var(--c-heading);
  background: var(--c-page-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bar { position: relative; }

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.nav-toggle__bar::before { top: -6px; }
.nav-toggle__bar::after { top: 6px; }

/* ---------- title bar / hero ---------- *
   Two modes, matching the original theme:
   .hero            light grey band, dark title  (po_sub_header_style: none)
   .hero--photo     300px photo banner, white title (custom_bg / show)
   ------------------------------------------------------------------ */

.hero {
  background: var(--c-page-bg);
  padding-block: 1.5rem;
}

.hero__title {
  font-size: var(--fs-h1);
  font-weight: 500;
  color: var(--c-heading);
  margin: 0;
}

.hero--photo {
  min-height: var(--hero-height);
  display: flex;
  align-items: center;
  padding-block: 2rem;
  background-color: var(--c-page-bg);
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

/* The original had no overlay, but white type over an arbitrary photo needs
   backing. A directional scrim sits behind the title (inline-start, i.e. right
   in RTL) and fades out, so most of the image stays as bright as the original. */
.hero--photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0.05) 60%);
}

.hero--photo .wrap { position: relative; }

.hero--photo .hero__title {
  font-size: var(--fs-hero-title);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
}

/* ---------- breadcrumbs ---------- */

.breadcrumb {
  font-size: var(--fs-breadcrumb);
  color: var(--c-gray);
  font-style: italic;
  margin-block-end: 0.35rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breadcrumb li + li::before {
  content: "«";
  margin-inline-end: 0.4rem;
  opacity: 0.6;
}

.breadcrumb a { color: inherit; }
.breadcrumb a:hover { color: var(--c-primary); }

.hero--photo .breadcrumb {
  color: #fff;
  letter-spacing: 1.2px;
  font-style: normal;
}

.hero--photo .breadcrumb a:hover { color: var(--c-page-bg); }

/* ---------- main content ---------- */

.main {
  background: var(--c-content-bg);
  padding-block: 2.5rem 3rem;
}

.content > * + * { margin-block-start: 1.25rem; }

.content h2 { margin-block-start: 2rem; }
.content h3,
.content h4 { margin-block-start: 1.5rem; }

/* Readable measure, centred — without the auto margins the text pins to the
   inline-start edge and leaves the other half of wide screens empty. */
.content > p,
.content > ul,
.content > ol {
  max-width: 72ch;
  margin-inline: auto;
}

.content ul,
.content ol { padding-inline-start: 1.25rem; }

.content > ul { list-style: disc; }
.content > ol { list-style: decimal; }
.content li + li { margin-block-start: 0.25rem; }

.content strong,
.content b { color: var(--c-heading); }

.content hr {
  border: 0;
  border-block-start: 1px solid var(--c-border);
  margin-block: 2rem;
}

.content iframe {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

/* ---------- galleries (original WordPress markup) ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--gap);
  margin-block-start: 1.5rem;
}

.gallery-item {
  margin: 0;
  border: 1px solid var(--c-border);
  background: var(--c-content-bg);
  overflow: hidden;
}

.gallery-item img { width: 100%; }

.gallery-caption,
.wp-caption-text {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-heading);
  text-align: center;
  line-height: 1.4;
}

/* ---------- card grid (partners, team, feature rows) ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
  margin-block: 1.5rem;
}

.card-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  background: var(--c-content-bg);
  border: 1px solid var(--c-border);
  transition: box-shadow 0.15s ease;
}

.card:hover { box-shadow: var(--shadow); }

.card figure { margin: 0; }

.card figure img,
.card > img {
  margin-inline: auto;
  max-height: 110px;
  width: auto;
  object-fit: contain;
}

.card h3,
.card h4 {
  margin: 0;
  font-size: var(--fs-h4);
  font-weight: 700;
  font-style: normal;
  line-height: 1.3;
}

.card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-muted);
}

.card--feature { text-align: center; }
.card--feature img { max-height: none; width: 100%; }

/* ---------- logo strip ---------- */

.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem var(--gap);
  margin-block: 1.5rem;
  align-items: center;
}

.logo-grid img {
  width: 100%;
  max-width: 340px;
  margin-inline: auto;
}

/* ---------- testimonial quotes ---------- */

/* Quotes vary a lot in length. CSS columns flow them tightly, where a grid
   would stretch every row to its tallest card and leave ragged gaps. */
.quote-grid {
  columns: 2;
  column-gap: var(--gap);
  margin-block: 1.5rem;
}

.quote {
  break-inside: avoid;
  margin-block-end: var(--gap);
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.9rem;
  padding: 1.1rem;
  background: var(--c-content-bg);
  border: 1px solid var(--c-border);
}

.quote__icon {
  width: 48px;
  height: 48px;
  margin: 0;
}

.quote__text {
  margin: 0;
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.7;
}

.quote__by {
  margin: 0.6rem 0 0;
  font-weight: 700;
  color: var(--c-heading);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

@media (max-width: 800px) {
  .quote-grid { columns: 1; }
}

/* ---------- accordion ---------- */

.accordion { margin-block: 1.5rem; }

.accordion details {
  border: 1px solid var(--c-border);
  background: var(--c-content-bg);
  margin-block-end: 0.6rem;
}

.accordion summary {
  padding: 0.9rem 1.1rem;
  font-weight: 700;
  color: var(--c-heading);
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  line-height: 1.5;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary::before {
  content: "+";
  flex: none;
  width: 1.25em;
  font-size: 1.1em;
  color: var(--c-primary);
  font-weight: 700;
}

.accordion details[open] > summary::before { content: "−"; }
.accordion summary:hover { color: var(--c-primary); }

.accordion__body {
  padding: 0.9rem 1.1rem 1.1rem;
  border-block-start: 1px solid var(--c-border);
}

.accordion__body > :first-child { margin-block-start: 0; }

/* ---------- two-column list ---------- */

.col-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 var(--gap);
  margin-block: 1rem;
}

.col-2 ul { margin: 0; }

/* ---------- image beside text ---------- */

.media {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: var(--gap);
  align-items: start;
  margin-block: 1.5rem;
}

.media--flip { grid-template-columns: 1fr minmax(200px, 300px); }
.media--even { grid-template-columns: 1fr 1fr; }

/* Only the media column's own image fills its column — images inside body copy
   keep their natural size, otherwise inline photos get blown up. */
.media__figure img { width: 100%; }

.media__body > :first-child { margin-block-start: 0; }

@media (max-width: 700px) {
  .media,
  .media--flip,
  .media--even { grid-template-columns: 1fr; }
}

/* ---------- floated content images ---------- */

/* Images the body copy wraps around, as the original pages did. The site is RTL
   throughout, so these use physical sides — it keeps browser support broad and
   matches the old layout one-to-one. */
.content .img-right,
.content .img-left {
  max-width: 300px;
  margin-block-end: 1rem;
}

.content .img-right {
  float: right;
  margin-left: 1.5rem;
}

.content .img-left {
  float: left;
  margin-right: 1.5rem;
}

.content h2 { clear: both; }

/* A block containing floats uses the full column width — the centred measure
   would squeeze wrapped text into a narrow ribbon beside the image.
   flow-root contains the floats so they don't escape the section. */
.content .has-float {
  display: flow-root;
  margin-block-end: 1.5rem;
}

@media (max-width: 600px) {
  .content .img-right,
  .content .img-left {
    float: none;
    margin-inline: auto;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-h4);
  line-height: 1.4;
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
}

.btn:hover,
.btn:focus-visible {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
  text-decoration: none;
}

/* ---------- contact panel ---------- */

.contact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem var(--gap);
  align-items: center;
  justify-content: center;
  margin-block: 1.5rem;
  padding: 1.25rem;
  background: var(--c-page-bg);
  border: 1px solid var(--c-border);
}

.contact-panel li,
.contact-panel p { margin: 0; }

.contact-panel__list {
  display: flex;
  flex-wrap: wrap;
  /* Align the text baselines. Left to the default the <li> boxes can differ in
     intrinsic height, which floats one value a few pixels above its neighbours. */
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  font-weight: 700;
  color: var(--c-heading);
}

.contact-panel__list li {
  display: block;
  line-height: inherit;
}

/* ---------- document links ---------- */

/* PDFs and spreadsheets both get an affordance; the glyph differs so the
   file type is obvious before clicking. */
.content a[href$=".pdf"],
.content a[href$=".xlsx"],
.content a[href$=".xls"],
.content a[href$=".docx"] { font-weight: 600; }

.content a[href$=".pdf"]::before { content: "📄"; margin-inline-end: 0.4rem; }
.content a[href$=".xlsx"]::before,
.content a[href$=".xls"]::before { content: "📊"; margin-inline-end: 0.4rem; }
.content a[href$=".docx"]::before { content: "📝"; margin-inline-end: 0.4rem; }

/* ---------- call-to-action band ---------- */

.cta-band {
  background: var(--c-primary);
  color: #fff;
  padding-block: 2rem;
  text-align: center;
}

.cta-band__text {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  margin-block-end: 1rem;
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.cta-band .btn {
  background: #fff;
  color: var(--c-primary);
  border-color: #fff;
}

.cta-band .btn:hover { background: var(--c-page-bg); }

.cta-band .btn--ghost {
  background: transparent;
  color: #fff;
}

.cta-band .btn--ghost:hover {
  background: #fff;
  color: var(--c-primary);
}

/* ---------- footer ---------- */

.footer {
  background: var(--c-footer-bg);
  color: var(--c-footer-text);
  font-size: var(--fs-footer-text);
  line-height: 1.5;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  padding-block: 2.5rem;
}

.footer__heading {
  color: #fff;
  font-size: var(--fs-footer-title);
  font-weight: 500;
  line-height: 2;
  letter-spacing: 1.5px;
  margin-block-end: 0.5rem;
}

.footer a { color: var(--c-footer-text); }
.footer a:hover { color: #000; }

/* Phone numbers and email are LTR values in an RTL column. Right-aligning them
   staggers their starts, so the list shrink-wraps and aligns them on the left
   while the group stays anchored to the RTL edge. */
.footer__contact {
  margin-block-start: 0.75rem;
  display: inline-block;
  direction: ltr;
  text-align: left;
}

.footer__contact li { font-weight: 700; }

.footer__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.15rem 1rem;
}

.footer__bar {
  background: var(--c-copyright-bg);
  color: #fff;
  font-size: var(--fs-copyright);
  text-transform: uppercase;
  padding-block: 1rem;
}

.footer__bar a { color: #fff; }
.footer__bar a:hover { color: var(--c-primary); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    flex-basis: 100%;
    display: none;
  }

  .nav.is-open { display: block; }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: 0.5rem;
  }

  .nav__item + .nav__item { border-block-start: 1px solid var(--c-border); }

  /* submenus stay open once the menu is expanded — no nested tapping */
  .nav__sub {
    position: static;
    display: block;
    background: transparent;
    box-shadow: none;
    padding: 0 0 0.5rem;
    padding-inline-start: 1rem;
  }

  .nav__sublink { color: var(--c-text); }

  .header { position: static; }

  :root {
    --fs-hero-title: 32px;
    --fs-h1: 28px;
    --fs-h2: 24px;
    --hero-height: 200px;
  }
}

@media (max-width: 600px) {
  .topbar__inner { justify-content: center; text-align: center; }
}

/* ---------- print ---------- */

@media print {
  .topbar, .nav, .nav-toggle, .cta-band, .footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .content a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
