/* ==========================================================================
   HUG BASE
   Sistema base global - Huerto Urbano Grow
   ========================================================================== */

/* ==========================================================================
   1. TOKENS / VARIABLES GLOBALES
   ========================================================================== */

:root {
  /* Colores principales */
  --hug-lime: #a3d133;
  --hug-lime-glow: #d4f38a;
  --hug-lime-dark: #7ba823;
  --hug-water-cyan: #4fd1c5;

  /* Neutros */
  --hug-dark: #020608;
  --hug-dark-2: #0a1012;
  --hug-white: #ffffff;
  --hug-light: #f8faf9;
  --hug-text: #1a1a1a;
  --hug-text-light: #4a5568;

  /* Bordes */
  --hug-border-light: rgba(0, 0, 0, 0.06);
  --hug-border-medium: rgba(0, 0, 0, 0.1);
  --hug-border-dark: rgba(255, 255, 255, 0.08);

  /* Textos sobre oscuro */
  --hug-text-on-dark: rgba(255, 255, 255, 0.92);
  --hug-text-muted-on-dark: rgba(255, 255, 255, 0.65);

  /* Sombras */
  --hug-shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.05);
  --hug-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --hug-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
  --hug-shadow-lime: 0 10px 28px rgba(163, 209, 51, 0.28);

  /* Radios */
  --hug-radius-sm: 10px;
  --hug-radius-md: 14px;
  --hug-radius-lg: 18px;
  --hug-radius-xl: 24px;
  --hug-radius-pill: 999px;

  /* Layout */
  --hug-container: 1200px;
  --hug-container-wide: 1400px;
  --hug-space-section: 90px;
  --hug-space-section-mobile: 60px;

  /* Tipografías */
  --hug-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --hug-font-serif: 'Playfair Display', Georgia, serif;

  /* Transiciones */
  --hug-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --hug-transition-fast: 0.2s ease;
  --hug-transition-base: 0.3s var(--hug-ease);
  --hug-transition-slow: 0.5s var(--hug-ease);
}

/* ==========================================================================
   2. RESET SUAVE
   ========================================================================== */

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  font-family: var(--hug-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--hug-text);
  background: var(--hug-white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

iframe {
  max-width: 100%;
  border: 0;
}

figure {
  margin: 0;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

/* ==========================================================================
   3. TIPOGRAFÍA GLOBAL
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.75em;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

h4 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

strong,
b {
  font-weight: 700;
}

small {
  font-size: 0.875rem;
}

/* ==========================================================================
   4. ENLACES
   ========================================================================== */

a {
  color: inherit;
  text-decoration: none;
  transition:
    color var(--hug-transition-fast),
    opacity var(--hug-transition-fast),
    border-color var(--hug-transition-fast);
}

a:hover {
  text-decoration: none;
}

a[href^="tel:"],
a[href^="mailto:"] {
  white-space: nowrap;
}

/* ==========================================================================
   5. FORMULARIOS
   ========================================================================== */

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

/* ==========================================================================
   6. FOCUS / ACCESIBILIDAD
   ========================================================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--hug-lime);
  outline-offset: 3px;
}

/* ==========================================================================
   7. LAYOUT HELPERS
   ========================================================================== */

.hug-container {
  width: min(100% - 40px, var(--hug-container));
  margin-inline: auto;
}

.hug-container-wide {
  width: min(100% - 40px, var(--hug-container-wide));
  margin-inline: auto;
}

.hug-section {
  padding-block: var(--hug-space-section);
}

.hug-grid {
  display: grid;
  gap: 24px;
}

.hug-flex {
  display: flex;
}

.hug-flex-wrap {
  flex-wrap: wrap;
}

.hug-items-center {
  align-items: center;
}

.hug-justify-between {
  justify-content: space-between;
}

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

.hug-hidden {
  display: none !important;
}

/* Full-width breakout reutilizable */
.hug-breakout {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
}

/* ==========================================================================
   8. BOTONES BASE
   ========================================================================== */

.hug-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  transition:
    transform var(--hug-transition-base),
    box-shadow var(--hug-transition-base),
    background-color var(--hug-transition-base),
    border-color var(--hug-transition-base),
    color var(--hug-transition-base);
  cursor: pointer;
  white-space: nowrap;
}

.hug-btn:hover {
  transform: translateY(-2px);
}

.hug-btn-primary {
  background: linear-gradient(135deg, var(--hug-lime) 0%, var(--hug-lime-dark) 100%);
  color: #0a1012;
  box-shadow: var(--hug-shadow-lime);
}

.hug-btn-primary:hover {
  box-shadow: 0 14px 34px rgba(163, 209, 51, 0.38);
}

.hug-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--hug-white);
  border-color: rgba(255, 255, 255, 0.18);
}

.hug-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.hug-btn-outline-dark {
  background: transparent;
  color: var(--hug-dark);
  border-color: rgba(0, 0, 0, 0.14);
}

.hug-btn-outline-dark:hover {
  border-color: var(--hug-lime-dark);
  color: var(--hug-lime-dark);
}

.hug-btn-block {
  width: 100%;
}

/* ==========================================================================
   9. BADGES / PILLS BASE
   ========================================================================== */

.hug-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--hug-radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hug-pill-lime {
  background: rgba(163, 209, 51, 0.1);
  border: 1px solid rgba(163, 209, 51, 0.25);
  color: var(--hug-lime-dark);
}

.hug-pill-cyan {
  background: rgba(79, 209, 197, 0.1);
  border: 1px solid rgba(79, 209, 197, 0.25);
  color: #0d8478;
}

.hug-pill-dark {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--hug-text-on-dark);
}

/* ==========================================================================
   10. TARJETAS BASE
   ========================================================================== */

.hug-card {
  background: var(--hug-white);
  border: 1px solid var(--hug-border-light);
  border-radius: var(--hug-radius-lg);
  box-shadow: var(--hug-shadow-sm);
}

.hug-card-dark {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--hug-border-dark);
  border-radius: var(--hug-radius-lg);
}

/* ==========================================================================
   11. UTILIDADES DE COLOR
   ========================================================================== */

.hug-text-muted {
  color: var(--hug-text-light);
}

.hug-text-muted-dark {
  color: var(--hug-text-muted-on-dark);
}

.hug-text-lime {
  color: var(--hug-lime-dark);
}

.hug-text-cyan {
  color: var(--hug-water-cyan);
}

.hug-bg-dark {
  background: var(--hug-dark);
  color: var(--hug-white);
}

.hug-bg-light {
  background: var(--hug-light);
}

/* ==========================================================================
   12. HELPERS WORDPRESS / CONTENIDO
   ========================================================================== */

.entry-content img,
.wp-block-image img {
  border-radius: 0;
}

.alignwide,
.alignfull {
  max-width: 100%;
}

.wp-caption,
.gallery {
  max-width: 100%;
}

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  html {
    scroll-behavior: auto;
  }

  .hug-container,
  .hug-container-wide {
    width: min(100% - 24px, var(--hug-container));
  }

  .hug-section {
    padding-block: var(--hug-space-section-mobile);
  }

  .hug-btn {
    min-height: 44px;
    padding: 12px 18px;
    font-size: 13px;
    white-space: normal;
  }
}

/* ==========================================================================
   14. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}