/*
 * HotNews — כפתור ופאנל נגישות
 * תקן: IS 5568 (תקן נגישות ישראלי), WCAG 2.1 AA
 * עיצוב: עצמאי לחלוטין, לא עוקף שום כלל קיים
 */

/* ===== כפתור נגישות קבוע בפינה ===== */
#hn-acc-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;           /* פינה שמאלית (RTL) */
  z-index: 9000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  transition: background 0.18s, transform 0.15s;
  padding: 0;
}
#hn-acc-btn:hover,
#hn-acc-btn:focus-visible {
  background: #1e40af;
  transform: scale(1.08);
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
#hn-acc-btn[aria-expanded="true"] {
  background: #1d4ed8;
}

/* ===== פאנל נגישות ===== */
#hn-acc-panel {
  position: fixed;
  bottom: 86px;
  left: 24px;
  z-index: 9001;
  background: #fff;
  border: 2px solid #1e3a8a;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  width: 236px;
  padding: 16px 14px 14px;
  direction: rtl;
  font-family: inherit;
  display: none;
}
#hn-acc-panel.is-open {
  display: block;
  animation: hn-acc-slide-in 0.18s ease;
}
@keyframes hn-acc-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* כותרת פאנל */
#hn-acc-panel .hn-acc-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* קבוצת אפשרות */
#hn-acc-panel .hn-acc-group {
  margin-bottom: 10px;
}
#hn-acc-panel .hn-acc-group-label {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

/* כפתורי קבוצה */
#hn-acc-panel .hn-acc-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#hn-acc-panel .hn-acc-row button {
  flex: 1;
  min-width: 66px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
  white-space: nowrap;
}
#hn-acc-panel .hn-acc-row button:hover,
#hn-acc-panel .hn-acc-row button:focus-visible {
  background: #eff6ff;
  border-color: #1e3a8a;
  outline: none;
}
#hn-acc-panel .hn-acc-row button.is-active {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}

/* כפתור איפוס */
#hn-acc-panel .hn-acc-reset {
  width: 100%;
  margin-top: 10px;
  padding: 7px 0;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
#hn-acc-panel .hn-acc-reset:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ===== מצבי נגישות גלובליים — מוגדרים על body ===== */

/* גודל גופן */
body.hn-font-lg  { font-size: 118% !important; }
body.hn-font-xl  { font-size: 136% !important; }

