/*
 * Theme Name:   Amancay Child
 * Theme URI:    https://hortigonia.com
 * Description:  Tema hijo para Herbolaria Amancay. Identidad visual orgánica con paleta patagónica.
 * Author:       Amancay Editorial
 * Template:     twentytwentyfour
 * Version:      2.0.0
 * Requires at least: 6.0
 * Text Domain:  amancay-child
 */

/* ==========================================================================
   VARIABLES Y TEMAS — Sistema de diseño Amancay
   Fuente de verdad: web-inbox/base-html/index-base.html
   ========================================================================== */
:root {
    --color-bg-primary:   #F8F5EE;
    --color-bg-secondary: #EBE7DC;
    --color-text-main:    #131510;
    --color-text-muted:   #4A5240;
    --color-border:       #D1CDA8;
    --color-primary:      #2D5016;
    --color-secondary:    #6B8E4E;
    --color-accent:       #8B6914;
    --color-hero-bg:      #1A3209;
    --font-display:       'Cormorant Garamond', serif;
    --font-body:          'Inter', sans-serif;
    --container-width:    1200px;
    --section-padding:    8rem 2rem;
    --nav-height:         80px;
}

[data-theme="dark"] {
    --color-bg-primary:   #131510;
    --color-bg-secondary: #1A1C16;
    --color-text-main:    #F8F5EE;
    --color-text-muted:   #A3A89D;
    --color-border:       #2D3326;
    --color-primary:      #6B8E4E;
    --color-secondary:    #8B6914;
}

/* ==========================================================================
   RESET Y BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-main);
    background-color: var(--color-bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--color-primary); color: #F8F5EE;
    padding: 8px 16px; z-index: 9999; transition: top 0.2s;
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; object-fit: cover; }
ul { list-style: none; }

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
    font-weight: 300;
    line-height: 1.1;
}

.text-sage    { color: var(--color-secondary); }
.text-italic  { font-style: italic; }
.font-medium  { font-weight: 500; }
.container    { max-width: var(--container-width); margin: 0 auto; padding: 0 2rem; }

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-body); font-weight: 400; font-size: 0.95rem;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer; border: none;
}

.btn-primary { background-color: var(--color-primary); color: #F8F5EE; }
[data-theme="dark"] .btn-primary { background-color: #F8F5EE; color: #131510; }
.btn-primary:hover { transform: translateY(-1px); opacity: 0.9; }

.btn-secondary {
    background-color: transparent;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-text-main);
    padding: 0.5rem 0;
}
.btn-secondary:hover { transform: translateY(-1px); opacity: 0.8; }

/* ==========================================================================
   ANIMACIONES DE SCROLL
   ========================================================================== */
@supports (animation-timeline: view()) {
    .reveal-group > *, .reveal {
        animation: fade-clip both;
        animation-timeline: view();
        animation-range: entry 5% cover 25%;
    }
    @keyframes fade-clip {
        0%   { opacity: 0; clip-path: inset(10% 0 10% 0); }
        100% { opacity: 1; clip-path: inset(0 0 0 0); }
    }
}
@media (prefers-reduced-motion: reduce) {
    .reveal-group > *, .reveal { animation: none !important; opacity: 1 !important; clip-path: none !important; }
}

/* ==========================================================================
   HEADER / NAVEGACIÓN
   ========================================================================== */
