/* =====================================================================
   Accessibility Widget Styles
   Vendos te: public/template/css/a11y.css
   Linko te header.php (pas style.css):
     <link rel="stylesheet" href="<?php echo base_url(); ?>template/css/a11y.css?v=1">
   ===================================================================== */

/* ---------- Variabla bazë (përdoren edhe për dark/contrast) ---------- */
:root {
  --a11y-fab-bg: #0d4b91;
  --a11y-fab-fg: #fff;
  --a11y-panel-bg: #fff;
  --a11y-panel-fg: #1a1a1a;
  --a11y-panel-border: #e3e3e3;
  --a11y-section-bg: #f6f7f9;
  --a11y-accent: #0d4b91;
  --a11y-accent-fg: #fff;
  --a11y-muted: #666;
  --a11y-radius: 10px;
  --a11y-shadow: 0 6px 24px rgba(0,0,0,.18);
  --a11y-z: 99999; /* mbi gjithçka */
}

/* ===== FAB (butoni flotues) ===== */
#a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--a11y-fab-bg);
  color: var(--a11y-fab-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--a11y-shadow);
  z-index: var(--a11y-z);
  transition: transform .2s ease;
}
#a11y-fab:hover { transform: scale(1.06); }
#a11y-fab:focus-visible {
  outline: 3px solid #ffb300;
  outline-offset: 3px;
}

/* ===== Paneli ===== */
.a11y-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100%;
  height: 100%;
  background: var(--a11y-panel-bg);
  color: var(--a11y-panel-fg);
  border-left: 1px solid var(--a11y-panel-border);
  box-shadow: var(--a11y-shadow);
  z-index: var(--a11y-z);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
.a11y-panel[hidden] { display: flex; } /* mbahet në DOM për tranzicion */
.a11y-panel.is-open { transform: translateX(0); }

/* Mobile: bottom sheet */
@media (max-width: 600px) {
  .a11y-panel {
    width: 100%;
    height: 85vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 1px solid var(--a11y-panel-border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .a11y-panel.is-open { transform: translateY(0); }
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--a11y-panel-border);
  background: var(--a11y-section-bg);
}
.a11y-panel__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.a11y-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--a11y-panel-fg);
  padding: 0 6px;
}
.a11y-close:focus-visible { outline: 2px solid var(--a11y-accent); }

.a11y-panel__body {
  padding: 14px 18px 28px;
  overflow-y: auto;
  flex: 1;
}

.a11y-section { margin-bottom: 22px; }
.a11y-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--a11y-muted);
  margin: 0 0 10px;
}

/* ===== Toggle row ===== */
.a11y-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--a11y-section-bg);
  border: 1px solid transparent;
  border-radius: var(--a11y-radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.a11y-toggle:hover { border-color: var(--a11y-panel-border); }
.a11y-toggle:focus-visible { outline: 2px solid var(--a11y-accent); outline-offset: 1px; }
.a11y-toggle__icon { font-size: 20px; }
.a11y-toggle__label { flex: 1; }
.a11y-toggle__switch {
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.a11y-toggle__switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.a11y-toggle[aria-pressed="true"] { background: #e8f0fb; border-color: var(--a11y-accent); }
.a11y-toggle[aria-pressed="true"] .a11y-toggle__switch { background: var(--a11y-accent); }
.a11y-toggle[aria-pressed="true"] .a11y-toggle__switch::after { transform: translateX(16px); }

/* ===== Stepper (font size, line height) ===== */
.a11y-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--a11y-section-bg);
  border-radius: var(--a11y-radius);
}
.a11y-stepper__label { flex: 1; }
.a11y-step {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--a11y-panel-border);
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
  color: inherit;
}
.a11y-step:hover { background: var(--a11y-section-bg); }
.a11y-step:focus-visible { outline: 2px solid var(--a11y-accent); }
.a11y-step__value {
  min-width: 48px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===== Butona të zakonshëm ===== */
.a11y-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--a11y-radius);
  border: 1px solid var(--a11y-panel-border);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.a11y-btn:hover { background: var(--a11y-section-bg); }
.a11y-btn:focus-visible { outline: 2px solid var(--a11y-accent); outline-offset: 1px; }
.a11y-btn--primary {
  background: var(--a11y-accent);
  color: var(--a11y-accent-fg);
  border-color: var(--a11y-accent);
  width: 100%;
}
.a11y-btn--primary:hover { filter: brightness(1.08); background: var(--a11y-accent); }
.a11y-btn--ghost {
  width: 100%;
  margin-bottom: 10px;
}

