/*
Theme Name: LaMevugarim
Theme URI: https://xn--5dbcirlkc7f.xn--4dbrk0ce
Description: פורטל תוכן נגיש לגיל השלישי — כתבות, מאמרים וטיפים. ערכת עיצוב בעברית (RTL) עם דגש חזק על נגישות: גופן גדול, ניגודיות גבוהה, ניווט פשוט וסרגל נגישות מובנה.
Author: Chai
Version: 1.1.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: lamevugarim
Tags: rtl-language-support, accessibility-ready, blog, news, custom-menu, featured-images, threaded-comments
*/

/* =========================================================
   Global Design System — LaMevugarim
   Senior-accessible, minimal, trustworthy.
   Base font 18px, line-height 1.7, contrast >= 7:1 targets.
   ========================================================= */
:root {
  /* Colors (60-30-10; trust + clarity) */
  --lm-bg: #FDFCF8;          /* warm off-white page background */
  --lm-surface: #FFFFFF;     /* cards */
  --lm-text: #1A2536;        /* near-navy body text (high contrast on bg) */
  --lm-muted: #4A5568;       /* secondary text */
  --lm-primary: #1F5C8B;     /* calm blue — brand/trust */
  --lm-primary-dark: #164667;
  --lm-accent: #2E7D32;      /* green — tips/positive */
  --lm-link: #0B4F8A;
  --lm-border: #D8DCE1;
  --lm-focus: #C2410C;       /* strong focus ring */

  /* Spacing scale */
  --lm-s1: 0.25rem; --lm-s2: 0.5rem; --lm-s3: 1rem;
  --lm-s4: 1.5rem;  --lm-s5: 2rem;  --lm-s6: 3rem;

  /* Radii & lines */
  --lm-radius: 12px;
  --lm-radius-sm: 8px;
  --lm-border-w: 1px;

  /* Typography */
  --lm-font: "Assistant", "Rubik", system-ui, "Segoe UI", Arial, sans-serif;
  --lm-fs-base: 18px;
  --lm-lh: 1.7;

  /* Layout */
  --lm-container: 1100px;
  --lm-tap: 48px; /* minimum tap/target size */
}

/* User-controlled font scaling (accessibility toolbar) */
html { font-size: var(--lm-fs-base); }
html[data-lm-fontscale="1"] { font-size: calc(var(--lm-fs-base) * 1.15); }
html[data-lm-fontscale="2"] { font-size: calc(var(--lm-fs-base) * 1.32); }
html[data-lm-fontscale="3"] { font-size: calc(var(--lm-fs-base) * 1.5); }

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

body {
  margin: 0;
  font-family: var(--lm-font);
  font-size: 1rem;
  line-height: var(--lm-lh);
  color: var(--lm-text);
  background: var(--lm-bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--lm-link); text-decoration: underline; }
a:hover { color: var(--lm-primary-dark); }

