/* Palestine Archive — styles.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #1a1a18;
  --muted: #5c5b56;
  --faint: #9c9a92;
  --bg: #ffffff;
  --bg2: #f5f4f0;
  --bg3: #edece8;
  --border: rgba(0,0,0,0.12);
  --border2: rgba(0,0,0,0.25);
  --green: #1D9E75; --green-bg: #E1F5EE; --olive: #3B6D11;
  --amber: #BA7517; --amber-bg: #FAEEDA;
  --red: #A32D2D;   --red-bg: #FCEBEB;
  --blue: #185FA5;  --blue-bg: #E6F1FB;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e6df; --muted: #9c9a92; --faint: #666460;
    --bg: #1c1c1a; --bg2: #242422; --bg3: #2c2c2a;
    --border: rgba(255,255,255,0.1); --border2: rgba(255,255,255,0.2);
  }
}

body { font-family: 'Spectral', Georgia, serif; color: var(--ink); background: var(--bg); min-height: 100vh; }

/* NAV */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px 14px; border-bottom: 0.5px solid var(--border); gap: 12px; flex-wrap: wrap; position: sticky; top: 0; background: var(--bg); z-index: 50; }
.nav-logo .ar { font-family: 'Amiri', serif; font-size: 22px; display: block; line-height: 1; }
.nav-logo .en { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.nav-tabs { display: flex; gap: 4px; }
.tab { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .06em; padding: 6px 14px; border: 0.5px solid var(--border); border-radius: 20px; cursor: pointer; background: transparent; color: var(--muted); transition: all .2s; }
.tab.active, .tab:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-witness { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 7px 16px; background: var(--green); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-witness:hover { opacity: .85; }
.btn-admin { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 6px 12px; background: transparent; color: var(--muted); border: 0.5px solid var(--border); border-radius: 4px; cursor: pointer; }
.btn-lang { font-family: 'Amiri', serif; font-size: 14px; padding: 5px 14px; background: transparent; color: var(--muted); border: 0.5px solid var(--border); border-radius: 4px; cursor: pointer; transition: all .2s; }
.btn-lang:hover { background: var(--bg2); color: var(--ink); border-color: var(--border2); }

/* Arabic text (inline Quran verses — always shown) */
.quranic .ar { font-family: 'Amiri', serif; direction: rtl; text-align: right; }

/* Bilingual toggle — default: show EN, hide AR */
.t-ar { display: none; }
.t-en { display: inline; }
p.t-ar { display: none; }
p.t-en { display: block; }
span.t-ar { display: none; }

/* Arabic mode */
body[data-lang=ar] .t-en { display: none !important; }
body[data-lang=ar] .t-ar { display: inline !important; }
body[data-lang=ar] p.t-en { display: none !important; }
body[data-lang=ar] p.t-ar { display: block !important; }
body[data-lang=ar] span.t-en { display: none !important; }
body[data-lang=ar] span.t-ar { display: inline !important; }

/* RTL layout in Arabic mode */
body[data-lang=ar] { direction: rtl; }
body[data-lang=ar] .nav { flex-direction: row-reverse; }
body[data-lang=ar] .tl-card-header { flex-direction: row-reverse; }
body[data-lang=ar] .tl-badges { justify-content: flex-start; }
body[data-lang=ar] .about-page { text-align: right; }
body[data-lang=ar] .about-body p { font-family: 'Amiri', serif; font-size: 15px; line-height: 1.9; }
body[data-lang=ar] .protocol-block { border-left: none; border-right: 3px solid var(--green); font-family: 'Amiri', serif; font-size: 15px; line-height: 1.9; }
body[data-lang=ar] .quranic { border-left: none; border-right: 3px solid var(--green); }
body[data-lang=ar] .tl-track { padding-left: 0; padding-right: 28px; }
body[data-lang=ar] .tl-track::before { left: auto; right: 7px; }
body[data-lang=ar] .tl-dot { left: auto; right: -24px; }
body[data-lang=ar] .tl-body { font-family: 'Amiri', serif; font-size: 15px; line-height: 1.9; direction: rtl; text-align: right; }
body[data-lang=ar] .tl-title { font-family: 'Amiri', serif; font-size: 19px; direction: rtl; }
body[data-lang=ar] .persp-text { font-family: 'Amiri', serif; font-size: 14px; line-height: 1.9; direction: rtl; text-align: right; }
body[data-lang=ar] .hero-title { font-family: 'Amiri', serif; font-size: 42px; direction: rtl; }
body[data-lang=ar] .hero-sub { font-family: 'Amiri', serif; font-size: 16px; line-height: 1.9; direction: rtl; }
body[data-lang=ar] .hero-eyebrow { direction: rtl; letter-spacing: 0; }
body[data-lang=ar] .hero-tags { flex-direction: row-reverse; }

/* VIEWS */
.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* HERO */
.hero { padding: 40px 28px 28px; border-bottom: 0.5px solid var(--border); }
.hero-eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hero-title { font-family: 'Amiri', serif; font-size: 38px; line-height: 1.15; margin-bottom: 8px; }
.hero-sub { font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 540px; margin-bottom: 20px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .06em; padding: 4px 10px; border-radius: 3px; text-transform: uppercase; }
.tag-neutral { background: var(--bg2); color: var(--muted); border: 0.5px solid var(--border); }
.tag-islamic { background: var(--green-bg); color: var(--olive); border: 0.5px solid #9FE1CB; }
.tag-civil   { background: var(--amber-bg); color: var(--amber); border: 0.5px solid #FAC775; }

/* TIMELINE */
.timeline-container { padding: 28px; }
.timeline-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .06em; padding: 5px 12px; border: 0.5px solid var(--border); border-radius: 3px; cursor: pointer; background: transparent; color: var(--muted); text-transform: uppercase; transition: all .15s; }
.filter-btn.on { border-color: var(--ink); color: var(--ink); background: var(--bg2); }
.loading-state { padding: 40px; text-align: center; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--faint); }
.tl-track { position: relative; padding-left: 28px; }
.tl-track::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--border2); }
.tl-entry { position: relative; margin-bottom: 4px; }
.tl-dot { position: absolute; left: -24px; top: 18px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--border2); z-index: 1; }
.dot-oct7      { background: #C04828; }
.dot-history   { background: #3B8BD4; }
.dot-conflict  { background: #A32D2D; }
.dot-ceasefire { background: #1D9E75; }
.dot-community { background: #BA7517; box-shadow: 0 0 0 2px #FAC775; }
.tl-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: 6px; padding: 16px 18px; cursor: pointer; transition: border-color .2s, box-shadow .2s; margin-bottom: 10px; }
.tl-card:hover { border-color: var(--border2); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.tl-card.expanded { border-color: var(--ink); }
.tl-card-header { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.tl-date { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .08em; color: var(--faint); white-space: nowrap; margin-top: 2px; }
.tl-title { font-family: 'Amiri', serif; font-size: 17px; line-height: 1.35; flex: 1; }
.tl-badges { display: flex; gap: 5px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 9px; padding: 2px 7px; border-radius: 2px; letter-spacing: .04em; white-space: nowrap; }
.badge-fact    { background: var(--blue-bg); color: var(--blue); }
.badge-islamic { background: var(--green-bg); color: var(--olive); }
.badge-civil   { background: var(--amber-bg); color: var(--amber); }
.badge-pending { background: var(--amber-bg); color: var(--amber); border: 0.5px solid #FAC775; }
.tl-expand { display: none; margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.tl-expand.show { display: block; }
.tl-body { font-size: 14px; line-height: 1.75; margin-bottom: 12px; }
.tl-perspectives { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.persp-block { background: var(--bg2); border-radius: 4px; padding: 12px 14px; }
.persp-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.persp-text { font-size: 13px; line-height: 1.65; color: var(--muted); }
.quranic { background: var(--green-bg); border-left: 3px solid var(--green); border-radius: 0 4px 4px 0; padding: 10px 14px; margin: 10px 0; }
.quranic .ar { font-family: 'Amiri', serif; font-size: 16px; text-align: right; direction: rtl; margin-bottom: 4px; }
.sources { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.source-chip { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 3px 9px; border: 0.5px solid var(--border); border-radius: 2px; color: var(--muted); }
.btn-add-testimony { margin-top: 12px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 6px 12px; border: 0.5px solid var(--border2); border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer; }
.btn-add-testimony:hover { color: var(--ink); border-color: var(--ink); }
.empty-state { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--bg); border-radius: 8px; border: 0.5px solid var(--border2); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px 16px; border-bottom: 0.5px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-title { font-family: 'Amiri', serif; font-size: 22px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.btn-close { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 6px; }
.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.field-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.field-note { font-size: 12px; color: var(--faint); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], textarea, select { width: 100%; padding: 10px 12px; border: 0.5px solid var(--border); border-radius: 4px; background: var(--bg2); color: var(--ink); font-family: 'Spectral', serif; font-size: 14px; outline: none; transition: border-color .15s; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--border2); }
select { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.perspective-check { display: flex; gap: 10px; flex-wrap: wrap; }
.pcheck { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.pcheck input { accent-color: var(--green); }
.fingerprint-block { background: var(--bg3); border: 0.5px solid var(--border); border-radius: 4px; padding: 10px 12px; }
.fingerprint-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: .1em; color: var(--faint); margin-bottom: 4px; }
.fingerprint-val { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); word-break: break-all; }
.btn-submit { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: .06em; padding: 11px 24px; background: var(--green); color: #fff; border: none; border-radius: 4px; cursor: pointer; align-self: flex-start; }
.btn-submit:hover { opacity: .85; }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; }
.submit-success { background: var(--green-bg); border: 0.5px solid #9FE1CB; border-radius: 4px; padding: 14px 16px; font-size: 13px; color: var(--olive); line-height: 1.6; display: none; }
.submit-success.show { display: block; }
.submit-error { background: var(--red-bg); border: 0.5px solid #F7C1C1; border-radius: 4px; padding: 12px 14px; font-size: 13px; color: var(--red); }

/* ABOUT */
.about-page { padding: 28px; max-width: 620px; }
.about-section { margin-bottom: 28px; }
.about-h { font-family: 'Amiri', serif; font-size: 20px; margin-bottom: 10px; }
.about-body p { font-size: 14px; line-height: 1.8; color: var(--muted); margin-bottom: 10px; }
.protocol-block { background: var(--bg2); border-radius: 6px; padding: 16px 18px; border-left: 3px solid var(--green); font-size: 13px; line-height: 1.7; color: var(--muted); }
.protocol-block strong { color: var(--ink); }

/* ADMIN */
.admin-gate { padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 300px; justify-content: center; }
.admin-gate-box { width: 100%; max-width: 340px; background: var(--bg); border: 0.5px solid var(--border); border-radius: 6px; padding: 24px; text-align: center; }
.admin-gate-title { font-family: 'Amiri', serif; font-size: 20px; margin-bottom: 6px; }
.admin-gate-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.admin-pass-row { display: flex; gap: 8px; }
.admin-pass-row input { flex: 1; }
.btn-unlock { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 9px 16px; background: var(--ink); color: var(--bg); border: none; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.admin-error { font-size: 12px; color: var(--red); margin-top: 6px; font-family: 'IBM Plex Mono', monospace; }
.admin-panel { padding: 28px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-h { font-family: 'Amiri', serif; font-size: 24px; }
.admin-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border-radius: 4px; padding: 12px 16px; flex: 1; min-width: 100px; }
.stat-num { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 500; }
.stat-lbl { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }
.pending-list { display: flex; flex-direction: column; gap: 10px; }
.pending-card { background: var(--bg); border: 0.5px solid var(--border); border-radius: 6px; padding: 16px 18px; }
.pending-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.pending-title { font-family: 'Amiri', serif; font-size: 16px; }
.pending-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); margin-top: 4px; }
.pending-body { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 12px; padding: 10px 12px; background: var(--bg2); border-radius: 4px; }
.pending-actions { display: flex; gap: 8px; }
.btn-approve { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 7px 14px; background: var(--green); color: #fff; border: none; border-radius: 3px; cursor: pointer; }
.btn-reject { font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 7px 14px; background: transparent; color: var(--red); border: 0.5px solid var(--red); border-radius: 3px; cursor: pointer; }
.btn-reject:hover { background: var(--red-bg); }
.pending-fp { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); margin-top: 8px; word-break: break-all; }

@media (max-width: 520px) {
  .tl-perspectives { grid-template-columns: 1fr; }
  .nav, .timeline-container, .admin-panel, .about-page { padding: 14px 16px; }
  .hero { padding: 24px 16px; }
}

/* Admin tabs */
.admin-tab { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .06em; padding: 7px 16px; border: 0.5px solid var(--border); border-radius: 3px; cursor: pointer; background: transparent; color: var(--muted); text-transform: uppercase; transition: all .15s; }
.admin-tab.active, .admin-tab:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Manage entries list */
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0.5px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: var(--bg); flex-wrap: wrap; }
.manage-row:hover { border-color: var(--border2); }
.manage-row-info { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.manage-date { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint); white-space: nowrap; }
.manage-title { font-family: 'Amiri', serif; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-row-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-del { font-family: 'IBM Plex Mono', monospace; font-size: 10px; padding: 5px 10px; border: 0.5px solid var(--red); color: var(--red); background: transparent; border-radius: 3px; cursor: pointer; }
.btn-del:hover { background: var(--red-bg); }

/* Approved testimonies section inside expanded timeline entries */
.approved-testimonies-section { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.testimonies-header { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.approved-testimony-card { background: var(--bg2); border-radius: 4px; padding: 12px 14px; margin-bottom: 8px; border: 0.5px solid var(--border); }
.testimony-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.testimony-author { font-family: 'Amiri', serif; font-size: 14px; color: var(--ink); }
.testimony-date { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); }
.testimony-body { font-size: 13px; line-height: 1.65; color: var(--muted); margin-bottom: 8px; }
.testimony-source { margin-bottom: 6px; }
.testimony-lenses { display: flex; gap: 4px; margin-bottom: 6px; }
.testimony-fp { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); word-break: break-all; }

/* Approved testimonies section inside expanded timeline entries */
.approved-testimonies-section { margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.testimonies-header { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.approved-testimony-card { background: var(--bg2); border-radius: 4px; padding: 12px 14px; margin-bottom: 8px; border: 0.5px solid var(--border); }
.testimony-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.testimony-author { font-family: 'Amiri', serif; font-size: 14px; color: var(--ink); }
.testimony-date { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); }
.testimony-body { font-size: 13px; line-height: 1.65; color: var(--muted); margin-bottom: 8px; }
.testimony-source { margin-bottom: 6px; }
.testimony-lenses { display: flex; gap: 4px; margin-bottom: 6px; }
.testimony-fp { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--faint); word-break: break-all; }
