/* TechPulse — additions on top of style.css (new components only) */

/* ----- News bar ----- */
.ticker-viewport { flex: 1; min-width: 0; overflow: hidden; }
.ticker-track { animation-duration: 60s; }
.ticker-item a { display: inline-flex; align-items: center; gap: 8px; }
.ticker-item small { color: #94a3b8; font-size: 0.78rem; }
.tk-tag { font-size: 0.66rem; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 4px; color: #fff; background: #475569; }
.tk-new { background: #16a34a; }
.tk-hn  { background: #ea580c; }
.tk-dev { background: #7c3aed; }
.ticker-close { flex-shrink: 0; background: transparent; border: 0; color: #94a3b8; font-size: 1.3rem; line-height: 1; padding: 0 14px; cursor: pointer; align-self: stretch; }
.ticker-close:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ----- Layout helpers ----- */
.tp-section { margin: 44px 0; }
.tp-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tp-section-head h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.tp-section .articles-grid { padding: 0; }
.tp-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); background: var(--bg-alt); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ----- Hero search ----- */
.tp-search { display: flex; gap: 10px; max-width: 560px; margin: 22px auto 0; }
.tp-search input { flex: 1; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); color: var(--text); font-size: 1rem; }
.tp-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tp-search button { padding: 0 22px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.tp-search button:hover { background: var(--primary-hover); }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.tp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-alt); color: var(--text); font-size: .88rem; font-weight: 600; cursor: pointer; }
.tp-chip:hover, .tp-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ----- Cards ----- */
.tp-card-img { display: block; margin: -26px -26px 4px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); position: relative; }
.tp-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.article-card:hover .tp-card-img img { transform: scale(1.04); }
.tp-card-meta { display: flex; gap: 6px; color: var(--text-muted); font-size: .82rem; margin-top: auto; }
.tp-card-big h3 { font-size: 1.5rem; line-height: 1.25; }
.tp-card-big p { font-size: 1rem; }

/* ----- Did you know ----- */
.dyk-actions { margin-top: 14px; }
.dyk-actions button { padding: 7px 14px; border-radius: 8px; border: 1px solid rgba(120,53,15,.35); background: rgba(255,255,255,.45); color: #78350f; font-weight: 700; cursor: pointer; }
html.dark-theme .dyk-actions button { color: #fef3c7; background: rgba(0,0,0,.25); border-color: rgba(254,243,199,.35); }

/* ----- News ----- */
.tp-news-list { display: grid; gap: 4px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.tp-news-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border-radius: 8px; }
.tp-news-item:hover { background: var(--bg-soft); }
.tp-news-item .tk-tag { margin-top: 3px; flex-shrink: 0; }
.tp-news-item a.t { color: var(--text); font-weight: 600; line-height: 1.4; }
.tp-news-item a.t:hover { color: var(--primary); }
.tp-news-meta { color: var(--text-muted); font-size: .82rem; margin-top: 3px; }
.tp-news-meta a { color: var(--text-muted); text-decoration: underline; }
.tp-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tp-news-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tp-news-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-soft); }
.tp-news-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tp-news-card a.t { color: var(--text); font-weight: 700; line-height: 1.35; }
.tp-news-card a.t:hover { color: var(--primary); }

/* ----- Article body ----- */
.tp-figure { margin: 22px 0; }
.tp-figure img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; background: var(--bg-soft); }
.tp-figure figcaption { text-align: center; font-size: .85rem; color: var(--text-muted); margin-top: 8px; }
.tp-cover { margin-top: 0; }
.tp-callout { margin: 0 0 18px; padding: 14px 18px; border-radius: 0 10px 10px 0; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.tp-callout.tp-warn { border-color: var(--danger); background: rgba(220,38,38,.1); }
.tp-callout.tp-tip  { border-color: var(--success); background: rgba(22,163,74,.1); }
.tp-callout.tp-quote { border-color: var(--border); background: var(--bg-soft); font-style: italic; }
.tp-toc { margin: 0 0 26px; padding: 14px 18px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; }
.tp-toc summary { cursor: pointer; font-weight: 700; }
.tp-toc ol { margin: 10px 0 0 22px; }
.tp-toc a { color: var(--text); }
.tp-toc a:hover { color: var(--primary); }
.tp-table-wrap { overflow-x: auto; margin: 0 0 18px; }
.tp-table-wrap table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.tp-table-wrap th, .tp-table-wrap td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.tp-table-wrap th { background: var(--bg-soft); }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.article-content img { max-width: 100%; }
@media (max-width: 640px) { .single-article { padding: 22px 16px; } }
.single-article .share-buttons { margin-top: 28px; }
#related { margin-top: 44px; }
#related h2 { margin-bottom: 14px; }

/* ----- Filters (articles page) ----- */
.tp-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 8px 0 22px; }
.tp-filters input[type=search] { flex: 1; min-width: 220px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt); color: var(--text); font-size: 1rem; }
.tp-more { text-align: center; margin: 10px 0 50px; }