/* Visible focus for keyboard users everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--lm-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Skip link */
.lm-skip-link {
  position: absolute; right: 8px; top: -60px;
  background: var(--lm-primary); color: #fff; padding: 12px 20px;
  border-radius: var(--lm-radius-sm); z-index: 1000; font-weight: 700;
  transition: top .15s ease; text-decoration: none;
}
.lm-skip-link:focus { top: 8px; color:#fff; }

/* ---------------- Accessibility toolbar ---------------- */
.lm-a11y-bar {
  background: var(--lm-primary-dark); color: #fff;
  border-bottom: 3px solid var(--lm-primary);
}
.lm-a11y-bar .lm-container {
  display: flex; flex-wrap: wrap; gap: var(--lm-s2);
  align-items: center; justify-content: flex-start;
  padding-top: var(--lm-s2); padding-bottom: var(--lm-s2);
}
.lm-a11y-label { font-weight: 700; margin-inline-end: var(--lm-s2); }
.lm-a11y-bar button {
  min-height: 40px; min-width: 44px; padding: 6px 14px;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  color: var(--lm-primary-dark); background: #fff;
  border: 2px solid #fff; border-radius: var(--lm-radius-sm); cursor: pointer;
}
.lm-a11y-bar button:hover { background: #EAF2F8; }
.lm-a11y-bar button[aria-pressed="true"] { background: var(--lm-accent); color:#fff; border-color:#fff; }

/* ---------------- Header & nav ---------------- */
.lm-header { background: var(--lm-surface); border-bottom: var(--lm-border-w) solid var(--lm-border); }
.lm-header .lm-container {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--lm-s4); padding-top: var(--lm-s3); padding-bottom: var(--lm-s3);
}
.lm-brand { display: flex; align-items: center; gap: var(--lm-s2); text-decoration: none; }
.lm-brand-mark {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--lm-primary); color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 1.4rem;
}
.lm-brand-name { font-size: 1.6rem; font-weight: 800; color: var(--lm-text); }
.lm-brand-tag { display:block; font-size: .8rem; font-weight: 600; color: var(--lm-muted); }

.lm-search { margin-inline-start: auto; display: flex; gap: var(--lm-s2); }
.lm-search input[type="search"] {
  min-height: var(--lm-tap); padding: 8px 14px; font-size: 1rem;
  border: 2px solid var(--lm-border); border-radius: var(--lm-radius-sm);
  font-family: inherit; min-width: 220px; color: var(--lm-text); background:#fff;
}
.lm-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--lm-tap); padding: 12px 24px;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  background: var(--lm-primary); color: #fff; border: 2px solid var(--lm-primary);
  border-radius: var(--lm-radius-sm); cursor: pointer; text-decoration: none;
}
.lm-btn:hover { background: var(--lm-primary-dark); border-color: var(--lm-primary-dark); color:#fff; }

.lm-nav { background: var(--lm-primary); }
.lm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.lm-nav li { margin: 0; }
.lm-nav a {
  display: block; padding: 14px 20px; color: #fff; text-decoration: none;
  font-weight: 700; font-size: 1.05rem; border-inline-start: 1px solid rgba(255,255,255,.15);
}
.lm-nav a:hover, .lm-nav .current-menu-item > a { background: var(--lm-primary-dark); color:#fff; }

/* ---------------- "Under construction" banner ---------------- */
.lm-construction {
  background: #FDE68A;
  color: #1A2536;
  border-bottom: 3px solid #F59E0B;
}
.lm-construction .lm-container {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: var(--lm-s3); padding-top: var(--lm-s3); padding-bottom: var(--lm-s3);
  text-align: center;
}
.lm-construction-badge {
  flex: 0 0 auto;
  background: #B45309; color: #fff; font-weight: 800; font-size: .9rem;
  padding: 6px 14px; border-radius: 999px; letter-spacing: .02em;
  text-transform: none;
}
.lm-construction-text { font-size: 1.05rem; line-height: 1.5; }
.lm-construction-text strong { color: #7C4A03; }

/* ---------------- Content layout ---------------- */
.lm-main { padding: var(--lm-s5) 0 var(--lm-s6); }
.lm-page-title { font-size: 2rem; margin: 0 0 var(--lm-s4); color: var(--lm-text); }
.lm-section-title {
  font-size: 1.5rem; margin: var(--lm-s5) 0 var(--lm-s3);
  padding-bottom: var(--lm-s2); border-bottom: 3px solid var(--lm-primary);
  color: var(--lm-text);
}

/* Hero */
.lm-hero {
  background: linear-gradient(180deg, #EAF2F8, var(--lm-bg));
  border: var(--lm-border-w) solid var(--lm-border); border-radius: var(--lm-radius);
  padding: var(--lm-s5); margin-bottom: var(--lm-s5);
}
.lm-hero h1 { font-size: 2.2rem; margin: 0 0 var(--lm-s2); }
.lm-hero p { font-size: 1.15rem; color: var(--lm-muted); margin: 0; max-width: 60ch; }

/* Card grid */
.lm-grid { display: grid; gap: var(--lm-s4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .lm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .lm-grid { grid-template-columns: 1fr; } }

.lm-card {
  background: var(--lm-surface); border: var(--lm-border-w) solid var(--lm-border);
  border-radius: var(--lm-radius); overflow: hidden; display: flex; flex-direction: column;
}
.lm-card-media { aspect-ratio: 16/9; background: #EAF2F8; overflow: hidden; }
.lm-card-media img { width: 100%; height: 100%; object-fit: cover; }
.lm-card-body { padding: var(--lm-s3); display: flex; flex-direction: column; gap: var(--lm-s2); flex: 1; }
.lm-cat-chip {
  align-self: flex-start; background: #EAF2F8; color: var(--lm-primary-dark);
  font-size: .85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  text-decoration: none;
}
.lm-card h3 { margin: 0; font-size: 1.25rem; line-height: 1.4; }
.lm-card h3 a { color: var(--lm-text); text-decoration: none; }
.lm-card h3 a:hover { color: var(--lm-primary); text-decoration: underline; }
.lm-card p { margin: 0; color: var(--lm-muted); }
.lm-card .lm-readmore { margin-top: auto; font-weight: 700; }

/* Single article */
.lm-article { background: var(--lm-surface); border: var(--lm-border-w) solid var(--lm-border);
  border-radius: var(--lm-radius); padding: var(--lm-s5); max-width: 760px; margin: 0 auto; }
.lm-article h1 { font-size: 2rem; line-height: 1.3; margin: 0 0 var(--lm-s3); }
.lm-article .lm-meta { color: var(--lm-muted); font-size: .95rem; margin-bottom: var(--lm-s4); }
.lm-article-content { font-size: 1.1rem; }
.lm-article-content p { margin: 0 0 var(--lm-s4); }
.lm-article-content h2 { font-size: 1.5rem; margin: var(--lm-s5) 0 var(--lm-s2); }
.lm-article-content ul, .lm-article-content ol { padding-inline-start: 1.5rem; margin: 0 0 var(--lm-s4); }
.lm-article-content li { margin-bottom: var(--lm-s2); }
.lm-featured { border-radius: var(--lm-radius); margin-bottom: var(--lm-s4); }

.lm-breadcrumbs { font-size: .95rem; margin-bottom: var(--lm-s4); color: var(--lm-muted); }
.lm-breadcrumbs a { color: var(--lm-link); }

/* Footer */
.lm-footer { background: var(--lm-primary-dark); color: #EAF2F8; margin-top: var(--lm-s6); }
.lm-footer .lm-container { padding-top: var(--lm-s5); padding-bottom: var(--lm-s5); }
.lm-footer a { color: #fff; }
.lm-footer .lm-foot-cols { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--lm-s4); }
@media (max-width: 700px){ .lm-footer .lm-foot-cols{ grid-template-columns:1fr; } }
.lm-footer h4 { font-size: 1.1rem; margin: 0 0 var(--lm-s2); color:#fff; }
.lm-footer ul { list-style:none; margin:0; padding:0; }
.lm-footer li { margin-bottom: var(--lm-s2); }
.lm-foot-bottom { border-top: 1px solid rgba(255,255,255,.2); margin-top: var(--lm-s4);
  padding-top: var(--lm-s3); font-size: .9rem; color:#CBD5E1; }

/* Pagination */
.lm-pagination { margin-top: var(--lm-s5); display:flex; gap: var(--lm-s2); flex-wrap:wrap; }
.lm-pagination .page-numbers {
  display:inline-flex; align-items:center; justify-content:center;
  min-width: var(--lm-tap); min-height: var(--lm-tap); padding: 0 12px;
  border: 2px solid var(--lm-border); border-radius: var(--lm-radius-sm);
  text-decoration:none; color: var(--lm-text); background:#fff; font-weight:700;
}
.lm-pagination .page-numbers.current { background: var(--lm-primary); color:#fff; border-color: var(--lm-primary); }

/* ---------------- High-contrast mode ---------------- */
html[data-lm-contrast="1"] body { background: #000; color: #fff; }
html[data-lm-contrast="1"] .lm-header,
html[data-lm-contrast="1"] .lm-surface,
html[data-lm-contrast="1"] .lm-card,
html[data-lm-contrast="1"] .lm-article,
html[data-lm-contrast="1"] .lm-hero { background: #000; color:#fff; border-color:#fff; }
html[data-lm-contrast="1"] .lm-brand-name,
html[data-lm-contrast="1"] .lm-card h3 a,
html[data-lm-contrast="1"] .lm-page-title,
html[data-lm-contrast="1"] .lm-section-title,
html[data-lm-contrast="1"] .lm-hero h1,
html[data-lm-contrast="1"] .lm-muted,
html[data-lm-contrast="1"] .lm-card p,
html[data-lm-contrast="1"] .lm-hero p { color: #fff; }
html[data-lm-contrast="1"] a,
html[data-lm-contrast="1"] .lm-breadcrumbs a { color: #FFD400; }
html[data-lm-contrast="1"] .lm-construction { background:#000; color:#FFD400; border-bottom:2px solid #FFD400; }
html[data-lm-contrast="1"] .lm-construction-text strong { color:#FFD400; }
html[data-lm-contrast="1"] .lm-construction-badge { background:#FFD400; color:#000; }
html[data-lm-contrast="1"] .lm-cat-chip { background:#FFD400; color:#000; }
html[data-lm-contrast="1"] .lm-btn,
html[data-lm-contrast="1"] .lm-nav a { background:#000; color:#FFD400; border-color:#FFD400; }
html[data-lm-contrast="1"] .lm-nav { background:#000; border-bottom:2px solid #FFD400; }

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.screen-reader-text {
  border:0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height:1px; width:1px; margin:-1px; overflow:hidden; padding:0; position:absolute;
}
