/* =========================================================================
   ctp-news.css — crypto.news-style layout overrides for CryptoTakeProfit
   Isolated from Source's gulp pipeline. Loaded AFTER built/screen.css.
   All selectors are ctp-* prefixed except scoped overrides of Source grid.

   FONT-SIZE TRAP: Source sets html{font-size:62.5%} so 1rem = 10px (NOT 16px).
   Body is 1.6rem = 16px; the nav menu is 1.5rem = 15px. Size ctp-* text on the
   SAME scale — content headlines should be >= 1.5rem, never sub-1rem, or they
   render tiny (e.g. 1.15rem = only 11.5px).
   ========================================================================= */

:root {
    --ctp-accent: var(--ghost-accent-color, #10B981);
    --ctp-wrap: 1200px;
    --ctp-gap: 32px;
    --ctp-border: rgb(0 0 0 / 0.09);
    --ctp-muted: rgb(0 0 0 / 0.55);
    --ctp-ink: #15171a;
    --ctp-card-bg: #fff;
}

/* ---- shared shell ---- */
.ctp-wrap {
    max-width: var(--ctp-wrap);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}
.ctp-section { margin: 40px 0; }
.ctp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    border-bottom: 2px solid var(--ctp-ink);
    padding-bottom: 8px;
}
.ctp-section-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    text-transform: none;
}
.ctp-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 0.95em;
    background: var(--ctp-accent);
    margin-right: 10px;
    vertical-align: -1px;
    border-radius: 2px;
}
.ctp-more {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ctp-accent);
    white-space: nowrap;
    text-decoration: none;
}
.ctp-more:hover { text-decoration: underline; }

/* ---- badges / meta ---- */
.ctp-badge, .ctp-mini-tag {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ctp-accent);
}
.ctp-badge {
    background: color-mix(in srgb, var(--ctp-accent) 12%, transparent);
    padding: 3px 8px;
    border-radius: 4px;
}
.ctp-meta-date, .ctp-mini-date {
    font-size: 1.3rem;
    color: var(--ctp-muted);
}

/* =========================================================================
   HERO
   ========================================================================= */
.ctp-hero {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: var(--ctp-gap);
    align-items: stretch;
}
.ctp-hero-lead-link { display: block; color: inherit; text-decoration: none; }
.ctp-hero-lead-img {
    margin: 0 0 16px;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: rgb(0 0 0 / 0.04);
}
.ctp-hero-lead-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctp-hero-lead-title {
    font-size: 2.8rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 12px 0 8px;
}
.ctp-hero-lead-link:hover .ctp-hero-lead-title { color: var(--ctp-accent); }
.ctp-hero-lead-excerpt {
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--ctp-muted);
    margin: 0 0 10px;
}

.ctp-hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ctp-hero-item { border-bottom: 1px solid var(--ctp-border); padding-bottom: 16px; }
.ctp-hero-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ctp-hero-item a {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    color: inherit;
    text-decoration: none;
    align-items: start;
}
.ctp-hero-item-img {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: rgb(0 0 0 / 0.04);
}
.ctp-hero-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctp-hero-item-title {
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 6px 0 0;
    letter-spacing: -0.01em;
}
.ctp-hero-item a:hover .ctp-hero-item-title { color: var(--ctp-accent); }

/* =========================================================================
   TWO-COLUMN (main river + sidebar)
   ========================================================================= */
.ctp-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: start;
}
.ctp-col-aside { position: sticky; top: 24px; }

/* river list */
.ctp-river { display: flex; flex-direction: column; }

/* mini card (river + sidebar list item) */
.ctp-mini { border-bottom: 1px solid var(--ctp-border); }
.ctp-mini:last-child { border-bottom: 0; }
.ctp-mini-link {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px;
    padding: 16px 0;
    color: inherit;
    text-decoration: none;
    align-items: start;
}
.ctp-mini-thumb {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: rgb(0 0 0 / 0.04);
}
.ctp-mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctp-mini-body { min-width: 0; }
.ctp-mini-title {
    font-size: 1.7rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 4px 0 6px;
    letter-spacing: -0.01em;
}
.ctp-mini-link:hover .ctp-mini-title { color: var(--ctp-accent); }

