/*
Theme Name: ViewSonic Israel
Theme URI: https://viewsonic.co.il
Author: ViewSonic Israel
Description: תבנית מותאמת אישית לאתר ViewSonic ישראל, בהתאם למערכת העיצוב "Precision Display Identity". תמיכה מלאה ב-RTL.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: viewsonic
*/

/* =========================================================
   Design tokens — Precision Display Identity
   ========================================================= */
:root {
    /* Colors */
    --color-surface: #f9f9f9;
    --color-surface-dim: #dadada;
    --color-surface-bright: #f9f9f9;
    --color-surface-container-lowest: #ffffff;
    --color-surface-container-low: #f3f3f3;
    --color-surface-container: #eeeeee;
    --color-surface-container-high: #e8e8e8;
    --color-surface-container-highest: #e2e2e2;
    --color-on-surface: #1a1c1c;
    --color-on-surface-variant: #5c403f;
    --color-inverse-surface: #2f3131;
    --color-inverse-on-surface: #f1f1f1;
    --color-outline: #906f6e;
    --color-outline-variant: #e5bdbb;
    --color-surface-tint: #bf0229;
    --color-primary: #9e001f;
    --color-on-primary: #ffffff;
    --color-primary-container: #c8102e;
    --color-on-primary-container: #ffdad8;
    --color-inverse-primary: #ffb3b1;
    --color-secondary: #5f5e5e;
    --color-on-secondary: #ffffff;
    --color-secondary-container: #e4e2e1;
    --color-on-secondary-container: #656464;
    --color-tertiary: #005468;
    --color-on-tertiary: #ffffff;
    --color-tertiary-container: #006e87;
    --color-on-tertiary-container: #b6ebff;
    --color-error: #ba1a1a;
    --color-on-error: #ffffff;
    --color-error-container: #ffdad6;
    --color-on-error-container: #93000a;
    --color-background: #f9f9f9;
    --color-on-background: #1a1c1c;
    --color-surface-variant: #e2e2e2;
    --color-viewsonic-red: #C8102E;
    --color-deep-black: #000000;
    --color-surface-gray: #F5F5F5;
    --color-border-subtle: #E5E5E5;

    /* Typography */
    --font-headline: 'Libre Franklin', 'Heebo', 'Assistant', sans-serif;
    --font-body: 'Open Sans', 'Heebo', 'Assistant', sans-serif;

    --fs-headline-xl: 48px;
    --lh-headline-xl: 56px;
    --ls-headline-xl: -0.02em;
    --fs-headline-xl-mobile: 32px;
    --lh-headline-xl-mobile: 40px;
    --fs-headline-lg: 32px;
    --lh-headline-lg: 40px;
    --fs-headline-md: 24px;
    --lh-headline-md: 32px;
    --fs-body-lg: 18px;
    --lh-body-lg: 28px;
    --fs-body-md: 16px;
    --lh-body-md: 24px;
    --fs-label-md: 14px;
    --lh-label-md: 20px;
    --fs-caption: 12px;
    --lh-caption: 16px;

    /* Radius */
    --radius-sm: 0.125rem;
    --radius-default: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;

    /* Spacing */
    --space-base: 8px;
    --space-xs: 4px;
    --space-sm: 12px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 80px;
    --space-gutter: 24px;
    --space-margin-mobile: 16px;
    --space-margin-desktop: 64px;

    /* Elevation */
    --shadow-level2: 0px 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-level3: 0px 12px 32px rgba(0, 0, 0, 0.1);

    --container-max: 1200px;
}

