/* ============================================================
   SCIENCIA NOTICIAS — Stylesheet
   Paleta y tipografía tomadas de design.md (Sciencia Expert)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;600;700&family=Inter:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --primary:        #1E2533;  /* Azul Oxford */
  --on-primary:     #ffffff;
  --secondary:      #E2A72F;  /* Dorado corporativo */
  --on-secondary:   #1E2533;
  --tertiary:       #397768;  /* Turquesa */
  --on-tertiary:    #ffffff;

  --bg:             #F8F6F0;  /* Crema ultra claro */
  --surface:        #FFFFFF;
  --surface-low:    #F5F2EC;
  --border:         #E8E4DB;
  --outline:        #79766C;

  --text:           #1B1A17;
  --text-muted:     #47453E;
  --text-dim:       #79766C;

  --status-info:    #2563EB;
  --status-danger:  #DC2626;

  --font-display: Arial, Helvetica, sans-serif;
  --font-body:    Calibri, 'Segoe UI', Tahoma, sans-serif;

  --r-sm: 0.25rem; --r: 0.5rem; --r-md: 0.75rem; --r-lg: 1rem; --r-xl: 1.5rem; --r-full: 9999px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --max-w: 1280px;
  --px: clamp(20px, 5vw, 60px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 1rem; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: var(--px); }

