/*
Theme Name: HUB Advanced
Theme URI: https://hub.co.il
Author: HUB Advanced Systems Ltd.
Author URI: https://hub.co.il
Description: Refined editorial WordPress theme for HUB Advanced Systems Ltd. RTL Hebrew. Kabbalistic minimalism. Built to preserve all existing content and URLs while delivering a contemporary, professional presentation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: Proprietary — © HUB Advanced Systems Ltd.
License URI: https://hub.co.il
Text Domain: hub-advanced
Tags: rtl, hebrew, editorial, minimalist, dark, custom-colors, custom-menu, threaded-comments, translation-ready
*/

/* ============================================================
   HUB Advanced — Brand Tokens
   ============================================================ */
:root {
  --ink:        #0B0F14;
  --ink-soft:   #111827;
  --paper:      #FFFFFF;
  --paper-warm: #F7F4EE;
  --rule:       #1A1F26;
  --rule-light: #E6E1D7;
  --ember:      #C86B3A;
  --ember-deep: #9E5128;
  --teal:       #2F6F6A;
  --teal-deep:  #1F4E4A;
  --serif: 'Frank Ruhl Libre', 'David Libre', Georgia, serif;
  --sans:  'Heebo', 'Assistant', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;
  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ember); color: var(--ink); }
a { color: var(--teal); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--ember); }
img, svg { display: block; max-width: 100%; height: auto; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================================
   HEADER — World-class sticky nav, hamburger, RTL, accessible
   ============================================================ */

/* ── Sticky wrapper ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--rule);
  will-change: box-shadow;
  transition: box-shadow 0.3s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 2px 28px rgba(0,0,0,0.6);
  border-bottom-color: var(--ember);
}

/* ── Inner flex row ─────────────────────────────────────── */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
  transition: height 0.3s ease;
}
.site-header.is-scrolled .site-header__inner { height: 56px; }

/* ── Brand ──────────────────────────────────────────────── */
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper);
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.site-brand:hover,
.site-brand:focus-visible { color: var(--ember); outline: none; }

.site-brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1.5px solid currentColor;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.site-brand:hover .site-brand__mark,
.site-brand:focus-visible .site-brand__mark {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--paper);
}

.site-brand__name { line-height: 1.15; }
.site-brand__name small {
  display: block;
  font-family: var(--sans);
  font-size: 0.67rem;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ── Hamburger button — mobile only ────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  color: var(--paper);
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-toggle:active { background: rgba(255,255,255,0.06); }
.nav-toggle:hover,
.nav-toggle:focus-visible { border-color: var(--ember); outline: none; }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #ffffff;
  border-radius: 3px;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.22s ease, width 0.22s ease;
}
/* X animation — span centers move ±(2.5px + 6px) = 8.5px → round to 9px */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; width: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ── Desktop nav list ───────────────────────────────────── */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav > ul,
.site-nav > div > ul {
  display: flex;
  gap: 2rem;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.site-nav a {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a:focus-visible               { color: var(--ember); outline: none; }
.site-nav .current-menu-item > a,
.site-nav .current-page-ancestor > a   { color: var(--ember); }

/* ── Desktop dropdown ───────────────────────────────────── */
.site-nav ul li { position: relative; }

.site-nav ul ul {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--ink-soft);
  border-top: 2px solid var(--ember);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  padding: 0.5rem 0;
  flex-direction: column;
  gap: 0;
  z-index: 9999;
  animation: hubDropIn 0.18s ease both;
}
@keyframes hubDropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.site-nav ul li:hover > ul,
.site-nav ul li:focus-within > ul { display: flex; }

.site-nav ul ul li { width: 100%; }
.site-nav ul ul a {
  display: block;
  padding: 0.65rem 1.25rem;
  white-space: nowrap;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.72);
}
.site-nav ul ul a:hover,
.site-nav ul ul a:focus-visible {
  background: rgba(255,255,255,0.05);
  color: var(--ember);
}

/* ── Backdrop ───────────────────────────────────────────── */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}
body.nav-open .nav-backdrop { display: block; }

/* ── MOBILE: hamburger drawer ───────────────────────────── */
@media (max-width: 879px) {

  .nav-toggle { display: flex; flex-direction: column; }

  .site-nav {
    position: absolute;
    right: 0;
    left: 0;
    top: 100%;
    background: var(--ink);
    border-top: 1px solid var(--rule);
    border-bottom: 2px solid transparent;
    z-index: 95;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      max-height   0.38s cubic-bezier(0.4,0,0.2,1),
      border-color 0.25s ease,
      visibility   0s   linear 0.38s;
  }
  .site-nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
    visibility: visible;
    border-bottom-color: var(--ember);
    -webkit-overflow-scrolling: touch;
    transition:
      max-height   0.38s cubic-bezier(0.4,0,0.2,1),
      border-color 0.25s ease,
      visibility   0s   linear 0s;
  }

  .site-nav > ul,
  .site-nav > div > ul {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0.5rem 0 1.25rem;
  }
  .site-nav ul li { width: 100%; }

  .site-nav > ul > li > a,
  .site-nav > div > ul > li > a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--rule);
    color: rgba(255,255,255,0.82);
  }

  /* Mobile sub-menu — flat, always visible */
  .site-nav ul ul {
    display: flex !important;
    position: static;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(255,255,255,0.04);
    padding: 0.25rem 0;
    animation: none;
  }
  .site-nav ul ul a {
    padding-right: 2.5rem;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
}

/* ── DESKTOP: force-reset mobile state ──────────────────── */
@media (min-width: 880px) {
  .site-nav {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
    border: none !important;
    background: transparent !important;
  }
  .nav-backdrop { display: none !important; }
}