/* =========================================================
   Reset & base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background-color: var(--color-surface);
    color: var(--color-on-surface);
    font-family: var(--font-body);
    font-size: var(--fs-body-md);
    line-height: var(--lh-body-md);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-headline); margin: 0; }
p { margin: 0; }
input, select, textarea { font-family: var(--font-body); font-size: var(--fs-body-md); }

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-margin-mobile);
}
@media (min-width: 768px) {
    .container { padding-inline: var(--space-margin-desktop); }
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-base);
    height: 48px;
    padding-inline: var(--space-md);
    border-radius: var(--radius-default);
    font-family: var(--font-body);
    font-size: var(--fs-label-md);
    font-weight: 600;
    line-height: var(--lh-label-md);
    border: 1px solid transparent;
    transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
    white-space: nowrap;
}
.btn--primary {
    background-color: var(--color-viewsonic-red);
    color: var(--color-on-primary);
    box-shadow: var(--shadow-level2);
}
.btn--primary:hover {
    background-color: var(--color-primary);
    box-shadow: var(--shadow-level3);
}
.btn--outline {
    background-color: transparent;
    color: var(--color-deep-black);
    border-color: var(--color-deep-black);
}
.btn--outline:hover {
    background-color: var(--color-deep-black);
    color: #fff;
}
.btn--block { width: 100%; }
@media (min-width: 768px) {
    .btn--block { width: auto; }
}

/* =========================================================
   Site header
   ========================================================= */
.site-header {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--space-sm);
}
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-base);
    font-family: var(--font-headline);
    font-size: var(--fs-headline-md);
    font-weight: 700;
    color: var(--color-viewsonic-red);
}
.brand img { height: 32px; width: auto; }
.brand__wordmark { color: var(--color-viewsonic-red); }
.footer-brand__wordmark { color: #fff; }

.primary-nav {
    display: none;
}
.primary-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
@media (min-width: 768px) {
    .primary-nav { display: flex; align-items: center; }
}
.primary-nav a {
    font-size: var(--fs-body-md);
    line-height: var(--lh-body-md);
    color: var(--color-on-surface);
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}
.primary-nav a:hover,
.primary-nav li.current-menu-item > a,
.primary-nav li.current_page_item > a {
    color: var(--color-viewsonic-red);
    border-bottom-color: var(--color-viewsonic-red);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.header-actions .btn--primary {
    display: none;
}
@media (min-width: 768px) {
    .header-actions .btn--primary { display: inline-flex; }
}

.mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--color-on-surface);
}
@media (min-width: 768px) {
    .mobile-menu-toggle { display: none; }
}

.mobile-nav {
    display: none;
    flex-direction: column;
    border-top: 1px solid var(--color-border-subtle);
    padding: var(--space-md) var(--space-margin-mobile);
    gap: var(--space-sm);
    background-color: var(--color-surface);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.mobile-nav a {
    font-size: var(--fs-body-md);
    color: var(--color-on-surface);
    padding-block: var(--space-xs);
}
.mobile-nav li.current-menu-item > a,
.mobile-nav li.current_page_item > a { color: var(--color-viewsonic-red); }
.mobile-nav .btn { margin-top: var(--space-base); }
@media (min-width: 768px) {
    .mobile-nav { display: none !important; }
}

/* =========================================================
   Main content
   ========================================================= */
.site-main {
    flex: 1 0 auto;
    width: 100%;
    padding-block: var(--space-xl);
}

.page-header {
    margin-bottom: var(--space-lg);
    text-align: center;
}
@media (min-width: 768px) {
    .page-header { text-align: right; }
}
.page-header__title {
    font-size: var(--fs-headline-xl-mobile);
    line-height: var(--lh-headline-xl-mobile);
    font-weight: 700;
    color: var(--color-deep-black);
    margin-bottom: var(--space-base);
}
@media (min-width: 768px) {
    .page-header__title {
        font-size: var(--fs-headline-xl);
        line-height: var(--lh-headline-xl);
        letter-spacing: var(--ls-headline-xl);
    }
}
.page-header__subtitle {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
    color: var(--color-secondary);
    max-width: 40em;
    margin-inline: auto;
}
@media (min-width: 768px) {
    .page-header__subtitle { margin-inline: 0; }
}

/* =========================================================
   Cards
   ========================================================= */
.card {
    background-color: var(--color-surface-container-lowest);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-default);
}

/* =========================================================
   Contact form (reused by the footer contact strip and by
   page-home.php's own "דברו איתנו" section)
   ========================================================= */
.contact-info__row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-secondary);
}
.contact-info__row .icon { color: var(--color-viewsonic-red); flex-shrink: 0; }

