/* --- 1. הגדרות בסיס ומשתנים --- */
:root {
    --primary-bg: #fdfdfc;    /* לבן שמנת */
    --secondary-bg: #f4f4f2;  /* אפור רך */
    --text-dark: #2c3e50;     /* כחול-אפור כהה */
    --accent-gold: #b8955a;   /* זהב מעומעם */
    --white: #ffffff;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --shadow: 0 4px 15px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-bg);
    color: var(--text-dark);
    margin: 0;
    line-height: 1.8;
    direction: rtl; /* תמיכה מלאה בעברית */
}

/* --- 2. נגישות --- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-gold);
    color: white;
    padding: 10px;
    z-index: 2000;
}
.skip-link:focus { top: 0; }

/* --- 3. ניווט (Header & Dropdown) --- */
/* NOTE: The sticky/flex header is scoped to the site header only,
   so content sections that use <header> won't be affected. */
.site-header {
    background-color: var(--white);
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-dark);
    text-decoration: none;
}

.main-nav {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: background-color 0.2s ease, text-decoration-color 0.2s ease, box-shadow 0.2s ease;
    padding: 6px 8px;
    border-radius: 10px;
}

/* Hover/Focus: keep high-contrast text and add a non-color-only cue */
.main-nav a:hover,
.main-nav a:focus {
    color: var(--text-dark);
    background-color: rgba(184, 149, 90, 0.18);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Current page indicator (works anywhere aria-current="page" exists) */
.main-nav a[aria-current="page"] {
    font-weight: 700;
    border-bottom: 2px solid rgba(44, 62, 80, 0.35);
    padding-bottom: 2px;
}
/* תפריט נפתח */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
    z-index: 1001;
    list-style: none;
    padding: 10px 0;
    border: 1px solid #eee;
    right: 0;
}

.dropdown-content li a {
    padding: 12px 16px;
    display: block;
    font-size: 0.95rem;
}

.dropdown-content li a:hover {
    background-color: var(--secondary-bg);
}

/* הצגת התפריט בריחוף עכבר */
.dropdown:hover .dropdown-content {
    display: block;
}

/* מציג את התפריט אם הכפתור או כל אחד מהקישורים שבתוכו מקבלים פוקוס */
.dropdown:focus-within .dropdown-content {
    display: block;
}


