/*
 * AtualReceitas Base CSS v1.0.32
 * Base styles (layout, typography, header/footer, forms, utilities)
 */

:root {
  /* Colors */
  --primary: #2C5F6F;
  --primary-hover: #1E4550;
  --secondary: #FF8E72;
  --secondary-hover: #ff6b51;
  --neutral: #F5F1E8;
  --accent: #81C784;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #DFE6E9;
  --white: #fff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Layout */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Typography */
body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--spacing-md); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--primary-hover); }

/* Layout */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  /* Prevent layout shift */
  will-change: transform;
  backface-visibility: hidden;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.site-title a {
  font-family: 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  transition: color var(--transition);
}

.site-title a:hover {
  color: var(--primary-hover);
}

/* Navigation */
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition);
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition);
}

.main-navigation a:hover::after {
  width: 100%;
}

.main-navigation a:hover {
  color: var(--primary);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  background: var(--neutral);
  padding: var(--spacing-2xl) 0 var(--spacing-md);
  margin-top: var(--spacing-2xl);
}

.site-info {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-lg); }
.mt-2 { margin-top: var(--spacing-lg); }

/* Responsive */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
  }

  .site-header .container {
    flex-wrap: wrap;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

/* Accessibility */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Focus styles */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Performance: reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================================
   AtualReceitas v1.0.15 - melhorias (listagens + UI)
   ========================================================== */

/* Search form (antes estava inline no template) */
.search-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}
.search-form label {
  flex: 1;
}
.search-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border, #DFE6E9);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.search-field:focus {
  outline: none;
  border-color: var(--primary, #2C5F6F);
}
.search-submit {
  padding: 0.75rem 1.5rem;
  background: var(--primary, #2C5F6F);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-submit:hover {
  background: var(--primary-hover, #1E4550);
  transform: translateY(-2px);
}
.search-submit svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 640px) {
  .search-submit span:not(.screen-reader-text) {
    display: none;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
}
.breadcrumbs-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}
.breadcrumbs-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.breadcrumbs-item + .breadcrumbs-item::before {
  content: "/";
  color: var(--text-light);
  margin: 0 0.25rem;
}
.breadcrumbs a {
  color: var(--text-light);
}
.breadcrumbs a:hover {
  color: var(--primary);
}
.breadcrumbs-item.is-current {
  color: var(--text);
  font-weight: 600;
}

/* Helpers */
.is-hidden {
  display: none !important;
}

/* Notification (copy link / feedback) */
.atualreceitas-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.9rem 1.25rem;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-weight: 700;
  animation: arSlideIn 0.25s ease;
}
.atualreceitas-notification.is-leaving {
  animation: arSlideOut 0.25s ease forwards;
}
@keyframes arSlideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes arSlideOut {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

/* Page / Sidebar / 404 */
.content-narrow {
  max-width: 800px;
}
.widget-area {
  padding: 1rem;
}
.not-found {
  text-align: center;
  padding: 4rem 0;
}
.not-found-code {
  font-size: 4rem;
  margin: 0 0 1rem 0;
}
.not-found p {
  margin: 1.5rem 0;
}


/* Back to top */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.back-to-top.is-visible {
    display: inline-flex;
}