.contact-form {
    padding: var(--space-md);
}
@media (min-width: 768px) {
    .contact-form { padding: var(--space-lg); }
}
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
@media (min-width: 768px) {
    .form-row { grid-template-columns: 1fr 1fr; }
}
.form-group { display: flex; flex-direction: column; gap: var(--space-base); }
.form-label {
    font-size: var(--fs-label-md);
    font-weight: 600;
    color: var(--color-deep-black);
}
.form-input,
.form-select,
.form-textarea {
    height: 48px;
    padding-inline: var(--space-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-default);
    background-color: #fff;
    color: var(--color-deep-black);
    width: 100%;
    transition: border-color .2s ease;
}
.form-textarea {
    height: auto;
    padding: var(--space-base);
    resize: vertical;
    min-height: 120px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-deep-black);
}
.form-select { appearance: none; background-image: none; }
.form-actions { display: flex; justify-content: flex-end; padding-top: var(--space-base); }
.form-notice {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-default);
    margin-bottom: var(--space-md);
    font-size: var(--fs-body-md);
}
.form-notice--success {
    background-color: var(--color-tertiary-container);
    color: var(--color-on-tertiary-container);
}
.form-notice--error {
    background-color: var(--color-error-container);
    color: var(--color-on-error-container);
}

/* =========================================================
   Contact strip — the "צור קשר" form itself, embedded in the
   global footer shell (not a dedicated page template) so it
   appears at the bottom of every page.
   ========================================================= */
.contact-strip {
    scroll-margin-top: 96px;
    background-color: var(--color-surface-gray);
    border-top: 1px solid var(--color-border-subtle);
    padding-block: var(--space-xl);
}
.contact-strip__header {
    text-align: center;
    max-width: 40em;
    margin-inline: auto;
    margin-bottom: var(--space-lg);
}
.contact-strip__title {
    font-size: var(--fs-headline-lg);
    line-height: var(--lh-headline-lg);
    font-weight: 600;
    color: var(--color-deep-black);
    margin-bottom: var(--space-base);
}
.contact-strip__subtitle {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
    color: var(--color-secondary);
}
.contact-strip__body {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-gutter);
}
@media (min-width: 768px) {
    .contact-strip__body { grid-template-columns: 4fr 8fr; }
}
.contact-strip__meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    height: fit-content;
}

/* =========================================================
   Front page sections
   ========================================================= */
.section {
    scroll-margin-top: 96px;
    padding-block: var(--space-xl);
    border-bottom: 1px solid var(--color-border-subtle);
}
.section:last-of-type { border-bottom: none; }
.section--alt { background-color: var(--color-surface-gray); }
.section__title {
    font-size: var(--fs-headline-lg);
    line-height: var(--lh-headline-lg);
    font-weight: 600;
    color: var(--color-deep-black);
    margin-bottom: var(--space-base);
}
.section__text {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
    color: var(--color-secondary);
    max-width: 48em;
}

.hero {
    padding-block: var(--space-xl);
    text-align: center;
}
.hero__title {
    font-size: var(--fs-headline-xl-mobile);
    line-height: var(--lh-headline-xl-mobile);
    font-weight: 700;
    color: var(--color-deep-black);
    margin-bottom: var(--space-base);
}
@media (min-width: 768px) {
    .hero__title {
        font-size: var(--fs-headline-xl);
        line-height: var(--lh-headline-xl);
        letter-spacing: var(--ls-headline-xl);
    }
}
.hero__subtitle {
    font-size: var(--fs-body-lg);
    color: var(--color-secondary);
    max-width: 40em;
    margin-inline: auto;
}

/* =========================================================
   Site footer
   ========================================================= */