/* --- 4. פריסה וקונטיינרים --- */
.container {
    padding: 60px 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

/* --- 5. עיצוב דף הבית (Hero) --- */
.hero {
    padding: 20px 10%;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* Logo above the homepage hero headline (PNG with transparency) */
.hero-logo{
    display: flex;
    justify-content: center;
    margin: 0 auto 26px;
}

.hero-logo-img{
    display: block;
    background: transparent;
    /* Size is controlled by width so the aspect ratio is always preserved */
    width: clamp(150px, 16vw, 260px);
    max-width: 320px;
    height: auto;
    max-height: 30vh;
    object-fit: contain;
}

@media (max-width: 768px){
    .hero-logo{
        margin-bottom: 18px;
    }

    .hero-logo-img{
        width: min(220px, 62vw);
        max-width: 260px;
        max-height: 24vh;
    }
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

/* --- 6. עיצוב דף אודות --- */
.about-flex {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    background-color: var(--secondary-bg);
    padding: 80px 10%;
}

.about-text { flex: 1; min-width: 300px; }

.about-image {
    /* Keep the portrait visually consistent across very wide and slightly narrower screens.
       Without this, the image can look small on ultra-wide layouts, then suddenly huge after wrapping. */
    flex: 0 1 420px;
    min-width: 300px;
    text-align: center;
}

.about-image img{
    display: block;
    margin: 0 auto;
    width: 100%;
    /* Override inline max-width on about.html */
    max-width: 420px !important;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.profile-img-placeholder {
    width: 100%;
    height: 400px;
    background: #eee;
    border-radius: 2px;
    box-shadow: 15px 15px 0px var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 7. אלמנטים חוזרים (כרטיסים, תיבות) --- */
.accent-title { color: var(--accent-gold); }

.card {
    background: var(--white);
    padding: 30px;
    border: 1px solid #eee;
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
}

.highlight-box {
    background-color: var(--secondary-bg);
    border-right: 4px solid var(--accent-gold);
    padding: 30px;
    margin: 40px 0;
}

.cta-button {
    background-color: var(--text-dark);
    color: var(--white);
    padding: 15px 40px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--accent-gold);
}

/* --- 8. שאלות ותשובות (FAQ) --- */
details {
    background-color: var(--white);
    border: 1px solid #eee;
    margin-bottom: 15px;
    padding: 15px 20px;
}

summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

/* --- 9. טופס צור קשר --- */
.contact-form {
    max-width: 600px;
    margin: 40px auto;
    background: var(--white);
    padding: 30px;
    border: 1px solid #eee;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-main);
}

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

/* --- הודעות סטטוס לטופס צור קשר --- */
#form-status{
    display: none;
    width: 100%;
    margin: 24px auto;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
}

/* Keep backwards compatibility if the class is used elsewhere */
.form-status{
    display: none;
    width: 100%;
    margin: 24px auto;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.6;
}

#form-status.success, .form-status.success{
    display: block;
    background-color: #e6f6ec;
    color: #166534;
    border: 1px solid #86efac;
}

#form-status.error, .form-status.error{
    display: block;
    background-color: #fde8e8;
    color: #b91c1c;
    border: 1px solid #f5b5b5;
}

/* --- 10. פוטר אחיד --- */
.site-footer {
    background-color: var(--secondary-bg);
    padding: 40px 10%;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    margin-top: 50px;
}

.site-footer p { margin: 5px 0; }
.site-footer a { color: var(--text-dark); text-decoration: none; font-weight: bold; }

/* Desktop: hide hamburger (mobile shows it) */
.menu-toggle{ display: none; }

/* --- 11. התאמה למובייל + תפריט המבורגר --- */
@media (max-width: 768px) {
    /* Layout basics */
    .hero h1 { font-size: 2.2rem; }
    .about-flex { flex-direction: column; text-align: center; }
    .container { padding: 40px 5%; }

    /* --- Hamburger navigation --- */
    .site-header{
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap; /* nav drops to next line when opened */
        align-items: center;
    }

    /* Hide nav by default on mobile */
    #site-nav{ display: none; width: 100%; }

    /* Hamburger button */
    .menu-toggle{
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 6px;
        gap: 3px;
        border: 1px solid rgba(0,0,0,0.10);
        background: transparent;
        border-radius: 10px;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .menu-toggle__bar{
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text-dark);
        border-radius: 2px;
        margin: 0;
        padding: 0;
        line-height: 0;
        flex: 0 0 auto;
    }

    /* Open state (JS adds .nav-open on .site-header) */
    .site-header.nav-open #site-nav{
        display: block;
        margin-top: 8px;
    }

    .site-header.nav-open .main-nav{
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100%;
    }

    .site-header.nav-open .main-nav a,
    .site-header.nav-open .dropbtn{
        display: block;
        width: 100%;
        text-align: right;
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* Dropdown on mobile: inside flow (not absolute) */
    .dropdown-content{
        position: static;
        min-width: 0;
        box-shadow: none;
        border: 0;
        padding: 6px 0 0;
        display: none; /* opened via .is-open */
    }

    /* Disable hover-open on touch */
    .dropdown:hover .dropdown-content{ display: none; }

    /* Open dropdown via JS toggle */
    .dropdown.is-open .dropdown-content{ display: block; }

    .dropdown-content li a{
        padding: 10px 18px;
        border-radius: 10px;
    }
}


/* --- קישורים בתוכן (לא משפיע על ניווט/פוטר) --- */
main a, main a:visited {
    color: #8d7144;
    text-decoration: none;
    text-underline-offset: 3px;
}
main a:hover, main a:focus { text-decoration: underline; }

/* חריגים בתוך main */
main .cta-button,
main .cta-button:visited {
    color: var(--white);
    text-decoration: none;
}

/* --- 12. עמוד המדע (Science) --- */
.science-page { padding-top: 50px; }

.science-hero {
    margin: 0 0 30px;
    text-align: center;
}

.science-hero p {
    margin: 0 auto;
    font-size: 1.05rem;
    max-width: none;
}

.science-block {
    margin: 28px 0;
    background: var(--white);
    border: 1px solid #eee;
    box-shadow: var(--shadow);
}

.science-block.is-alt { background: var(--secondary-bg); }

.science-block-inner {
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 30px;
    align-items: center;
}

.science-kicker {
    margin: 0 0 8px;
    color: var(--accent-gold);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.science-title {
    margin: 0 0 12px;
    font-size: 1.55rem;
    font-weight: 600;
}

.science-copy p { margin: 0 0 12px; }

.science-divider {
    height: 1px;
    background: rgba(44, 62, 80, 0.10);
    margin: 16px 0;
}

.science-treatment {
    background: rgba(184, 149, 90, 0.10);
    border-right: 4px solid var(--accent-gold);
    padding: 14px 16px;
}

.science-treatment h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.science-list {
    margin: 10px 0 0;
    padding-right: 18px;
}

.science-list li { margin: 6px 0; }

.science-figure {
    margin: 0;
    background: var(--white);
    border: 1px solid #eee;
    padding: 14px;
}

.science-block.is-alt .science-figure { background: var(--primary-bg); }

.science-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.science-figure figcaption {
    margin-top: 10px;
    font-size: 0.92rem;
    color: rgba(44, 62, 80, 0.80);
    line-height: 1.5;
}

/* Summary section: stack so the image can be large */
.science-block--summary .science-block-inner {
    grid-template-columns: 1fr;
}

.science-figure--wide {
    max-width: 1100px;
    margin: 20px auto 0;
    padding: 18px;
}

.science-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 28px;
}

.science-summary-card {
    background: var(--white);
    border: 1px solid #eee;
    box-shadow: 0 2px 14px rgba(0,0,0,0.03);
    padding: 18px;
}

.science-summary-card h3 {
    margin: 0 0 8px;
    color: var(--accent-gold);
    font-size: 1.05rem;
}

.science-summary-card p { margin: 0 0 10px; }

.science-note { margin-top: 30px; }

.science-final-cta {
    margin-top: 45px;
    padding-top: 35px;
    border-top: 1px solid #eee;
    text-align: center;
}

.science-final-cta h2 {
    margin: 0 0 12px;
    font-weight: 300;
    font-size: 1.8rem;
}

.science-final-cta p {
    max-width: 720px;
    margin: 0 auto 18px;
}

@media (max-width: 900px) {
    .science-block-inner {
        grid-template-columns: 1fr;
        padding: 22px;
    }
    .science-summary-grid { grid-template-columns: 1fr 1fr; }
    .science-figure--wide { max-width: none; }
}

@media (max-width: 520px) {
    .science-summary-grid { grid-template-columns: 1fr; }
}
/* --- תוספת: גריד טיפולים (לדפי טיפול) --- */
.treatment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .treatment-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* --- נגישות קישורים: הדגשה עדינה + Bold (רק בדף המדע) --- */
/* מטרה: לא להסתמך על צבע בלבד, בלי underline, בלי לשבור עימוד */

.science-page a:not(.cta-button),
.science-page a:visited:not(.cta-button) {
    /* צבע טקסט כהה ונגיש יותר מהזהב על רקע בהיר */
    color: #2c3e50; /* שימוש בצבע הטקסט הראשי שלך */

    font-weight: 700;
    text-decoration: none;

    /* "רקע עדין" שלא יוצר קפיצות/שינויי פריסה משמעותיים */
    background-color: rgba(184, 149, 90, 0.18); /* נגזרת עדינה של accent gold */
    padding: 0 0.22em;
    border-radius: 0.35em;

    /* חשוב לקישורים שנשברים לשורות (מדגיש כל שורה בנפרד בצורה נקייה) */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.science-page a:hover:not(.cta-button),
.science-page a:focus:not(.cta-button) {
    background-color: rgba(184, 149, 90, 0.28);
}

/* חיווי פוקוס ברור למקלדת (נגישות) */
.science-page a:focus-visible:not(.cta-button) {
    outline: 3px solid var(--text-dark);
    outline-offset: 3px;
}


/* --- 13. עיצוב השוואת לפני ואחרי --- */
/* התאמה ספציפית לעמוד הבית כדי שההשוואה תהיה ממורכזת ואלגנטית */
#main > section:last-of-type .comparison-card {
    max-width: 500px;
    margin: 0 auto;
}
.comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.comparison-card {
    background: var(--white);
    border: 1px solid #eee;
    padding: 15px;
    box-shadow: var(--shadow);
    text-align: center;
}

.comparison-images {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.comparison-images > div {
    flex: 1;
    position: relative;
}

.comparison-images img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #f0f0f0;
}

.comparison-label {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(44, 62, 80, 0.8);
    color: var(--white);
    padding: 2px 8px;
    font-size: 0.8rem;
    border-radius: 2px;
}

.comparison-card p {
    font-size: 0.95rem;
    margin: 10px 0 0;
    color: var(--text-dark);
}

@media (max-width: 480px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
}

/* --- 14. גלריית חוויות (לפני ואחרי מורחב) --- */
.experience-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.experience-item {
    background: var(--white);
    border-bottom: 3px solid var(--accent-gold);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.experience-item:hover {
    transform: translateY(-5px);
}

.experience-item h4 {
    margin-top: 0;
    color: var(--accent-gold);
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.experience-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 15px;
    font-style: italic;
}

/* --- נגישות קישורים: תחתית עמוד צור קשר --- */
/* Bold + רקע עדין, בלי underline, בלי שינוי עימוד */

body:has(main > .contact-form) main > div:last-of-type a {
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;

    background-color: rgba(184, 149, 90, 0.18);
    padding: 0 0.25em;
    border-radius: 0.35em;

    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

body:has(main > .contact-form) main > div:last-of-type a:hover,
body:has(main > .contact-form) main > div:last-of-type a:focus {
    background-color: rgba(184, 149, 90, 0.28);
}

/* חיווי פוקוס נגיש למקלדת */
body:has(main > .contact-form) main > div:last-of-type a:focus-visible {
    outline: 3px solid var(--text-dark);
    outline-offset: 3px;
}

/* --- נגישות קישורים: Footer --- */
/* הבחנה שאינה צבע בלבד, שקטה ולא דומיננטית */

.site-footer a {
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid rgba(44, 62, 80, 0.35);
    padding-bottom: 2px;
}

.site-footer a:hover,
.site-footer a:focus {
    border-bottom-color: var(--accent-gold);
}

/* פוקוס נגיש למקלדת */
.site-footer a:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}

/* =========================================================
   נגישות: חיווי פוקוס (Focus) אחיד וברור לכל האתר
   ========================================================= */

/* צבע פוקוס עקבי ונגיש (ניתן לשנות אם תרצי) */
:root{
  --focus-ring: rgba(44, 62, 80, 0.55); /* נגזרת של text-dark */
  --focus-outline: 3px solid var(--focus-ring);
  --focus-offset: 3px;
}

/* בסיס: כל מה שהוא אינטראקטיבי יקבל חיווי פוקוס ברור */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible{
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
  border-radius: 10px;
}

/* שדות טופס: בנוסף ל-outline, לתת גם גבול ברור (מעל ברירת מחדל) */
.form-group input:focus-visible,
.form-group textarea:focus-visible{
  border-color: rgba(44, 62, 80, 0.55);
}

/* FAQ: אסור לבטל outline – מחזירים אותו בצורה אלגנטית */
summary{
  outline: none; /* נשאר כדי למנוע כפילות ב-:focus (לא ב-:focus-visible) */
}
summary:focus-visible{
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
  border-radius: 10px;
}

/* כפתור dropdown "טיפולים" וההמבורגר – חיזוק קל כדי שלא "ייבלע" */
.menu-toggle:focus-visible,
.dropbtn:focus-visible{
  outline: 3px solid rgba(184, 149, 90, 0.85); /* accent-gold */
  outline-offset: 4px;
  border-radius: 12px;
}

/* --- חיזוק סגנון Footer (אחרי כללי הפוקוס) --- */
.site-footer a{
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(44, 62, 80, 0.35);
  padding-bottom: 2px;
}

.site-footer a:hover,
.site-footer a:focus{
  border-bottom-color: var(--accent-gold);
}

.site-footer a:focus-visible{
  outline: 3px solid rgba(184, 149, 90, 0.85);
  outline-offset: 3px;
  border-radius: 8px;
}

/* --- תיקון overflow אופקי במובייל: שדה honeypot בטופס צור קשר --- */
input[name="website"]{
  position: absolute !important;
  left: 0 !important;          /* מבטל left:-9999px שגורם לרוחב מסמך גדול */
  top: 0 !important;

  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;

  opacity: 0 !important;
  pointer-events: none !important;

  /* hiding without layout overflow */
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

html, body{
  overflow-x: hidden;
}
