/*
Theme Name: TechFeed
Theme URI: https://example.com/techfeed
Author: techfeed
Description: Tema de blog de notícias de tecnologia com grid de cards coloridos por categoria, inspirado em portais como TechTudo/Tecmundo. Categorias nativas do WordPress, post fixado (sticky) vira o destaque da home, tempo de leitura calculado automaticamente.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techfeed
*/

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e7eaf0;
  --text: #14181f;
  --text-muted: #6b7280;
  --brand: #2e5eff;
  --brand-dim: #1e46d6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
*:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  max-width: 980px;
  margin: 0 auto;
  gap: 1rem;
}
.brand {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand span { color: var(--brand); }

.primary-nav { display: flex; gap: 0.5rem; }
.primary-nav ul { list-style: none; display: flex; gap: 0.5rem; margin: 0; padding: 0; }
.primary-nav a {
  background: none;
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-block;
}
.primary-nav a:hover { background: var(--bg); color: var(--text); }
.primary-nav .current-menu-item a { background: var(--brand); color: #fff; }

.header-search { flex-shrink: 0; }
.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.5rem 0.9rem;
}
.search-box input { background: none; border: none; font-size: 0.85rem; width: 140px; }
.search-box input:focus { outline: none; }
.search-box button { background: none; border: none; display: flex; color: var(--text-muted); }

.category-bar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0 1.5rem 0.9rem;
  max-width: 980px;
  margin: 0 auto;
  scrollbar-width: thin;
}
.category-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}
.category-link:hover { color: var(--text); border-color: var(--cat-color, var(--brand)); }
.category-link.is-active {
  background: var(--cat-color, var(--brand));
  border-color: var(--cat-color, var(--brand));
  color: #fff;
}

/* ---------- Layout ---------- */
.container { max-width: 980px; margin: 0 auto; padding: 1.75rem 1.5rem; flex: 1; width: 100%; }
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Ad widget areas ---------- */
.ad-slot {
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 1rem;
  margin: 1.25rem 0;
  border-radius: 8px;
}
.ad-slot-widget { margin: 1.25rem 0; }
.ad-slot-widget:empty { display: none; }

/* ---------- Category badge / monogram cover ---------- */
.cat-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 0.28rem 0.6rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.02em;
  width: fit-content;
}
.card-cover {
  height: 150px; border-radius: 12px 12px 0 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-cover-hero { height: 220px; border-radius: 14px; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover-monogram {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  font-size: 2rem;
  letter-spacing: 0.05em;
}
.card-cover-hero .card-cover-monogram { font-size: 3rem; }

/* ---------- Featured card ---------- */
.featured-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 1.25rem;
}
.featured-card:hover { box-shadow: 0 8px 24px rgba(20,24,31,0.08); }
.featured-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.breaking-pill {
  background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
  padding: 0.2rem 0.55rem; border-radius: 999px; text-transform: uppercase; width: fit-content;
}
.featured-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1.25; margin: 0.2rem 0 0; }
.featured-excerpt { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin: 0; }

.card-meta { display: flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.78rem; margin-top: 0.3rem; flex-wrap: wrap; }
.meta-readtime { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ---------- Card grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.news-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; height: 100%;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.news-card:hover { box-shadow: 0 8px 20px rgba(20,24,31,0.08); transform: translateY(-2px); }
.news-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.news-card-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1rem; line-height: 1.35; margin: 0.15rem 0 0; }
.news-card-title a:hover { color: var(--brand); }
.news-card-excerpt {
  color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.35rem; margin-top: 1.75rem; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted); padding: 0 0.6rem;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .page-numbers.dots { border: none; background: none; }

.loading-state, .empty-state { color: var(--text-muted); font-size: 0.92rem; padding: 3rem 0; text-align: center; }

/* ---------- Category archive header ---------- */
.category-header { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.5rem; }
.category-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--cat-color, var(--brand));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.1rem;
}
.category-title { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.5rem; margin: 0; }
.category-subtitle { color: var(--text-muted); font-size: 0.85rem; margin: 0.15rem 0 0; }

/* ---------- Single article ---------- */
.article-page { max-width: 720px; margin: 0 auto; }
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-weight: 600; font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.1rem;
}
.back-link:hover { color: var(--brand); }
.article-header { display: flex; flex-direction: column; gap: 0.55rem; margin: 1.2rem 0 1.4rem; }
.article-title { font-family: "Sora", sans-serif; font-weight: 800; font-size: 2rem; line-height: 1.2; margin: 0; }
.article-meta { margin-top: 0.2rem; }
.article-excerpt {
  font-size: 1.08rem; color: var(--text); border-left: 3px solid var(--brand);
  padding-left: 1rem; margin-bottom: 1.6rem; font-style: italic;
}
.article-body { line-height: 1.8; font-size: 1rem; }
.article-body p { margin-bottom: 1.15rem; }
.article-body img { border-radius: 10px; margin: 1rem 0; }
.related-section { margin-top: 2.2rem; border-top: 1px solid var(--border); padding-top: 1.3rem; }
.related-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.9rem; }
.link-btn { color: var(--brand); text-decoration: underline; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .primary-nav, .header-search { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .article-title, .featured-title { font-size: 1.4rem; }
}