.site-header {
    position: fixed; top: 0; left: 0; width: 100%;
    height: var(--nav-height); z-index: 1000;
    display: flex; align-items: center;
    background: rgba(248, 245, 238, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.3s ease;
}
[data-theme="dark"] .site-header {
    background: rgba(19, 21, 16, 0.85);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container { width: 100%; display: flex; justify-content: space-between; align-items: center; }

.brand-link {
    display: flex; align-items: center; gap: 0.75rem;
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 400;
}

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a { font-size: 0.9rem; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 0.6; }

.theme-toggle,
.mobile-toggle {
    background: none; border: none; color: inherit;
    cursor: pointer; padding: 0.5rem;
    display: flex; align-items: center; justify-content: center;
}
.mobile-toggle { display: none; }

/* ==========================================================================
   HERO — Full viewport con overlay
   ========================================================================== */
.hero {
    min-height: 100vh; position: relative;
    display: flex; align-items: flex-end;
    padding-bottom: 12vh; color: #F8F5EE;
}

.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; }
.hero-bg .img-placeholder { width: 100%; height: 100%; min-height: 100vh; }

.hero-overlay {
    position: absolute; inset: 0;
    background-color: var(--color-hero-bg);
    opacity: 0.65; z-index: -1;
}

.hero-content { max-width: 800px; width: 100%; }

.kicker {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.85rem; letter-spacing: 0.05em;
    text-transform: uppercase; margin-bottom: 2rem;
}
.kicker-dot {
    width: 8px; height: 8px;
    background-color: var(--color-secondary);
    border-radius: 50%;
    animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse {
    0%   { transform: scale(0.9); opacity: 0.7; }
    50%  { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    margin-bottom: 1.5rem; max-width: 900px;
}
.hero-desc {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    max-width: 500px; margin-bottom: 3rem; opacity: 0.9;
}
.hero-actions { display: flex; gap: 2rem; align-items: center; }
.hero-actions .btn-secondary { color: #F8F5EE; border-color: rgba(248, 245, 238, 0.4); }

.scroll-indicator {
    position: absolute; bottom: 2rem; left: 2rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; opacity: 0.6;
    animation: bounce 2s infinite ease-in-out;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* ==========================================================================
   SECCIONES BASE
   ========================================================================== */
section {
    padding: var(--section-padding);
    min-height: 80vh;
    display: flex; flex-direction: column; justify-content: center;
}

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

.section-kicker {
    font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--color-text-muted); margin-bottom: 1rem; display: block;
}
.section-title { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 2rem; max-width: 800px; }

/* ==========================================================================
   SECCIÓN HISTORIA
   ========================================================================== */
.story-grid { display: grid; grid-template-columns: 4fr 5fr; gap: 6vw; align-items: center; }

.story-img-wrapper { position: relative; aspect-ratio: 4/5; overflow: hidden; }
.story-img-wrapper img { width: 100%; height: 100%; transition: transform 0.7s ease; }
.story-img-wrapper:hover img { transform: scale(1.03); }
.story-img-wrapper .img-placeholder { width: 100%; height: 100%; }

.badge-img {
    position: absolute; bottom: 2rem; right: -1rem;
    background: var(--color-bg-primary); color: var(--color-text-main);
    padding: 1rem 1.5rem;
    font-family: var(--font-display); font-size: 1.25rem;
    border-left: 2px solid var(--color-primary);
}

.story-content p { margin-bottom: 1.5rem; font-size: 1.1rem; color: var(--color-text-muted); max-width: 500px; }

/* ==========================================================================
   SECCIÓN RIESGO (3 cards)
   ========================================================================== */
.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-bottom: 4rem; }

.risk-card { border-top: 1px solid var(--color-border); padding-top: 2rem; }
.risk-icon { width: 32px; height: 32px; margin-bottom: 1.5rem; color: var(--color-text-main); }
.risk-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.risk-card p  { color: var(--color-text-muted); font-size: 0.95rem; }

.highlight-answer {
    background-color: rgba(107, 142, 78, 0.1);
    border-left: 4px solid var(--color-secondary);
    padding: 2rem 3rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.3; max-width: 900px;
}

/* ==========================================================================
   SECCIÓN PILARES + CAROUSEL DE NOTICIAS
   ========================================================================== */
.pillars-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; }
.pillars-content p { font-size: 1.1rem; color: var(--color-text-muted); margin-bottom: 1.5rem; max-width: 500px; }
.pillars-actions { margin-top: 3rem; display: flex; gap: 2rem; align-items: center; }

.news-carousel {
    position: relative;
    background-color: var(--color-bg-primary);
    border: 2px solid var(--color-text-main);
    border-radius: 40px;
    padding: 4rem 3rem;
    display: flex; align-items: center; justify-content: center;
    min-height: 400px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
[data-theme="dark"] .news-carousel {
    border-color: var(--color-border);
    background-color: var(--color-bg-secondary);
}

.carousel-track-container { width: 100%; position: relative; overflow: hidden; }
.carousel-track { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; }

.carousel-slide { min-width: 100%; opacity: 0; display: none; flex-direction: column; align-items: center; }
.carousel-slide.current-slide {
    opacity: 1; display: flex;
    animation: fadeInSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(15px); }
    to   { opacity: 1; transform: translateX(0); }
}

.slide-kicker {
    font-size: 0.85rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--color-secondary);
    margin-bottom: 2rem; text-align: center; display: block;
}
.slide-text { font-size: 1.15rem; line-height: 1.7; color: var(--color-text-main); text-align: center; max-width: 85%; }

.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: transparent; border: none; cursor: pointer;
    color: var(--color-text-main); padding: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease; z-index: 10;
}
.carousel-btn svg { width: 32px; height: 32px; stroke-width: 1.5; }
.carousel-btn:hover { opacity: 0.6; }
.prev-btn { left: 1rem; }
.next-btn { right: 1rem; }
.prev-btn:hover { transform: translateY(-50%) translateX(-4px); }
.next-btn:hover { transform: translateY(-50%) translateX(4px); }

/* ==========================================================================
   SECCIÓN CITA DIVIDER
   ========================================================================== */
.divider-section {
    background-color: var(--color-primary); color: #F8F5EE;
    padding: 8vw 2rem; text-align: center; min-height: auto;
}
.divider-quote { font-size: clamp(2rem, 4vw, 3.5rem); max-width: 800px; margin: 0 auto 1.5rem auto; line-height: 1.2; }
.divider-attr  { font-size: 0.9rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.8; }

/* ==========================================================================
   SECCIÓN VITRINA / PRODUCTS GRID
   ========================================================================== */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-bottom: 4rem; }

.product-card {
    background-color: var(--color-bg-primary);
    display: flex; flex-direction: column;
    transition: transform 0.3s ease;
}
.product-card:hover { transform: translateY(-4px); }

