/*
Theme Name: SL Cricket Rankings
Theme URI: https://example.com/sl-cricket-rankings
Author: Newgen Platform
Description: A public rankings site for the Sri Lankan cricket player rating system. Visitors get the leaderboards, the specialist boards, a player page and the methodology — and nothing else. Every update to the data happens in wp-admin, behind a WordPress capability. The full equal-point, context-adjusted rating engine ships inside the theme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: slcr
Tags: custom-colors, custom-menu, translation-ready, full-width-template
*/

/* ============================================================================
   Sri Lankan Cricket Player Rankings — stylesheet

   Hand-written rather than generated: the original's Tailwind build step has no
   place in a plain-PHP app that is meant to be dropped onto a host and run. The
   palette, spacing and component shapes are carried over unchanged, so the pages
   look the same; they are just expressed as classes instead of utility strings.
   ========================================================================= */

:root {
  color-scheme: dark;

  /* Sri Lanka cricket palette */
  --lion-100: #f8ecca;
  --lion-200: #f0d792;
  --lion-300: #e8bd58;
  --lion-400: #e2a634;
  --lion-500: #d9881c;
  --lion-600: #c06716;

  --maroon-500: #8d153a;

  --ink-50: #f6f7f9;
  --ink-100: #eceef2;
  --ink-200: #d5dae2;
  --ink-300: #b0b9c8;
  --ink-400: #8593a8;
  --ink-500: #66758d;
  --ink-600: #515d74;
  --ink-700: #434c5e;
  --ink-800: #3a4150;
  --ink-900: #181b22;
  --ink-950: #0f1116;

  --emerald: #34d399;
  --amber: #f59e0b;
  --rose: #fda4af;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The UA rule for [hidden] is display:none, but any author rule that sets
   display — .grid, .tabs, .toggle — outranks it. The script toggles `hidden` to
   show and hide panels, so it has to win. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-950);
  color: var(--ink-100);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ------------------------------------------------------------------ layout */

.shell {
  margin: 0 auto;
  max-width: 80rem;
  padding: 0 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--ink-800);
  background: rgba(15, 17, 22, 0.85);
  backdrop-filter: blur(8px);
}

.site-header .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--lion-500);
  color: var(--ink-950);
  font-size: 1rem;
  font-weight: 900;
}

.brand-text {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.brand-text small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-400);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.site-nav a {
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  color: var(--ink-300);
  transition: background-color 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--ink-800);
  color: var(--ink-50);
}

.site-nav a[aria-current="page"] {
  color: var(--lion-300);
}

main.shell {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--ink-800);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-500);
}

/* ---------------------------------------------------------------- utilities */

.stack > * + * { margin-top: 1.25rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.stack-lg > * + * { margin-top: 2rem; }

.page-intro h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-intro p {
  margin-top: 0.25rem;
  max-width: 42rem;
  font-size: 0.875rem;
  color: var(--ink-400);
}

.muted { color: var(--ink-400); }
.small { font-size: 0.75rem; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.accent { color: var(--lion-300); font-weight: 600; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* -------------------------------------------------------------- components */

.card {
  border: 1px solid var(--ink-800);
  border-radius: 0.75rem;
  background: rgba(24, 27, 34, 0.6);
}

.card-pad { padding: 1.25rem; }

.card h2 {
  font-size: 0.875rem;
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  border: 1px solid var(--ink-800);
  border-radius: 0.75rem;
  background: rgba(24, 27, 34, 0.6);
  padding: 0.25rem;
}

.tab {
  border: 0;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  color: var(--ink-300);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab:hover { background: var(--ink-800); color: var(--ink-50); }

.tab[aria-selected="true"] {
  background: var(--lion-500);
  color: var(--ink-950);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-400);
  cursor: pointer;
}

.check input { accent-color: var(--lion-500); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--ink-400);
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ink-600);
}

.live[data-live="true"] .live-dot { background: var(--emerald); }

/* tables */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  border-bottom: 1px solid var(--ink-800);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid rgba(58, 65, 80, 0.6);
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover { background: rgba(58, 65, 80, 0.4); }

tbody tr.flash { background: rgba(217, 136, 28, 0.12); }

td a:hover, td a:focus-visible { color: var(--lion-300); }

.col-rank { width: 3.5rem; }
.col-bar { width: 12rem; }
.col-num { width: 6rem; }

@media (max-width: 640px) {
  .hide-sm { display: none; }
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  background: var(--ink-800);
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  vertical-align: middle;
}

.empty {
  padding: 3rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-400);
}

/* meters */

.meter {
  height: 0.375rem;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink-800);
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, var(--lion-600), var(--lion-300));
}

.criterion + .criterion { margin-top: 0.75rem; }

.criterion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.criterion-head span:first-child { font-size: 0.75rem; color: var(--ink-300); }
.criterion-head span:last-child { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-100); }
.criterion-head .of { color: var(--ink-500); }

