/*
Theme Name: Larkspur
Description: Tema clássico de blog com barra lateral direita, cards em grade e tipografia limpa para sites de conteúdo.
Author: Treino no Apê
Version: 1.4.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: larkspur
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #f6f0e3;
  --fg: #37332c;
  --muted: #7d7466;
  --border: #e2d8c3;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --accent: #c05f3c;
  --accent-deep: #a04a2c;
  --teal: #2f5f5b;
  --teal-deep: #244a47;
  --olive: #8a8760;
  --surface: #fdfaf3;
  --ink-soft: #554f44;
  --sidebar-w: 320px;
  --gap: 28px;
  --thumb-ratio: 16 / 9;
  font-size: 16px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--fg); margin: 0 0 .5em; overflow-wrap: break-word; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }
blockquote {
  margin: 0 0 1.1em;
  padding: .4em 1.2em;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
hr { border: 0; border-top: 1px dashed var(--border); margin: 2em 0; }
table { border-collapse: collapse; width: 100%; margin-bottom: 1.1em; }
th, td { border: 1px solid var(--border); padding: .5em .8em; text-align: left; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  clip: rect(1px,1px,1px,1px); overflow: hidden;
}

/* ---------- Utility classes ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.flex-center { display: flex; align-items: center; gap: 12px; }
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: .65em 1.4em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { padding-top: 14px; padding-bottom: 14px; }
.brand-link {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.01em;
}
.brand-link:hover { color: var(--accent); text-decoration: none; }
.custom-logo-link img { max-height: 48px; width: auto; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.menu li { position: relative; }
.menu a {
  display: block;
  padding: .55em .85em;
  color: var(--fg);
  font-weight: 500;
  border-radius: var(--radius);
}
.menu a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: .4em 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  z-index: 50;
}
.menu li:hover > .sub-menu,
.menu li:focus-within > .sub-menu,
.menu li.open > .sub-menu { opacity: 1; visibility: visible; }
.menu .sub-menu a { padding: .45em 1em; border-radius: 0; font-weight: 400; }
.sub-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: .5em;
  font: inherit;
}

#search-toggle, #nav-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg);
}
#search-toggle:hover, #nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
#nav-toggle { display: none; }

#search-panel {
  border-top: 1px dashed var(--border);
  background: var(--surface);
  padding: 18px 0;
}
#search-panel .search-form { max-width: 640px; margin: 0 auto; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-field {
  flex: 1;
  padding: .6em .9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--fg);
}
.search-field:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.search-submit {
  background: var(--teal);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: .6em 1.2em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.search-submit:hover { background: var(--teal-deep); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding-top: 14px;
  font-size: .875rem;
  color: var(--muted);
}
.breadcrumb .crumb { color: var(--muted); }
.breadcrumb a.crumb:hover { color: var(--accent); }
.breadcrumb .trail { margin: 0 .5em; color: var(--border); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 40px;
  padding-top: 28px;
  padding-bottom: 48px;
  align-items: start;
}
.content-area { min-width: 0; }

/* ---------- Hero (text-only, centered) ---------- */
.hero {
  text-align: center;
  padding: 48px 20px 40px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 32px;
}
.hero h1 { font-size: 2.4rem; margin-bottom: .35em; }
.hero-desc {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Post cards ---------- */
.post-card { display: flex; flex-direction: column; }
.post-card .card-thumb img {
  width: 100%;
  aspect-ratio: var(--thumb-ratio);
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-meta {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .5em;
  display: flex;
  gap: .6em;
  flex-wrap: wrap;
}
.card-meta a { color: var(--olive); font-weight: 600; }
.card-title { font-size: 1.15rem; margin-bottom: .4em; }
.card-title a { color: var(--fg); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: .925rem; margin-bottom: 0; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block;
  padding: .45em .9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
}
.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Single post ---------- */
.single-post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px; }
.post-header { margin-bottom: 1.4em; }
.post-header h1 { font-size: 2rem; margin-bottom: .3em; }
.post-meta { color: var(--muted); font-size: .875rem; margin: 0; }
.post-meta a { color: var(--teal); font-weight: 500; }
.post-featured { margin: 0 0 1.6em; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.post-featured img { width: 100%; }
.entry-content { overflow-wrap: break-word; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.table-scroll { overflow-x: auto; margin-bottom: 1.1em; }
.table-scroll table { margin-bottom: 0; }

.tag-list { list-style: none; margin: 1.8em 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.tag-list a {
  display: inline-block;
  border: 1px dashed var(--olive);
  color: var(--olive);
  border-radius: 999px;
  padding: .25em .9em;
  font-size: .8rem;
  font-weight: 500;
}
.tag-list a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.author-bio {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 2em;
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.author-bio .avatar { border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.author-bio h3 { font-size: 1rem; margin-bottom: .2em; }
.author-bio p { font-size: .9rem; color: var(--ink-soft); margin: 0; }

.article-note {
  margin-top: 2em;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .925rem;
  color: var(--ink-soft);
}
.article-note strong { color: var(--accent-deep); }

.related-posts { margin-top: 2.4em; border-top: 1px dashed var(--border); padding-top: 1.6em; }
.related-posts > h2 { font-size: 1.3rem; }
.related-posts .grid { gap: var(--gap); }
.related-posts .card-body { padding: 14px 16px 16px; }
.related-posts .card-title { font-size: .95rem; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 2.4em; border-top: 1px dashed var(--border); padding-top: 1.6em; }
.comments-title { font-size: 1.3rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 2em; }
.comment-list .children { list-style: none; margin-left: 1.6em; padding-left: 1.2em; border-left: 1px dashed var(--border); }
.comment-body {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.comment-meta { font-size: .8rem; color: var(--muted); margin-bottom: .4em; }
.comment-meta .fn { color: var(--fg); font-weight: 600; font-size: .95rem; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { font-size: .85rem; }
.comment-respond { margin-top: 1.6em; }
.comment-form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .3em; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .6em .9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--fg);
  margin-bottom: 1em;
}
.comment-form .submit {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: .65em 1.5em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.comment-form .submit:hover { background: var(--accent-deep); }
.comment-navigation { display: flex; justify-content: space-between; margin-bottom: 1.4em; font-size: .875rem; }

/* ---------- Sidebar ---------- */
.sidebar .widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: var(--gap);
}
.widget-title {
  font-size: 1.05rem;
  margin-bottom: .8em;
  padding-bottom: .5em;
  border-bottom: 1px dashed var(--border);
  color: var(--teal);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: .35em 0; border-bottom: 1px dashed var(--border); font-size: .925rem; }
.widget ul li:last-child { border-bottom: 0; }
.widget ul li a { color: var(--fg); }
.widget ul li a:hover { color: var(--accent); }
.widget .post-date { display: block; font-size: .78rem; color: var(--muted); }
.widget ul li .count { color: var(--muted); font-size: .8rem; }
.sidebar .search-form { flex-direction: column; }

/* ---------- Page ---------- */
.page-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px; }

/* ---------- 404 / empty ---------- */
.not-found-box { text-align: center; padding: 48px 20px; }
.not-found-box h1 { font-size: 2.2rem; }
.not-found-box .search-form { max-width: 480px; margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-deep);
  color: #d8e2df;
  margin-top: 48px;
  padding: 48px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: 36px;
}
.foot-brand-link {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.foot-brand-link:hover { color: #e8b9a4; text-decoration: none; }
.foot-text { color: #c4d2ce; font-size: .9rem; }
.foot-head {
  font-weight: 700;
  color: #fff;
  font-size: .95rem;
  margin: 0 0 .7em;
  padding-bottom: .5em;
  border-bottom: 1px dashed rgba(255,255,255,.25);
}
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin-bottom: .45em; }
.foot-links a { color: #c4d2ce; font-size: .9rem; }
.foot-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px dashed rgba(255,255,255,.2);
  padding-top: 18px;
  text-align: center;
  font-size: .85rem;
  color: #a9bab5;
}
.footer-bottom p { margin: 0; }
.foot-note { margin-top: .4em !important; font-size: .8rem; opacity: .8; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { margin-top: 8px; }
}
@media (max-width: 760px) {
  #nav-toggle { display: inline-flex; }
  #site-nav { display: none; width: 100%; order: 3; }
  #site-nav.open { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-header .flex-center { order: 2; }
  .menu { flex-direction: column; gap: 0; }
  .menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin-left: 14px;
  }
  .menu li.open > .sub-menu { display: block; }
  .menu li { display: flex; flex-wrap: wrap; align-items: center; }
  .menu li > a { flex: 1; }
  .sub-toggle { display: inline-flex; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .single-post, .page-content { padding: 22px 20px; }
  .author-bio { flex-direction: column; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.55rem; }
  .hero h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.5rem; }
  .not-found-box h1 { font-size: 1.7rem; }
}
