/*
Theme Name: Gagot Bnia
Description: ערכת עיצוב עבור צ.ב גגות ובניה בע"מ - שחזור העיצוב המקורי, רספונסיבי ותומך RTL.
Version: 1.0
Text Domain: gagot
*/

:root {
  --red: #b2251f;
  --red-dark: #912624;
  --red-deep: #731e1d;
  --red-soft: #cb5950;
  --cream: #f4e4d5;
  --linen: #e9e3dc;
  --ink: #444;
  --line: #e2e2e2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  direction: rtl;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 18px rgba(0, 0, 0, .09);
}

/* ---------- header ---------- */
.site-head { padding: 10px 16px 0; }

.logo-strip {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.site-head .logo-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Transparent hit areas over the logo bitmap: left = phone, right = home. */
.logo-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
}

.logo-hit-tel  { left: 0;  width: 42%; }
.logo-hit-home { right: 0; width: 58%; }

.logo-hit-tel:focus-visible,
.logo-hit-home:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Mobile header: the logo strip is a 980px-wide image whose phone number is
   pixels, so below 760px we swap in real text and a tappable number. */
.head-mobile { display: none; }

.brand-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--red);
  font-size: 21px;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 0 10px;
}

.head-call {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin: 0 0 10px;
  border: 2px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
  text-decoration: none;
  direction: ltr;
}

.head-call:active { background: var(--cream); }

/* Sticky call bar - mobile only. */
.call-bar { display: none; }

/* ---------- nav ---------- */
.nav-bar { background: var(--red); margin-top: 10px; }

.nav-bar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-bar li { position: relative; }

.nav-bar a {
  display: block;
  padding: 13px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  border-left: 1px solid rgba(255, 255, 255, .18);
  transition: background .15s ease;
}

.nav-bar li:last-child a { border-left: 0; }

.nav-bar a:hover,
.nav-bar .current-menu-item > a {
  background: var(--red-deep);
}

.nav-toggle {
  display: none;
  width: 100%;
  padding: 12px;
  background: var(--red);
  color: #fff;
  border: 0;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 980 / 300;
  background: #ddd center/cover no-repeat;  /* first frame set inline - never blank */
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: heroFade 15s infinite;
}

.hero img:nth-child(1) { animation-delay: 0s; }
.hero img:nth-child(2) { animation-delay: 5s; }
.hero img:nth-child(3) { animation-delay: 10s; }

/* Each slide holds for ~5s of the 15s loop with a short crossfade. Slide 1
   starts fully opaque so the hero is never blank on first paint. */
@keyframes heroFade {
  0%   { opacity: 1; }
  31%  { opacity: 1; }
  35%  { opacity: 0; }
  96%  { opacity: 0; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero img { animation: none; }
  .hero img:nth-child(1) { opacity: 1; }
}

/* ---------- content ---------- */
.content { padding: 26px 26px 34px; }

.content h1 {
  color: var(--red-dark);
  font-size: 28px;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--cream);
}

.content h2 { color: var(--red-dark); font-size: 21px; margin: 26px 0 8px; }

.content p { margin: 0 0 14px; text-align: justify; }

.content a { color: var(--red); }
.content a:hover { color: var(--red-deep); }

.content ul { padding-inline-start: 22px; }
.content li { margin-bottom: 6px; }

.content strong { color: #2f2f2f; }

/* ---------- service cards (home) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin: 22px 0 30px;
}

.card {
  border: 1px solid var(--line);
  background: #fdfcfa;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: box-shadow .15s ease, transform .15s ease;
}

.card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .13); transform: translateY(-2px); }

.card img { width: 100%; height: 140px; object-fit: cover; display: block; }

.card span {
  display: block;
  padding: 11px 12px;
  font-weight: 700;
  color: var(--red-dark);
  text-align: center;
}

/* ---------- gallery ---------- */
.gagot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.gagot-shot {
  display: block;
  border: 1px solid var(--line);
  padding: 3px;
  background: #fff;
  line-height: 0;
}

.gagot-shot:hover { border-color: var(--red-soft); }

.gagot-shot img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  display: block;
}

/* ---------- lightbox ---------- */
body.glb-open { overflow: hidden; }

.glb {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 15, .92);
  padding: 3vh 3vw;
}

.glb.is-on { display: flex; }

.glb-stage {
  margin: 0;
  max-width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.glb img {
  max-width: 100%;
  max-height: 84vh;
  display: block;
  border-radius: 3px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .55);
  background: #222;
}

.glb.is-loading img { opacity: .25; }

.glb-cap {
  color: #f0e9e7;
  font-size: 15px;
  letter-spacing: 1px;
  direction: ltr;
}

.glb-close,
.glb-nav {
  position: absolute;
  border: 0;
  background: rgba(0, 0, 0, .42);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  border-radius: 50%;
  transition: background .15s ease;
}

.glb-close:hover,
.glb-nav:hover { background: var(--red); }

.glb-close {
  top: 14px;
  inset-inline-end: 16px;
  width: 46px;
  height: 46px;
  font-size: 30px;
}

