/* WebToday Jardinería — páginas de artículos y recursos.
   Se carga después de site.css y reutiliza sus colores, botones, cabecera y pie. */

/* ---------- Migas de pan ---------- */
.breadcrumb { padding-top: 22px; font-size: .85rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; color: #a3ada7; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green); text-decoration: underline; }

/* ---------- Cabecera del artículo ---------- */
.art-head { padding-top: 18px; padding-bottom: 28px; }
.art-kicker {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--green-soft); color: var(--green); font-size: .78rem; font-weight: 700;
}
.art-head h1 {
  margin-top: 14px; font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.035em; max-width: 880px;
}
.art-head h1 span { color: var(--green); }
.art-lead { margin-top: 16px; font-size: 1.1rem; max-width: 720px; }
.art-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px;
  font-size: .86rem; color: var(--muted);
}
.art-meta li { display: inline-flex; align-items: center; gap: 6px; }
.art-meta .icon { width: 18px; height: 18px; stroke: var(--muted); }

/* ---------- Foto de portada ---------- */
.art-cover { margin-top: 4px; }
.art-cover img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 18px; box-shadow: var(--shadow-lg); background: var(--green-wash);
}
.art-cover figcaption { margin-top: 10px; font-size: .82rem; color: var(--muted); }

/* ---------- Estructura: texto + columna lateral ---------- */
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 40px; padding-bottom: 64px; }
.art-aside { display: grid; gap: 18px; align-content: start; }

/* ---------- Caja de descarga ---------- */
.download {
  background: #fff; border: 2px solid var(--green); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.download h2 { font-size: 1.1rem; font-weight: 800; }
.download p { margin-top: 6px; font-size: .9rem; color: var(--muted); }
.download-actions { display: grid; gap: 10px; margin-top: 16px; }
.download .btn { justify-content: flex-start; }
.download .btn small { margin-left: auto; font-weight: 600; opacity: .8; font-size: .78rem; }
.download-note { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: .82rem; color: var(--muted); }
.download-note::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d6b45' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- Índice ---------- */
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.toc h2 { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; gap: 10px; padding: 7px 0; color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; line-height: 1.35;
}
.toc a::before { content: counter(toc); flex: none; width: 20px; color: var(--green); font-weight: 800; }
.toc a:hover { color: var(--green); }

/* ---------- Texto del artículo ---------- */
.prose { max-width: 720px; font-size: 1.04rem; line-height: 1.75; }
.prose > * + * { margin-top: 18px; }
.prose h2 {
  margin-top: 52px; font-size: clamp(1.45rem, 4vw, 1.85rem); font-weight: 800; scroll-margin-top: 90px;
}
.prose h3 { margin-top: 32px; font-size: 1.18rem; font-weight: 700; scroll-margin-top: 90px; }
.prose h2 + p, .prose h3 + p { margin-top: 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--green); font-weight: 700; }
.prose strong { color: var(--ink); }
.prose a { font-weight: 600; text-underline-offset: 3px; }

/* Tablas: con scroll lateral en móvil para que nunca rompan la página */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
.prose th { text-align: left; background: var(--green-wash); color: var(--ink); font-weight: 700; padding: 12px 14px; }
.prose td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose td:first-child { font-weight: 600; color: var(--ink); }

