/* Shaghayegh Chess: a chessboard where poppies grow.
   Poppy red is the one loud colour; everything else is board greys and ink. */
:root {
  --poppy: #c0202e;
  --poppy-deep: #8e1520;
  --ink: #1c2321;
  --leaf: #355e3b;
  --paper: #ffffff;
  --square: #eef1f0;
  --line: #d9dedc;
  --muted: #5d6762;
  --r: 6px;
  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.75 var(--font); }
img { max-width: 100%; display: block; }
a { color: var(--poppy-deep); }
a:hover { color: var(--poppy); }
:focus-visible { outline: 3px solid var(--poppy); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; white-space: nowrap; }
.brand img { width: 44px; height: 44px; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: var(--r); font-weight: 600; font-size: 15.5px; }
.nav a:hover { background: var(--square); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--poppy-deep); box-shadow: inset 0 -3px 0 var(--poppy); border-radius: 0; }
.lang { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 5px 12px; font: 600 14px var(--font); cursor: pointer; }
.menu { display: none; border: 0; background: none; padding: 8px; cursor: pointer; }
.menu span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; }

/* hero: the club name beside a corner of a board with poppies on it */
.hero { border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; padding: 64px 20px 56px; }
.hero h1 { font-size: clamp(38px, 5.2vw, 66px); line-height: 1.2; margin: 0 0 18px; font-weight: 800; letter-spacing: -0.01em; }
.hero .tagline { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; color: var(--poppy-deep); margin: -4px 0 18px; }
.hero p { max-width: 36em; margin: 0 0 26px; color: var(--muted); font-size: 18px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; text-decoration: none; padding: 10px 20px; border-radius: var(--r); font-weight: 600; font-size: 16px; border: 2px solid var(--ink); color: var(--ink); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.red { background: var(--poppy); border-color: var(--poppy); color: #fff; }
.btn.red:hover { background: var(--poppy-deep); border-color: var(--poppy-deep); }
.board { width: 100%; max-width: 440px; justify-self: center; aspect-ratio: 1; }
.hero-media { width: 100%; }
.photos { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--square); box-shadow: 10px 10px 0 var(--poppy); }
[dir="rtl"] .photos { box-shadow: -10px 10px 0 var(--poppy); }
.photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.photos img.on { opacity: 1; }
.dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.dots button { width: 12px; height: 12px; border-radius: 0; border: 2px solid var(--ink); background: var(--paper); padding: 0; cursor: pointer; }
.dots button[aria-pressed="true"] { background: var(--ink); }
.board svg { width: 100%; height: 100%; display: block; }

/* sections */
.sec { padding: 52px 0; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.sec h2 { font-size: 28px; line-height: 1.3; margin: 0; font-weight: 800; }
.sec h2::before { content: ""; display: inline-block; width: 0.6em; height: 0.6em; background: var(--poppy); margin-inline-end: 0.45em; vertical-align: 0.05em; }
.more { font-weight: 600; font-size: 15px; text-decoration: none; }
.empty { color: var(--muted); background: var(--square); padding: 18px 20px; border-radius: var(--r); margin: 0; }
.page-title { font-size: clamp(32px, 5vw, 48px); margin: 40px 0 8px; font-weight: 800; line-height: 1.2; }

/* news */
.news-list { display: grid; gap: 0; }
.news-item { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.news-item:first-child { padding-top: 0; }
.news-item:hover h3 { color: var(--poppy-deep); }
.news-item .ph { aspect-ratio: 4 / 3; background: var(--square); border-radius: var(--r); overflow: hidden; }
.news-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.news-item.no-img { grid-template-columns: 1fr; }
.news-item h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
.date { color: var(--muted); font-size: 14px; }
.news-item p { margin: 6px 0 0; color: var(--muted); }
.article { max-width: 720px; margin: 0 auto; padding-bottom: 56px; }
.article .lead-img { border-radius: var(--r); margin: 22px 0; }
.article p { margin: 0 0 1.1em; }
.back { display: inline-block; margin-top: 28px; font-weight: 600; text-decoration: none; }

/* gallery */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile { border: 0; padding: 0; background: var(--square); cursor: zoom-in; border-radius: var(--r); overflow: hidden; aspect-ratio: 1; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.viewer { position: fixed; inset: 0; background: rgba(20, 24, 23, 0.94); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 20px; }
.viewer[hidden] { display: none; }
.viewer figure { margin: 0; max-width: 100%; max-height: 100%; }
.viewer img { max-height: 82vh; margin: 0 auto; border-radius: 4px; }
.viewer figcaption { color: #e9ecea; text-align: center; margin-top: 10px; }
.viewer-close { position: absolute; top: 14px; inset-inline-end: 14px; background: #fff; border: 0; border-radius: var(--r); padding: 6px 14px; font: 600 15px var(--font); cursor: pointer; }

/* players */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.person { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--square); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); font-size: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person strong { display: block; font-size: 17px; line-height: 1.4; }
.person .ttl { color: var(--poppy-deep); font-weight: 800; margin-inline-end: 4px; }
.person small { color: var(--muted); font-size: 14px; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* tournaments */
.tlist { border-top: 1px solid var(--line); }
.trow { display: grid; grid-template-columns: 9em 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.trow strong { font-size: 18px; }
.trow .place { color: var(--muted); font-size: 14px; display: block; }

/* about */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; padding-bottom: 56px; }
.about p { margin: 0 0 1.1em; max-width: 38em; }
.facts { border-top: 3px solid var(--ink); }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts span { display: block; color: var(--muted); font-size: 14px; }

.foot { border-top: 1px solid var(--line); background: var(--square); margin-top: 40px; padding: 28px 0; font-size: 15px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.foot a { color: var(--ink); }
.foot .admin { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .board { max-width: 300px; order: -1; justify-self: start; }
  .hero-media { order: -1; }
  .photos { box-shadow: none; }
  [dir="rtl"] .photos { box-shadow: none; }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .menu { display: block; }
  .nav { display: none; position: absolute; top: 68px; inset-inline: 0; background: var(--paper); flex-direction: column; padding: 8px 20px 16px; border-bottom: 1px solid var(--line); margin: 0; }
  .nav.open { display: flex; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--poppy); }
  .top-in { gap: 10px; }
  .brand { white-space: normal; font-size: 15px; line-height: 1.35; min-width: 0; flex: 1; }
  .brand img { width: 38px; height: 38px; flex: none; }
  .lang { margin-inline-start: auto; flex: none; }
  .menu { flex: none; }
  .news-item { grid-template-columns: 1fr; gap: 12px; }
  .trow { grid-template-columns: 1fr; gap: 4px; }
  .sec { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { .photos img { transition: none; } }
@media (prefers-reduced-motion: no-preference) {
  .board .poppy { transform-origin: center; transform-box: fill-box; animation: bloom 0.9s cubic-bezier(.2, .8, .2, 1) both; }
  .board .poppy:nth-of-type(2) { animation-delay: 0.15s; }
  .board .poppy:nth-of-type(3) { animation-delay: 0.3s; }
  @keyframes bloom { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}
