/* Ortak sayfa duzeni: lichess "page-menu" YERLESIMI (kod/stil kopyalanmadi; renk ve yazi bizim
   style.css degiskenlerimiz). Solda dar alt menu, sagda tek buyuk kutu, kutuda zebra satirlar.
   Bkz. public/js/shell/pageMenu.js. Kullanan sayfalar: /kulupler*, /kulup/*, /topluluklar*. */

:root { --pm-zebra: color-mix(in srgb, var(--card-2) 55%, var(--card)); }

.pm-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0 18px;
  align-items: start;
}

/* --- sol menu --- */
.pm-side { display: flex; flex-direction: column; min-width: 0; }
.pm-switch { display: none; }
.pm-grp { position: relative; display: flex; flex-direction: column; }
.pm-grp + .pm-grp { margin-top: 14px; }
.pm-group {
  margin: 4px 0 4px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.pm-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pm-link:hover { color: var(--accent); background: color-mix(in srgb, var(--card) 55%, transparent); }
.pm-link.active { background: var(--card); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.pm-link:focus-visible, .pm-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- kutu --- */
.pm-box {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.pm-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 24px 28px 18px;
}
.pm-title { margin: 0; font-size: 30px; font-weight: 300; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.pm-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pm-tools input[type="search"] { width: 240px; max-width: 100%; }
.pm-body { padding: 0 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.pm-intro { margin: 0; padding: 0 28px 16px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.pm-intro a { color: var(--accent); font-weight: 600; }
.pm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 34px 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}
.pm-empty p { margin: 0; }
.pm-empty .pm-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pm-empty a.btn-primary-sm, .pm-empty a.ghost-btn { text-decoration: none; display: inline-flex; border-radius: 8px; }

/* --- kutu ici bolumler (ayracli, vurgu renkli baslik) --- */
.pm-h2 { margin: 0 0 10px; font-size: 21px; font-weight: 400; line-height: 1.25; color: var(--accent); }
.pm-sec { border-top: 1px solid var(--border); }
.pm-sec > .pm-h2 { margin: 0; padding: 20px 28px 12px; }
.pm-sec > .pm-rows { border-top: 0; }

/* --- zebra satirlar --- */
.pm-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.pm-row { display: flex; align-items: center; gap: 14px; padding: 12px 28px; min-width: 0; }
.pm-row:nth-child(even) { background: var(--pm-zebra); }
.pm-icon { flex: none; display: inline-flex; color: var(--muted); }
.pm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-name { font-size: 19px; line-height: 1.25; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
a.pm-name:hover { text-decoration: underline; }
.pm-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-info {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.pm-info a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pm-info a:hover { text-decoration: underline; }
.pm-hot { color: var(--accent); font-weight: 700; }
.pm-small { font-size: 12px; }

/* --- telefon / dar ekran: yalniz secili grubun sekmeleri yatay serit; basta grup degistirici --- */
@media (max-width: 800px) {
  .pm-layout { display: block; }
  .pm-side {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .pm-switch {
    display: flex;
    flex: none;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
  }
  .pm-sw {
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }
  .pm-sw.active { background: var(--card); color: var(--accent); }
  .pm-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .pm-grp { display: none; }
  .pm-grp + .pm-grp { margin-top: 0; }
  .pm-grp.current {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pm-grp.current::-webkit-scrollbar { display: none; }
  /* tasan kenarlarda solma: daha fazla sekme oldugunu gosterir */
  .pm-grp.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .pm-grp.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
  .pm-grp.fade-l.fade-r {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  }
  .pm-group { display: none; }
  .pm-link { flex: none; white-space: nowrap; border-radius: 0; padding: 10px 10px; font-size: 14px; }
  .pm-link:hover { background: none; }
  .pm-link.active { background: none; box-shadow: inset 0 -2px 0 var(--accent); }
}
@media (max-width: 520px) {
  .pm-top { padding: 18px 16px 14px; }
  .pm-title { font-size: 25px; }
  .pm-tools, .pm-tools input[type="search"] { width: 100%; }
  .pm-body { padding: 0 16px 20px; }
  .pm-intro { padding: 0 16px 14px; }
  .pm-row { padding: 10px 16px; gap: 10px; }
  .pm-sec > .pm-h2 { padding: 16px 16px 10px; font-size: 19px; }
  .pm-name { font-size: 17px; }
  .pm-row .pm-icon svg { width: 22px; height: 22px; }
}

/* Ayri sayfa ust menusu (shell/siteNav.js): profil menusunde <a> ogeler <button>'larla ayni */
a.profile-menu-item { text-decoration: none; box-sizing: border-box; font-weight: 600; }
.pm-note { font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
span.pm-name { color: var(--text); } /* link olmayan satir adi (ör. basvurular) link rengi almaz */