/* Aviso destacado */
.callout {
  display: flex; gap: 14px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--green-wash); border-left: 4px solid var(--green); font-size: .98rem; line-height: 1.6;
}
.callout .icon { margin-top: 2px; }
.callout-warn { background: #fff8e6; border-left-color: #b7791f; }
.callout-warn .icon { stroke: #8a5a12; }

/* Lista de pasos numerados */
.steps { list-style: none !important; padding: 0 !important; counter-reset: step; display: grid; gap: 14px; }
.steps li { position: relative; counter-increment: step; padding: 18px 18px 18px 64px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 !important; }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 800; font-size: .95rem;
}
.steps strong { display: block; margin-bottom: 2px; }

/* ---------- Ejemplo de parte relleno ---------- */
.sheet {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; font-size: .9rem; line-height: 1.45;
}
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-bottom: 14px; border-bottom: 2px solid var(--green); }
.sheet-head strong { font-size: 1.05rem; color: var(--ink); }
.sheet-head span { color: var(--muted); font-size: .85rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-top: 16px; }
.sheet-grid div { min-width: 0; }
.sheet dt { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sheet dd { margin: 2px 0 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.sheet-wide { grid-column: 1 / -1; }
.sheet-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sheet-tasks span { padding: 3px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .8rem; font-weight: 700; }
.sheet-sign { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); }
.sheet-sign em { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.3rem; color: #23415f; font-style: normal; }

/* ---------- Comparativa papel / Excel / app ---------- */
.compare { display: grid; gap: 14px; }
.compare-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.compare-item h3 { margin: 0; font-size: 1.05rem; }
.compare-item p { margin-top: 8px; font-size: .93rem; line-height: 1.6; }
.compare-item .tag { margin-top: 10px; }
.compare-item.is-featured { border: 2px solid var(--green); }

/* ---------- Preguntas frecuentes ---------- */
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; min-height: 56px; cursor: pointer; list-style: none;
  font-weight: 700; color: var(--ink); line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-soft); color: var(--green); font-size: 1.2rem; font-weight: 700;
}
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 20px 18px; font-size: .97rem; line-height: 1.7; }
.faq details > div p + p { margin-top: 10px; }

