/*
Theme Name: Analyzing Market
Theme URI: https://coingsty.com
Author: Coingsty
Author URI: https://coingsty.com
Description: Plain-PHP reconstruction of the Analyzing Market theme used by Coingsty. Rebuilt 2026-08-13 after the box .159 disk loss; the custom post type slugs and archive bases match the pre-wipe registrations so every original permalink still resolves.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: analyzingmarket
Tags: news, cryptocurrency, custom-post-types
*/

/* ------------------------------------------------------------------ tokens */
:root {
  --am-bg: #ffffff;
  --am-surface: #f6f8fb;
  --am-card: #ffffff;
  --am-border: #e2e8f0;
  --am-text: #16202e;
  --am-muted: #5b6b80;
  --am-accent: #1359d6;
  --am-accent-ink: #ffffff;
  --am-up: #067a4a;
  --am-down: #c02636;
  --am-radius: 10px;
  --am-wrap: 1180px;
  --am-shadow: 0 1px 2px rgba(16, 32, 54, .06), 0 4px 14px rgba(16, 32, 54, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --am-bg: #0e1522;
    --am-surface: #141d2e;
    --am-card: #182234;
    --am-border: #27354b;
    --am-text: #e8eef7;
    --am-muted: #9dadc2;
    --am-accent: #6ea8ff;
    --am-accent-ink: #0e1522;
    --am-up: #35d08a;
    --am-down: #ff7b8a;
    --am-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  }
}

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

body {
  margin: 0;
  background: var(--am-bg);
  color: var(--am-text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--am-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); margin-top: 0; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); }
h3 { font-size: 1.15rem; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
pre { background: var(--am-surface); padding: 1rem; border-radius: var(--am-radius); overflow-x: auto; }

.am-wrap { max-width: var(--am-wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

.am-skip {
  position: absolute; left: -9999px; top: 0; background: var(--am-accent);
  color: var(--am-accent-ink); padding: .6rem 1rem; z-index: 100;
}
.am-skip:focus { left: 0; }

/* ------------------------------------------------------------- masthead */
.am-masthead {
  border-bottom: 1px solid var(--am-border);
  background: var(--am-card);
  position: sticky; top: 0; z-index: 40;
}
.am-masthead__inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 64px; flex-wrap: wrap;
}
.am-brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--am-text); }
.am-brand:hover { text-decoration: none; color: var(--am-accent); }
.am-brand__tag { display: block; font-size: .72rem; font-weight: 500; color: var(--am-muted); letter-spacing: .02em; }