.site-footer {
    background-color: var(--color-deep-black);
    color: var(--color-inverse-on-surface);
    margin-top: auto;
}
.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-block: var(--space-lg);
    gap: var(--space-md);
}
@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-base);
}
.footer-brand img { height: 24px; width: auto; }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}
@media (min-width: 768px) {
    .footer-nav { justify-content: flex-start; }
}
.footer-nav a {
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
    color: var(--color-secondary-fixed, #c8c6c6);
    transition: color .2s ease;
}
.footer-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-base);
    text-align: center;
}
@media (min-width: 768px) {
    .footer-meta { align-items: flex-end; text-align: left; }
}
.footer-social { display: flex; gap: var(--space-base); }
.footer-social a {
    color: var(--color-secondary-fixed, #c8c6c6);
    transition: color .2s ease;
}
.footer-social a:hover { color: #fff; }
.footer-copyright {
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
    color: var(--color-secondary-fixed, #c8c6c6);
}

/* =========================================================
   Icons (inline SVG currentColor)
   ========================================================= */
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon--flip { transform: scaleX(-1); }

/* =========================================================
   Home page template (page-home.php)
   ========================================================= */
.hero-home {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-deep-black);
}
@media (min-width: 768px) {
    .hero-home { min-height: 600px; }
}
.hero-home__media {
    position: absolute;
    inset: 0;
}
.hero-home__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .6;
}
.hero-home__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, .3) 60%, transparent);
}
.hero-home__content {
    position: relative;
    z-index: 1;
    max-width: 56em;
    margin-inline: auto;
    padding-inline: var(--space-margin-mobile);
    padding-block: var(--space-xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
@media (min-width: 768px) {
    .hero-home__content { padding-inline: var(--space-margin-desktop); }
}
.hero-home__title {
    font-size: var(--fs-headline-xl-mobile);
    line-height: var(--lh-headline-xl-mobile);
    font-weight: 700;
    color: #fff;
    margin-bottom: var(--space-md);
}
@media (min-width: 768px) {
    .hero-home__title {
        font-size: var(--fs-headline-xl);
        line-height: var(--lh-headline-xl);
        letter-spacing: var(--ls-headline-xl);
    }
}
.hero-home__subtitle {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
    color: var(--color-surface-container-low);
    max-width: 40em;
    margin-bottom: var(--space-lg);
}
.hero-home__actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
}
@media (min-width: 768px) {
    .hero-home__actions { flex-direction: row; width: auto; }
}

.btn--outline-white {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}
.btn--outline-white:hover {
    background-color: rgba(255, 255, 255, .1);
}

.section-heading { margin-bottom: var(--space-lg); }
.section-heading--center { text-align: center; }
.section__divider {
    width: 64px;
    height: 4px;
    background-color: var(--color-viewsonic-red);
    margin-top: var(--space-sm);
}
.section-heading--center .section__divider { margin-inline: auto; }
.section__text--center { max-width: 40em; margin-inline: auto; }

.about-section__inner { max-width: 48em; margin-inline: auto; text-align: center; }
.about-section__inner .section__divider { margin-inline: auto; margin-bottom: var(--space-lg); }
.about-section__text {
    color: var(--color-on-surface-variant);
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}
@media (min-width: 768px) {
    .gallery-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 220px; }
}
.gallery-grid__item { border-radius: var(--radius-lg); overflow: hidden; }
.gallery-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.gallery-grid__item:hover img { transform: scale(1.05); }
@media (min-width: 768px) {
    .gallery-grid__item--feature { grid-column: span 2; grid-row: span 2; }
    .gallery-grid__item--wide { grid-column: span 2; }
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-gutter);
}
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
.product-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface-container-lowest);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .3s ease, border-color .3s ease;
}
.product-card:hover {
    box-shadow: var(--shadow-level2);
    border-color: var(--color-surface-variant);
}
.product-card__media {
    position: relative;
    height: 256px;
    background-color: var(--color-surface-container-low);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform .5s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card__badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    box-shadow: var(--shadow-level2);
}
.product-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-md);
}
.product-card__title {
    font-size: var(--fs-headline-md);
    line-height: var(--lh-headline-md);
    font-weight: 600;
    color: var(--color-on-surface);
    margin-bottom: var(--space-xs);
    transition: color .2s ease;
}
.product-card:hover .product-card__title { color: var(--color-viewsonic-red); }
.product-card__text {
    color: var(--color-on-surface-variant);
    font-size: var(--fs-body-md);
    line-height: var(--lh-body-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card__link {
    display: flex;
    align-items: center;
    gap: var(--space-base);
    color: var(--color-viewsonic-red);
    font-size: var(--fs-label-md);
    font-weight: 600;
    margin-top: var(--space-md);
}
.product-card__link .icon { transform: scaleX(-1); }

.chip {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-surface-gray);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-default);
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
    color: var(--color-on-surface);
}

.contact-home__form { max-width: 48em; margin-inline: auto; padding: var(--space-md); }
@media (min-width: 768px) {
    .contact-home__form { padding: var(--space-lg); }
}
