/* Hebrew-first reset. Direction comes from <html dir> (set per-locale by
 * inc/i18n.php): dir="rtl" on HE, dir="ltr" on /en/. Everything uses logical
 * properties so layout flips cleanly without per-direction overrides. */

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

* { margin: 0; }

/* The HTML5 hidden attribute must win over component display rules
 * (.hb-drawer{display:flex} etc. otherwise override the UA [hidden]{display:none}).
 * Panels toggle this attribute via JS; keeping it authoritative means they stay
 * closed until opened. */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height, 80px);
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    background: var(--surface-bg);
    color: var(--surface-text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-body);
    line-height: var(--lh-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
picture { display: contents; }

a { color: inherit; text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--surface-accent); }

button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

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

:focus-visible {
    outline: 3px solid var(--hb-gold);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Layout helpers */
.hb-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.hb-container--narrow { max-width: var(--container-narrow); }

.hb-main { min-height: 60vh; }

/* Accessibility utilities */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-start: -9999px;
    z-index: var(--z-modal);
    background: var(--hb-gold);
    color: var(--hb-charcoal);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: var(--fw-bold);
}
.skip-link:focus { inset-inline-start: 12px; }
