/*
Theme Name: CryptoRanked Market
Theme URI: https://cryptoranked.ru/
Author: CryptoRanked
Description: Data-first crypto exchange ranking and review theme.
Version: 3.0.0
Text Domain: cryptoranked-terminal
*/

:root {
    --ct-bg: #0d1117;
    --ct-surface: #161b22;
    --ct-surface-raised: #1c2128;
    --ct-border: #30363d;
    --ct-border-soft: #21262d;
    --ct-text: #f0f3f6;
    --ct-text-secondary: #b1bac4;
    --ct-muted: #7d8590;
    --ct-blue: #2f81f7;
    --ct-blue-hover: #58a6ff;
    --ct-green: #3fb950;
    --ct-amber: #d29922;
    --ct-red: #f85149;
    --ct-shell: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--ct-bg);
    color: var(--ct-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--ct-blue-hover); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.ct-shell { width: min(calc(100% - 48px), var(--ct-shell)); margin-inline: auto; }
.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
    z-index: 1000; top: 8px; left: 8px; width: auto; height: auto; padding: 10px 14px;
    clip: auto; background: #fff; color: #111;
}

/* Global navigation */
.ct-header {
    position: sticky; z-index: 100; top: 0; border-bottom: 1px solid var(--ct-border);
    background: rgba(13, 17, 23, .96); backdrop-filter: blur(12px);
}
.admin-bar .ct-header { top: 32px; }
.ct-header__inner {
    min-height: 64px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center; gap: 36px;
}
.ct-brand {
    display: inline-flex; align-items: center; gap: 10px; color: var(--ct-text);
    font-size: 17px; font-weight: 750; letter-spacing: -.025em; text-decoration: none;
}
.ct-brand__mark {
    width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; background: var(--ct-blue); color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: -.02em;
}
.ct-nav ul { display: flex; align-items: center; gap: 28px; padding: 0; margin: 0; list-style: none; }
.ct-nav a { color: var(--ct-text-secondary); font-size: 13px; font-weight: 550; text-decoration: none; }
.ct-nav a:hover, .ct-nav .current-menu-item > a { color: var(--ct-text); }
.ct-header__action {
    min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px;
    border: 1px solid var(--ct-border); border-radius: 6px; background: var(--ct-surface);
    color: var(--ct-text); font-size: 13px; font-weight: 600; text-decoration: none;
}
.ct-header__action:hover { border-color: #6e7681; background: var(--ct-surface-raised); }

/* Market overview */
.ct-intro { padding: 32px 0 28px; }
.ct-breadcrumbs, .ct-page-breadcrumbs {
    display: flex; align-items: center; gap: 8px; color: var(--ct-muted); font-size: 12px;
}
.ct-breadcrumbs strong { color: var(--ct-text-secondary); font-weight: 500; }
.ct-intro__row {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; margin-top: 14px;
}
.ct-intro h1 {
    margin: 0; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -.035em;
}
.ct-intro p {
    max-width: 720px; margin: 12px 0 0; color: var(--ct-text-secondary); font-size: 15px;
}
.ct-method-link {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding-bottom: 2px;
    color: var(--ct-text-secondary); font-size: 13px; font-weight: 550; text-decoration: none;
}
.ct-method-link:hover { color: var(--ct-blue-hover); }
.ct-market-nav { border-block: 1px solid var(--ct-border); }
.ct-market-nav__inner { display: flex; align-items: center; gap: 28px; }
.ct-market-nav a {
    position: relative; padding: 14px 1px; color: var(--ct-muted);
    font-size: 13px; font-weight: 600; text-decoration: none;
}
.ct-market-nav a:hover { color: var(--ct-text-secondary); }
.ct-market-nav a.is-active { color: var(--ct-text); }
.ct-market-nav a.is-active::after {
    content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--ct-blue);
}
.ct-rating { padding: 28px 0 72px; scroll-margin-top: 80px; }
.ct-rating__heading {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.ct-rating__heading h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.015em; }
.ct-rating__heading p { margin: 5px 0 0; color: var(--ct-muted); font-size: 12px; }
.ct-rating__legend { display: flex; gap: 16px; color: var(--ct-muted); font-size: 11px; }
.ct-rating__legend span { display: inline-flex; align-items: center; gap: 6px; }
.ct-rating__legend i { width: 7px; height: 7px; border-radius: 50%; }
.ct-rating__legend .is-high { background: var(--ct-green); }
.ct-rating__legend .is-mid { background: var(--ct-amber); }
.ct-rating__legend .is-low { background: var(--ct-red); }

