@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@600;800&family=Noto+Kufi+Arabic:wght@500;700;800&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap");

/* =========================================================
   منتدى معلمي ستيم الفلسطيني
   Calm linen page, indigo header, the STEAM logo with the flag.
   Tatreez is a light trace only: a small stitch row under titles.
   ========================================================= */

:root {
  --linen: #F5EEDF;
  --linen-2: #ECE2CB;
  --paper: #FBF7EE;
  --indigo: #1E2A5A;
  --indigo-2: #151E45;
  --red: #A3231F;
  --red-2: #8A1C19;
  --gold: #E3A62B;
  --olive: #5C6B2E;
  --ink: #26221A;
  --muted: #5E5747;
  --line: #D8CBAE;

  --f-head: "Noto Kufi Arabic", "IBM Plex Sans Arabic", sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif;
  --f-latin: "Lexend", "IBM Plex Sans Arabic", sans-serif;

  --wrap: 1180px;
  --pad: clamp(16px, 4vw, 40px);
  --gap: clamp(16px, 2.4vw, 28px);
  --sec: clamp(48px, 7vw, 88px);
  --r: 6px;

  /* four small red cross-stitches under every section title */
  --stitch-row: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='12' fill='none' stroke='%23A3231F' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M2 2l8 8M10 2l-8 8M17 2l8 8M25 2l-8 8M32 2l8 8M40 2l-8 8M47 2l8 8M55 2l-8 8'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-head); color: var(--indigo); margin: 0; line-height: 1.45; }
p { margin: 0; }
a { color: var(--red); text-underline-offset: 4px; }
a:hover { color: var(--red-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--r); }

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad) var(--sec); }

