/*
Theme Name: SafeFlux Blog
Theme URI: https://safeflux.com.br
Author: SafeFlux
Author URI: https://safeflux.com.br
Description: Tema personalizado para o blog SafeFlux - Gestão Operacional
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: safeflux
*/

/* ============================================
   RESET & BASE STYLES
   ============================================ */

:root {
  --primary: 174 62% 47%;
  --primary-foreground: 0 0% 100%;
  --background: 220 20% 97%;
  --foreground: 220 20% 10%;
  --card: 0 0% 100%;
  --card-foreground: 220 20% 10%;
  --muted: 220 15% 92%;
  --muted-foreground: 220 10% 45%;
  --border: 220 15% 90%;
  --accent: 24 95% 53%;
  --accent-foreground: 0 0% 100%;
  --secondary: 174 30% 92%;
  --secondary-foreground: 174 62% 35%;
  --radius: 0.75rem;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* ============================================
   HEADER STYLES
   ============================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: hsla(var(--background), 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

.site-logo svg {
  width: 2rem;
  height: 2rem;
}

.main-navigation {
  display: none;
}

@media (min-width: 768px) {
  .main-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.main-navigation a {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s;
}

.main-navigation a:hover,
.main-navigation a.current {
  color: hsl(var(--foreground));
}

.header-actions {
  display: none;
}

@media (min-width: 768px) {
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--muted));
}

.btn-cta {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-cta:hover {
  background-color: hsl(24 95% 48%);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* ============================================
   BLOG HERO SECTION
   ============================================ */

.blog-hero {
  padding: 4rem 0 5rem;
  border-bottom: 1px solid hsl(var(--border));
  text-align: center;
}

.blog-hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}

.blog-hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .blog-hero h1 {
    font-size: 3rem;
  }
}

.blog-hero h1 span {
  color: hsl(var(--primary));
}

.blog-hero p {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* Search Bar */
.search-form {
  position: relative;
  max-width: 28rem;
  margin: 0 auto;
}

.search-form svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.search-form input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.search-form input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
}

/* ============================================
   BLOG LAYOUT
   ============================================ */

.blog-content {
  padding: 3rem 0 4rem;
}

.blog-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.blog-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Section Heading */
.section-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-heading::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  background-color: hsl(var(--primary));
  border-radius: 50%;
}

/* ============================================
   BLOG CARDS
   ============================================ */

.blog-card {
  display: block;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}

.blog-card:hover {
  border-color: hsla(var(--primary), 0.3);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.blog-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 1.25rem;
}

.blog-card .category {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.blog-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card:hover h3 {
  color: hsl(var(--primary));
}

.blog-card .excerpt {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card .meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.blog-card .meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-card .meta svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Featured Card */
.blog-card.featured {
  display: block;
}

@media (min-width: 768px) {
  .blog-card.featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  
  .blog-card.featured .blog-card-image {
    aspect-ratio: auto;
  }
  
  .blog-card.featured .blog-card-content {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .blog-card.featured h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
  }
  
  .blog-card.featured .excerpt {
    -webkit-line-clamp: 3;
    margin-bottom: 1rem;
  }
}

.blog-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--primary));
  font-weight: 500;
  transition: gap 0.2s;
}

.blog-card:hover .read-more {
  gap: 0.75rem;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   SIDEBAR
   ============================================ */

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
}

.sidebar-widget h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.sidebar-widget h3 svg {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--primary));
}

/* Categories Widget */
.categories-list {
  list-style: none;
}

.categories-list li {
  margin-bottom: 0.5rem;
}

.categories-list button,
.categories-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  border-radius: 0.5rem;
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
}

.categories-list button:hover,
.categories-list a:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.categories-list button.active,
.categories-list a.active {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-weight: 500;
}

.categories-list .count {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Popular Posts Widget */
.popular-posts {
  list-style: none;
}

.popular-posts li {
  margin-bottom: 1rem;
}

.popular-posts li:last-child {
  margin-bottom: 0;
}

.popular-posts a {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.popular-posts .number {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 50%;
}

.popular-posts h4 {
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-posts a:hover h4 {
  color: hsl(var(--primary));
}

.popular-posts .date {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
}

/* Newsletter Widget */
.newsletter-widget {
  background: linear-gradient(135deg, hsla(var(--primary), 0.1), hsla(var(--primary), 0.05));
  border-color: hsla(var(--primary), 0.2);
}

.newsletter-widget h3 {
  margin-bottom: 0.5rem;
}

.newsletter-widget p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.newsletter-widget form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.newsletter-widget input {
  width: 100%;
  padding: 0.625rem 1rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.newsletter-widget input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsla(var(--primary), 0.2);
}

.newsletter-widget button {
  width: 100%;
  padding: 0.625rem 1rem;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.newsletter-widget button:hover {
  background-color: hsl(24 95% 48%);
}

/* ============================================
   SINGLE POST
   ============================================ */

.single-post-header {
  padding: 3rem 0;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
}

.single-post-header .category {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  margin-bottom: 1rem;
}

.single-post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .single-post-header h1 {
    font-size: 2.5rem;
  }
}

.single-post-header .meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.single-post-header .meta span {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.single-post-featured-image {
  max-width: 56rem;
  margin: 0 auto 3rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.single-post-featured-image img {
  width: 100%;
  height: auto;
}

.single-post-content {
  max-width: 48rem;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.single-post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: hsl(var(--foreground));
}

.single-post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: hsl(var(--foreground));
}

.single-post-content p {
  margin-bottom: 1.25rem;
  color: hsl(var(--foreground));
}

.single-post-content ul,
.single-post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

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

.single-post-content blockquote {
  border-left: 4px solid hsl(var(--primary));
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

.single-post-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
}

.single-post-content a:hover {
  text-decoration: none;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background-color: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  max-width: 20rem;
}

.footer-brand .site-logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.footer-column h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.2s;
}

.footer-column a:hover {
  color: hsl(var(--primary));
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.pagination a {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.pagination a:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--primary));
}

.pagination span.current {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
