/*
Theme Name: SeniorDog
Theme URI: https://vidadecachorrovelho.com.br
Author: Lucrando Da Roça
Description: Tema WordPress ultraleve com visual de portal moderno: hero em destaque, grid de cartões com efeito glassmorphism, modo escuro, busca em overlay e tipografia Inter. Feito com JS puro (sem frameworks) e em conformidade com as boas práticas do Google AdSense.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: seniordog
*/

/* ============ Variáveis (claro e escuro) ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f6;
  --card: #ffffff;
  --text: #111112;
  --muted: #6b6b72;
  --accent: #7c3aed;
  --accent-2: #2563eb;
  --accent-dark: #6d28d9;
  --border: #e7e7ea;
  --glass: rgba(17, 17, 18, 0.55);
  --shadow: 0 2px 12px rgba(17, 17, 18, 0.06);
  --radius-lg: 32px;
  --radius: 20px;
}

[data-theme="dark"] {
  --bg: #0e0e11;
  --bg-soft: #16161a;
  --card: #1a1a1f;
  --text: #f2f2f4;
  --muted: #9a9aa5;
  --border: #2a2a31;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ============ Reset ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background 0.25s ease, color 0.25s ease;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); text-decoration: none; }
[data-theme="dark"] a { color: #a78bfa; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 800; color: var(--text); overflow-wrap: break-word; }

blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

::selection { background: var(--accent); color: #fff; }

/* ============ Acessibilidade ============ */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; left: 1rem; top: 1rem;
  width: auto; z-index: 999; background: var(--card); padding: .5rem 1rem;
  border-radius: 8px; display: inline-block;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ============ Layout ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.site-main { display: block; padding: 2rem 0 3.5rem; }
.content-area { max-width: 820px; margin: 0 auto; }

.entry-content > * { margin-bottom: 1.25rem; }
.entry-content h2 { font-size: 1.55rem; margin-top: 2.25rem; }
.entry-content h3 { font-size: 1.28rem; margin-top: 1.75rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: .6rem .8rem; text-align: left; }