/* ---------- Buttons ---------- */
.btn, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 24px;
  border-radius: var(--r); border: 2px solid transparent;
  font: 700 16px/1.2 var(--f-head); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn-primary {
  background: var(--red); color: #fff; border-color: var(--red);
  box-shadow: 0 4px 0 var(--red-2);
}
.btn-primary:hover { background: var(--red-2); color: #fff; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-2); }
.btn-ghost, .btn-secondary { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn-ghost:hover, .btn-secondary:hover { background: var(--indigo); color: var(--linen); }
.btn-light { background: var(--linen); color: var(--indigo); border-color: var(--linen); }
.btn-light:hover { background: var(--gold); border-color: var(--gold); color: var(--indigo-2); }
button[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header: one indigo band, logo in the middle ---------- */
.masthead { background: linear-gradient(180deg, #24326E 0%, var(--indigo) 100%); color: var(--linen); }
.masthead-in {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(14px, 2vw, 22px) var(--pad) clamp(10px, 1.4vw, 16px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
}
.brand {
  justify-self: start; display: grid; gap: 2px; text-decoration: none; color: var(--linen);
  padding-inline-start: 14px; border-inline-start: 3px solid var(--gold);
}
.brand:hover { color: var(--linen); }
.brand-1 { font: 500 15px/1.4 var(--f-head); color: var(--gold); }
.brand-2 { font: 800 clamp(20px, 2.3vw, 28px)/1.25 var(--f-head); }
.mark-link {
  display: block; width: clamp(300px, 34vw, 450px); padding: 4px 22px 0;
  background: radial-gradient(closest-side, rgba(245, 238, 223, .11), transparent);
}
.partner { justify-self: end; display: flex; align-items: center; }
.partner img { display: block; height: clamp(42px, 5vw, 56px); width: auto; max-width: none; flex: none; }

/* ---------- Logo: coloured letters with a white stroke, a 3D shadow, and a waving flag ---------- */
.logo-mark { display: block; width: 100%; height: auto; overflow: visible; }
.lm-word text { font: 800 112px/1 var(--f-latin); text-anchor: middle; paint-order: stroke; stroke-linejoin: round; }
.lm-word .lm-back { stroke-width: 12; }
.lm-word .lm-front { stroke: #fff; stroke-width: 10; }
.lm-art { fill: none; stroke: #F5EEDF; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lm-back-art { opacity: .75; }
.lm-art .lm-chip { fill: #24326E; }
.lm-art .lm-fill-red { fill: #E0392C; }
.lm-art .lm-fill-gold { fill: #F0A81E; }
.lm-pole { fill: #E3D7BC; }
.lm-knob { fill: var(--gold); }
.lm-flag path { stroke: rgba(245, 238, 223, .5); stroke-width: .7; }
.lm-flag { animation: flag-rise 1s cubic-bezier(.2, .7, .2, 1) .2s both; }
@keyframes flag-rise { from { opacity: 0; translate: 0 60px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .lm-flag { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Navigation: pills on the darker strip under the logo ---------- */
.nav { background: var(--indigo-2); border-bottom: 3px solid var(--red); position: sticky; top: 0; z-index: 20; }
.nav-in {
  max-width: var(--wrap); margin: 0 auto; padding: 8px var(--pad);
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
}
.nav-in::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; display: flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 99px; font: 600 16px/1 var(--f-head); color: rgba(245, 238, 223, .82); text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { color: var(--linen); background: rgba(245, 238, 223, .1); }
.nav a[aria-current="page"] { background: var(--linen); color: var(--indigo); }
.nav .nav-admin {
  margin-inline-start: auto; font-size: 14px; font-weight: 500; min-height: 40px; padding: 0 14px;
  border: 1px solid rgba(245, 238, 223, .35); color: rgba(245, 238, 223, .75);
}

/* ---------- Section rhythm ---------- */
.sec { padding-top: var(--sec); }
.sec-head { max-width: 46em; margin-bottom: clamp(22px, 3vw, 34px); }
.sec-head h2, .page-head h1 { font-weight: 800; }
.sec-head h2 { font-size: clamp(25px, 3vw, 36px); }
.sec-head h2::after, .page-head h1::after {
  content: ""; display: block; width: 60px; height: 12px; margin-top: 10px; background: var(--stitch-row) no-repeat;
}
.sec-head p { margin-top: 12px; color: var(--muted); font-size: 18px; }

.page-head { padding: clamp(40px, 6vw, 72px) 0 0; max-width: 46em; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 48px); }
.page-head p { margin-top: 14px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); }
.page-head + .sec, .page-head + .form-card { padding-top: clamp(28px, 4vw, 44px); }
.page-head + .form-card { margin-top: clamp(28px, 4vw, 44px); }

/* ---------- Home: hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px); align-items: center;
  padding-top: clamp(44px, 7vw, 92px);
}
.hero h1 { font-size: clamp(36px, 5.6vw, 66px); font-weight: 800; line-height: 1.3; }
.hero h1 span { display: block; font-size: .58em; font-weight: 600; color: var(--olive); margin-top: 6px; }
.hero .lead { margin-top: 22px; font-size: clamp(17px, 1.7vw, 20px); max-width: 34em; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Ticket (workshops) ---------- */
.ticket {
  display: grid; grid-template-columns: 96px 1fr;
  background: var(--paper); border: 2px solid var(--indigo); border-radius: var(--r);
  box-shadow: 6px 6px 0 var(--indigo);
}
.ticket-stub {
  background: var(--red); color: var(--linen);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 16px 8px; border-inline-end: 3px dashed var(--linen);
  border-start-start-radius: 3px; border-end-start-radius: 3px; text-align: center;
}
.t-day { font: 800 40px/1 var(--f-latin); }
.t-month { font: 600 14px/1.2 var(--f-latin); }
.t-later { font: 700 14px/1.5 var(--f-head); }
.ticket-body { padding: 20px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ticket-body h3 { font-size: 21px; }
.ticket-kicker { font: 700 15px/1.4 var(--f-head); color: var(--red); }
.ticket-date { font: 600 17px/1.4 var(--f-latin); color: var(--indigo); direction: ltr; }
.ticket-place, .ticket-desc { color: var(--muted); }
.ticket-body .btn { margin-top: 8px; }
.ticket-seats { font-weight: 600; color: var(--olive); }
.ticket-closed { font-weight: 700; color: var(--red); background: #F6E1DE; padding: 4px 12px; border-radius: 4px; }
.ticket-big .ticket-body h3 { font-size: clamp(24px, 2.6vw, 32px); }
.ticket-big { grid-template-columns: 112px 1fr; }
.ticket-big .t-day { font-size: 50px; }
.tickets { display: grid; gap: 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* ---------- STEAM from our surroundings ---------- */
.steam-local {
  list-style: none; margin: 0; padding: 0; direction: ltr; /* S on the left, read as S T E A M */
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap);
}
.steam-local li {
  direction: rtl; background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--c);
  border-radius: var(--r); padding: 20px 18px 22px;
}
.sl-letter { display: block; font: 800 46px/1 var(--f-latin); color: var(--c); margin-bottom: 12px; }
.steam-local h3 { font-size: 19px; color: var(--c); }
.steam-local p { margin-top: 6px; font-size: 16px; line-height: 1.75; }

/* ---------- Manifesto band ---------- */
.manifesto {
  margin: var(--sec) calc(50% - 50vw) 0; padding: clamp(36px, 5vw, 56px) var(--pad);
  background: var(--indigo); color: var(--linen);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px clamp(28px, 6vw, 80px);
}
.manifesto p { font: 700 clamp(20px, 2.4vw, 28px)/1.5 var(--f-head); }
.manifesto s { color: rgba(245, 238, 223, .7); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 4px; }
.manifesto strong { color: var(--gold); font-weight: 800; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.about-lead { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.95; }
.about-cards { display: grid; gap: 16px; padding-top: 8px; }
.note { background: var(--paper); border-inline-start: 4px solid var(--olive); padding: 18px 20px; border-radius: var(--r); }
.note h3 { font-size: 18px; color: var(--olive); margin-bottom: 4px; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.card h3 { font-size: 19px; }
.tag { font: 700 13px/1 var(--f-head); padding: 7px 10px; border-radius: 99px; background: var(--linen-2); color: var(--muted); }
.tag-doing { background: #E4E8F5; color: var(--indigo); }
.tag-done { background: #E5EBD6; color: var(--olive); }
.tag-idea { background: #F6E6C4; color: #7A5310; }

.idea .idea-icon { font-size: 30px; line-height: 1; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.facts div { display: flex; gap: 6px; background: var(--linen-2); border-radius: 4px; padding: 4px 10px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--indigo); }
.materials { font-size: 15px; color: var(--muted); }
.soon { background: var(--paper); border: 1.5px dashed var(--olive); border-radius: var(--r); padding: 20px 22px; max-width: 46em; }
.soon strong { font: 700 18px/1.5 var(--f-head); color: var(--olive); }
.soon p { margin-top: 4px; color: var(--muted); }
.soon-top { margin-bottom: var(--gap); }

/* ---------- News ---------- */
.news-list { border-top: 2px solid var(--indigo); }
.news-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 8px 28px;
  padding: 22px 0; border-bottom: 1.5px dashed var(--line);
}
.news-row time { font: 700 17px/1.6 var(--f-latin); color: var(--red); direction: ltr; text-align: right; }
.news-row h3 { font-size: 20px; }
.news-row p { color: var(--ink); margin-top: 4px; }
.more { margin-top: 18px; font-weight: 700; }
.more a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0 28px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-block: 6px; right: 7px; border-right: 3px dashed var(--red); }
.timeline li { position: relative; padding-bottom: 30px; }
.timeline li::before {
  content: ""; position: absolute; right: -27px; top: 8px; width: 14px; height: 14px;
  background: var(--red); transform: rotate(45deg); outline: 3px solid var(--linen);
}
.timeline .when { font: 700 15px/1.6 var(--f-head); color: var(--olive); }
.timeline h3 { font-size: 20px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--paper); border: 2px solid var(--indigo); border-radius: var(--r);
  padding: clamp(20px, 4vw, 40px); max-width: 860px;
}
.form-card > .muted { margin-bottom: 8px; }
fieldset { border: 0; border-top: 1.5px dashed var(--line); margin: 22px 0 0; padding: 22px 0 0; min-width: 0; }
legend { font: 700 18px/1.5 var(--f-head); color: var(--indigo); padding-inline-end: 10px; }
#reg-form fieldset:first-of-type { border-top: 0; padding-top: 8px; }
#reg-form fieldset:first-of-type > .field { display: inline-block; vertical-align: top; width: 100%; }
@media (min-width: 760px) {
  #reg-form fieldset:first-of-type { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  #reg-form fieldset:first-of-type > legend { grid-column: 1 / -1; }
  #reg-form fieldset:first-of-type > .field:has(textarea) { grid-column: 1 / -1; }
}
.field:has(> input.hidden) { display: none; }
.field { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; color: var(--indigo); }
.req { color: var(--red); }
input[type="text"], input[type="tel"], input[type="email"], input[type="url"], input[type="number"],
input[type="password"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: 400 16px/1.5 var(--f-body); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(227, 166, 43, .45); }
input[type="file"] { font: inherit; padding: 10px 0; }
.invalid { border-color: var(--red) !important; }
.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--red); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }
.choice-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.choice {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--indigo); background: #EEF0F7; }
.choice input { width: 20px; height: 20px; accent-color: var(--red); }
.actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
#form-status, #ws-status { font-weight: 600; }
.err { color: var(--red); font-weight: 600; }
.ok { color: var(--olive); font-weight: 700; }
.success { margin-top: 10px; display: grid; gap: 12px; justify-items: start; }
.success h3 { color: var(--olive); }

/* ---------- Dialogs ---------- */
dialog {
  width: min(560px, calc(100% - 24px)); max-height: 92vh; padding: 0; border: 0; border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  box-shadow: 8px 8px 0 var(--indigo), 0 0 0 2px var(--indigo);
}
dialog::backdrop { background: rgba(21, 30, 69, .72); }
.dlg { padding: clamp(22px, 4vw, 34px); display: flex; flex-direction: column; gap: 10px; }
.dlg h3 { font-size: 26px; }
.dlg-date { font: 700 17px/1.4 var(--f-latin); color: var(--red); direction: ltr; text-align: right; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- Footer ---------- */
.footer { background: var(--indigo); color: var(--linen); }
.footer .band { height: 4px; background: var(--red); }
.footer-in {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(32px, 5vw, 52px) var(--pad) 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 22px 40px;
}
.footer-brand { display: grid; gap: 4px; flex: 1 1 260px; }
.footer-brand strong { font: 800 21px/1.4 var(--f-head); }
.footer-brand span { color: var(--gold); }
.footer-links { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 26px; }
.footer-links a { color: var(--linen); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: var(--gold); }
.copy { text-align: center; font-size: 14px; color: #C9CDE0; padding: 14px var(--pad); border-top: 1px dashed rgba(245, 238, 223, .3); }

/* ---------- Tablet ---------- */
@media (max-width: 1020px) {
  .steam-local { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero, .about { grid-template-columns: 1fr; }
  .hero-side { max-width: 520px; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead-in { grid-template-columns: 1fr auto; padding-block: 12px 14px; }
  .mark-link { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(330px, 92vw); padding-top: 6px; }
  .nav a { padding: 0 14px; font-size: 15px; }
  .steam-local { grid-template-columns: 1fr; gap: 12px; }
  .steam-local li { display: grid; grid-template-columns: 44px 1fr; gap: 0 16px; padding: 16px; }
  .sl-letter { grid-row: span 2; font-size: 38px; margin: 2px 0 0; }
  .steam-local p { margin-top: 2px; }
  .news-row { grid-template-columns: 1fr; gap: 4px; }
  .ticket, .ticket-big { grid-template-columns: 84px 1fr; box-shadow: 4px 4px 0 var(--indigo); }
  .ticket-big .t-day, .t-day { font-size: 36px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .manifesto { flex-direction: column; align-items: center; text-align: center; }
  .nav .nav-admin { margin-inline-start: 0; }
}