/* ----- Header + drop-down menus ----- */
.main-header .container.tp-hbar { flex-direction: row; flex-wrap: nowrap; padding: 10px 4px; }
.tp-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.tp-nav > ul > li { position: relative; display: flex; align-items: center; }
.tp-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: .93rem; white-space: nowrap; }
.tp-nav a:hover, .tp-nav a.active, .tp-dd.on > a { background: var(--bg-soft); color: var(--primary); }
.tp-dd-btn { display: none; background: transparent; border: 0; color: var(--text); padding: 8px 12px; cursor: pointer; font-size: 1rem; }
.tp-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 230px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 120; }
.tp-menu a { font-weight: 500; }
.tp-menu .tp-menu-all { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; color: var(--primary); font-weight: 700; }
.tp-dd:hover .tp-menu, .tp-dd:focus-within .tp-menu, .tp-dd.open .tp-menu { display: block; }
.tp-hbar-right, .tp-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.tp-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-alt); color: var(--text); cursor: pointer; font-size: 1.05rem; }
.tp-iconbtn:hover { border-color: var(--primary); }
.tp-burger { display: none; }
@media (max-width: 960px) {
  .tp-burger { display: inline-flex; }
  .tp-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-alt); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 8px 16px 16px; max-height: calc(100vh - 110px); overflow-y: auto; }
  .tp-nav.open { display: block; }
  .tp-nav ul { flex-direction: column; }
  .tp-nav > ul > li { flex-wrap: wrap; }
  .tp-nav > ul > li > a { flex: 1; }
  .tp-dd-btn { display: inline-flex; }
  .tp-menu, .tp-dd:hover .tp-menu, .tp-dd:focus-within .tp-menu { display: none; position: static; width: 100%; box-shadow: none; border: 0; padding: 0 0 6px 14px; background: transparent; }
  .tp-dd.open .tp-menu { display: block; }
}