.a11y-link {
  display: block;
  padding: 8px 0;
  color: var(--a11y-accent);
  text-decoration: underline;
  font-size: 14px;
}

/* ===== TTS ===== */
.a11y-tts__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.a11y-tts__controls .a11y-btn { padding: 8px 12px; }
.a11y-tts__rate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--a11y-muted);
  flex: 1;
}
.a11y-tts__notice {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #fff7e0;
  border-left: 3px solid #f0b400;
  font-size: 13px;
  color: #5a4500;
  border-radius: 4px;
}

/* Klasa në body kur paneli është hapur (parandalon scroll në mobile) */
body.a11y-panel-open { overflow: hidden; }

/* =====================================================================
   PREFERENCAT QË NDIKOJNË NË FAQEN KRYESORE
   ===================================================================== */

/* ---------- Madhësia e tekstit (4 nivele) ---------- */
html[data-a11y-font="1"] body { font-size: 110%; }
html[data-a11y-font="2"] body { font-size: 120%; }
html[data-a11y-font="3"] body { font-size: 135%; }

/* ---------- Hapësira e rreshtave ---------- */
html[data-a11y-line="1.8"] body p,
html[data-a11y-line="1.8"] .single_article_body { line-height: 1.8 !important; }
html[data-a11y-line="2.0"] body p,
html[data-a11y-line="2.0"] .single_article_body { line-height: 2.0 !important; }

/* ---------- Theksoj linket ---------- */
html.a11y-links a {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  font-weight: 600;
}

/* ---------- Ndaloj animacionet ---------- */
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ---------- Modaliteti i errët ---------- */
html.a11y-dark {
  background: #1a1a1a;
  color: #eaeaea;
}
html.a11y-dark body,
html.a11y-dark .center,
html.a11y-dark #wrapper,
html.a11y-dark article,
html.a11y-dark .single_article_body,
html.a11y-dark .article-body,
html.a11y-dark .article_header {
  background-color: #1a1a1a !important;
  color: #eaeaea !important;
}
html.a11y-dark a { color: #6db1ff !important; }
html.a11y-dark a:visited { color: #b48cff !important; }
html.a11y-dark img:not([alt*="logo" i]) { filter: brightness(.9); }
html.a11y-dark .a11y-panel,
html.a11y-dark #a11y-fab { /* widget vetë mbetet i lexueshëm */
  --a11y-panel-bg: #2a2a2a;
  --a11y-panel-fg: #eaeaea;
  --a11y-section-bg: #353535;
  --a11y-panel-border: #444;
}

/* ---------- Kontrast i lartë (i ndryshëm nga dark) ---------- */
html.a11y-contrast {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast body,
html.a11y-contrast body * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.a11y-contrast a,
html.a11y-contrast a * { color: #ffeb3b !important; }
html.a11y-contrast img { filter: grayscale(1) contrast(1.2); }
/* widget i ruan ngjyrat e veta që të mbetet i përdorshëm */
html.a11y-contrast .a11y-panel,
html.a11y-contrast .a11y-panel *,
html.a11y-contrast #a11y-fab {
  background-color: var(--a11y-panel-bg) !important;
  color: var(--a11y-panel-fg) !important;
}

/* ---------- Modaliteti i leximit (vetëm te lajm_single) ---------- */
html.a11y-reading .ads_desktop,
html.a11y-reading ins[data-revive-zoneid],
html.a11y-reading [data-revive-zoneid],
html.a11y-reading .sidebar,
html.a11y-reading aside,
html.a11y-reading ul.comments,
html.a11y-reading .comments,
html.a11y-reading #header,
html.a11y-reading header,
html.a11y-reading #footer,
html.a11y-reading footer,
html.a11y-reading .flash_news,
html.a11y-reading .related,
html.a11y-reading .a11y-removable {
  display: none !important;
}
html.a11y-reading .single_article_body,
html.a11y-reading .article-body {
  max-width: 720px !important;
  margin: 20px auto !important;
  font-size: 1.1em !important;
  line-height: 1.7 !important;
  padding: 0 16px !important;
}
html.a11y-reading .article_header {
  max-width: 720px !important;
  margin: 0 auto !important;
  padding: 16px !important;
}

/* TTS – theksimi i fjalisë që po lexohet */
.a11y-tts-active {
  background: #ffeb3b !important;
  color: #000 !important;
  padding: 2px 0;
  border-radius: 2px;
}
