/* Vital Habits Guide: shared styles. Mobile first; logical properties so the same file serves RTL and LTR pages. */
/* Heebo, served from this site (one variable file per script; SIL Open Font License, see /assets/fonts/OFL.txt).
   The pages preload both files, so the text is drawn in Heebo from the start. */
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/heebo-hebrew.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-weight: 400 700;
  font-display: swap;
  src: url(/assets/fonts/heebo-latin.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 {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #1f2430;
  --ink-soft: #454c5a;
  --muted: #6b7280;
  --line: #e6dfd3;
  --label-bg: #f1ece3;
  --accent: #2f4b7c;
  --accent-hover: #243b63;
  --good: #0f766e;
  --bad: #b45309;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
}
img, svg { max-width: 100%; }
a { color: var(--accent); }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { padding-block: 12px; }
.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  min-height: 32px;
}
.brand-mark { flex: none; width: 28px; height: 28px; }
.brand-guide { color: var(--good); font-weight: 500; }

/* Article */
article { padding-block: 20px 8px; }
.vhg-kicker {
  display: inline-block;
  margin: 0 0 4px;
  padding: 3px 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--ink);
  background: var(--label-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}
h1 {
  font-size: clamp(26px, 6.6vw, 34px);
  line-height: 1.3;
  margin: 10px 0 18px;
}
h2 {
  font-size: 22px;
  line-height: 1.35;
  margin: 36px 0 12px;
}
p { margin: 0 0 16px; }
ul { margin: 0 0 16px; padding-inline-start: 22px; }
li { margin-bottom: 8px; }

/* Numbered steps: the number is its own element, so RTL never moves the digit. */
.step { display: flex; align-items: center; gap: 12px; }
.step .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

/* The one-minute check */
.check {
  background: var(--card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--good);
  border-radius: 12px;
  padding: 14px 16px 2px;
  margin: 16px 0 20px;
}

/* Illustrations */
.figure-pair { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 24px 0 8px; }
@media (min-width: 560px) { .figure-pair { grid-template-columns: 1fr 1fr; } }
.figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 8px;
}
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { font-size: 15px; line-height: 1.5; color: var(--ink-soft); margin-top: 8px; text-align: center; }

/* Product */
.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px 18px 6px;
  margin: 40px 0 8px;
}
.product-img { margin: 16px 0 8px; }
.product-img img { display: block; width: 100%; height: auto; border-radius: 10px; }
.ticks { list-style: none; padding-inline-start: 0; }
.ticks li { position: relative; padding-inline-start: 30px; }
.ticks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .38em;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='9' fill='%230f766e'/%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Who it fits */
.fit { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 560px) { .fit { grid-template-columns: 1fr 1fr; } }
.fit-col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 2px; }
.fit-yes { border-top: 4px solid var(--good); }
.fit-no { border-top: 4px solid var(--bad); }
.fit-title { font-weight: 700; margin-bottom: 6px; }
.fit ul { padding-inline-start: 20px; }

/* Side-by-side comparison: two columns; each row's label spans both, so it fits a phone. */
.compare {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 16px;
  line-height: 1.5;
}
.compare caption { padding: 0 2px 10px; font-size: 19px; font-weight: 700; line-height: 1.4; text-align: start; }
.compare thead th { width: 50%; padding: 10px 10px 10px; font-size: 16px; line-height: 1.35; vertical-align: top; }
.compare thead th:first-child { border-top: 4px solid var(--bad); }
.compare thead th:last-child { border-top: 4px solid var(--good); }
.compare thead img { display: block; width: 100%; height: auto; margin: 0 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.compare thead small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.compare tbody th {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: start;
  background: var(--label-bg);
  border-block: 1px solid var(--line);
}
.compare td { padding: 9px 12px 12px; vertical-align: top; }
.compare th:last-child:not([colspan]), .compare td:last-child { background: #f2f8f7; border-inline-start: 1px solid var(--line); }

/* Call to action */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin: 20px 0 24px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.cta:hover { background: var(--accent-hover); }
.cta:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.cta[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* After a tap on an offer link: the button shows it's working, and a message says the next page is opening. */
.cta.is-going {
  background-image: linear-gradient(110deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.28) 50%, rgba(255,255,255,0) 70%);
  background-size: 220% 100%;
  animation: vhg-sheen 1.1s linear infinite;
  cursor: progress;
}
a[data-offer].is-going { opacity: .85; }
.vhg-going {
  position: fixed;
  inset-inline: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
  margin-inline: auto;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(31, 36, 48, .28);
}
.vhg-going[hidden] { display: none; }
.vhg-spin {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: vhg-spin .8s linear infinite;
}
@keyframes vhg-spin { to { transform: rotate(360deg); } }
@keyframes vhg-sheen { from { background-position: 180% 0; } to { background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) {
  .cta.is-going, .vhg-spin { animation-duration: 2.4s; }
}

/* Offer links inside the text, and pictures that lead to the offer */
p a[data-offer], figcaption a[data-offer] { font-weight: 700; text-underline-offset: 3px; }
a.img-link { display: block; color: inherit; text-decoration: none; }
a.img-link:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; border-radius: var(--radius); }

/* Story pages: commission line, dek, byline, photos, features, FAQ, author box */
h3 { font-size: 19px; line-height: 1.4; margin: 24px 0 8px; }
.affil { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.dek { font-size: 20px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 16px; }
.byline { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.byline img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.byline p { margin: 0; }
.photo { margin: 20px 0 24px; }
.photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--line); }
.photo figcaption, .product-img figcaption { font-size: 15px; line-height: 1.5; color: var(--muted); margin-top: 8px; text-align: center; }
.product-img.plain img { background: var(--card); border: 1px solid var(--line); padding: 14px 10px; }
.features {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 2px;
  margin: 8px 0 0;
}
.cta .arrow { margin-inline-start: .45em; }
.faq h3 { font-size: 18px; margin: 22px 0 4px; }
.author {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 36px 0 8px;
}
.author img { flex: none; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author h2 { font-size: 18px; margin: 0 0 4px; }
.author p { margin: 0 0 4px; font-size: 16px; line-height: 1.6; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer .wrap { padding-block: 20px 40px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.site-footer a { color: var(--ink-soft); }

/* Simple pages (privacy, home, 404) */
.page h1 { font-size: clamp(24px, 6vw, 30px); }
.page .updated { color: var(--muted); font-size: 15px; }
.page .summary { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 2px; }
.page h2 { font-size: 20px; margin-top: 28px; }
.guides { list-style: none; padding-inline-start: 0; }
.guides li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.guides .lang { display: block; font-size: 14px; color: var(--muted); }
