/*
Theme Name: TechBlog IA
Theme URI: https://techblog.ia.br
Author: Albenides Fernandes
Description: Tema editorial premium para o portal TechBlog IA.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: techblog-ia
*/

:root {
  --tb-bg: #070b14;
  --tb-bg-soft: #0a101b;
  --tb-panel: #0f1624;
  --tb-panel-2: #121a29;
  --tb-border: rgba(137, 151, 181, .14);
  --tb-text: #f5f7ff;
  --tb-muted: #9ca8bd;
  --tb-purple: #7c5cff;
  --tb-blue: #2878ff;
  --tb-shadow: 0 16px 45px rgba(0, 0, 0, .18);
}

html[data-theme="light"] {
  --tb-bg: #edf2fb;
  --tb-bg-soft: #f8faff;
  --tb-panel: #fff;
  --tb-panel-2: #f3f6fb;
  --tb-border: rgba(26, 39, 67, .13);
  --tb-text: #111827;
  --tb-muted: #667085;
  --tb-shadow: 0 15px 40px rgba(32, 48, 83, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--tb-bg); color: var(--tb-text); font-family: Inter, "Segoe UI", Arial, sans-serif; transition: background .25s, color .25s; }
body.admin-bar .tb-header { top: 32px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
.tb-container { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.tb-site { min-height: 100vh; background: radial-gradient(circle at 43% 7%, rgba(42, 83, 190, .13), transparent 30%), var(--tb-bg); }
.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; }

.tb-trend { min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid var(--tb-border); background: rgba(5, 8, 15, .75); }
html[data-theme="light"] .tb-trend { background: rgba(255,255,255,.82); }
.tb-trend__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.tb-trend p { margin: 0; color: var(--tb-muted); font-size: 12px; }
.tb-trend strong { margin-right: 13px; color: #8e70ff; letter-spacing: .04em; }
.tb-socials { display: flex; align-items: center; gap: 9px; }
.tb-socials a { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--tb-muted); font-size: 11px; font-weight: 800; transition: .2s; }
.tb-socials a:hover { color: #fff; background: var(--tb-purple); transform: translateY(-2px); }

.tb-header { position: sticky; z-index: 50; top: 0; height: 90px; display: flex; align-items: center; border-bottom: 1px solid var(--tb-border); background: color-mix(in srgb, var(--tb-bg) 88%, transparent); backdrop-filter: blur(18px); }
.tb-nav-wrap { display: flex; align-items: center; justify-content: space-between; }
.tb-logo { display: flex; align-items: center; gap: 12px; font-size: 27px; font-weight: 850; letter-spacing: -.045em; }
.tb-logo__mark { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid #6757fb; border-radius: 10px; color: #7063ff; background: rgba(76, 62, 219, .1); transform: rotate(30deg); }
.tb-logo__mark span { transform: rotate(-30deg); font-size: 22px; }
.tb-logo__name span { color: #6b5aff; }
.tb-logo__name small { margin-left: 4px; vertical-align: top; color: #8795ff; font-size: 8px; letter-spacing: .08em; }
.custom-logo { max-width: 190px; max-height: 60px; width: auto; }
.tb-menu { display: flex; align-items: stretch; height: 90px; gap: 35px; margin: 0 0 0 70px; padding: 0; list-style: none; }
.tb-menu li { display: flex; }
.tb-menu a { position: relative; display: flex; align-items: center; font-size: 14px; font-weight: 650; }
.tb-menu a::after { content: ""; position: absolute; bottom: 0; left: 50%; right: 50%; height: 2px; background: linear-gradient(90deg, var(--tb-blue), var(--tb-purple)); transition: .25s; }
.tb-menu a:hover::after, .tb-menu .current-menu-item a::after { left: 0; right: 0; }
.tb-actions { display: flex; align-items: center; gap: 13px; }
.tb-icon-btn, .tb-menu-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.tb-icon-btn:hover { background: var(--tb-panel-2); }
.tb-theme-btn { background: #202a41; color: #dce3ff; }
html[data-theme="light"] .tb-theme-btn { background: #e3e9f4; color: #38435d; }
.tb-subscribe-btn { min-width: 106px; height: 49px; display: grid; place-items: center; border-radius: 9px; color: #fff; font-size: 14px; font-weight: 750; background: linear-gradient(135deg, #256ae9, #6c43e9); box-shadow: 0 8px 24px rgba(64,69,230,.25); transition: .2s; }
.tb-subscribe-btn:hover { transform: translateY(-2px); }
.tb-menu-btn { display: none; }
.tb-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tb-main { padding-top: 25px; }
.tb-hero-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); gap: 24px; }
.tb-panel { border: 1px solid var(--tb-border); border-radius: 12px; background: linear-gradient(145deg, var(--tb-panel), color-mix(in srgb, var(--tb-panel) 86%, #18233b)); box-shadow: var(--tb-shadow); }
.tb-hero { position: relative; height: 505px; overflow: hidden; border-radius: 12px; }
.tb-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tb-hero__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,8,18,.88), rgba(4,10,22,.42) 64%, rgba(5,9,17,.2)), linear-gradient(0deg, rgba(4,8,16,.96), transparent 62%); }
.tb-badge { position: absolute; top: 21px; left: 20px; padding: 9px 13px; border-radius: 7px; color: #fff; font-size: 10px; font-weight: 850; background: linear-gradient(135deg, #435cff, #713fed); }
.tb-hero__content { position: absolute; left: 26px; right: 28px; bottom: 23px; }
.tb-category { display: inline-flex; padding: 7px 10px; border-radius: 6px; color: #e3e8f6; background: rgba(30,43,70,.83); font-size: 10px; font-weight: 800; }
.tb-hero h1 { max-width: 780px; margin: 14px 0 10px; color: #fff; font-size: clamp(30px, 3vw, 43px); line-height: 1.09; letter-spacing: -.035em; }
.tb-hero h1 a:hover { color: #d7d3ff; }
.tb-hero__excerpt { max-width: 680px; margin: 0; color: #c7d0df; font-size: 15px; line-height: 1.65; }
.tb-meta { margin-top: 20px; display: flex; gap: 17px; align-items: center; color: #bac3d2; font-size: 11px; }
.tb-author { display: flex; align-items: center; gap: 8px; }
.tb-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; color: #fff; background: linear-gradient(135deg,#7d5cff,#1d74e8); font-size: 9px; font-weight: 800; }
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-reading { margin-left: auto; }

.tb-latest { padding: 24px 20px; }
.tb-heading-line { margin: 0 0 20px; padding-left: 13px; border-left: 3px solid var(--tb-purple); font-size: 17px; }
.tb-latest__list { display: grid; gap: 18px; }
.tb-latest__item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.tb-latest__thumb { height: 75px; overflow: hidden; border-radius: 8px; background: #17233a; }
.tb-latest__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-latest__item strong { display: block; font-size: 13px; line-height: 1.42; }
.tb-latest__item time { display: block; margin-top: 7px; color: var(--tb-muted); font-size: 10px; }
.tb-latest__item:hover strong { color: #8f7aff; }

.tb-categories { margin-top: 24px; padding: 25px 15px; display: grid; grid-template-columns: repeat(8, 1fr); }
.tb-category-link { min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; border-radius: 10px; text-align: center; transition: .22s; }
.tb-category-link:hover { background: var(--tb-panel-2); transform: translateY(-3px); }
.tb-category-link b { color: #735fff; font-size: 29px; font-weight: 500; }
.tb-category-link span { font-size: 10px; font-weight: 700; }

.tb-content-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); gap: 22px; align-items: start; margin: 24px 0 28px; }
.tb-highlights { padding: 23px 20px 18px; }
.tb-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; }
.tb-section-head h2 { position: relative; margin: 0; font-size: 21px; }
.tb-section-head h2::after { content: ""; position: absolute; bottom: -10px; left: 0; width: 30px; height: 2px; background: linear-gradient(90deg,var(--tb-blue),var(--tb-purple)); }
.tb-section-head a { color: #7791ff; font-size: 11px; }
.tb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tb-card { overflow: hidden; border: 1px solid var(--tb-border); border-radius: 10px; background: var(--tb-panel-2); transition: .25s; }
.tb-card:hover { transform: translateY(-5px); border-color: rgba(107,88,255,.45); box-shadow: 0 14px 32px rgba(0,0,0,.18); }
.tb-card__image { display: block; height: 166px; overflow: hidden; background: #17233a; }
.tb-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.tb-card:hover .tb-card__image img { transform: scale(1.05); }
.tb-card__body { padding: 16px 15px 14px; }
.tb-card__category { color: #b962ef; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tb-card h3 { min-height: 65px; margin: 10px 0 8px; font-size: 15px; line-height: 1.4; }
.tb-card h3 a:hover { color: #8774ff; }
.tb-card p { min-height: 68px; margin: 0; color: var(--tb-muted); font-size: 11px; line-height: 1.55; }
.tb-card__meta { margin-top: 14px; display: flex; justify-content: space-between; color: var(--tb-muted); font-size: 9px; }
.tb-more { margin: 19px auto 0; min-height: 41px; display: flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--tb-border); border-radius: 7px; color: #ecf0ff; background: linear-gradient(135deg,#202d55,#1b2240); font-size: 11px; }

.tb-sidebar { display: grid; gap: 15px; }
.tb-side-card { padding: 20px; }
.tb-side-card h2 { margin: 0 0 17px; font-size: 17px; }
.tb-newsletter p { color: var(--tb-muted); font-size: 12px; line-height: 1.55; }
.tb-newsletter form { display: grid; grid-template-columns: 1fr auto; margin-top: 17px; }
.tb-newsletter input, .tb-footer-newsletter input { min-width: 0; height: 44px; padding: 0 13px; border: 1px solid var(--tb-border); border-radius: 7px 0 0 7px; outline: 0; color: var(--tb-text); background: var(--tb-panel-2); font-size: 11px; }
.tb-newsletter input:focus, .tb-footer-newsletter input:focus { border-color: var(--tb-purple); }
.tb-newsletter button { border: 0; border-radius: 0 7px 7px 0; padding: 0 16px; color: #fff; background: linear-gradient(135deg,#5159f3,#753fde); cursor: pointer; font-size: 10px; font-weight: 750; }
.tb-newsletter small { display: block; margin-top: 11px; color: var(--tb-muted); font-size: 9px; }
.tb-popular { padding: 0; margin: 0; list-style: none; }
.tb-popular li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--tb-border); }
.tb-popular__number { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border: 2px solid #6949cf; border-radius: 50%; font-size: 11px; font-weight: 800; }
.tb-popular a { font-size: 11px; line-height: 1.35; }
.tb-popular a:hover { color: #8a78ff; }
.tb-popular time { display: block; margin-top: 3px; color: var(--tb-muted); font-size: 9px; }
.tb-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tb-tags a { padding: 7px 9px; border-radius: 6px; background: var(--tb-panel-2); font-size: 9px; transition: .2s; }
.tb-tags a:hover { color: #fff; background: var(--tb-purple); }

.tb-footer { margin-top: 24px; border-top: 1px solid var(--tb-border); background: radial-gradient(circle at 50% 20%,rgba(36,62,122,.11),transparent 40%),var(--tb-bg-soft); }
.tb-footer__grid { display: grid; grid-template-columns: 1.6fr .8fr .9fr 1fr 1.35fr; gap: 45px; padding-block: 46px 31px; }
.tb-footer h3 { position: relative; margin: 0 0 12px; font-size: 13px; }
.tb-footer h3::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 20px; height: 2px; background: var(--tb-purple); }
.tb-footer p { color: var(--tb-muted); font-size: 11px; line-height: 1.65; }
.tb-footer__column { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.tb-footer__column a { color: var(--tb-muted); font-size: 10px; }
.tb-footer__column a:hover { color: #8e7bff; }
.tb-footer-newsletter form { display: grid; grid-template-columns: 1fr 46px; width: 100%; }
.tb-footer-newsletter button { border: 1px solid var(--tb-border); border-radius: 0 7px 7px 0; color: #fff; background: #1f2b4b; cursor: pointer; }
.tb-copyright { min-height: 58px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--tb-border); color: var(--tb-muted); font-size: 9px; }
.tb-copyright div { display: flex; gap: 25px; }

.tb-archive-header { padding: 55px 0 28px; }
.tb-archive-header h1 { margin: 0 0 10px; font-size: clamp(32px,5vw,54px); letter-spacing: -.04em; }
.tb-archive-header p { max-width: 700px; color: var(--tb-muted); }
.tb-archive-grid { margin-bottom: 55px; }
.tb-pagination { margin: 30px 0; }
.tb-pagination .nav-links { display: flex; gap: 8px; }
.tb-pagination .page-numbers { padding: 9px 13px; border: 1px solid var(--tb-border); border-radius: 6px; background: var(--tb-panel); }
.tb-pagination .current { color: #fff; background: var(--tb-purple); }

.tb-single { width: min(880px, calc(100% - 40px)); margin: 45px auto 70px; }
.tb-single__header { margin-bottom: 25px; }
.tb-single__header h1 { margin: 14px 0 15px; font-size: clamp(35px,5vw,60px); line-height: 1.06; letter-spacing: -.045em; }
.tb-single__featured { overflow: hidden; margin: 30px 0; border-radius: 16px; }
.tb-single__featured img { width: 100%; max-height: 520px; object-fit: cover; }
.tb-entry { color: color-mix(in srgb, var(--tb-text) 89%, var(--tb-muted)); font-size: 17px; line-height: 1.85; }
.tb-entry h2, .tb-entry h3 { margin-top: 1.7em; line-height: 1.25; color: var(--tb-text); }
.tb-entry a { color: #8171ff; text-decoration: underline; }
.tb-entry blockquote { margin: 30px 0; padding: 18px 25px; border-left: 4px solid var(--tb-purple); background: var(--tb-panel); }
.tb-entry pre { max-width: 100%; overflow: auto; padding: 18px; border-radius: 9px; background: #050812; }
.tb-entry img { border-radius: 10px; }
.tb-author-box { display: grid; grid-template-columns: 65px 1fr; gap: 16px; margin-top: 40px; padding: 22px; }
.tb-author-box .tb-avatar { width: 65px; height: 65px; }
.tb-author-box h3 { margin: 3px 0 7px; }
.tb-author-box p { margin: 0; color: var(--tb-muted); font-size: 12px; line-height: 1.55; }
.tb-empty { margin: 50px auto 80px; padding: 45px; text-align: center; }

.tb-search-modal { position: fixed; z-index: 120; inset: 0; display: none; padding-top: 13vh; background: rgba(3,6,13,.93); backdrop-filter: blur(18px); }
.tb-search-modal.is-open { display: block; }
.tb-search-modal__close { position: absolute; top: 35px; right: 4vw; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 28px; }
.tb-search-form { width: min(760px, calc(100% - 40px)); display: grid; grid-template-columns: 1fr auto; margin-inline: auto; border: 1px solid rgba(120,99,255,.65); border-radius: 13px; overflow: hidden; background: #111827; box-shadow: 0 20px 70px rgba(0,0,0,.45); }
.tb-search-form input { min-width: 0; height: 65px; padding: 0 20px; border: 0; outline: 0; color: #fff; background: transparent; font-size: 18px; }
.tb-search-form button { width: 70px; border: 0; color: #fff; background: linear-gradient(135deg,#315eea,#7044e9); cursor: pointer; }
.tb-toast { position: fixed; z-index: 150; right: 24px; bottom: 24px; display: none; max-width: 380px; padding: 14px 18px; border: 1px solid rgba(103,89,255,.5); border-radius: 9px; color: #fff; background: #161f34; box-shadow: 0 18px 50px rgba(0,0,0,.35); font-size: 11px; }
.tb-toast.is-visible { display: block; }

@media (max-width: 1100px) {
  .tb-menu { gap: 21px; margin-left: 25px; }
  .tb-categories { grid-template-columns: repeat(4,1fr); }
  .tb-content-layout { grid-template-columns: minmax(0,2.2fr) minmax(275px,1fr); }
  .tb-grid { grid-template-columns: repeat(2,1fr); }
  .tb-footer__grid { grid-template-columns: 1.4fr repeat(3,.8fr); }
  .tb-footer-newsletter { grid-column: 1/-1; }
}
@media (max-width: 820px) {
  body.admin-bar .tb-header { top: 46px; }
  .tb-container { width: min(100% - 28px,680px); }
  .tb-trend .tb-socials, .tb-subscribe-btn { display: none; }
  .tb-header { height: 74px; }
  .tb-logo { font-size: 23px; }
  .tb-logo__mark { width: 39px; height: 39px; }
  .tb-menu-wrap { position: absolute; top: 74px; left: 0; right: 0; display: none; padding: 12px 20px 20px; border-bottom: 1px solid var(--tb-border); background: var(--tb-panel); }
  .tb-menu-wrap.is-open { display: block; }
  .tb-menu { height: auto; flex-direction: column; gap: 0; margin: 0; }
  .tb-menu li, .tb-menu a { min-height: 46px; }
  .tb-menu-btn { display: grid; }
  .tb-hero-layout, .tb-content-layout { grid-template-columns: 1fr; }
  .tb-latest { display: none; }
  .tb-sidebar { grid-template-columns: 1fr 1fr; }
  .tb-tags-card { grid-column: 1/-1; }
  .tb-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (max-width: 560px) {
  .tb-trend p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-main { padding-top: 14px; }
  .tb-hero { height: 500px; }
  .tb-hero__content { left: 18px; right: 18px; bottom: 18px; }
  .tb-hero h1 { font-size: 29px; }
  .tb-hero__excerpt { font-size: 13px; }
  .tb-meta { flex-wrap: wrap; gap: 9px; }
  .tb-reading { width: 100%; margin-left: 0; }
  .tb-categories { grid-template-columns: repeat(2,1fr); padding: 14px 8px; }
  .tb-category-link { min-height: 105px; }
  .tb-highlights { padding-inline: 13px; }
  .tb-grid, .tb-sidebar { grid-template-columns: 1fr; }
  .tb-card__image { height: 210px; }
  .tb-card h3, .tb-card p { min-height: 0; }
  .tb-card p { margin-bottom: 15px; }
  .tb-tags-card { grid-column: auto; }
  .tb-footer__grid { grid-template-columns: 1fr 1fr; gap: 33px 23px; }
  .tb-footer-brand, .tb-footer-newsletter { grid-column: 1/-1; }
  .tb-copyright { flex-direction: column; justify-content: center; gap: 12px; padding-block: 17px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
