/* ==========================================
   AgroMáquinas – App-first design system
   Mobile first. Bold. Fresh. Agricultural.
   ========================================== */

:root {
  --green-dark: #1A3A1F;
  --green-mid: #2D6A35;
  --green-light: #4CAF50;
  --gold: #D4AC0D;
  --gold-light: #F9E94E;
  --earth: #6B4226;
  --off-white: #F8F9F4;
  --light-bg: #F0F4EE;
  --white: #FFFFFF;
  --dark: #111A12;
  --text-dark: #1C250E;
  --text-muted: #6B7760;
  --border: #DCE8D4;
  --shadow-sm: 0 2px 10px rgba(26,58,31,0.08);
  --shadow-md: 0 8px 30px rgba(26,58,31,0.14);
  --shadow-lg: 0 20px 60px rgba(26,58,31,0.18);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  /* Space for bottom nav on mobile */
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

/* ======= HEADER ======= */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(26,58,31,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.app-header.scrolled {
  background: rgba(17,26,18,0.98);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--green-light) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: white;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 3px;
}

.top-nav {
  display: none;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

@media (min-width: 768px) {
  .top-nav { display: flex; }
}

.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 7px 14px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: white;
  background: rgba(255,255,255,0.12);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 8px;
}

@media (min-width: 768px) {
  .hamburger { display: none; }
}

.hamburger span {
  width: 22px;
  height: 2.5px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-drawer {
  display: none;
  flex-direction: column;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 0;
}

.mobile-drawer.open { display: flex; }

.drawer-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 600;
  padding: 14px 24px;
  font-size: 1rem;
  transition: var(--transition);
  border-radius: 0;
}

.drawer-link:hover, .drawer-link.active {
  background: rgba(255,255,255,0.08);
  color: white;
}

/* ======= HERO ======= */
.hero-section {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 64px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('hero.png');
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.04);
  transition: transform 8s ease-out;
}

.hero-section:hover .hero-bg {
  transform: scale(1.0);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(17,26,18,0.88) 0%,
    rgba(26,58,31,0.72) 50%,
    rgba(17,26,18,0.55) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 60px 24px;
  margin: 0 auto;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-content {
    text-align: left;
    margin: 0;
    padding: 80px 60px;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212,172,13,0.2);
  border: 1px solid rgba(212,172,13,0.5);
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5.5rem);
  color: white;
  line-height: 1.0;
  margin-bottom: 22px;
}

.hero-highlight {
  background: linear-gradient(90deg, var(--gold) 0%, var(--green-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: rgba(255,255,255,0.82);
  max-width: 520px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-actions { justify-content: flex-start; }
}

.btn-hero-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold) 0%, #f0c000 100%);
  color: var(--dark);
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(212,172,13,0.4);
}

.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(212,172,13,0.6);
}

.btn-hero-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: white;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-stats { justify-content: flex-start; }
}

.hstat strong {
  display: block;
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1;
}

.hstat span {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hstat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.2);
}

/* ======= UTILITIES ======= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padded { padding: 60px 0; }

.light-bg { background: var(--light-bg); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--green-mid);
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 32px;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.section-header-row .section-title { margin-bottom: 0; }

.see-all-link {
  color: var(--green-mid);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.see-all-link:hover { color: var(--green-dark); }

/* ======= CATEGORY CARDS ======= */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) { .cats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .cats-grid { grid-template-columns: repeat(6, 1fr); gap: 16px; } }

.cat-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition);
  text-align: center;
}

.cat-card:hover {
  border-color: var(--green-mid);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.cat-emoji { font-size: 2rem; }

.cat-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.3;
}

.cat-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ======= ARTICLES ======= */
.articles-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
  }
  .article-card.featured { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .articles-grid {
    grid-template-columns: 5fr 3fr;
    grid-template-rows: auto auto;
  }
  .article-card.featured { grid-column: 1; grid-row: 1 / 3; }
}

.article-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(45,106,53,0.3);
}

.article-img-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .article-card.featured .article-img-wrap { height: 360px; }
}

.article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-img { transform: scale(1.05); }

.article-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gold);
  color: var(--dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-body {
  padding: 22px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green-mid);
}

.article-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
}

.article-card.featured .article-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}

.article-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex-grow: 1;
}

.article-read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ======= FORUM PREVIEW ======= */
.forum-list {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
}

.forum-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.forum-row:last-child { border-bottom: none; }

.forum-row:hover { background: var(--light-bg); }

.forum-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green-mid);
  color: white;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.forum-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forum-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  line-height: 1.35;
}

.forum-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.forum-arrow {
  color: var(--text-muted);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.btn-main {
  display: inline-block;
  background: var(--green-dark);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-main:hover {
  background: var(--green-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ======= NEWSLETTER ======= */
.newsletter-section { padding: 60px 0; }

.newsletter-card {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  border-radius: 24px;
  padding: 50px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(212,172,13,0.2) 0%, transparent 70%);
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.newsletter-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
}

.newsletter-sub {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  margin-bottom: 30px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-input {
  flex: 1;
  min-width: 220px;
  padding: 14px 20px;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
}

.newsletter-btn {
  background: var(--gold);
  color: var(--dark);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.newsletter-btn:hover {
  background: var(--gold-light);
  transform: scale(1.04);
}

/* ======= FOOTER ======= */
.app-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.75);
  padding: 50px 0 30px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
}

.footer-brand .brand-icon {
  font-size: 30px;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.footer-brand strong {
  display: block;
  color: white;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 400px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 30px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover { color: white; }

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}

/* ======= BOTTOM NAV (Mobile App Nav) ======= */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(26,58,31,0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 900;
  padding: env(safe-area-inset-bottom, 0);
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 5px;
  text-decoration: none;
  gap: 3px;
  transition: var(--transition);
  position: relative;
}

.bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2.5px;
  background: var(--gold);
  border-radius: 0 0 4px 4px;
}

.bnav-icon { font-size: 1.3rem; line-height: 1; }

.bnav-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: rgba(255,255,255,0.55);
}

.bnav-item.active .bnav-label { color: var(--gold); }

/* ======= FORUM PAGE ======= */
.page-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  padding: 100px 0 50px;
  color: white;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 50px;
  background: var(--off-white);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.page-hero-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-hero .section-label { color: var(--gold-light); margin-bottom: 12px; }

.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 14px;
}

.page-hero p {
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  max-width: 600px;
}

/* Forum full page */
.forum-full { padding: 50px 0 40px; }

.forum-full-list {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.new-topic-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 0;
  margin-bottom: 10px;
}

.btn-new-topic {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--green-dark);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition);
}

.btn-new-topic:hover {
  background: var(--green-mid);
  transform: translateY(-2px);
}

/* ======= MODAL ======= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: white;
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-bg);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover { background: #eee; }

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  transition: var(--transition);
  background: var(--off-white);
}

.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  border-color: var(--green-mid);
  background: white;
}

.form-field textarea {
  height: 140px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-cancel {
  padding: 12px 22px;
  border: 2px solid var(--border);
  background: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.btn-submit {
  padding: 12px 28px;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-submit:hover { background: var(--green-mid); }

/* ======= SCROLL INDICATOR FOR HERO ======= */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  letter-spacing: 1px;
  animation: bounce 2s infinite;
}

.scroll-hint-arrow { font-size: 1.2rem; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}
