/* איגוד שחקני הלוח הישראלי - the old site's warm olive and cream, made light and modern */
:root {
  /* the logo's colours */
  --c-terracotta: #c0562b;
  --c-mustard: #e0a63a;
  --c-teal: #3f7a6e;
  --c-olive: #59552f;

  --olive-950: #1f1d10;
  --olive-900: #2b2817;
  --olive-800: #3a3721;
  --olive-700: #4b4729;
  --olive-600: #59552f;
  --olive-500: #736d4a;
  --olive-300: #c9c09a;

  --bg: #f7f2e6;           /* warm paper */
  --surface: #fffdf8;      /* cards */
  --surface-2: #f3ecda;    /* chips, table heads */
  --line: #e6dcc3;
  --text: #2a2716;
  --muted: #625c43;
  --link: #9a4318;
  --accent: #b24e24;       /* headings inside texts (the old site's orange, darker for contrast) */

  /* names used by admin.css */
  --parchment: var(--surface);
  --cream: var(--surface-2);
  --orange: var(--accent);
  --orange-bright: var(--c-mustard);

  --radius: 16px;
  --shadow: 0 1px 2px rgba(43,40,23,.06), 0 6px 20px rgba(43,40,23,.07);
  --shadow-lg: 0 2px 6px rgba(43,40,23,.08), 0 18px 44px rgba(43,40,23,.13);
  --wrap: 1200px;
  --font: "Heebo", "Segoe UI", Arial, sans-serif;
  --display: "Rubik", "Heebo", "Segoe UI", Arial, sans-serif;
}
@media (min-width: 1700px) { :root { --wrap: 1360px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
body:not(.admin) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:not(.admin) > * { flex-shrink: 0; }
body:not(.admin) > .site-footer { margin-top: auto; }

img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--olive-900); }
:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: -9999px; top: 0; background: #000; color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { inset-inline-start: 8px; top: 8px; }
.muted { color: var(--muted); }