.glb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 34px;
}

/* RTL gallery: "previous" sits on the right, "next" on the left */
.glb-prev { right: 16px; }
.glb-next { left: 16px; }

.glb-nav[hidden] { display: none; }

.glb-spin {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .28);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}

.glb.is-loading .glb-spin { opacity: 1; animation: glbSpin .8s linear infinite; }

@keyframes glbSpin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .glb { padding: 0; }
  .glb img { max-height: 74vh; }
  .glb-nav { width: 44px; height: 44px; font-size: 28px; }
  .glb-prev { right: 6px; }
  .glb-next { left: 6px; }
  .glb-close { top: 8px; inset-inline-end: 8px; }
}

/* ---------- call to action ---------- */
.cta {
  background: var(--cream);
  border-inline-start: 5px solid var(--red);
  padding: 18px 20px;
  margin: 26px 0 6px;
}

.cta p { margin: 0 0 6px; font-size: 17px; }

.cta .phones { font-size: 25px; font-weight: 700; letter-spacing: .5px; }

.cta a { color: var(--red-deep); text-decoration: none; }
.cta a:hover { text-decoration: underline; }

/* ---------- contact form ---------- */
.gagot-form { margin: 20px 0 6px; }

.gagot-form .field { margin: 0 0 15px; }

.gagot-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
  color: #333;
}

.gagot-form label .opt { font-weight: 400; color: #888; font-size: 14px; }

.gagot-form input[type="text"],
.gagot-form input[type="tel"],
.gagot-form input[type="email"],
.gagot-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #c9c4bd;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;               /* 16px stops iOS zooming the page on focus */
  line-height: 1.5;
  color: var(--ink);
}

.gagot-form input:focus,
.gagot-form textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(178, 37, 31, .14);
}

.gagot-form textarea { resize: vertical; min-height: 120px; }

.gagot-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gagot-form .submit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
}

.gagot-form button {
  min-height: 50px;
  padding: 0 32px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease;
}

.gagot-form button:hover { background: var(--red-dark); }
.gagot-form button:active { background: var(--red-deep); }

.gagot-form .or { color: #666; font-size: 15px; }
.gagot-form .or a { color: var(--red); font-weight: 700; text-decoration: none; direction: ltr; }

.form-ok,
.form-err {
  padding: 15px 17px;
  border-radius: 6px;
  margin: 18px 0;
  font-size: 16px;
}

.form-ok {
  background: #eaf5ea;
  border-inline-start: 5px solid #3c8c40;
  color: #1f5222;
}

.form-ok a { color: #1f5222; font-weight: 700; }

.form-err {
  background: #fdeceb;
  border-inline-start: 5px solid var(--red);
  color: #8a1f1a;
}

.form-err ul { margin: 0; padding-inline-start: 20px; }

/* ---------- footer ---------- */
.site-foot {
  background: var(--red-deep);
  color: #f2e6e3;
  padding: 20px 26px;
  font-size: 15px;
  text-align: center;
}

.site-foot a { color: #fff; text-decoration: none; font-weight: 700; }
.site-foot a:hover { text-decoration: underline; }

.site-foot .foot-nav {
  margin-top: 10px;
  font-size: 14px;
  opacity: .85;
}

.site-foot .foot-nav a { font-weight: 400; margin: 0 6px; }

.site-foot .foot-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 4px;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  /* swap the pixel-baked logo strip for real, tappable text */
  .logo-strip { display: none; }
  .head-mobile { display: block; }

  .nav-toggle { display: block; }
  .nav-bar ul { display: none; flex-direction: column; }
  .nav-bar.open ul { display: flex; }
  .nav-bar a {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .18);
    text-align: center;
    padding: 15px 20px;
  }

  /* 980x300 collapses to a ~115px sliver at phone widths - give it height */
  .hero { aspect-ratio: 3 / 2; max-height: 230px; }

  .content { padding: 20px 16px 26px; }
  .content h1 { font-size: 22px; line-height: 1.35; }
  .content h2 { font-size: 19px; }

  /* justified text creates whitespace rivers in narrow Hebrew columns */
  .content p,
  .content li { text-align: start; }

  .cards { gap: 12px; }
  .card img { height: 165px; }

  .gagot-gallery { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .gagot-shot img { height: 96px; }

  .cta { padding: 16px; }
  .cta .phones { font-size: 22px; direction: ltr; text-align: center; }
  .cta .phones a { display: inline-block; padding: 10px 14px; }

  /* comfortable tap targets in the footer */
  .site-foot { padding: 20px 16px; }
  .site-foot .foot-nav ul { gap: 0; }
  .site-foot .foot-nav a,
  .site-foot > div > a { display: inline-block; padding: 10px 12px; }

  /* room for the sticky bar so it never covers the footer */
  body { padding-bottom: 62px; }

  .call-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 56px;
    padding: 0 14px calc(env(safe-area-inset-bottom, 0px) / 2);
    background: var(--red);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, .22);
  }

  .call-bar:active { background: var(--red-deep); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