/* ============ Header ============ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  transition: background 0.25s ease;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 72px;
}

.site-branding { display: flex; align-items: center; gap: .6rem; }
.site-title { font-size: 1.3rem; margin: 0; font-weight: 800; letter-spacing: -0.02em; }
.site-title a { color: var(--text); display: inline-flex; align-items: center; gap: .5rem; }
.site-title a:hover { text-decoration: none; }
.site-title a::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block; flex: none;
}
.custom-logo { max-height: 44px; width: auto; }
.site-description { display: none; }

/* Navegação centralizada */
.main-navigation { flex: 1; display: flex; justify-content: center; }
.main-navigation ul { list-style: none; display: flex; gap: .25rem; flex-wrap: wrap; justify-content: center; }
.main-navigation a {
  display: block; padding: .45rem .9rem; border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: .92rem;
  transition: background .15s ease;
}
.main-navigation a:hover, .main-navigation .current-menu-item > a {
  background: var(--bg-soft); text-decoration: none; color: var(--accent-dark);
}
[data-theme="dark"] .main-navigation a:hover, [data-theme="dark"] .main-navigation .current-menu-item > a { color: #a78bfa; }

/* Ações do topo: busca + modo escuro */
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-btn {
  background: none; border: 0; cursor: pointer; color: var(--text);
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn svg { width: 21px; height: 21px; }
.nav-toggle { display: none; }

/* ============ Hero (post em destaque) ============ */
.hero-post {
  position: relative; border-radius: var(--radius-lg);
  overflow: hidden; margin: 1rem 0 2.5rem;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 8;
}
@media (max-width: 700px) { .hero-post { aspect-ratio: 16 / 12; } }
.hero-post img { width: 100%; height: 100%; object-fit: cover; }
.hero-post::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.55) 100%);
}
.hero-overlay {
  position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.5rem; z-index: 2;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 18px; padding: 1.1rem 1.4rem;
  color: #fff;
}
.hero-overlay .entry-category { background: rgba(255,255,255,.18); color: #fff; }
.hero-overlay .hero-title {
  font-size: clamp(1.15rem, 2.6vw, 1.9rem); margin: .45rem 0 .3rem;
}
.hero-overlay .hero-title a { color: #fff; }
.hero-overlay .hero-title a:hover { text-decoration: none; color: #ddd6fe; }
.hero-overlay .entry-meta { color: rgba(255,255,255,.75); font-size: .85rem; }
.hero-overlay .read-more { color: #ddd6fe; }

/* ============ Grid de posts (glassmorphism) ============ */
.posts-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  position: relative; border-radius: var(--radius);
  overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(17,17,18,.14); }
.post-card > a.card-link { position: absolute; inset: 0; z-index: 1; }
.post-card img.entry-cover { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.post-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.45) 100%);
}
.card-overlay {
  position: absolute; left: .9rem; right: .9rem; bottom: .9rem; z-index: 2;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 14px; padding: .85rem 1rem; color: #fff;
}
.card-overlay .overlay-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; font-size: .72rem; margin-bottom: .4rem;
}
.card-overlay time { color: rgba(255,255,255,.7); text-transform: none; }
.card-overlay .entry-category {
  background: rgba(255,255,255,.18); color: #fff;
  padding: .18rem .6rem; border-radius: 999px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: .68rem;
  white-space: nowrap;
}
.card-overlay .entry-title { font-size: 1rem; line-height: 1.35; margin: 0; }
.card-overlay .entry-title a { color: #fff; }
.card-overlay .entry-title a:hover { color: #ddd6fe; text-decoration: none; }

/* Listagem simples (busca/arquivo sem imagem cobre o card) */
.post-card.no-cover { aspect-ratio: auto; }
.post-card.no-cover .card-plain { padding: 1.4rem; position: relative; z-index: 2; }
.post-card.no-cover .card-plain .entry-title { font-size: 1.15rem; }
.post-card.no-cover .card-plain .entry-title a { color: var(--text); }
.post-card.no-cover .card-plain .entry-excerpt { color: var(--muted); margin-top: .5rem; font-size: .93rem; }

/* ============ Paginação ============ */
.pagination { margin: 2.5rem 0; }
.nav-links { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.nav-links a, .nav-links span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); font-weight: 600; font-size: .9rem; color: var(--text);
  padding: 0 .5rem;
}
.nav-links a:hover { background: var(--bg-soft); text-decoration: none; }
.nav-links .current { background: #374151; color: #fff; border-color: #374151; }

/* ============ Artigo único ============ */
.page-header-archive { padding: 1rem 0 0; }
.page-title { font-size: 1.8rem; margin-bottom: 1.5rem; }

.single-post .entry-header { margin-bottom: 1.5rem; }
.single .entry-title { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: .5rem 0 .75rem; letter-spacing: -0.02em; }
.entry-meta { color: var(--muted); font-size: .88rem; display: flex; gap: .75rem; flex-wrap: wrap; }

.single-featured { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.single-featured img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.entry-tags { margin: 1.5rem 0; }
.entry-tags a {
  background: var(--bg-soft); color: var(--accent-dark);
  padding: .35rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  display: inline-block; margin: .25rem .25rem .25rem 0;
}
[data-theme="dark"] .entry-tags a { color: #a78bfa; }

.author-box {
  display: flex; gap: 1rem; background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem; margin: 2.25rem 0; align-items: flex-start;
}
.author-box img { border-radius: 50%; }
.author-box .author-name { font-weight: 800; }
.author-box p { color: var(--muted); font-size: .92rem; margin-top: .25rem; }

.related-posts h2 { font-size: 1.3rem; margin: 2.5rem 0 1.1rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .related-grid { grid-template-columns: 1fr; } }
.related-grid .post-card { margin-bottom: 0; }

/* ============ Widgets, sidebar e anúncios ============ */
.widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.35rem; margin-bottom: 1.5rem;
}
.widget-title { font-size: 1rem; margin-bottom: .8rem; }
.widget ul { list-style: none; }
.widget ul li { padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.widget ul li:last-child { border-bottom: 0; }

.ad-slot { margin: 1.75rem 0; text-align: center; overflow: hidden; }
.ad-slot-header { padding: .6rem 0; }
.site-header .ad-slot-header:empty { display: none; }

/* ============ Footer multicolumn ============ */
.site-footer { border-top: 1px solid var(--border); margin-top: 2.5rem; }
.footer-grid {
  display: grid; gap: 2rem; padding: 2.5rem 0;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .footer-logo { font-size: 1.15rem; font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: .5rem; }
.footer-brand .footer-logo::before {
  content: ""; width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
}
.footer-brand p { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.footer-col h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { padding: .22rem 0; }
.footer-col a { color: var(--text); font-size: .92rem; }
.footer-col a:hover { color: var(--accent-dark); }

.site-info { border-top: 1px solid var(--border); padding: 1.1rem 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* ============ Overlay de busca ============ */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; background: var(--glass);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 18vh;
}
.search-overlay.open { display: flex; }
.search-overlay .search-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.5rem; width: min(560px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.search-overlay .search-panel form { display: flex; gap: .6rem; }
.search-overlay input[type="search"] {
  flex: 1; border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .9rem; font: inherit; background: var(--bg-soft); color: var(--text);
}
.search-overlay button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: 0; border-radius: 12px; padding: 0 1.3rem;
  font-weight: 700; cursor: pointer;
}

/* ============ Comentários ============ */
.comments-area { margin-top: 2.5rem; }
.comment-list { list-style: none; }
.comment-list .comment { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.comment-form { display: grid; gap: .75rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 12px;
  padding: .65rem .85rem; font: inherit; background: var(--bg-soft); color: var(--text);
}
.comment-form .submit {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: 0; border-radius: 12px;
  padding: .7rem 1.5rem; font-weight: 700; cursor: pointer; width: auto;
}

/* ============ Responsivo ============ */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-navigation { position: absolute; top: 100%; left: 0; right: 0; display: none; background: var(--bg); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem 1.1rem; }
  .main-navigation.open { display: block; }
  .main-navigation ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-navigation a { padding: .6rem .9rem; }
  .header-inner { flex-wrap: wrap; }
}