/* ============================================================
   MAIN
   ============================================================ */
.site-main {
  min-height: 60vh;
  padding: 0 0 6rem !important; /* כפיית ביטול ריווח עליון */
  margin-top: 0 !important;
  display: flow-root; 
}

/* איפוס שוליים אגרסיבי לבלוק הראשון בעמוד (עוקף את וורדפרס גוטנברג) */
.site-main > *:first-child,
.site-main > .container > *:first-child,
.wp-site-blocks > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* העלמת תגיות ריקות של וורדפרס (wpautop) שדוחפות תוכן ויוצרות רווחים לבנים */
p:empty, br {
  display: none !important;
}

/* PAGE HEADER */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule-light);
}
.page-header__eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ember);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.page-header__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

/* ============================================================
   POST / PAGE CONTENT
   ============================================================ */
.entry {
  max-width: 760px;
  margin: 0 auto;
}
.entry__meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(17,24,39,0.55);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.entry__meta a { color: var(--teal-deep); }
.entry__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.entry__title a { color: inherit; }
.entry__title a:hover { color: var(--ember-deep); }
.entry__thumb {
  margin: 0 0 2rem;
  overflow: hidden;
}
.entry__thumb img {
  width: 100%;
  height: auto;
}
.entry__content {
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.entry__content > * + * { margin-top: 1.25em; }
.entry__content h1,
.entry__content h2,
.entry__content h3,
.entry__content h4 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
}
.entry__content h2 { font-size: 1.75rem; }
.entry__content h3 { font-size: 1.4rem; }
.entry__content h4 { font-size: 1.15rem; }
.entry__content p { margin: 0 0 1.25em; }
.entry__content blockquote {
  border-inline-start: 3px solid var(--ember);
  padding: 0.5rem 1.5rem;
  margin: 2em 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink);
  background: var(--paper-warm);
}
.entry__content code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--paper-warm);
  padding: 0.15em 0.4em;
  border: 1px solid var(--rule-light);
}
.entry__content pre {
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 2em 0;
}
.entry__content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}
.entry__content ul, .entry__content ol {
  padding-inline-start: 1.5rem;
  margin: 0 0 1.25em;
}
.entry__content li { margin-bottom: 0.5em; }
.entry__content a {
  color: var(--teal-deep);
  border-bottom: 1px solid currentColor;
}
.entry__content a:hover { color: var(--ember-deep); }
.entry__content img {
  margin: 2em 0;
}
.entry__content hr {
  border: none;
  border-top: 1px solid var(--rule-light);
  margin: 3em 0;
}

/* TAGS */
.entry__tags {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-light);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}
.entry__tags a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  margin: 0 0.5rem 0.5rem 0;
  border: 1px solid var(--rule-light);
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-light);
}
.entry__tags a:hover {
  border-color: var(--ember);
  color: var(--ember-deep);
}

/* ============================================================
   POST LIST (archive / blog)
   ============================================================ */
.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule-light);
  transition: padding 0.3s ease;
}
.post-card:hover { padding-inline-start: 0.75rem; }
.post-card:first-child { padding-top: 0; }
@media (min-width: 720px) {
  .post-card.has-thumb { grid-template-columns: 220px 1fr; gap: 2.5rem; }
}
.post-card__thumb {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-warm);
}
.post-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.04); }
.post-card__meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(17,24,39,0.5);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.post-card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}
.post-card__title a { color: var(--ink); }
.post-card__title a:hover { color: var(--ember-deep); }
.post-card__excerpt {
  color: rgba(17,24,39,0.7);
  font-size: 0.98rem;
  margin: 0 0 1rem;
}
.post-card__more {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ember-deep);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.pagination .page-numbers {
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--rule-light);
  color: var(--ink-soft);
  min-width: 42px;
  text-align: center;
}
.pagination .page-numbers.current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pagination .page-numbers:hover {
  border-color: var(--ember);
  color: var(--ember-deep);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments {
  max-width: 760px;
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--rule-light);
}
.comments__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0 0 2rem;
  color: var(--ink);
}
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
}
.comment-list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule-light);
}
.comment-author {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.comment-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: rgba(17,24,39,0.5);
  margin-bottom: 0.75rem;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule-light);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
#commentform input:focus,
#commentform textarea:focus {
  outline: none;
  border-color: var(--teal);
}
#commentform .submit,
.btn-primary {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  background: var(--ember);
  color: var(--ink);
  border: none;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}
#commentform .submit:hover,
.btn-primary:hover {
  background: var(--ember-deep);
  color: var(--paper);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (min-width: 720px) {
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer .site-brand { color: var(--paper); margin-bottom: 1rem; }
.site-footer__about {
  max-width: 36ch;
  line-height: 1.7;
}
.site-footer h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 1.25rem;
  font-weight: 500;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
.site-footer ul a {
  color: rgba(255,255,255,0.7);
}
.site-footer ul a:hover { color: var(--ember); }
.site-footer__bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.45);
}
.site-footer__seal {
  color: var(--teal);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0;
}
.site-footer__copyright strong { color: var(--paper); font-weight: 600; }

/* ============================================================
   404 / SEARCH
   ============================================================ */
.notfound {
  text-align: center;
  padding: 4rem 0;
}
.notfound__code {
  font-family: var(--serif);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: var(--ember);
  line-height: 1;
  margin: 0 0 1rem;
}
.notfound__title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 1.5rem;
}

/* ACCESSIBILITY */
.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px; width: 1px;
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}