/* sidebar variant: smaller, numbered, no thumb */
.ctp-aside-box {
    border: 1px solid var(--ctp-border);
    border-radius: 12px;
    padding: 18px 18px 6px;
    margin-bottom: 24px;
    background: var(--ctp-card-bg);
}
.ctp-aside-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 12px;
    color: var(--ctp-ink);
}
.ctp-aside-list { list-style: none; margin: 0; padding: 0; counter-reset: ctp; }
.ctp-aside-list li {
    counter-increment: ctp;
    border-bottom: 1px solid var(--ctp-border);
    padding: 12px 0;
}
.ctp-aside-list li:last-child { border-bottom: 0; }
.ctp-aside-list a {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    align-items: baseline;
}
.ctp-aside-list a::before {
    content: counter(ctp);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ctp-accent);
    line-height: 1;
    min-width: 1ch;
}
.ctp-aside-list .ctp-aside-item-title {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 600;
}
.ctp-aside-list a:hover .ctp-aside-item-title { color: var(--ctp-accent); }

/* promo box (CTP Bot / newsletter) */
.ctp-promo {
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--ctp-accent), color-mix(in srgb, var(--ctp-accent) 60%, #0b7a5b));
    color: #fff;
}
.ctp-promo h3 { font-size: 1.7rem; font-weight: 800; margin: 0 0 8px; color: #fff; }
.ctp-promo p { font-size: 1.4rem; line-height: 1.45; margin: 0 0 14px; opacity: 0.92; }
.ctp-promo-btn {
    display: inline-block;
    background: #fff;
    color: var(--ctp-accent);
    font-weight: 700;
    font-size: 1.4rem;
    padding: 9px 16px;
    border-radius: 8px;
    text-decoration: none;
}
.ctp-promo-btn:hover { opacity: 0.92; }

/* =========================================================================
   CATEGORY GRID SECTIONS
   ========================================================================= */
.ctp-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.ctp-cat-card { color: inherit; text-decoration: none; display: block; }
.ctp-cat-img {
    margin: 0 0 10px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: rgb(0 0 0 / 0.04);
}
.ctp-cat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ctp-cat-title {
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 700;
    margin: 8px 0 6px;
    letter-spacing: -0.01em;
}
.ctp-cat-card:hover .ctp-cat-title { color: var(--ctp-accent); }

/* =========================================================================
   POST PAGE — content + right sidebar
   ========================================================================= */
.ctp-post-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 56px;
    align-items: start;
}
.ctp-post-layout .gh-main { min-width: 0; }

/* Neutralise Source's breakout grid inside the narrower main column so
   content + full-width images size to the column, not the viewport. */
.ctp-post-layout .gh-canvas {
    --content-width: 100%;
    --container-width: 100%;
    --container-gap: 0px;
    grid-template-columns: [full-start wide-start main-start] minmax(0,1fr) [main-end wide-end full-end];
}
.ctp-post-aside { position: sticky; top: 24px; }

/* related list reuses .ctp-mini but tighter */
.ctp-post-aside .ctp-mini-link { grid-template-columns: 84px 1fr; padding: 12px 0; }
.ctp-post-aside .ctp-mini-title { font-size: 1.4rem; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 991px) {
    .ctp-cols,
    .ctp-post-layout { grid-template-columns: 1fr; gap: 40px; }
    .ctp-col-aside,
    .ctp-post-aside { position: static; }
    .ctp-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .ctp-hero { grid-template-columns: 1fr; }
    .ctp-hero-lead-title { font-size: 2.4rem; }
}
@media (max-width: 575px) {
    .ctp-cat-grid { grid-template-columns: 1fr; }
    .ctp-mini-link { grid-template-columns: 104px 1fr; gap: 12px; }
    .ctp-hero-item a { grid-template-columns: 84px 1fr; }
    .ctp-hero-lead-title { font-size: 2.1rem; }
}

/* dark-bg accent readability (site can set dark background) */
.has-light-text .ctp-section-head { border-bottom-color: currentColor; }
.has-light-text .ctp-section-title,
.has-light-text .ctp-aside-title { color: inherit; }
.has-light-text .ctp-aside-box { background: rgb(255 255 255 / 0.03); }