/* ---------- Header: logo and menu in one row ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,253,248,.94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 80px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--olive-900); text-decoration: none; flex: 0 0 auto; }
.brand:hover { color: var(--olive-900); }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -.01em; }
.brand-sub { font-size: 13.5px; color: var(--muted); }

.menu-toggle {
  display: none; margin-inline-start: auto;
  background: transparent; border: 0; padding: 10px; border-radius: 10px; cursor: pointer; color: var(--olive-900);
}
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 28px; height: 28px; display: block; }

.main-nav { margin-inline-start: auto; }
.menu, .menu ul { list-style: none; margin: 0; padding: 0; }
.menu { display: flex; align-items: center; gap: 2px; }
.menu > li { position: relative; display: flex; align-items: center; }
.menu a, .menu .menu-label {
  display: block; padding: 10px 14px; border-radius: 10px;
  font-family: var(--display); font-weight: 500; font-size: 16.5px;
  color: var(--olive-800); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.menu a:hover, .menu .menu-label:hover, .has-sub.open > .menu-label { background: var(--surface-2); color: var(--olive-950); }
.menu a[aria-current="page"] { color: var(--accent); }
.menu > .has-sub > a, .menu > .has-sub > .menu-label { padding-inline-end: 4px; }
.menu-cta { margin-inline-start: 10px; }
.menu .menu-contact { background: var(--olive-800); color: #fff; padding: 9px 20px; border-radius: 999px; }
.menu .menu-contact:hover { background: var(--olive-950); color: #fff; }

.sub-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; margin-inline-end: 4px;
  background: transparent; border: 0; border-radius: 6px; cursor: pointer; color: var(--olive-500);
}
.sub-toggle svg { width: 13px; height: 13px; transition: transform .15s; }
.sub-toggle:hover { background: var(--surface-2); color: var(--olive-900); }
.has-sub.open > .sub-toggle svg { transform: rotate(180deg); }

.menu .sub {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 40;
  min-width: 240px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
/* a bridge over the gap, so the pointer can reach the list */
.menu > .has-sub > .sub::before { content: ""; position: absolute; inset: -10px 0 auto 0; height: 10px; }
.menu .sub li { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.menu .sub a, .menu .sub .menu-label { flex: 1; padding: 8px 12px; font-family: var(--font); font-weight: 500; font-size: 15.5px; white-space: normal; border-radius: 8px; }
/* a third level opens inside the same panel (a side panel could leave the screen) */
.menu .sub .sub {
  position: static; transform: none; flex-basis: 100%; min-width: 0; padding: 0 0 4px;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
.menu .sub .sub a { padding-inline-start: 26px; font-size: 15px; }
/* keyboard: the button beside the item opens it (disclosure pattern); mouse: hover on the top level */
@media (hover: hover) and (min-width: 981px) { .menu > .has-sub:hover > .sub { display: block; } }
.has-sub.open > .sub { display: block; }

/* ---------- Home: opening ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before {
  /* the logo's shapes, very large and faint, at the far side */
  content: ""; position: absolute; inset-inline-end: -90px; top: 50%; width: 520px; height: 520px; transform: translateY(-42%) rotate(-8deg);
  background: url("/img/favicon.svg") center / contain no-repeat; opacity: .13; pointer-events: none;
}
.hero-inner { position: relative; padding-top: 76px; padding-bottom: 56px; }
.eyebrow { margin: 0 0 10px; font-family: var(--display); font-weight: 600; font-size: 16px; color: #33665b; letter-spacing: .01em; }
.hero h1 {
  margin: 0; max-width: 980px; text-wrap: balance;
  font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.08; letter-spacing: -.02em; color: var(--olive-950);
}
.hero-lead { margin: 18px 0 0; max-width: 620px; font-size: 19px; line-height: 1.7; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* the menu's sections as cards */
.explore { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.explore-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px 20px;
  /* the icon and the title in one row, the links under both */
  display: grid; grid-template-columns: auto 1fr; align-items: center; align-content: start; column-gap: 12px;
}
.explore-icon { display: block; width: 26px; height: 26px; background: var(--c-terracotta); border-radius: 50%; }
.explore-card:nth-child(4n+2) .explore-icon { background: var(--c-mustard); border-radius: 8px; }
.explore-card:nth-child(4n+3) .explore-icon { background: var(--c-teal); border-radius: 0; clip-path: polygon(50% 4%, 100% 96%, 0 96%); }
.explore-card:nth-child(4n+4) .explore-icon { background: var(--c-olive); border-radius: 0 100% 0 0; }
.explore-card h2 { margin: 0; line-height: 1.3; font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--olive-950); }
/* the links as plain text with a small dot between them. Every link has a dot before it; the list is pulled
   out by one dot's width and clipped there, so the dot that starts a line is never seen */
.explore-card ul {
  grid-column: 1 / -1; list-style: none; margin: 12px 0 0; margin-inline-start: -29px; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px;
  clip-path: inset(-6px 29px -6px 0); /* the site is right to left: the start side is the right */
}
.explore-card li { display: inline-flex; align-items: center; }
.explore-card li::before {
  content: ""; width: 5px; height: 5px; margin: 0 12px; border-radius: 50%; background: var(--olive-300); flex: 0 0 auto;
}
.explore-card a { font-size: 16px; font-weight: 500; text-decoration: none; color: var(--olive-800); line-height: 1.6; }
.explore-card a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Inner pages: title ---------- */
.page-head { padding-top: 40px; padding-bottom: 6px; }
.page-title {
  margin: 6px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1.15; letter-spacing: -.015em; color: var(--olive-950); text-wrap: balance;
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-inline-end: 4px; color: var(--olive-300); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--olive-900); text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 300px; padding-top: 28px; padding-bottom: 72px; align-items: start; }
.explore + .layout, .wrap:has(> .explore) + .layout { padding-top: 28px; }
.layout.layout-single { grid-template-columns: minmax(0, 1fr); }
.content {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 48px 44px; min-width: 0;
}
.layout-single .content { max-width: 980px; }
.content > :first-child { margin-top: 0; }

/* text from the editor (and from the old site) */
.rich > :first-child { margin-top: 0; }
.rich h2, .rich h3, .rich h4 { font-family: var(--display); color: var(--olive-950); line-height: 1.3; margin: 1.5em 0 .5em; letter-spacing: -.01em; }
.rich h2 { font-size: 27px; font-weight: 700; }
.rich h3 { font-size: 22px; font-weight: 600; color: var(--accent); }
.rich h4 { font-size: 19px; font-weight: 600; }
.rich p, .rich div { margin: 0 0 .8em; }
.rich ul, .rich ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
.rich li { margin: .3em 0; }
.rich ul li::marker { color: var(--c-terracotta); }
.rich hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.rich a { overflow-wrap: anywhere; }
.rich img { border-radius: 10px; }
.rich img.img-right, .rich img.photo { float: right; margin: .3em 0 1em 1.6em; max-width: 45%; }
.rich img.img-left { float: left; margin: .3em 1.6em 1em 0; max-width: 45%; }
.rich::after { content: ""; display: table; clear: both; }
.rich table { border-collapse: collapse; margin: 0 0 1.4em; max-width: 100%; font-size: 16px; }
.rich td, .rich th { padding: 8px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.rich th { background: var(--surface-2); text-align: start; font-weight: 600; }
.rich iframe { display: block; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; margin: 0 0 1.2em; background: #000; }
/* file links (rules, summaries, teaching guides) get a small file-type tag */
.rich a[href$=".pdf" i]::after, .rich a[href$=".doc" i]::after, .rich a[href$=".docx" i]::after,
.rich a[href$=".zip" i]::after, .rich a[href$=".ppt" i]::after, .rich a[href$=".pptx" i]::after,
.rich a[href$=".xls" i]::after, .rich a[href$=".xlsx" i]::after {
  display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; color: #fff; background: var(--olive-500);
}
.rich a[href$=".pdf" i]::after { content: "PDF"; background: #b3261e; }
.rich a[href$=".doc" i]::after, .rich a[href$=".docx" i]::after { content: "Word"; background: #1f5fae; }
.rich a[href$=".zip" i]::after { content: "ZIP"; }
.rich a[href$=".ppt" i]::after, .rich a[href$=".pptx" i]::after { content: "PPT"; background: #b8560a; }
.rich a[href$=".xls" i]::after, .rich a[href$=".xlsx" i]::after { content: "Excel"; background: #1d6b3a; }

.sub-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sub-pages a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-radius: 12px; text-decoration: none; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--olive-900);
}
.sub-pages a::after { content: "←"; color: var(--olive-300); transition: transform .15s; }
.sub-pages a:hover { border-color: var(--olive-500); box-shadow: var(--shadow); }
.sub-pages a:hover::after { color: var(--accent); transform: translateX(-3px); }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 104px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-card > h2 { margin: 0; padding: 18px 22px 6px; font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--olive-950); }
.side-empty { margin: 0; padding: 8px 22px 18px; color: var(--muted); }
.news-list { list-style: none; margin: 0; padding: 0 22px 12px; }
.news-list li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.news-list li:last-child { border-bottom: 0; }
.news-list time { display: inline-block; margin-bottom: 4px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--olive-800); background: var(--surface-2); }
.news-list strong { display: block; font-weight: 600; }
.news-list p { margin: 4px 0 0; white-space: pre-line; color: var(--muted); }
.section-nav ul { list-style: none; margin: 0; padding: 6px 10px 12px; }
.section-nav ul ul { padding: 0 0 2px; }
.section-nav a, .section-nav span { display: block; padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--olive-800); font-weight: 500; font-size: 15.5px; line-height: 1.5; }
.section-nav ul ul a, .section-nav ul ul span { padding-inline-start: 26px; font-size: 15px; }
.section-nav a:hover { background: var(--surface-2); color: var(--olive-950); }
.section-nav a[aria-current="page"] { background: var(--surface-2); color: var(--olive-950); font-weight: 600; box-shadow: inset -3px 0 0 var(--c-terracotta); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 44px; align-items: start; }
.form { display: grid; gap: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.form h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--olive-950); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  padding: 11px 14px; border: 1px solid #d3c8a8; border-radius: 10px; background: #fff;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--olive-600); outline: 3px solid rgba(89,85,47,.18); }
.field .ltr, input.ltr { direction: ltr; text-align: right; }
.field-hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-family: var(--display); font-weight: 600; font-size: 16.5px; line-height: 1.2;
  padding: 13px 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--olive-800); color: #fff; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--olive-950); color: #fff; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.btn-outline { background: transparent; color: var(--olive-900); box-shadow: inset 0 0 0 1.5px var(--olive-500); }
.btn.btn-outline:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--olive-900); color: var(--olive-950); }
.btn.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn.btn-secondary:hover { background: #e9dfc4; color: var(--text); }
.alert { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.alert-ok { background: #e6f2e3; color: #1f5a21; border: 1px solid #bfdcb8; }
.alert-err { background: #fdecea; color: #8e1c12; border: 1px solid #f1c3bd; }
.form-note { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--olive-900); color: #d9d1b3; font-size: 15px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-top: 52px; padding-bottom: 36px; }
.site-footer .brand { color: #fff8e4; }
.site-footer .brand-sub { color: #bdb48f; }
.footer-brand p { margin: 16px 0 0; max-width: 380px; color: #c9c09d; line-height: 1.7; }
.site-footer h2 { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 15px; color: #fff8e4; letter-spacing: .02em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #e7dfc2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 18px; padding-bottom: 22px; border-top: 1px solid #45412a; font-size: 14px; color: #b3aa86;
}
.credit { display: inline-flex; align-items: center; gap: 8px; }
.credit-logo { display: inline-flex; padding: 2px 0; }
.credit-logo img { display: block; width: 125px; height: 12px; }

.admin-chip {
  position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 50;
  background: var(--olive-950); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.admin-chip:hover { background: var(--accent); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .brand-sub { display: none; }
}

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .header-inner { min-height: 68px; gap: 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 18px; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    max-height: calc(100dvh - 68px); overflow-y: auto;
  }
  .main-nav.open { display: block; }
  .menu { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 18px; }
  .menu li { flex-wrap: wrap; }
  .menu > li { border-bottom: 1px solid var(--line); }
  .menu a, .menu .menu-label { flex: 1; padding: 13px 8px; white-space: normal; border-radius: 8px; }
  .menu > .has-sub > a, .menu > .has-sub > .menu-label { padding-inline-end: 8px; }
  .sub-toggle { width: 44px; height: 44px; margin: 0; }
  .menu .sub, .menu .sub .sub {
    position: static; transform: none; flex-basis: 100%; min-width: 0; padding: 0 0 8px;
    border: 0; border-radius: 0; box-shadow: none; background: transparent;
  }
  .menu > .has-sub > .sub::before { display: none; }
  .menu .sub a, .menu .sub .menu-label { padding-inline-start: 24px; }
  .menu .sub .sub a, .menu .sub .sub .menu-label { padding-inline-start: 40px; }
  .menu-cta { margin: 14px 0 0; border-bottom: 0 !important; }
  .menu .menu-contact { text-align: center; padding: 12px 20px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .brand-name { font-size: 16.5px; }
  .hero::before { width: 300px; height: 300px; inset-inline-end: -110px; top: 30%; }
  .hero-inner { padding-top: 44px; padding-bottom: 36px; }
  .hero-lead { font-size: 17px; }
  .explore { gap: 14px; }
  .explore-card { padding: 18px 18px 16px; }
  .page-head { padding-top: 26px; }
  .content { padding: 24px 18px 28px; border-radius: 14px; }
  .rich img.img-right, .rich img.img-left, .rich img.photo { float: none; display: block; margin: 0 auto 1em; max-width: 100%; }
  .rich table { display: block; overflow-x: auto; }
  .field-row { grid-template-columns: 1fr; }
  .form { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
}

@media print {
  .site-header, .sidebar, .site-footer, .admin-chip, .crumbs { display: none !important; }
  .content { box-shadow: none; border: 0; padding: 0; }
  .layout { display: block; }
}