.am-nav { margin-left: auto; }
.am-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; }
.am-nav li { position: relative; }
.am-nav a { color: var(--am-text); font-size: .93rem; font-weight: 600; padding: .35rem 0; display: inline-block; }
.am-nav a:hover { color: var(--am-accent); text-decoration: none; }
/* Second-level items render inline rather than as dropdowns: no JS, no clipping. */
.am-nav .sub-menu {
  display: none;
  position: absolute; left: 0; top: 100%;
  background: var(--am-card); border: 1px solid var(--am-border);
  border-radius: var(--am-radius); box-shadow: var(--am-shadow);
  min-width: 210px; padding: .5rem 0; flex-direction: column; gap: 0; z-index: 50;
}
.am-nav li:hover > .sub-menu, .am-nav li:focus-within > .sub-menu { display: flex; }
.am-nav .sub-menu a { display: block; padding: .4rem 1rem; font-weight: 500; white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.am-main { padding: 2rem 0 3rem; }
.am-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
@media (max-width: 900px) { .am-layout { grid-template-columns: minmax(0, 1fr); } }

.am-sidebar { position: sticky; top: 84px; }
.am-sidebar .widget {
  background: var(--am-card); border: 1px solid var(--am-border);
  border-radius: var(--am-radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}
.am-sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.am-sidebar .widget li { padding: .3rem 0; border-bottom: 1px solid var(--am-border); }
.am-sidebar .widget li:last-child { border-bottom: 0; }

/* ----------------------------------------------------------------- cards */
.am-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.am-card {
  background: var(--am-card); border: 1px solid var(--am-border);
  border-radius: var(--am-radius); padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: .5rem; min-width: 0;
}
.am-card__title { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.am-card__title a { color: var(--am-text); }
.am-card__title a:hover { color: var(--am-accent); text-decoration: none; }
.am-card__meta { font-size: .8rem; color: var(--am-muted); }
.am-card__excerpt { font-size: .9rem; color: var(--am-muted); margin: 0; }

.am-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--am-accent); margin-bottom: .35rem;
}

.am-section { margin: 2.5rem 0; }
.am-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.am-section__head h2 { margin: 0; }
.am-section__more { font-size: .88rem; font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------------- single */
.am-article { min-width: 0; }
.am-article__header { margin-bottom: 1.5rem; }
.am-meta { font-size: .85rem; color: var(--am-muted); display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.am-thumb { margin: 1.25rem 0; border-radius: var(--am-radius); overflow: hidden; }

.am-prose { font-size: 1.02rem; }
.am-prose > *:first-child { margin-top: 0; }
.am-prose p, .am-prose ul, .am-prose ol { margin: 0 0 1.05em; }
.am-prose ul, .am-prose ol { padding-left: 1.3em; }
.am-prose li { margin-bottom: .35em; }
.am-prose h2 { border-top: 1px solid var(--am-border); padding-top: 1.4rem; }
.am-prose blockquote {
  margin: 1.5em 0; padding: .4rem 0 .4rem 1.1rem;
  border-left: 3px solid var(--am-accent); color: var(--am-muted); font-style: italic;
}
.am-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.am-prose figure { margin: 1.5em 0; }

.am-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------------------ data strip */
.am-stats {
  display: grid; gap: 1px; background: var(--am-border);
  border: 1px solid var(--am-border); border-radius: var(--am-radius); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.5rem 0;
}
.am-stat { background: var(--am-card); padding: .85rem 1rem; min-width: 0; }
.am-stat__k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--am-muted); }
.am-stat__v { font-size: 1.15rem; font-weight: 700; margin-top: .15rem; word-break: break-word; }
.am-up { color: var(--am-up); }
.am-down { color: var(--am-down); }

.am-symbol {
  display: inline-block; background: var(--am-surface); border: 1px solid var(--am-border);
  border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; color: var(--am-muted); vertical-align: middle;
}
.am-coinhead { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.am-coinhead img { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }

.am-stale {
  background: var(--am-surface); border: 1px solid var(--am-border); border-left: 3px solid var(--am-accent);
  border-radius: var(--am-radius); padding: .85rem 1.1rem; margin: 1.5rem 0;
  font-size: .88rem; color: var(--am-muted);
}

/* -------------------------------------------------------------- FAQ / dl */
.am-faq { margin: 2rem 0; }
.am-faq details {
  border: 1px solid var(--am-border); border-radius: var(--am-radius);
  padding: .8rem 1.1rem; margin-bottom: .6rem; background: var(--am-card);
}
.am-faq summary { cursor: pointer; font-weight: 600; }
.am-faq details[open] summary { margin-bottom: .6rem; }

/* -------------------------------------------------------------- listings */
.am-list { list-style: none; margin: 0; padding: 0; }
.am-list li { padding: .7rem 0; border-bottom: 1px solid var(--am-border); }
.am-list li:last-child { border-bottom: 0; }
.am-list a { font-weight: 600; color: var(--am-text); }
.am-list a:hover { color: var(--am-accent); text-decoration: none; }
.am-list span { display: block; font-size: .82rem; color: var(--am-muted); }

.am-cols { columns: 3 190px; column-gap: 1.75rem; }
.am-cols a { display: block; padding: .22rem 0; font-size: .93rem; break-inside: avoid; }

/* ------------------------------------------------------------ pagination */
.am-pagination { margin: 2.5rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.am-pagination .page-numbers {
  border: 1px solid var(--am-border); border-radius: 8px; padding: .4rem .8rem;
  color: var(--am-text); font-size: .9rem; background: var(--am-card);
}
.am-pagination .page-numbers.current { background: var(--am-accent); color: var(--am-accent-ink); border-color: var(--am-accent); }
.am-pagination a.page-numbers:hover { border-color: var(--am-accent); text-decoration: none; }

/* ---------------------------------------------------------------- search */
.am-searchform { display: flex; gap: .5rem; }
.am-searchform input[type="search"] {
  flex: 1 1 auto; min-width: 0; padding: .55rem .8rem; font-size: .95rem;
  border: 1px solid var(--am-border); border-radius: 8px;
  background: var(--am-bg); color: var(--am-text);
}
.am-searchform button {
  flex: 0 0 auto; padding: .55rem 1rem; font-size: .95rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--am-accent); border-radius: 8px;
  background: var(--am-accent); color: var(--am-accent-ink);
}

/* ---------------------------------------------------------------- footer */
.am-footer {
  border-top: 1px solid var(--am-border); background: var(--am-surface);
  margin-top: 3rem; padding: 2.5rem 0 2rem; font-size: .9rem;
}
.am-footer__cols { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.am-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.am-footer .widget li { padding: .22rem 0; }
.am-footer__legal {
  margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--am-border);
  color: var(--am-muted); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}
.am-footer__legal nav { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; }

/* --------------------------------------------------------------- utility */
.screen-reader-text {
  border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; width: 1px; word-wrap: normal;
}
.am-notice {
  background: var(--am-surface); border: 1px solid var(--am-border);
  border-radius: var(--am-radius); padding: 1.1rem 1.25rem; color: var(--am-muted);
}
.alignleft { float: left; margin: .3rem 1.4rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.4rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.am-clear::after { content: ""; display: table; clear: both; }