.criterion .meter > span { background: var(--lion-400); }
.criterion[data-tone="high"] .meter > span { background: var(--emerald); }
.criterion[data-tone="mid"] .meter > span { background: var(--lion-400); }
.criterion[data-tone="low"] .meter > span { background: var(--amber); }
.criterion[data-tone="poor"] .meter > span { background: var(--maroon-500); }

/* definition lists and ordered lists */

.deflist > div {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.deflist dt { width: 7rem; flex: none; font-weight: 500; color: var(--ink-100); }
.deflist dd { margin: 0; color: var(--ink-400); }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--ink-300);
}

.steps li { display: flex; gap: 0.75rem; }
.steps li + li { margin-top: 0.5rem; }

.step-number {
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--ink-800);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--ink-300);
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--ink-300);
}

.rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.rows li + li { margin-top: 0.25rem; }

.board-list { counter-reset: board; }
.board-list li + li { margin-top: 0.375rem; }

.board-rank {
  display: inline-block;
  width: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-500);
}

/* forms */

.label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
}

.field {
  width: 100%;
  border: 1px solid var(--ink-700);
  border-radius: 0.5rem;
  background: var(--ink-900);
  padding: 0.5rem 0.75rem;
  color: var(--ink-50);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus {
  border-color: var(--lion-400);
  box-shadow: 0 0 0 1px var(--lion-400);
}

.field:disabled { opacity: 0.5; }

.hint {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--ink-500);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--ink-200);
  cursor: pointer;
}

.toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--lion-500);
}

.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.slider-head span:first-child { font-size: 0.75rem; font-weight: 500; color: var(--ink-300); }
.slider-head output { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-400); }

.slider input[type="range"] {
  width: 100%;
  accent-color: var(--lion-500);
}

.slider-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--ink-500);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary { background: var(--lion-500); color: var(--ink-950); }
.btn-primary:hover:not(:disabled) { background: var(--lion-400); }

.btn-ghost {
  border: 1px solid var(--ink-700);
  background: transparent;
  color: var(--ink-200);
}

.btn-ghost:hover:not(:disabled) { background: var(--ink-800); }

.banner {
  border: 1px solid;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.banner-ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}

.banner-error {
  border-color: rgba(141, 21, 58, 0.5);
  background: rgba(141, 21, 58, 0.12);
  color: var(--rose);
}

.back-link {
  font-size: 0.75rem;
  color: var(--ink-400);
}

.back-link:hover { color: var(--lion-300); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card > h2.section-title {
  border-bottom: 1px solid var(--ink-800);
  padding: 0.75rem 1.25rem;
}

.fieldset-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.fieldset-note {
  font-size: 0.75rem;
  color: var(--ink-500);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.noscript {
  border: 1px solid rgba(217, 136, 28, 0.4);
  border-radius: 0.5rem;
  background: rgba(217, 136, 28, 0.08);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--lion-200);
}

/* ============================================================================
   WordPress integration

   Everything above is the rankings design carried over unchanged. What follows
   is only what WordPress itself needs: the admin bar's fixed strip, the markup
   classes core emits into post content, and a readable default for the ordinary
   pages and posts a site will still have alongside the boards.
   ========================================================================= */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100000;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--lion-500);
  color: var(--ink-950);
  font-weight: 600;
  clip: auto;
  width: auto;
  height: auto;
}

.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* The one link a visitor never sees: it is printed only for a signed-in editor. */
.site-nav .nav-admin {
  color: var(--lion-300);
}

.site-nav .nav-admin::before {
  content: "✎";
  margin-right: 0.3rem;
  font-size: 0.85em;
}

/* --------------------------------------------------------- posts and pages */

.entry {
  max-width: 44rem;
  margin: 0 auto;
}

.entry-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.entry-meta {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--ink-500);
}

.entry-content {
  margin-top: 1.5rem;
  color: var(--ink-200);
  line-height: 1.7;
}

.entry-content > * + * {
  margin-top: 1rem;
}

.entry-content h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--ink-100);
}

.entry-content h3 {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink-100);
}

.entry-content a {
  color: var(--lion-300);
}

.entry-content blockquote {
  border-left: 2px solid var(--lion-500);
  padding-left: 1rem;
  color: var(--ink-300);
  font-style: italic;
}

.entry-content code,
.entry-content pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.entry-content pre {
  overflow-x: auto;
  border: 1px solid var(--ink-800);
  border-radius: 0.5rem;
  background: var(--ink-900);
  padding: 1rem;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.25rem;
  list-style: revert;
}

.entry-content img,
.wp-caption img,
.wp-block-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.wp-caption-text,
.wp-block-image figcaption {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--ink-500);
}

.alignleft {
  float: left;
  margin: 0 1rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0 0 1rem 1rem;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.875rem;
}

.pager a {
  color: var(--lion-300);
}