/* Market controls */
.ct-toolbar {
    min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
    margin-top: 18px; padding: 10px 12px; border: 1px solid var(--ct-border); border-bottom: 0;
    border-radius: 8px 8px 0 0; background: var(--ct-surface);
}
.ct-filter-tabs { display: flex; gap: 3px; }
.ct-filter-tabs button {
    min-height: 34px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent;
    color: var(--ct-muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ct-filter-tabs button:hover { background: var(--ct-surface-raised); color: var(--ct-text-secondary); }
.ct-filter-tabs button.is-active { background: #263041; color: #79c0ff; }
.ct-toolbar__controls { display: flex; gap: 8px; }
.ct-search { position: relative; display: block; }
.ct-search svg {
    position: absolute; top: 50%; left: 11px; width: 15px; height: 15px;
    transform: translateY(-50%); fill: var(--ct-muted); pointer-events: none;
}
.ct-search input, .ct-sort select {
    height: 36px; border: 1px solid var(--ct-border); border-radius: 5px; outline: 0;
    background: var(--ct-bg); color: var(--ct-text); font-size: 12px;
}
.ct-search input { width: 210px; padding: 0 12px 0 34px; }
.ct-sort select { min-width: 154px; padding: 0 30px 0 10px; }
.ct-search input:focus, .ct-sort select:focus {
    border-color: var(--ct-blue); box-shadow: 0 0 0 2px rgba(47, 129, 247, .18);
}

/* Ranking table */
.ct-table-shell {
    position: relative; border: 1px solid var(--ct-border); border-radius: 0 0 8px 8px;
    background: var(--ct-surface); overflow: hidden;
}
.ct-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.ct-ranking-content > * { margin-top: 0; }
.ct-ranking-content .ninja_table_wrapper { margin: 0 !important; }
.ct-ranking-content .ninja_table_wrapper .ninja_table_search,
.ct-ranking-content .ninja_table_wrapper .ninja_table_info,
.ct-ranking-content .ninja_table_wrapper tr.footable-filtering { display: none !important; }
.ct-ranking-content table, .ct-market-table {
  display: table !important;
    width: 100% !important; min-width: 760px; margin: 0 !important; border: 0 !important;
    border-collapse: separate !important; border-spacing: 0 !important;
    background: transparent !important; color: var(--ct-text) !important; table-layout: fixed;
}
.ct-ranking-content thead th {
    height: 42px; padding: 0 16px !important; border: 0 !important;
    border-bottom: 1px solid var(--ct-border) !important; background: var(--ct-bg) !important;
    color: var(--ct-muted) !important; font-size: 10px !important; font-weight: 650 !important;
    letter-spacing: .045em; line-height: 1.2; text-align: left !important;
    text-transform: uppercase; white-space: nowrap;
}
.ct-ranking-content thead th:nth-child(1) { width: 96px; text-align: center !important; }
.ct-ranking-content thead th:nth-child(2) { width: 30%; }
.ct-ranking-content thead th:nth-child(3) { width: 150px; }
.ct-ranking-content thead th:nth-child(4) { width: 190px; }
.ct-ranking-content thead th:nth-child(5) { width: 130px; text-align: right !important; }
.ct-ranking-content tbody { counter-reset: market-row; }
.ct-ranking-content tbody tr { counter-increment: market-row; transition: background-color 120ms ease; }
.ct-ranking-content tbody tr:hover { background: var(--ct-surface-raised) !important; }
.ct-ranking-content tbody tr[hidden],
.ct-ranking-content tbody tr.ct-row-hidden,
.ct-ranking-content tbody tr.ct-invalid-market-row { display: none !important; }
.ct-ranking-content tbody td {
    height: 68px; padding: 9px 16px !important; border: 0 !important;
    border-bottom: 1px solid var(--ct-border-soft) !important; background: transparent !important;
    color: var(--ct-text-secondary) !important; font-size: 13px !important;
    line-height: 1.35; vertical-align: middle !important;
}
.ct-ranking-content tbody tr:last-child td { border-bottom: 0 !important; }
.ct-ranking-content tbody td:first-child { position: relative; padding-left: 48px !important; }
.ct-ranking-content tbody td:first-child::before {
    content: counter(market-row); position: absolute; top: 50%; left: 17px; width: 20px;
    transform: translateY(-50%); color: var(--ct-muted); font-size: 12px;
    font-variant-numeric: tabular-nums; text-align: center;
}
.ct-ranking-content tbody td:first-child img {
    width: 32px !important; height: 32px !important; display: block;
    border-radius: 7px; object-fit: contain; background: #fff;
}
.ct-ranking-content tbody td:nth-child(2) {
    color: var(--ct-text) !important; font-size: 14px !important; font-weight: 650;
}
.ct-ranking-content tbody td:nth-child(3) {
    position: relative; padding-left: 32px !important; color: var(--ct-text) !important;
    font-size: 14px !important; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ct-ranking-content tbody td:nth-child(3)::before {
    content: ""; position: absolute; top: 50%; left: 16px; width: 7px; height: 7px;
    border-radius: 50%; transform: translateY(-50%); background: var(--ct-muted);
}
.ct-ranking-content tbody td:nth-child(3).is-high::before { background: var(--ct-green); }
.ct-ranking-content tbody td:nth-child(3).is-mid::before { background: var(--ct-amber); }
.ct-ranking-content tbody td:nth-child(3).is-low::before { background: var(--ct-red); }
.ct-ranking-content tbody td:nth-child(3) .glsr-summary,
.ct-ranking-content tbody td:nth-child(4) .glsr-summary { display: block !important; }
.ct-ranking-content tbody td:nth-child(3) .glsr-summary-rating {
    font-size: inherit !important; font-weight: inherit !important;
}
.ct-ranking-content tbody td:nth-child(4) {
    color: var(--ct-muted) !important; font-variant-numeric: tabular-nums;
}
.ct-ranking-content tbody td:nth-child(4) .glsr-summary-text { color: inherit !important; font-size: 0 !important; }
.ct-ranking-content tbody td:nth-child(4) .glsr-tag-value { font-size: 12px !important; }
.ct-ranking-content tbody td:last-child { text-align: right; }
.ct-ranking-content .nt_btn, .ct-ranking-content tbody td:last-child a {
    min-height: 32px !important; display: inline-flex !important; align-items: center;
    justify-content: center; padding: 0 12px !important; border: 1px solid var(--ct-border) !important;
    border-radius: 5px !important; background: transparent !important;
    color: var(--ct-text-secondary) !important; font-size: 11px !important;
    font-weight: 600 !important; text-decoration: none !important; white-space: nowrap;
}
.ct-ranking-content .nt_btn:hover, .ct-ranking-content tbody td:last-child a:hover {
    border-color: #6e7681 !important; background: var(--ct-surface-raised) !important;
    color: var(--ct-text) !important;
}
.ct-empty { padding: 56px 24px; color: var(--ct-muted); text-align: center; }
.ct-empty strong, .ct-empty span { display: block; }
.ct-empty strong { margin-bottom: 5px; color: var(--ct-text); font-size: 15px; }

/* Existing homepage guide, kept separate from the market screen */
.ct-guide {
    padding: 56px 0 80px;
    border-top: 1px solid var(--ct-border);
    background: #11161d;
}
.ct-guide .ct-shell { max-width: 1060px; }
.ct-guide__label {
    margin-bottom: 14px; color: var(--ct-muted); font-size: 11px;
    font-weight: 700; letter-spacing: .065em; text-transform: uppercase;
}
.ct-guide__content { max-width: 820px; padding-top: 0; }

/* Profiles, review pages and editorial */
.ct-document { padding: 26px 0 80px; }
.ct-document__shell { max-width: 1060px; }
.ct-page-breadcrumbs { margin-bottom: 24px; }
.ct-page-breadcrumbs a { color: var(--ct-muted); text-decoration: none; }
.ct-page-breadcrumbs a:hover { color: var(--ct-text-secondary); }
.ct-article { max-width: 860px; }
.ct-article__header { padding-bottom: 24px; border-bottom: 1px solid var(--ct-border); }
.ct-kicker {
    display: block; margin-bottom: 8px; color: var(--ct-blue-hover); font-size: 11px;
    font-weight: 700; letter-spacing: .065em; text-transform: uppercase;
}
.ct-article__header h1 {
    margin: 0; font-size: clamp(34px, 6vw, 54px); line-height: 1.08; letter-spacing: -.04em;
}
.ct-article__header p { margin: 12px 0 0; color: var(--ct-muted); font-size: 14px; }
.ct-prose { padding-top: 28px; color: var(--ct-text-secondary); }
.ct-prose > :first-child { margin-top: 0; }
.ct-prose h2, .ct-prose h3, .ct-prose h4 {
    color: var(--ct-text); line-height: 1.25; letter-spacing: -.025em;
}
.ct-prose h2 { margin: 2.1em 0 .7em; font-size: 27px; }
.ct-prose h3 { margin: 1.8em 0 .65em; font-size: 21px; }
.ct-prose p, .ct-prose li { max-width: 76ch; }
.ct-prose p { margin: 0 0 1.15em; }
.ct-prose ul, .ct-prose ol { padding-left: 22px; }
.ct-prose li + li { margin-top: 7px; }
.ct-prose hr { height: 1px; margin: 40px 0; border: 0; background: var(--ct-border); }
.ct-prose blockquote {
    margin: 28px 0; padding: 18px 20px; border-left: 3px solid var(--ct-blue);
    background: var(--ct-surface); color: var(--ct-text);
}
.ct-prose figure { margin: 30px 0; }
.ct-prose figure img, .ct-featured img { border-radius: 8px; }
.ct-featured { margin: 28px 0 0; }
.ct-prose input:not([type="submit"]), .ct-prose textarea, .ct-prose select,
.glsr-input, .glsr-textarea, .glsr-select {
    width: 100%; min-height: 42px; padding: 10px 12px !important;
    border: 1px solid var(--ct-border) !important; border-radius: 6px !important;
    outline: 0; background: var(--ct-surface) !important; color: var(--ct-text) !important;
}
.ct-prose input:focus, .ct-prose textarea:focus, .ct-prose select:focus {
    border-color: var(--ct-blue) !important; box-shadow: 0 0 0 2px rgba(47, 129, 247, .18);
}
.ct-prose input[type="submit"], .ct-prose button, .glsr-button {
    min-height: 40px; padding: 0 16px !important; border: 1px solid var(--ct-blue) !important;
    border-radius: 6px !important; background: var(--ct-blue) !important;
    color: #fff !important; font-weight: 650 !important; cursor: pointer;
}
.glsr-review {
    margin: 0 !important; padding: 22px 0 !important; border-bottom: 1px solid var(--ct-border) !important;
}
.glsr-review:first-child { border-top: 1px solid var(--ct-border) !important; }
.glsr-review-title h3 {
    margin: 0 0 7px !important; color: var(--ct-text) !important;
    font-size: 17px !important; line-height: 1.35 !important; letter-spacing: -.01em !important;
}
.glsr-review-author { color: var(--ct-text-secondary) !important; font-weight: 650; }
.glsr-review-date { color: var(--ct-muted) !important; }

/* Archive */
.ct-archive { padding-bottom: 72px; }
.ct-archive__header { padding: 42px 0 28px; border-bottom: 1px solid var(--ct-border); }
.ct-archive__header h1 { margin: 0; font-size: clamp(32px, 5vw, 46px); letter-spacing: -.035em; }
.ct-feed { border-inline: 1px solid var(--ct-border); }
.ct-feed-card {
    display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: start;
    gap: 24px; padding: 24px; border-bottom: 1px solid var(--ct-border);
}
.ct-feed-card:hover { background: var(--ct-surface); }
.ct-feed-card__meta { color: var(--ct-muted); font-size: 12px; }
.ct-feed-card h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.ct-feed-card h2 a { color: var(--ct-text); text-decoration: none; }
.ct-feed-card p { margin: 0; color: var(--ct-muted); font-size: 13px; }
.ct-feed-card__arrow { color: var(--ct-muted); font-size: 19px; text-decoration: none; }
.ct-empty-state { padding: 64px 0; color: var(--ct-muted); }

/* Footer and service states */
.ct-footer { border-top: 1px solid var(--ct-border); background: #090c10; }
.ct-footer__grid {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; padding-block: 34px 28px;
}
.ct-brand--footer { font-size: 15px; }
.ct-brand--footer .ct-brand__mark { width: 27px; height: 27px; }
.ct-footer p { margin: 9px 0 0; color: var(--ct-muted); font-size: 12px; }
.ct-footer__nav { display: flex; align-items: center; gap: 22px; }
.ct-footer__nav a { color: var(--ct-text-secondary); font-size: 12px; text-decoration: none; }
.ct-footer__nav a:hover { color: var(--ct-text); }
.ct-footer__note {
    display: flex; justify-content: space-between; gap: 24px; padding-block: 16px;
    border-top: 1px solid var(--ct-border-soft); color: var(--ct-muted); font-size: 11px;
}
.ct-not-found { min-height: 62vh; padding: 80px 0; text-align: center; }
.ct-not-found__code { color: var(--ct-blue); font-size: 13px; font-weight: 750; }
.ct-not-found h1 { margin: 8px 0 0; font-size: clamp(36px, 7vw, 64px); letter-spacing: -.045em; }
.ct-not-found p { margin: 10px 0 24px; color: var(--ct-muted); }
.ct-primary-button {
    min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px;
    border-radius: 6px; background: var(--ct-blue); color: #fff;
    font-size: 13px; font-weight: 650; text-decoration: none;
}

@media (max-width: 900px) {
    .ct-header__inner { grid-template-columns: minmax(0, 1fr) auto; }
    .ct-nav { display: none; }
    .ct-rating__legend { display: none; }
    .ct-toolbar { align-items: stretch; flex-direction: column; }
    .ct-toolbar__controls { width: 100%; }
    .ct-search { flex: 1; }
    .ct-search input { width: 100%; }
}

@media (max-width: 640px) {
    .ct-shell { width: min(calc(100% - 28px), var(--ct-shell)); }
    .admin-bar .ct-header { top: 46px; }
    .ct-header__inner { min-height: 58px; }
    .ct-brand__name { font-size: 15px; }
    .ct-header__action { min-height: 34px; padding-inline: 11px; font-size: 11px; }
    .ct-intro { padding: 24px 0 22px; }
    .ct-intro__row { align-items: flex-start; flex-direction: column; gap: 16px; }
    .ct-intro h1 { font-size: 30px; }
    .ct-intro p { font-size: 14px; }
    .ct-market-nav__inner { gap: 22px; overflow-x: auto; }
    .ct-market-nav a { flex: 0 0 auto; }
    .ct-rating { padding-top: 22px; }
    .ct-rating__heading h2 { font-size: 18px; }
    .ct-toolbar {
        margin-inline: -14px; padding: 10px 14px; border-inline: 0; border-radius: 0;
    }
    .ct-filter-tabs { padding-bottom: 2px; overflow-x: auto; }
    .ct-filter-tabs button { flex: 0 0 auto; }
    .ct-toolbar__controls { flex-direction: column; }
    .ct-sort select { width: 100%; }
    .ct-table-shell { margin-inline: -14px; border-inline: 0; border-radius: 0; }
    .ct-ranking-content table, .ct-market-table { min-width: 680px; }
    .ct-ranking-content thead th, .ct-ranking-content tbody td { padding-inline: 12px !important; }
    .ct-ranking-content tbody td:first-child { padding-left: 43px !important; }
    .ct-ranking-content tbody td:first-child::before { left: 12px; }
    .ct-ranking-content tbody td:nth-child(3) { padding-left: 27px !important; }
    .ct-ranking-content tbody td:nth-child(3)::before { left: 12px; }
    .ct-document { padding-top: 20px; }
    .ct-article__header h1 { font-size: 36px; }
    .ct-prose { padding-top: 22px; }
    .ct-prose h2 { font-size: 24px; }
    .ct-feed-card { grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px 0; }
    .ct-feed-card__meta { grid-column: 1 / -1; }
    .ct-footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .ct-footer__nav { align-items: flex-start; flex-direction: column; gap: 12px; }
    .ct-footer__note { align-items: flex-start; flex-direction: column; gap: 7px; }
}