/* ניגודיות גבוהה */
body.hn-contrast {
  background: #000 !important;
  color: #fff !important;
}
body.hn-contrast a { color: #ffe066 !important; }

/* כלל גלובלי — כל האלמנטים עם רקע */
body.hn-contrast *:not(#hn-acc-btn):not(#hn-acc-panel):not(#hn-acc-panel *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #444 !important;
}

/* קישורים ושמות */
body.hn-contrast a,
body.hn-contrast a * { color: #ffe066 !important; }

/* כפתורים בולטים */
body.hn-contrast .btn,
body.hn-contrast button:not(#hn-acc-btn):not(#hn-acc-panel button),
body.hn-contrast [class*="btn"] {
  background: #1a1a1a !important;
  color: #fff !important;
  border-color: #555 !important;
}

/* תמונות */
body.hn-contrast img { filter: grayscale(100%) contrast(1.1); }

/* ריווח בין שורות */
body.hn-spacing .article-body,
body.hn-spacing p,
body.hn-spacing li,
body.hn-spacing span {
  line-height: 2 !important;
  letter-spacing: 0.04em !important;
}

/* גופן קריא (ללא קרנף) */
body.hn-readable * {
  font-family: Arial, Helvetica, sans-serif !important;
}

/* הסתרת אנימציות */
body.hn-no-anim *,
body.hn-no-anim *::before,
body.hn-no-anim *::after {
  animation: none !important;
  transition: none !important;
}

/* ===== הסתרת הפאנל ב-print ===== */
@media print {
  #hn-acc-btn,
  #hn-acc-panel { display: none !important; }
}

/* ===================================================================
 * עיצוב ייחודי לדפי כתבה — דריסת ערכי px קבועים
 * lg = 118%  |  xl = 136%
 * =================================================================== */

/* ---- גודל גדול (lg) ---- */
body.hn-font-lg .article-title         { font-size: clamp(33px, 3.8vw, 47px) !important; }
body.hn-font-lg .article-subtitle      { font-size: 22px !important; }

body.hn-font-lg .article-content p     { font-size: 22px !important; }
body.hn-font-lg .article-content > p:first-of-type { font-size: 21px !important; }
body.hn-font-lg .article-content h2    { font-size: 40px !important; }
body.hn-font-lg .article-content h3    { font-size: 31px !important; }
body.hn-font-lg .article-content ul    { font-size: 21px !important; }
body.hn-font-lg .article-content li    { font-size: 21px !important; }
body.hn-font-lg .article-highlight p   { font-size: 20px !important; }
body.hn-font-lg .article-quote blockquote { font-size: 24px !important; }

/* מובייל lg (≤768px) */
@media (max-width: 768px) {
  body.hn-font-lg .article-title       { font-size: 28px !important; }
  body.hn-font-lg .article-subtitle    { font-size: 19px !important; }
  body.hn-font-lg .article-content p   { font-size: 19px !important; }
  body.hn-font-lg .article-content > p:first-of-type { font-size: 20px !important; }
  body.hn-font-lg .article-content h2  { font-size: 26px !important; }
  body.hn-font-lg .article-content h3  { font-size: 22px !important; }
  body.hn-font-lg .article-content ul  { font-size: 19px !important; }
}

/* ---- גודל גדול מאוד (xl) ---- */
body.hn-font-xl .article-title         { font-size: clamp(38px, 4.4vw, 54px) !important; }
body.hn-font-xl .article-subtitle      { font-size: 26px !important; }

body.hn-font-xl .article-content p     { font-size: 26px !important; }
body.hn-font-xl .article-content > p:first-of-type { font-size: 24px !important; }
body.hn-font-xl .article-content h2    { font-size: 46px !important; }
body.hn-font-xl .article-content h3    { font-size: 35px !important; }
body.hn-font-xl .article-content ul    { font-size: 24px !important; }
body.hn-font-xl .article-content li    { font-size: 24px !important; }
body.hn-font-xl .article-highlight p   { font-size: 23px !important; }
body.hn-font-xl .article-quote blockquote { font-size: 28px !important; }

/* מובייל xl (≤768px) */
@media (max-width: 768px) {
  body.hn-font-xl .article-title       { font-size: 32px !important; }
  body.hn-font-xl .article-subtitle    { font-size: 22px !important; }
  body.hn-font-xl .article-content p   { font-size: 22px !important; }
  body.hn-font-xl .article-content > p:first-of-type { font-size: 23px !important; }
  body.hn-font-xl .article-content h2  { font-size: 30px !important; }
  body.hn-font-xl .article-content h3  { font-size: 25px !important; }
  body.hn-font-xl .article-content ul  { font-size: 22px !important; }
}

/* ---- ריווח בכתבה (spacing) ---- */
body.hn-spacing .article-content p,
body.hn-spacing .article-content li {
  line-height: 2.2 !important;
  letter-spacing: 0.04em !important;
}

/* ===================================================================
 * מדריכים — guide.php משתמש ב-.article-content (כבר מכוסה)
 * + תוספות ייחודיות למדריך
 * =================================================================== */
body.hn-font-lg .guide-summary        { font-size: 18px !important; }
body.hn-font-xl .guide-summary        { font-size: 21px !important; }

/* ===================================================================
 * פרופילים — profile.php
 * =================================================================== */
body.hn-font-lg .profile-bio-text     { font-size: 19px !important; }
body.hn-font-xl .profile-bio-text     { font-size: 22px !important; }

/* ריווח פרופיל */
body.hn-spacing .profile-bio-text     { line-height: 2.2 !important; letter-spacing: 0.04em !important; }

/* ===================================================================
 * SIDEBAR WIDGETS (גלובלי — global.css)
 * =================================================================== */
/* כותרות widget */
body.hn-font-lg .widget h3                    { font-size: 20px !important; }
body.hn-font-xl .widget h3                    { font-size: 23px !important; }

/* כותרות כתבות בסיידבר */
body.hn-font-lg .sidebar-article-title        { font-size: 15px !important; }
body.hn-font-xl .sidebar-article-title        { font-size: 17px !important; }

/* רשימת דירוג */
body.hn-font-lg .ranking-list a               { font-size: 15px !important; }
body.hn-font-xl .ranking-list a               { font-size: 17px !important; }

/* quick links */
body.hn-font-lg .widget .quick-links a        { font-size: 16px !important; }
body.hn-font-xl .widget .quick-links a        { font-size: 18px !important; }

/* panel head */
body.hn-font-lg .panel-head h2,
body.hn-font-lg .panel-head h3                { font-size: 17px !important; }
body.hn-font-xl .panel-head h2,
body.hn-font-xl .panel-head h3                { font-size: 20px !important; }

/* ===================================================================
 * FOOTER (גלובלי — global.css)
 * =================================================================== */
body.hn-font-lg .footer-top section h4        { font-size: 16px !important; }
body.hn-font-xl .footer-top section h4        { font-size: 19px !important; }

body.hn-font-lg .footer-top section ul li a   { font-size: 15px !important; }
body.hn-font-xl .footer-top section ul li a   { font-size: 17px !important; }

body.hn-font-lg .footer-top section p         { font-size: 15px !important; }
body.hn-font-xl .footer-top section p         { font-size: 17px !important; }

body.hn-font-lg .footer-newsletter-text h3    { font-size: 20px !important; }
body.hn-font-xl .footer-newsletter-text h3    { font-size: 23px !important; }

body.hn-font-lg .footer-newsletter-form input[type="email"],
body.hn-font-lg .footer-newsletter-form input[type="text"] { font-size: 16px !important; }
body.hn-font-xl .footer-newsletter-form input[type="email"],
body.hn-font-xl .footer-newsletter-form input[type="text"] { font-size: 18px !important; }

body.hn-font-lg .footer-newsletter-form button { font-size: 16px !important; }
body.hn-font-xl .footer-newsletter-form button { font-size: 18px !important; }

/* ===================================================================
 * ניווט ראשי (global.css)
 * =================================================================== */
body.hn-font-lg .primary-nav a               { font-size: 17px !important; }
body.hn-font-xl .primary-nav a               { font-size: 19px !important; }

body.hn-font-lg .drawer-nav-l1               { font-size: 18px !important; }
body.hn-font-xl .drawer-nav-l1               { font-size: 20px !important; }

body.hn-font-lg .drawer-nav-l2               { font-size: 16px !important; }
body.hn-font-xl .drawer-nav-l2               { font-size: 18px !important; }

/* ===================================================================
 * עמוד ראשי — כותרות, כרטיסים, מבזקים (home.css)
 * =================================================================== */
/* כותרת hero */
body.hn-font-lg .hero-main h1                 { font-size: clamp(28px, 3.4vw, 38px) !important; }
body.hn-font-xl .hero-main h1                 { font-size: clamp(32px, 4vw, 44px) !important; }

/* כותרות section */
body.hn-font-lg .section-head h2              { font-size: 26px !important; }
body.hn-font-xl .section-head h2              { font-size: 30px !important; }

/* מבזקים */
body.hn-font-lg .home-breaking-title          { font-size: 26px !important; }
body.hn-font-xl .home-breaking-title          { font-size: 30px !important; }

/* כרטיסי חדשות — h3 בתוך card */
body.hn-font-lg .card h3,
body.hn-font-lg .card-title                   { font-size: calc(1em * 1.18) !important; }
body.hn-font-xl .card h3,
body.hn-font-xl .card-title                   { font-size: calc(1em * 1.36) !important; }

/* ===================================================================
 * כפתורים כלליים (chat-btn, hot-links, section-links)
 * =================================================================== */
body.hn-font-lg .chat-btn                     { font-size: 16px !important; }
body.hn-font-xl .chat-btn                     { font-size: 18px !important; }

body.hn-font-lg .hot-links a                  { font-size: 16px !important; }
body.hn-font-xl .hot-links a                  { font-size: 18px !important; }

body.hn-font-lg .section-links a              { font-size: 16px !important; }
body.hn-font-xl .section-links a              { font-size: 18px !important; }

/* ===================================================================
 * ניגודיות גבוהה — הפאנל עצמו (מונע שיבוש עצמי)
 * =================================================================== */
body.hn-contrast #hn-acc-btn {
  background: #1e3a8a !important;
  color: #fff !important;
  border-color: #93c5fd !important;
}
body.hn-contrast #hn-acc-panel {
  background: #1a1a1a !important;
  border-color: #4a6fa5 !important;
  color: #fff !important;
}
body.hn-contrast #hn-acc-panel .hn-acc-title { color: #93c5fd !important; }
body.hn-contrast #hn-acc-panel .hn-acc-group-label { color: #aaa !important; }
body.hn-contrast #hn-acc-panel .hn-acc-row button {
  background: #222 !important;
  color: #fff !important;
  border-color: #555 !important;
}
body.hn-contrast #hn-acc-panel .hn-acc-row button.is-active {
  background: #1e3a8a !important;
  color: #fff !important;
}
body.hn-contrast #hn-acc-panel .hn-acc-reset {
  background: #222 !important;
  color: #aaa !important;
  border-color: #444 !important;
}
body.hn-contrast .hn-acc-statement {
  color: #93c5fd !important;
}

/* ===================================================================
 * קישור הצהרת נגישות
 * =================================================================== */
.hn-acc-statement {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  padding: 4px 0;
}
.hn-acc-statement:hover {
  color: #1e3a8a;
  text-decoration: underline;
}
