﻿/* ==========================================================================
   BSDSul.com.br - Modern FreeBSD Inspired Theme
   ========================================================================== */

:root {
  --primary: #ab2b28;
  --primary-hover: #8f2220;
  --primary-light: rgba(171, 43, 40, 0.1);
  --secondary: #1e293b;
  --accent: #e11d48;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Theme Variables */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-alt: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  
  --code-bg: #1e293b;
  --code-color: #f8fafc;
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: #111827;
  --bg-header: #0f172a;
  --bg-alt: #1f2937;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.5);
  
  --code-bg: #030712;
  --code-color: #38bdf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header & Navigation */
.site-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 0.6rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none !important;
}

.brand-logo {
  height: 76px;
  max-height: 88px;
  width: auto;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-logo-custom {
  height: 80px;
  max-height: 92px;
  max-width: 340px;
}

.brand-name {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  user-select: none;
  font-family: 'Inter', var(--font-family), sans-serif;
  text-decoration: none !important;
}

.brand-name-bsd {
  color: #000000;
  transition: color 0.2s ease;
}

[data-theme="dark"] .brand-name-bsd {
  color: #f8fafc;
}

.brand-name-sul {
  color: #ab2b28;
  transition: color 0.2s ease;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.brand-title span {
  color: var(--primary);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.mobile-menu-btn {
  display: none;
}

/* Category Filter Bar */
.category-bar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  overflow-x: auto;
  white-space: nowrap;
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  list-style: none;
  padding-bottom: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  background-color: var(--bg-alt);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.chip:hover, .chip.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 1.75rem auto;
}

.search-form {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-sizing: border-box;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

.search-actions .btn {
  white-space: nowrap;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-alt);
  border-color: var(--primary);
  color: var(--primary);
}

/* Main Layout */
.main-content {
  flex: 1;
  padding: 2.5rem 0 4rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 22px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.75rem;
}

.news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-header-meta {
  padding: 1.25rem 1.5rem 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-category-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  color: #ffffff;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-body {
  padding: 0.5rem 1.5rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.card-title a {
  color: var(--text-main);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--primary);
}

.card-summary {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex: 1;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  text-indent: 1.75rem;
}

.card-footer {
  padding: 0.85rem 1.5rem;
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.read-more-link {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Post Detail */
.post-detail {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin: 0.85rem 0;
  color: var(--text-main);
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-main);
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.post-content p {
  text-indent: 2.25rem;
  margin-top: 0;
  margin-bottom: 1.6rem;
  line-height: 1.85;
  text-align: justify;
  text-justify: inter-word;
}

/* Exceções ao recuo de parágrafo */
.post-content blockquote p,
.post-content ul p,
.post-content ol p,
.post-content table p,
.post-content .no-indent,
.post-content p.no-indent,
.post-content p:has(> img:only-child),
.post-content p:has(> figure),
.post-content p:has(> pre),
.sobre-logo-container p {
  text-indent: 0;
}

.post-content h2, .post-content h3, .post-content h4 {
  margin: 2rem 0 1rem 0;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.post-content ul, .post-content ol {
  margin: 1.25rem 0 1.5rem 1.75rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content pre {
  background-color: var(--code-bg);
  color: var(--code-color);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.925rem;
  line-height: 1.55;
  margin: 1.75rem 0;
  border: 1px solid var(--border-color);
}

.post-content code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  background-color: var(--bg-alt);
  color: var(--primary);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-alt);
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
  font-style: italic;
}

.post-footer-actions {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  text-decoration: none !important;
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Footer */
.site-footer {
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem 0;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.freebsd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-alt);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .header-inner {
    height: auto;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  .nav-link {
    width: 100%;
    padding: 0.6rem;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .brand {
    gap: 0.5rem;
  }
  .brand-logo {
    height: 54px;
    max-height: 62px;
    max-width: 160px;
  }
  .brand-logo-custom {
    height: 54px;
    max-height: 62px;
    max-width: 170px;
  }
  .brand-name {
    font-size: 1.55rem;
  }
  .post-content p {
    text-indent: 1.5rem;
    margin-bottom: 1.25rem;
  }
  .card-summary {
    text-indent: 1.25rem;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 2.25rem 0 2rem 0;
  }
  .hero .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-title {
    font-size: 1.55rem;
  }
  .hero-subtitle {
    font-size: 0.925rem;
    margin-bottom: 1.25rem;
  }
  .search-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.55rem;
  }
  .search-input {
    width: 100%;
    min-width: 100%;
  }
  .search-actions {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .search-actions .btn-primary {
    flex: 1;
    width: 100%;
    padding: 0.75rem 1rem;
  }
  .search-actions .btn-outline {
    padding: 0.75rem 1rem;
    flex-shrink: 0;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    height: 44px;
    max-height: 50px;
    max-width: 120px;
  }
  .brand-logo-custom {
    height: 44px;
    max-height: 50px;
    max-width: 130px;
  }
  .brand-name {
    font-size: 1.35rem;
  }
}
