/*
Theme Name: Nemea
Theme URI: https://nemea.pt
Author: Nemea
Author URI: https://nemea.pt
Description: Tema editorial da Nemea — alinhado com a aplicação nemea.pt (verde esmeralda, IBM Plex, cartões limpos, grelha de 3 colunas com barra lateral).
Version: 1.3.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: nemea
*/

/* ============================================================
   Nemea blog — design tokens mirrored from the app (globals.css)
   ============================================================ */
:root {
  /* Tokens mirrored from the nemea.pt landing (apps/landing/globals.css) so the blog reads as the
     same site: forest-ink text, green-tinted surface, mint hovers, Fraunces display. */
  --primary: #16a34a;
  --primary-600: #15803d;   /* landing --primary-700 */
  --primary-050: #f0fdf4;
  --ink: #0e1f16;           /* landing --foreground */
  --bg: #f6f8f5;            /* landing --background */
  --card: #ffffff;
  --muted: #5b6b62;         /* landing --muted-fg */
  --muted-2: #8a978d;
  --border: #e0e6e1;        /* landing --line */
  --accent: #e7f8ee;        /* landing --mint */
  --mint: #e7f8ee;
  --forest: #0b3d2e;        /* landing --forest */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 31, 22, .04), 0 8px 24px -16px rgba(14, 31, 22, .18);
  --shadow-lg: 0 12px 32px -14px rgba(14, 31, 22, .22);
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif; /* display, matches landing */
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--ink); line-height: 1.2; font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Header — exact nemea.pt SiteNav replica ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff; font-weight: 600;
  display: grid; place-items: center; font-family: var(--font-serif); font-size: 18px;
}
.brand-name { font-family: var(--font-sans); font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a { font-family: var(--font-sans); font-size: 14px; font-weight: 400; color: var(--muted); transition: color .15s; }
.main-nav a:hover { color: var(--ink); text-decoration: none; }
.main-nav a.is-active { color: var(--ink); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-entrar { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--ink); padding: 8px 14px; border-radius: 8px; transition: background .15s; }
.nav-entrar:hover { background: var(--mint); text-decoration: none; }
.nav-cta { font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: #fff; background: var(--primary); padding: 8px 16px; border-radius: 8px; transition: background .15s; }
.nav-cta:hover { background: var(--primary-600); color: #fff; text-decoration: none; }
@media (max-width: 860px) { .main-nav { display: none; } }
@media (max-width: 520px) { .nav-entrar { display: none; } }

/* ---------- Hero banner (blog index) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px;
  background: var(--forest) url('assets/hero.jpg') center/cover no-repeat;
  margin: 30px 0 10px; padding: 68px 52px; color: #fff; box-shadow: var(--shadow);
}
.hero::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(8,42,30,.88) 0%, rgba(8,42,30,.55) 55%, rgba(8,42,30,.22) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #a7f3d0; }
.hero h1 { font-family: var(--font-serif); color: #fff; font-weight: 500; letter-spacing: -.02em;
  line-height: 1.04; font-size: clamp(30px, 4.6vw, 52px); margin: 12px 0 0; max-width: 17ch; }
.hero p { color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.6; margin: 16px 0 0; max-width: 50ch; }
.hero .hero-cta { margin-top: 26px; display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--forest); font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 10px; transition: transform .15s, box-shadow .15s; }
.hero .hero-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -12px rgba(0,0,0,.4); text-decoration: none; }
@media (max-width: 560px) { .hero { padding: 44px 28px; border-radius: 16px; } }

/* ---------- Page hero ---------- */
.page-hero { padding: 44px 0 8px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; letter-spacing: -.02em; }
.page-hero p { margin: 0; color: var(--muted); font-size: 17px; max-width: 60ch; }
.page-hero .eyebrow { font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--primary-600); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

/* ---------- Layout: content + right sidebar ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 28px 0 64px; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Post grid (3 columns) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 1180px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d7dce3; }
.card-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #eef2f7, #e3ede7); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-thumb.placeholder { display: grid; place-items: center; color: var(--primary); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chip {
  align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--primary-600);
  background: var(--accent); padding: 3px 10px; border-radius: 999px; line-height: 1.5;
}
.card h2 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.card h2 a { color: var(--ink); }
.card h2 a:hover { color: var(--primary-600); text-decoration: none; }
.card .excerpt { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.card .meta { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 13px; margin-top: 4px; }
.card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 88px; }
@media (max-width: 980px) { .sidebar { position: static; } }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.widget-title { font-family: var(--font-sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.widget li { margin: 0; }
.widget li a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: 14.5px; transition: background .15s; }
.widget li a:hover { background: #f1f3f6; text-decoration: none; color: var(--primary-600); }
.widget .count { color: var(--muted-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.search-form { display: flex; gap: 8px; }
.search-form input[type=search] {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fbfcfd;
}
.search-form input[type=search]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.search-form button {
  border: 0; background: var(--primary); color: #fff; border-radius: 10px; padding: 9px 14px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.search-form button:hover { background: var(--primary-600); }
.recent-post { display: flex; gap: 12px; padding: 8px 0; }
.recent-post:not(:last-child) { border-bottom: 1px solid var(--border); }
.recent-post .rp-thumb { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; flex: none; background: #eef2f7; }
.recent-post .rp-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.recent-post .rp-title a { color: inherit; }
.recent-post .rp-date { font-size: 12px; color: var(--muted-2); margin-top: 3px; }

/* ---------- Single post ---------- */
.single .layout { grid-template-columns: minmax(0, 1fr) 300px; }
.article { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 8px 36px; box-shadow: var(--shadow); overflow: hidden; }
.article > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.article-featured { max-width: none; margin: 0 0 28px; aspect-ratio: 16 / 8; overflow: hidden; border-radius: 12px; }
.article-featured img { width: 100%; height: 100%; object-fit: cover; }
.article-head { padding-top: 24px; }
.article-head .chip { margin-bottom: 14px; }
.article-title { font-size: clamp(28px, 3.6vw, 42px); margin: 0 0 14px; letter-spacing: -.02em; line-height: 1.15; }
.article-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.article-meta .avatar { width: 30px; height: 30px; border-radius: 50%; }
.entry { font-size: 17.5px; line-height: 1.8; color: #2b3440; }
.entry p { margin: 0 0 1.3em; }
.entry h2 { font-size: 27px; margin: 1.6em 0 .5em; }
.entry h3 { font-size: 22px; margin: 1.4em 0 .4em; }
.entry a { color: var(--primary-600); text-decoration: underline; text-underline-offset: 2px; }
.entry ul, .entry ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.entry li { margin: .3em 0; }
.entry img { border-radius: 12px; margin: 1.5em auto; }
.entry blockquote {
  margin: 1.6em 0; padding: 6px 22px; border-left: 3px solid var(--primary);
  color: var(--ink); font-family: var(--font-serif); font-style: italic; font-size: 19px;
}
.entry code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .9em; background: #f1f3f6; padding: .15em .4em; border-radius: 5px; }
.entry pre { background: var(--ink); color: #e8ecf1; padding: 18px 20px; border-radius: 12px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.entry pre code { background: none; padding: 0; color: inherit; }
.entry hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tags a { font-size: 13px; color: var(--muted); background: #f1f3f6; padding: 5px 12px; border-radius: 999px; }
.tags a:hover { color: var(--primary-600); text-decoration: none; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--ink);
  font-size: 14px; font-weight: 500;
}
.pagination .page-numbers.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary-600); text-decoration: none; }

/* ---------- Empty / misc ---------- */
.notice { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); box-shadow: var(--shadow); }

/* ---------- Footer — nemea.pt SiteFooter replica (light, multi-column) ---------- */
.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0; }
.footer-brand { }
.footer-brand p { margin: 12px 0 0; max-width: 30ch; font-size: 14px; color: var(--muted); }
.footer-col h4 { font-family: var(--font-sans); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--primary-600); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; font-size: 12px; color: var(--muted); }
.footer-bottom .mono { font-family: var(--font-mono, ui-monospace, monospace); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Accessibility ---------- */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }

@media (max-width: 720px) {
  .main-nav { position: fixed; inset: 64px 0 auto 0; background: #fff; border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; gap: 2px; display: none; box-shadow: var(--shadow-lg); }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; }
}

/* ============================================================
   v1.1 — editorial polish + comments
   ============================================================ */

/* Author badge (replaces the generic gravatar mystery-person) */
.author-badge {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--accent); color: var(--primary-600);
  font-family: var(--font-sans); font-weight: 700; font-size: 14px;
}

/* Featured image on single: a touch shorter + refined */
.article-featured { aspect-ratio: 16 / 9; }

/* Drop cap on the first paragraph */
.entry > p:first-of-type::first-letter {
  font-family: var(--font-serif); font-weight: 600; float: left;
  font-size: 3.4em; line-height: .82; padding: 6px 12px 0 0; color: var(--primary-600);
}

/* Comments ------------------------------------------------ */
#comments { max-width: 760px; margin: 36px auto 0; }
.comments-title { font-size: 22px; margin: 0 0 20px; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment-list ol.children { list-style: none; margin: 16px 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.comment-body {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.comment-body .comment-author { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment-body .comment-author img { border-radius: 50%; }
.comment-body .comment-author .fn { font-weight: 600; font-style: normal; color: var(--ink); }
.comment-body .comment-meta { font-size: 12.5px; color: var(--muted-2); margin: 2px 0 8px; }
.comment-body .comment-meta a { color: var(--muted-2); }
.comment-body p { margin: 0 0 .6em; font-size: 15px; }
.comment-body .reply { font-size: 13px; }
.comment-body .reply a { color: var(--primary-600); font-weight: 600; }

/* Comment form */
.comment-respond {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.comment-reply-title { font-size: 20px; margin: 0 0 6px; }
.comment-notes, .logged-in-as { color: var(--muted); font-size: 13.5px; margin: 0 0 16px; }
.comment-form { display: grid; gap: 14px; }
.comment-form-comment { grid-column: 1 / -1; }
.comment-form-author, .comment-form-email, .comment-form-url { }
@media (min-width: 620px) { .comment-form { grid-template-columns: 1fr 1fr; } .comment-form-url { grid-column: 1 / -1; } }
.comment-form label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.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: 10px; padding: 11px 13px;
  font: inherit; font-size: 14.5px; color: var(--ink); background: #fbfcfd; transition: border-color .15s, box-shadow .15s;
}
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.comment-form-cookies-consent { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); }
.comment-form-cookies-consent label { font-weight: 400; margin: 0; }
.form-submit { grid-column: 1 / -1; margin: 0; }
.comment-form .btn-submit, .form-submit input[type=submit] {
  border: 0; background: var(--primary); color: #fff; border-radius: 10px; padding: 11px 22px;
  font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.comment-form .btn-submit:hover, .form-submit input[type=submit]:hover { background: var(--primary-600); }

/* ============================================================
   v1.3.0 — seamless with nemea.pt: centered post reading + forest CTA band
   ============================================================ */

/* Single post: centered editorial column (no sidebar), like the landing's content pages. */
.single .article { max-width: 860px; margin: 28px auto 56px; }
@media (max-width: 900px) { .single .article { margin: 20px auto 40px; } }

/* Forest CTA band — mirrors apps/landing CtaBand; the blog's closing element. */
.cta-band { background: var(--forest); }
.cta-band + .site-footer { margin-top: 0; }
.cta-inner { max-width: 780px; text-align: center; padding-top: 84px; padding-bottom: 84px; }
.cta-band h2 { font-family: var(--font-serif); color: #fff; font-weight: 500; letter-spacing: -.02em;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.1; margin: 0; }
.cta-band p { color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.6; margin: 16px auto 0; max-width: 46ch; }
.cta-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta-actions a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sans);
  font-weight: 600; font-size: 14px; padding: 13px 24px; border-radius: 10px; transition: background .15s, transform .15s; }
.cta-actions .btn-primary { background: var(--primary); color: #fff; }
.cta-actions .btn-primary:hover { background: var(--primary-600); text-decoration: none; transform: translateY(-1px); }
.cta-actions .btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.25); }
.cta-actions .btn-ghost:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.cta-note { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 20px; }
@media (max-width: 560px) { .cta-inner { padding-top: 56px; padding-bottom: 56px; } }