/* ── Header ── */
.n-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; }
.n-header-inner { max-width: var(--max-w); margin-inline: auto; padding: 16px var(--px); display: flex; align-items: center; justify-content: space-between; }
.n-menu-btn { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.n-menu-btn span { width: 24px; height: 2px; background: var(--primary); border-radius: 2px; }
.n-logo { display: flex; align-items: center; gap: 10px; }
.n-logo img { height: 42px; width: auto; }
.n-logo-text { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.02em; color: var(--primary); }
.n-logo-text span { color: var(--secondary); }
.n-back { font-size: 0.8rem; font-weight: 700; color: var(--primary); border: 1.5px solid var(--border); padding: 8px 16px; border-radius: var(--r-full); transition: all 0.2s ease; }
.n-back:hover { border-color: var(--primary); background: var(--surface-low); }

/* ── Menú hamburguesa ── */
.n-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.n-menu-btn.open span:nth-child(2) { opacity: 0; }
.n-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.n-menu-btn span { transition: all 0.2s ease; }
.n-menu-panel {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 32px rgba(16,19,26,0.12); z-index: 199;
}
.n-menu-panel.open { display: block; }
.n-menu-panel ul { max-width: var(--max-w); margin-inline: auto; padding: 8px var(--px) 16px; }
.n-menu-panel a { display: flex; align-items: center; gap: 8px; padding: 14px 4px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 0.95rem; color: var(--text); }
.n-menu-panel li:last-child a { border-bottom: none; }
.n-menu-panel a:hover { color: var(--tertiary); }
.n-menu-panel a.highlight { color: var(--tertiary); }
.n-menu-panel a.highlight::after { content: 'Herramienta'; margin-left: auto; background: var(--secondary); color: var(--on-secondary); font-size: 0.6rem; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: var(--r-full); }

/* ── Calculadora de muestra ── */
.n-calc-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 2rem; margin-bottom: 2.5rem; }
.n-calc-box h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.n-calc-box > p { color: var(--text-muted); margin-bottom: 1.75rem; line-height: 1.7; }
.n-calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 1.75rem; }
.n-calc-field label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; }
.n-calc-field input[type="number"] {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 1rem; color: var(--text); background: var(--bg);
}
.n-calc-field input[type="number"]:focus { outline: none; border-color: var(--tertiary); }
.n-calc-radios { display: flex; gap: 1.5rem; align-items: center; height: 46px; }
.n-calc-radios label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.n-calc-actions { display: flex; gap: 1rem; margin-bottom: 1.75rem; }
.n-calc-btn { background: var(--status-info); color: #fff; font-weight: 700; font-size: 0.9rem; padding: 12px 28px; border: none; border-radius: var(--r-full); cursor: pointer; transition: filter 0.2s ease; }
.n-calc-btn:hover { filter: brightness(1.1); }
.n-calc-btn.clear { background: var(--secondary); color: var(--on-secondary); }
.n-calc-result { text-align: center; padding-top: 1rem; border-top: 1px solid var(--border); }
.n-calc-result span { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.5rem; }
.n-calc-result strong { font-family: var(--font-display); font-size: 3.5rem; font-weight: 700; color: var(--status-info); }
.n-formula-box { background: var(--primary); color: #fff; border-radius: var(--r-lg); padding: 2rem; text-align: center; margin: 2rem 0; }
.n-formula-box code { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; display: block; margin-bottom: 1rem; color: var(--secondary); }
.n-article-content .n-formula-box ul { display: inline-flex; flex-direction: column; gap: 10px; text-align: left; font-size: 0.92rem; color: #ffffff; margin: 0; }
.n-article-content .n-formula-box li { color: #ffffff; }
.n-article-content .n-formula-box strong { color: var(--secondary); font-weight: 700; }
.n-faq details { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.n-faq summary { font-weight: 700; cursor: pointer; font-size: 1rem; }
.n-faq details p { color: var(--text-muted); margin-top: 0.75rem; line-height: 1.7; }

/* ── Pasos / Consejos (bloques numerados) ── */
.n-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.n-step { background: var(--primary); color: #fff; border-radius: var(--r-md); padding: 1.5rem 1.25rem; }
.n-step-num { width: 30px; height: 30px; border-radius: 50%; background: var(--secondary); color: var(--on-secondary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); margin-bottom: 1rem; }
.n-step p { font-size: 0.82rem; color: rgba(255,255,255,0.88); line-height: 1.55; margin: 0; }

/* ── Tarjetas de muestreo ── */
.n-sampling-sub { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 1.75rem 0 1rem; color: var(--tertiary); }
.n-sampling-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.n-sampling-card { background: var(--primary); border-radius: var(--r-md); padding: 1.5rem 1.25rem; text-align: left; }
.n-sampling-card.alt { background: var(--tertiary); }
.n-sampling-card h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.6rem; line-height: 1.3; }
.n-sampling-card p { color: rgba(255,255,255,0.85); font-size: 0.8rem; line-height: 1.55; margin: 0; }

.n-example-box { background: var(--surface-low); border-left: 3px solid var(--secondary); border-radius: var(--r-sm); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.n-example-box code { display: block; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--primary); margin-top: 0.5rem; }

@media (max-width: 900px) {
  .n-steps, .n-sampling-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .n-calc-grid { grid-template-columns: 1fr; }
  .n-steps, .n-sampling-grid { grid-template-columns: 1fr; }
}

/* ── Hero band ── */
.n-hero { background: var(--primary); padding: 28px 0 40px; }
.n-hero-grid { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 18px; }
.n-hero-col { display: flex; flex-direction: column; gap: 18px; }
.n-card {
  position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4/3;
  background: var(--primary);
}
.n-hero-col .n-card { flex: 1; }
.n-card img { width: 100%; height: 100%; object-fit: cover; }
.n-card-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
}
.n-tag {
  display: inline-flex; align-self: flex-start; background: var(--secondary); color: var(--on-secondary);
  font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-sm); margin-bottom: 10px;
}
.n-card-title { color: #fff; font-weight: 700; font-size: 0.95rem; line-height: 1.35; margin-bottom: 8px; }
.n-card-date { color: rgba(255,255,255,0.75); font-size: 0.72rem; font-style: italic; display: flex; align-items: center; gap: 6px; }

.n-hero-main { position: relative; border-radius: var(--r-md); overflow: hidden; aspect-ratio: 16/10; }
.n-hero-main img { width: 100%; height: 100%; object-fit: cover; }
.n-hero-main .n-card-overlay { padding: 28px; }
.n-hero-main .n-tag { font-size: 0.72rem; padding: 5px 12px; }
.n-hero-main .n-card-title { font-size: clamp(1.3rem, 2.4vw, 1.9rem); font-weight: 800; text-transform: uppercase; line-height: 1.2; }
.n-hero-main .n-card-date { font-size: 0.8rem; }

/* ── Ticker ── */
.n-ticker { background: var(--secondary); overflow: hidden; }
.n-ticker-inner { display: flex; align-items: center; gap: 20px; padding: 14px var(--px); max-width: var(--max-w); margin-inline: auto; }
.n-ticker-label {
  background: var(--surface); color: var(--primary); font-family: var(--font-display); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 16px; border-radius: var(--r-sm);
  flex-shrink: 0;
}
.n-ticker-text { color: var(--on-secondary); font-weight: 700; font-size: 0.95rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-ticker-text strong { text-transform: uppercase; }

/* ── Section headings ── */
.n-section { padding-block: 3rem; }
.n-section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.01em;
  text-transform: uppercase; font-style: italic; padding-bottom: 12px; border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}

/* ── Layout: main + sidebar ── */
.n-layout { display: grid; grid-template-columns: 2.1fr 1fr; gap: 3rem; align-items: start; }

/* ── Article row (Recientes) ── */
.n-article-row { display: grid; grid-template-columns: 320px 1fr; gap: 1.75rem; margin-bottom: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
.n-article-row:last-child { border-bottom: none; }
.n-article-row img { border-radius: var(--r-md); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.n-article-cat { display: inline-block; color: var(--tertiary); font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.n-article-row h3 { font-size: 1.35rem; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.n-article-row h3 a:hover { color: var(--tertiary); }
.n-article-meta { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 10px; }
.n-article-summary { color: var(--text-muted); font-size: 0.92rem; line-height: 1.7; margin-bottom: 14px; }
.n-readmore {
  display: inline-block; border: 1.5px solid var(--border); color: var(--primary); font-weight: 700;
  font-size: 0.8rem; padding: 8px 20px; border-radius: var(--r-sm); transition: all 0.2s ease;
}
.n-readmore:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.n-tags { margin-top: 14px; font-size: 0.82rem; color: var(--text-dim); }
.n-tags a { color: var(--tertiary); font-style: italic; }
.n-tags a:hover { text-decoration: underline; }

/* ── Sidebar ── */
.n-sidebar-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.25rem; margin-bottom: 1.75rem; box-shadow: var(--shadow); }
.n-sidebar-title {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em; text-transform: uppercase;
  color: #fff; background: var(--status-danger); display: inline-block; padding: 6px 14px; border-radius: var(--r-sm);
  margin-bottom: 1.25rem;
}
.n-sidebar-item { display: flex; gap: 12px; margin-bottom: 1.1rem; align-items: flex-start; }
.n-sidebar-item:last-child { margin-bottom: 0; }
.n-sidebar-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }
.n-sidebar-item h5 { font-size: 0.85rem; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.n-sidebar-item h5 a:hover { color: var(--tertiary); }
.n-sidebar-item span { font-size: 0.72rem; color: var(--text-dim); }

.n-promo {
  background: linear-gradient(135deg, var(--tertiary) 0%, #2b5b50 100%); color: #fff;
  border-radius: var(--r-lg); padding: 2rem 1.5rem; margin-bottom: 1.75rem; text-align: center;
}
.n-promo h4 { color: #fff; font-size: 1.3rem; font-weight: 800; text-transform: uppercase; margin-bottom: 0.5rem; }
.n-promo p { font-size: 0.85rem; color: rgba(255,255,255,0.85); margin-bottom: 1.25rem; line-height: 1.5; }
.n-promo a { display: inline-block; background: var(--secondary); color: var(--on-secondary); font-weight: 700; font-size: 0.82rem; padding: 10px 22px; border-radius: var(--r-full); }
.n-promo a:hover { filter: brightness(1.08); }

/* ── Article detail page ── */
.n-article-header { background: var(--primary); padding: 3rem 0 3.5rem; }
.n-article-header .n-tag { margin-bottom: 1rem; }
.n-article-header h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.25; margin-bottom: 1rem; max-width: 800px; }
.n-article-header .n-article-meta { color: rgba(255,255,255,0.7); }
.n-article-body { max-width: 780px; margin-inline: auto; padding-block: 3rem; }
.n-article-cover { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 2rem; box-shadow: var(--shadow); }
.n-article-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.n-article-content p { color: var(--text-muted); font-size: 1.02rem; line-height: 1.85; margin-bottom: 1.4rem; }
.n-article-content h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 1rem; padding-top: 0.5rem; }
.n-article-content ul, .n-article-content ol { color: var(--text-muted); font-size: 1.02rem; line-height: 1.85; margin: 0 0 1.4rem 1.4rem; }
.n-article-content li { margin-bottom: 0.5rem; }
.n-article-content strong { color: var(--text); }
.n-article-footer-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ── Company footer (matches Sciencia Group) ── */
.n-contact-cta { background: var(--bg); text-align: center; padding: 3rem 0; border-top: 1px solid var(--border); }
.n-contact-cta p { color: var(--text-muted); margin-bottom: 1.25rem; font-size: 1rem; }
.n-contact-cta a.btn-whatsapp {
  display: inline-flex; align-items: center; gap: 10px; background: var(--tertiary); color: #fff;
  font-weight: 700; font-size: 0.95rem; padding: 14px 32px; border-radius: var(--r-full); transition: filter 0.2s ease;
}
.n-contact-cta a.btn-whatsapp:hover { filter: brightness(1.1); }

.n-footer { background: #fff; border-top: 1px solid rgba(16,19,26,0.1); padding-block: 3rem 2rem; font-family: 'Inter', sans-serif; }
.n-footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.n-footer-brand img { height: 76px; margin-bottom: 0.75rem; }
.n-footer-brand p { font-size: 0.85rem; color: #4b5265; line-height: 1.65; max-width: 280px; }
.n-footer-col h4 { font-family: 'Space Mono', monospace; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(16,19,26,0.5); margin-bottom: 1rem; }
.n-footer-col ul { display: flex; flex-direction: column; gap: 0.6rem; }
.n-footer-col a, .n-footer-col span { font-size: 0.875rem; font-weight: 400; color: #4b5265; transition: color 0.3s; }
.n-footer-col a:hover { color: #0e71b7; }
.n-footer-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(16,19,26,0.1); padding-top: 1.5rem; font-size: 0.8rem; font-family: 'Inter', sans-serif; color: rgba(16,19,26,0.5); max-width: var(--max-w); margin-inline: auto; padding-inline: var(--px); }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .n-layout { grid-template-columns: 1fr; }
  .n-hero-grid { grid-template-columns: 1fr; }
  .n-hero-col { flex-direction: row; }
  .n-hero-col .n-card { aspect-ratio: 16/10; }
}
@media (max-width: 700px) {
  .n-hero-col { flex-direction: column; }
  .n-article-row { grid-template-columns: 1fr; }
  .n-footer-inner { grid-template-columns: 1fr; }
  .n-footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .n-footer-brand img { height: 46px; }
}