/* ---------- Bloque final hacia el programa ---------- */
.art-cta {
  margin-top: 52px; padding: 28px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
.art-cta h2 { margin: 0; color: #fff; font-size: 1.45rem; }
.art-cta p { margin-top: 10px; opacity: .92; }
.art-cta .btn { margin-top: 18px; }

/* ---------- Autor ---------- */
.author { display: flex; gap: 14px; align-items: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.author img { width: 48px; height: 48px; border-radius: 12px; background: var(--green-wash); padding: 6px; }
.author strong { display: block; color: var(--ink); }

/* =========================================================
   Tableta y escritorio
   ========================================================= */
@media (min-width: 720px) {
  .compare { grid-template-columns: repeat(3, 1fr); }
  .download-actions { grid-template-columns: 1fr 1fr; }
  .sheet-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet-grid .sheet-half { grid-column: span 2; }
  .art-cta { padding: 36px 40px; }
}

@media (min-width: 1000px) {
  .art-head { padding-top: 26px; padding-bottom: 36px; }
  .art-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; padding-top: 56px; padding-bottom: 96px; }
  .art-aside { position: sticky; top: 92px; order: 2; }
  .art-aside .download-actions { grid-template-columns: 1fr; }
  .art-main { order: 1; }
}

@media print {
  .site-header, .site-footer, .art-aside, .art-cta, .skip-link { display: none !important; }
  .art-cover img { box-shadow: none; }
}

/* =========================================================
   Calculadora
   ========================================================= */
.calc {
  margin-top: 36px; padding: 22px; border-radius: 18px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.prose .calc h2 { margin-top: 0; font-size: 1.4rem; }
.calc-intro { margin-top: 8px !important; font-size: .95rem; color: var(--muted); line-height: 1.55; }
.calc-form { margin-top: 18px; display: grid; gap: 18px; }
.calc-form fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.calc-form legend { padding: 0 6px; font-weight: 800; color: var(--ink); font-size: .95rem; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.calc-field { display: grid; gap: 6px; align-content: start; }
.calc-field label { font-size: .88rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.calc-input { display: flex; align-items: stretch; border: 1px solid #b9c4bc; border-radius: 10px; background: #fff; overflow: hidden; }
.calc-input:focus-within { outline: 3px solid #2f8f5f; outline-offset: 1px; }
.calc-input input { flex: 1; min-width: 0; min-height: 46px; padding: 8px 12px; border: 0; font: inherit; font-size: 1rem; color: var(--ink); background: transparent; }
.calc-input input:focus { outline: none; }
.calc-input span { display: flex; align-items: center; padding: 0 12px; background: var(--green-wash); color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.calc-field select {
  min-height: 48px; padding: 8px 12px; border: 1px solid #b9c4bc; border-radius: 10px;
  font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
}
.calc-check { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; min-height: 48px; }
.calc-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); }
.calc-check label { font-weight: 500; }
.calc-help { margin: 0 !important; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.calc-actions { display: flex; justify-content: flex-end; }

.calc-result { margin-top: 20px; border-radius: 14px; overflow: hidden; border: 2px solid var(--green); }
.calc-main { padding: 20px; background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); color: #fff; }
.calc-label { margin: 0 !important; font-size: .85rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; opacity: .85; }
.calc-price { margin: 4px 0 0 !important; font-size: clamp(2.2rem, 8vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.calc-price small { font-size: .95rem; font-weight: 600; letter-spacing: 0; opacity: .85; }
.calc-sub { margin: 6px 0 0 !important; font-size: .95rem; opacity: .92; }
.calc-breakdown { margin: 0; padding: 8px 20px; display: grid; background: #fff; }
.calc-breakdown div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; line-height: 1.4; }
.calc-breakdown div:last-child { border-bottom: 0; }
.calc-breakdown dt { color: var(--muted); }
.calc-breakdown dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.calc-note { margin: 0 !important; padding: 12px 20px 16px; background: var(--green-wash); font-size: .85rem; line-height: 1.55; }

.sources { font-size: .92rem; }
.sources li + li { margin-top: 10px; }

@media (min-width: 560px) {
  .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  .calc { padding: 30px; }
  .calc-breakdown { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .calc-breakdown div:nth-last-child(2) { border-bottom: 0; }
}
.calc-field select { width: 100%; min-width: 0; }

/* Barra fija con el precio (solo móvil y tableta) */
.calc-float {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--green-dark); color: #fff; text-decoration: none; box-shadow: var(--shadow-lg);
  transform: translateY(150%); transition: transform .25s ease;
}
.calc-float span { font-size: .82rem; opacity: .85; }
.calc-float strong, .prose .calc-float strong { color: #fff; font-size: 1.15rem; font-weight: 800; }
.calc-float .calc-float-link { margin-left: auto; opacity: 1; font-weight: 700; }
.calc-float.is-visible { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .calc-float { transition: none; } }
@media (min-width: 1000px) { .calc-float { display: none; } }

/* Aviso para deslizar las tablas anchas en móvil */
@media (max-width: 719px) {
  .table-scroll::before {
    content: "Desliza la tabla →"; position: sticky; left: 0; display: block;
    padding: 8px 14px 0; font-size: .78rem; font-weight: 600; color: var(--muted);
  }
}

/* Tablas de pocas columnas: se ajustan al ancho del móvil sin deslizar */
.prose .table-fit table { min-width: 0; }
.prose .table-fit td:not(:first-child), .prose .table-fit th:not(:first-child) { white-space: nowrap; }
@media (max-width: 719px) {
  .table-fit::before { content: none; }
  .prose .table-fit th, .prose .table-fit td { padding: 10px; }
}

/* Páginas legales */
.legal { padding-bottom: 72px; }
.legal ul { list-style: disc; }

/* Comparativa de dos columnas (disponible / próximamente) */
@media (min-width: 720px) { .compare.compare-2 { grid-template-columns: 1fr 1fr; } }
.compare-item ul, .compare-item ol { margin-top: 10px; padding-left: 20px; font-size: .93rem; line-height: 1.55; }
.compare-item li + li { margin-top: 6px; }
.steps.steps-plain li { padding-top: 22px; }

/* Página de recursos */
.res-intro { margin-bottom: 8px; }
.res-grid { display: grid; gap: 20px; margin-top: 28px; }
.res-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.res-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.res-body { display: flex; flex-direction: column; gap: 10px; padding: 20px; flex: 1; }
.res-body .tag { align-self: flex-start; background: var(--green-soft); color: var(--green); }
.res-body h2 { font-size: 1.2rem; font-weight: 800; }
.res-body h2 a { color: var(--ink); text-decoration: none; }
.res-body h2 a:hover { color: var(--green); }
.res-body p { font-size: .95rem; line-height: 1.6; flex: 1; }
.res-body .btn { align-self: flex-start; }
.res-more { max-width: 720px; margin: 36px 0 72px; display: grid; gap: 10px; }
@media (min-width: 720px) { .res-grid { grid-template-columns: 1fr 1fr; } }
