/*
Theme Name: Freesider Developer
Theme URI: https://freesider.com.br
Description: Tema minimalista editorial para o blog Freesider
Author: Fagner Borges
Version: 1.0.0
Text Domain: freesider
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --accent: #20BF8A;
  --accent-hover: #059669;
  --border: #E4E4E7;
  --dark: #18181B;
  --radius: 8px;
  --max-width: 720px;
  --max-width-wide: 1120px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

ul, ol { list-style: none; }

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

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Libre Bodoni', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1.5rem; }

/* ===== LAYOUT ===== */
.site-container {
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.content-narrow {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-logo a { color: inherit; }
.site-logo img { height: 36px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 32px; list-style: none; }

.main-nav li { list-style: none; }

.main-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}

.footer-links li { display: inline; }

.main-nav a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.nav-toggle svg { width: 24px; height: 24px; }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .main-nav.active { display: flex; }
}

/* ===== HERO (Homepage) ===== */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 16px;
}

.hero .tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero .category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.category-pill {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  cursor: pointer;
}

.category-pill:hover,
.category-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 2rem; }
}

/* ===== POST GRID ===== */
.posts-section { padding: 0 0 80px; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* ===== POST CARD (List Style) ===== */
.post-card {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

.post-card:first-child { padding-top: 0; }
.post-card:hover { opacity: 0.85; }

.post-card-content { flex: 1; }

.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.post-card .post-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.post-card .post-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.post-card .post-meta .sep {
  width: 3px;
  height: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
}

.post-card h2 {
  font-size: 1.375rem;
  margin-bottom: 8px;
  line-height: 1.35;
}

.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); }

.post-card .post-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .read-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.post-card-thumb {
  width: 200px;
  min-width: 200px;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 640px) {
  .post-card { flex-direction: column-reverse; gap: 16px; }
  .post-card-thumb { width: 100%; height: 200px; min-width: auto; }
  .post-card h2 { font-size: 1.25rem; }
}

/* ===== FEATURED POST ===== */
.featured-post {
  padding: 0 0 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.featured-post .post-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 12px;
  display: inline-block;
}

.featured-post h2 {
  font-size: 2.25rem;
  margin-bottom: 16px;
  line-height: 1.2;
}

.featured-post h2 a { color: var(--text); }
.featured-post h2 a:hover { color: var(--accent); }

.featured-post .post-excerpt {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.featured-post .post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .featured-post h2 { font-size: 1.75rem; }
}

/* ===== SINGLE POST ===== */
.single-header {
  padding: 64px 0 40px;
  text-align: center;
}

.single-header .post-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-block;
}

.single-header h1 {
  font-size: 2.75rem;
  max-width: 800px;
  margin: 0 auto 20px;
  line-height: 1.2;
}

.single-header .post-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.single-header .author-name { font-weight: 600; color: var(--text); }

@media (max-width: 768px) {
  .single-header { padding: 40px 0 24px; }
  .single-header h1 { font-size: 1.875rem; }
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
  padding: 0 0 64px;
}

.article-content h2 {
  font-size: 1.75rem;
  margin: 48px 0 16px;
}

.article-content h3 {
  font-size: 1.375rem;
  margin: 40px 0 12px;
}

.article-content p {
  font-size: 1.0625rem;
  line-height: 1.8;
  margin-bottom: 1.75rem;
}

.article-content ul, .article-content ol {
  margin: 0 0 1.75rem 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  list-style: disc;
}

.article-content ol { list-style: decimal; }

.article-content li { margin-bottom: 0.5rem; }

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 0 16px 24px;
  margin: 32px 0;
  font-family: 'Libre Bodoni', serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.6;
}

.article-content img {
  border-radius: var(--radius);
  margin: 32px 0;
}

.article-content pre {
  background: var(--dark);
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-content pre code { background: none; padding: 0; }

/* ===== POST FOOTER ===== */
.post-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.post-tags a {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.post-tags a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== AUTHOR BOX ===== */
.author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.author-box .author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box .author-name {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.author-box .author-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== RELATED POSTS ===== */
.related-posts {
  padding: 64px 0;
}

.related-posts h3 {
  font-size: 1.25rem;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.related-card h4 {
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.related-card h4 a { color: var(--text); }
.related-card h4 a:hover { color: var(--accent); }

.related-card .post-category {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

@media (max-width: 768px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 48px 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  color: #94A3B8;
  padding: 48px 0;
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.footer-links { display: flex; gap: 24px; }

.footer-links a {
  font-size: 0.8125rem;
  color: #94A3B8;
  transition: color 0.2s;
}

.footer-links a:hover { color: white; }

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===== SEARCH ===== */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.search-form input[type="search"]:focus {
  border-color: var(--accent);
}

.search-form button {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-form button:hover { background: var(--accent-hover); }

/* ===== 404 ===== */
.error-404 {
  text-align: center;
  padding: 120px 0;
}

.error-404 h1 { font-size: 4rem; margin-bottom: 16px; }
.error-404 p { color: var(--text-secondary); margin-bottom: 32px; }

/* ===== ARCHIVE HEADER ===== */
.archive-header {
  padding: 64px 0 40px;
}

.archive-header h1 { font-size: 2.25rem; margin-bottom: 8px; }

.archive-header .archive-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===== UTILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  .post-card { animation: fadeIn 0.4s ease-out; }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