.product-img-wrapper { position: relative; aspect-ratio: 4/3; overflow: hidden; background-color: var(--color-border); }
.product-img-wrapper img { width: 100%; height: 100%; transition: transform 0.5s ease; }
.product-card:hover .product-img-wrapper img { transform: scale(1.05); }
.product-img-wrapper .img-placeholder { width: 100%; height: 100%; }

.product-badge {
    position: absolute; top: 1rem; left: 1rem;
    background: var(--color-bg-primary); color: var(--color-text-main);
    padding: 0.25rem 0.75rem; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em;
    z-index: 2;
}

.product-info { padding: 2rem 0; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-size: 1.75rem; margin-bottom: 0.75rem; }
.product-desc  { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex-grow: 1; }

/* ==========================================================================
   SECCIÓN CONTACTO
   ========================================================================== */
.contact-banner { max-width: 800px; }
.contact-banner h2 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: 1.5rem; }
.contact-banner p  { font-size: 1.2rem; color: var(--color-text-muted); margin-bottom: 3rem; max-width: 600px; }

.social-icons { display: flex; gap: 1.5rem; margin-top: 4rem; }
.social-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--color-border); border-radius: 2px;
    color: var(--color-text-main);
    transition: background-color 0.2s, color 0.2s;
}
.social-icon:hover { background-color: var(--color-text-main); color: var(--color-bg-primary); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background-color: #1A3209; color: #F8F5EE; padding: 6rem 2rem 3rem 2rem; }

.footer-grid {
    max-width: var(--container-width); margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr;
    gap: 4rem; margin-bottom: 4rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-size: 1.75rem; margin-bottom: 1.5rem; }
.footer-disclaimer { font-size: 0.85rem; opacity: 0.7; max-width: 500px; }

.footer-nav { display: flex; flex-direction: column; gap: 1rem; }
.footer-nav a { opacity: 0.8; transition: opacity 0.2s; }
.footer-nav a:hover { opacity: 1; }

.footer-bottom {
    max-width: var(--container-width); margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem; font-size: 0.85rem; opacity: 0.6;
}

/* ==========================================================================
   PLACEHOLDERS — Imágenes pendientes del Image Engine
   Mantener hasta que el Image Engine apruebe cada imagen.
   Ver: web-inbox/base-html/image-registry.md
   ========================================================================== */
.img-placeholder {
    display: flex; align-items: center; justify-content: center;
    background-color: #1A3209;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent, transparent 14px,
        rgba(45, 80, 22, 0.35) 14px, rgba(45, 80, 22, 0.35) 28px
    );
    position: relative; width: 100%; height: 100%; min-height: 220px;
}

.img-ph-inner {
    background: rgba(10, 24, 4, 0.90);
    border: 1px solid #6B8E4E; border-radius: 6px;
    padding: 1.25rem 1.75rem;
    display: flex; flex-direction: column; align-items: center;
    gap: 0.4rem; text-align: center; max-width: 88%; z-index: 2;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.ph-tag {
    font-family: 'Inter', monospace; font-size: 0.6rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: #8B6914; margin-bottom: 0.2rem;
}
.ph-id    { font-family: monospace; font-size: 0.78rem; font-weight: 600; color: #6B8E4E; word-break: break-all; }
.ph-dims  { font-family: 'Inter', sans-serif; font-size: 0.65rem; color: rgba(248, 245, 238, 0.5); }
.ph-trigger {
    font-family: 'Inter', sans-serif; font-size: 0.68rem;
    color: rgba(248, 245, 238, 0.75); margin-top: 0.35rem;
    padding-top: 0.5rem; border-top: 1px solid rgba(107, 142, 78, 0.25);
    font-style: italic; max-width: 280px;
}
.ph-icon { width: 20px; height: 20px; color: #6B8E4E; margin-bottom: 0.25rem; opacity: 0.8; }

/* ==========================================================================
   COMPONENTES BLOG / INNER PAGES (heredados — no modificar hasta W2 pasada 2)
   ========================================================================== */
.amancay-hashtags    { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.amancay-hashtag     { background: var(--color-bg-secondary); color: var(--color-primary); padding: 0.25rem 0.75rem; border-radius: 2px; font-size: 0.85rem; }
.amancay-disclaimer  { border-left: 3px solid var(--color-accent); padding: 1rem 1.5rem; margin: 2rem 0; font-size: 0.9rem; color: var(--color-text-muted); }
.amancay-relacionados { margin-top: 3rem; }
.amancay-tiempo-lectura { font-size: 0.85rem; color: var(--color-text-muted); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 992px) {
    .story-grid, .pillars-grid { grid-template-columns: 1fr; gap: 3rem; }
    .story-img-wrapper { max-width: 600px; }
    .risk-grid, .products-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links {
        display: none; position: absolute; top: var(--nav-height);
        left: 0; width: 100%; background: var(--color-bg-primary);
        flex-direction: column; padding: 2rem; gap: 1.5rem;
        border-bottom: 1px solid var(--color-border);
    }
    [data-theme="dark"] .nav-links { background: var(--color-bg-primary); }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }

    .risk-grid, .products-grid, .footer-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .highlight-answer { padding: 1.5rem; }
    .badge-img { right: 0; bottom: 0; }
}