/* ----- Footer ----- */
.tp-footer .container.tp-foot { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; align-items: start; }
.tp-foot h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.tp-foot a { display: block; color: var(--footer-text); padding: 3px 0; }
.tp-foot a:hover { color: #60a5fa; }
.tp-foot p { max-width: 36ch; margin-top: 8px; opacity: .85; }
.tp-foot-logo { color: #fff; font-size: 1.15rem; }
.tp-foot-bottom { margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; opacity: .8; display: block !important; }
@media (max-width: 760px) { .tp-footer .container.tp-foot { grid-template-columns: 1fr 1fr; } }

/* ----- Badges + card facts ----- */
.tp-badge { display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #fff; background: #475569; vertical-align: middle; }
.tp-kind-guide { background: #2563eb; } .tp-kind-diagnosis { background: #dc2626; } .tp-kind-project { background: #7c3aed; }
.tp-kind-review { background: #d97706; } .tp-kind-tip { background: #16a34a; }
.tp-card-img .tp-badge { position: absolute; left: 12px; top: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tp-card-facts { display: flex; flex-wrap: wrap; gap: 6px; color: var(--text); font-size: .82rem; font-weight: 600; margin: 2px 0 6px; }
.tp-card-facts span { color: var(--text-muted); }
.tp-stars { color: #f59e0b; letter-spacing: 1px; }
.tp-muted { color: var(--text-muted); font-size: .85rem; }

/* ----- Home sections ----- */
.tp-picks { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: start; }
.tp-picks-side { display: grid; gap: 6px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
.tp-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; color: var(--text); }
.tp-row:hover { background: var(--bg-soft); }
.tp-row img, .tp-row-ph { width: 96px; height: 72px; flex-shrink: 0; border-radius: 8px; object-fit: cover; }
.tp-row-ph { display: grid; place-items: center; background: var(--bg-soft); font-size: 1.6rem; }
.tp-row-txt small { display: block; color: var(--primary); font-weight: 800; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.tp-row-txt b { display: block; line-height: 1.3; font-size: .95rem; }
.tp-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 28px; align-items: start; }
.tp-split .articles-grid { grid-template-columns: repeat(2, 1fr); }
.tp-side-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.tp-side-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.tp-pop { list-style: none; counter-reset: pop; margin: 0; padding: 0; display: grid; gap: 4px; }
.tp-pop li { counter-increment: pop; display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.tp-pop li:last-child { border-bottom: 0; }
.tp-pop li::before { content: counter(pop); font-weight: 800; font-size: 1.25rem; color: var(--primary); min-width: 22px; }
.tp-pop a { color: var(--text); font-weight: 600; line-height: 1.35; }
.tp-pop a:hover { color: var(--primary); }
.tp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tp-tile { display: block; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s; }
.tp-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.tp-tile .ic { font-size: 2rem; display: block; margin-bottom: 8px; }
.tp-tile b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.tp-tile span { color: var(--text-muted); font-size: .85rem; line-height: 1.45; display: block; }
.tp-2col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 28px; align-items: start; }
.tp-2col .articles-grid { grid-template-columns: repeat(2, 1fr); }
.tp-band { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); padding: 28px; }
.tp-about { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.tp-about p { color: var(--text-muted); max-width: 70ch; margin-top: 6px; }
@media (max-width: 860px) {
  .tp-picks, .tp-split, .tp-2col, .tp-about { grid-template-columns: 1fr; }
  .tp-split .articles-grid, .tp-2col .articles-grid { grid-template-columns: 1fr; }
}

/* ----- Newsletter ----- */
.tp-news-form h3 { font-size: 1.05rem; margin-bottom: 6px; }
.tp-news-form p { color: var(--text-muted); font-size: .9rem; margin-bottom: 12px; }
.tp-nl-row { display: flex; gap: 8px; }
.tp-nl-row input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.tp-nl-row button { padding: 0 16px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.tp-news-form small { display: block; margin-top: 8px; color: var(--text-muted); font-size: .78rem; }
.tp-nl-status { margin: 8px 0 0 !important; min-height: 1.2em; font-size: .85rem !important; }

/* ----- Article layout + template ----- */
.tp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
#sidebar { position: sticky; top: 84px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 20px; }
@media (max-width: 1000px) { .tp-layout { grid-template-columns: minmax(0, 1fr); } #sidebar { position: static; } }
.tp-layout > * { min-width: 0; }
.article-content pre { overflow-x: auto; }
.article-content { overflow-wrap: anywhere; }
.article-content pre, .article-content table { overflow-wrap: normal; }
.tp-head-badges { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tp-head-badges .article-category { margin-bottom: 0; }

.tp-glance { margin: 0 0 26px; padding: 20px; border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 12px; background: var(--bg-soft); }
.tp-glance h2 { font-size: 1.05rem; margin: 0 0 14px !important; }
.tp-g-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tp-g-cell span, .tp-g-lists span { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 3px; }
.tp-g-cell b { font-size: 1rem; }
.tp-skill i { font-style: normal; color: var(--primary); letter-spacing: 2px; }
.tp-safety { display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff; background: #16a34a; font-size: .85rem !important; }
.tp-safety-medium { background: #d97706; } .tp-safety-high { background: #dc2626; }
.tp-g-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.tp-g-lists ul { margin: 0 0 0 18px; padding: 0; font-size: .95rem; }
.tp-g-note { margin: 14px 0 0; font-weight: 600; font-size: .9rem; }

.tp-review { margin: 0 0 26px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-alt); }
.tp-review-head { font-size: 1.2rem; margin-bottom: 14px; }
.tp-review-head .tp-stars { font-size: 1.5rem; }
.tp-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tp-proscons h3 { font-size: 1rem; margin: 0 0 6px; }
.tp-proscons ul { margin: 0 0 0 18px; padding: 0; }
.tp-pros h3 { color: #16a34a; } .tp-cons h3 { color: #dc2626; }
.tp-verdict { margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); }
@media (max-width: 640px) { .tp-proscons { grid-template-columns: 1fr; } }

.tp-video { position: relative; margin: 0 0 26px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; }
.tp-video img, .tp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.tp-video .tp-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; background: rgba(220,38,38,.92); color: #fff; display: grid; place-items: center; font-size: 1.7rem; padding-left: 5px; box-shadow: 0 6px 24px rgba(0,0,0,.4); transition: transform .2s; }
.tp-video:hover .tp-play { transform: translate(-50%, -50%) scale(1.08); }
.tp-video.on { cursor: default; }

.tp-code { position: relative; margin: 0 0 18px; }
.tp-code pre { margin: 0; }
.tp-copy { position: absolute; right: 8px; top: 8px; z-index: 1; padding: 4px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; background: rgba(15,23,42,.85); color: #e2e8f0; font-size: .75rem; font-weight: 700; cursor: pointer; }
.tp-copy:hover { background: var(--primary); }

/* numbered steps: big counters */
.article-content ol { list-style: none; counter-reset: step; padding-left: 0; margin: 0 0 20px; }
.article-content ol > li { counter-increment: step; position: relative; padding: 4px 0 14px 50px; min-height: 40px; }
.article-content ol > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .95rem; }

/* ----- Category pages ----- */
.tp-cat-hero { margin: 26px 0 8px; padding: 34px 28px; border: 1px solid var(--border); border-radius: var(--radius-lg, 16px); background: var(--bg-soft); }
.tp-cat-hero h1 { font-size: 2rem; letter-spacing: -.02em; }
.tp-cat-hero p { color: var(--text-muted); max-width: 70ch; margin-top: 8px; }
