/* ==========================================================================
   SPOT Residents — styles
   --------------------------------------------------------------------------
   TO MATCH SPOT BRANDING: edit ONLY the variables in the :root block below.
   The colours here are a warm, high-contrast starting palette inspired by
   spotamsterdam.nl. Swap --brand and --accent for the official SPOT colours
   and everything else follows automatically.
   ========================================================================== */

:root {
  /* --- Brand colours — CHANGE THESE to match SPOT ------------------------ */
  --brand: #e0472d;          /* primary brand colour (warm red/orange)       */
  --brand-dark: #b8351e;     /* darker brand, for hovers/active              */
  --accent: #1f6f78;         /* secondary accent (teal)                      */
  --accent-dark: #164e55;

  /* --- Neutrals / surface ------------------------------------------------ */
  --bg: #fbf7f2;             /* page background (warm off-white)             */
  --surface: #ffffff;        /* cards, form fields                          */
  --ink: #1c1a17;            /* main text (high contrast on --bg)           */
  --ink-soft: #55504a;       /* secondary text                              */
  --line: #e6ddd2;           /* borders / dividers                          */
  --focus: #0b57d0;          /* focus ring (accessible blue)                */

  /* --- Feedback colours -------------------------------------------------- */
  --ok-bg: #e7f6ec; --ok-ink: #12592c;
  --warn-bg: #fdf1dd; --warn-ink: #7a4c05;
  --err-bg: #fde7e4; --err-ink: #8f2314;

  /* --- Sizing ------------------------------------------------------------ */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --radius: 14px;
  --touch: 48px;             /* minimum touch target                        */
  --maxw: 760px;
}

/* Arabic font stack */
html[lang="ar"], .lang-ar { font-family: var(--font-ar); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;              /* large base font */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

a { color: var(--accent-dark); }
a:hover { color: var(--brand-dark); }

/* Focus visibility — WCAG */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ------------------------------- Header ---------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--brand);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  background: var(--brand); color: #fff; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 8px; font-size: 18px;
}
.brand-text { font-weight: 700; font-size: 18px; }

/* Language switcher */
.lang-switcher { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--line); text-decoration: none; color: var(--ink);
  font-size: 16px; background: var(--surface);
}
.lang-link:hover { border-color: var(--brand); }
.lang-link.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* -------------------------------- Main ----------------------------------- */
main { padding: 22px 18px 60px; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0.2em 0 0.5em; }
h2 { font-size: 1.4rem; margin: 1.4em 0 0.4em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 0.3em; }
p { margin: 0.6em 0; }
ul { margin: 0.6em 0; padding-inline-start: 1.4em; }
li { margin: 0.35em 0; }

.lede { font-size: 1.15rem; color: var(--ink-soft); }
.home-intro { text-align: center; margin: 10px 0 26px; }

/* Home cards */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--ink);
  min-height: 140px; transition: transform .08s ease, border-color .08s ease;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card-icon { font-size: 2.4rem; line-height: 1; }
.card-title { font-size: 1.3rem; font-weight: 700; }
.card-desc { color: var(--ink-soft); }

/* Content */
.content { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* Notices */
.notice { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 1rem; }
.notice-pending { background: var(--warn-bg); color: var(--warn-ink); }
.notice-override { background: var(--warn-bg); color: var(--warn-ink); }
.notice-success { background: var(--ok-bg); color: var(--ok-ink); }
.notice-error { background: var(--err-bg); color: var(--err-ink); }

/* --------------------------------- Forms --------------------------------- */
.form-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 18px; }
.form-intro { color: var(--ink-soft); }
.field { display: block; margin: 16px 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: var(--touch); font-size: 1.05rem; font-family: inherit;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 140px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch); padding: 12px 20px; border-radius: 10px;
  border: 2px solid var(--brand); background: var(--brand); color: #fff;
  font-size: 1.05rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-big { width: 100%; font-size: 1.15rem; margin-top: 8px; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: 0.95rem; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg); color: var(--ink); border-color: var(--brand); }
.btn-danger { background: var(--surface); color: var(--err-ink); border-color: var(--err-ink); }
.btn-danger:hover { background: var(--err-bg); color: var(--err-ink); }
.inline { display: inline; }

/* Login */
.login-section, .admin { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

/* -------------------------------- Footer --------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 40px; margin-top: 30px; }
.cookie-note { color: var(--ink-soft); font-size: 0.92rem; }
.footer-edit { font-size: 0.92rem; color: var(--ink-soft); }
.edit-link { display: inline-block; margin-inline-start: 8px; font-weight: 600; }

/* -------------------------------- Admin ---------------------------------- */
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 8px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.98rem; }
.admin-table th, .admin-table td { text-align: start; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: var(--bg); }
.col-msg { min-width: 220px; white-space: pre-wrap; }
.row-handled { opacity: 0.55; }
.col-actions { white-space: nowrap; }
.col-actions form { margin: 2px 0; }
.empty { text-align: center; color: var(--ink-soft); padding: 26px; }

/* ------------------------------ Editor UI -------------------------------- */
.editing #blocks [contenteditable] { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 6px; padding: 4px 6px; }
.edit-toolbar {
  position: sticky; top: 62px; z-index: 15; display: flex; flex-wrap: wrap; gap: 8px;
  background: var(--accent); padding: 10px; border-radius: 10px; margin: 10px 0 16px;
}
.edit-toolbar .btn { background: var(--surface); color: var(--ink); border-color: var(--surface); min-height: 42px; }
.edit-toolbar .btn:hover { background: var(--bg); }
.block-wrap { position: relative; border: 1px solid transparent; border-radius: 8px; padding: 4px; margin: 6px 0; }
.editing .block-wrap { border-color: var(--line); }
.block-tools { display: flex; gap: 6px; margin-top: 6px; }
.edit-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  background: var(--ink); color: #fff; padding: 12px 16px;
  display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.edit-bar .btn-primary { background: var(--brand); border-color: var(--brand); }
.edit-bar .btn-cancel { background: transparent; color: #fff; border-color: #fff; }
.edit-bar .status { flex: 1 1 100%; text-align: center; font-size: 0.95rem; }
body.editing { padding-bottom: 120px; }

/* RTL: layout mirrors automatically via logical properties, but fix a few. */
html[dir="rtl"] .lang-switcher { direction: rtl; }
html[dir="rtl"] .brand-mark { letter-spacing: 0; }

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