
/* ---------- Lazy YouTube thumbnails ---------- */
.video-embed iframe{position:absolute; top:0; left:0; width:100%; height:100%; border:0}
.video-embed.lazy-yt{cursor:pointer; background:#000; position:relative}
.video-embed.lazy-yt::after{content:'▶'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:68px; height:48px; background:rgba(0,0,0,.7); color:#fff; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.4rem; transition:background .2s}
.video-embed.lazy-yt:hover::after{background:rgba(200,0,0,.9)}
.video-embed.lazy-yt img{width:100%; height:100%; object-fit:cover}
/* ============ AloePedia — Charts, Diagrams & Illustrations ============ */

/* ---------- Bar charts (CSS) ---------- */
.bar-chart{margin:1.2rem 0}
.bar-row{display:flex; align-items:center; gap:.6rem; margin:.4rem 0}
.bar-label{min-width:120px; font-size:.88rem; font-weight:600; text-align:right; color:var(--text)}
.bar-track{flex:1; height:28px; background:var(--surface2); border-radius:6px; overflow:hidden; position:relative}
.bar-fill{height:100%; border-radius:6px; display:flex; align-items:center; padding-left:.6rem; font-size:.78rem; font-weight:700; color:#fff; transition:width .6s ease}
.bar-fill.green{background:linear-gradient(90deg,#43a047,#66bb6a)}
.bar-fill.blue{background:linear-gradient(90deg,#1565c0,#42a5f5)}
.bar-fill.amber{background:linear-gradient(90deg,#e65100,#f4a83d)}
.bar-fill.red{background:linear-gradient(90deg,#b71c1c,#ef5350)}
.bar-fill.teal{background:linear-gradient(90deg,#00695c,#26a69a)}
.bar-fill.purple{background:linear-gradient(90deg,#6a1b9a,#ab47bc)}
.bar-value{min-width:60px; font-size:.82rem; font-weight:700; color:var(--muted)}

/* ---------- Donut / Pie charts (CSS) ---------- */
.donut-chart{display:flex; align-items:center; gap:2rem; margin:1.2rem 0; flex-wrap:wrap}
.donut{width:160px; height:160px; border-radius:50%; position:relative; flex-shrink:0}
.donut-center{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:80px; height:80px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:1.1rem; font-weight:800; color:var(--text); text-align:center; line-height:1.2}
.donut-legend{display:flex; flex-direction:column; gap:.4rem}
.legend-item{display:flex; align-items:center; gap:.5rem; font-size:.88rem}
.legend-dot{width:12px; height:12px; border-radius:3px; flex-shrink:0}

/* ---------- Timeline / Process flow ---------- */
.process-flow{display:flex; align-items:stretch; gap:0; margin:1.5rem 0; overflow-x:auto; padding-bottom:.5rem}
.flow-step{flex:1; min-width:140px; background:var(--surface); border:2px solid var(--border); border-radius:12px; padding:1rem; text-align:center; position:relative; transition:border-color .15s}
.flow-step:hover{border-color:var(--brand)}
.flow-step .step-icon{font-size:2rem; margin-bottom:.4rem}
.flow-step .step-num{position:absolute; top:-10px; left:50%; transform:translateX(-50%); background:var(--brand); color:#fff; width:22px; height:22px; border-radius:50%; font-size:.75rem; font-weight:800; display:flex; align-items:center; justify-content:center}
.flow-step .step-title{font-weight:700; font-size:.9rem; margin-bottom:.2rem}
.flow-step .step-desc{font-size:.8rem; color:var(--muted)}
.flow-arrow{display:flex; align-items:center; font-size:1.4rem; color:var(--brand); padding:0 .3rem; flex-shrink:0}

/* ---------- Illustration containers ---------- */
.illustration{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:1.2rem; margin:1.2rem 0; overflow-x:auto; text-align:center}
.illustration svg{max-width:100%; height:auto}
.illustration figcaption{font-size:.85rem; color:var(--muted); margin-top:.8rem; text-align:center}

/* ---------- Data callout boxes ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:1rem; margin:1.2rem 0}
.stat-box{background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:1rem; text-align:center}
.stat-box .stat-number{font-size:1.8rem; font-weight:800; color:var(--brand); line-height:1}
.stat-box .stat-label{font-size:.82rem; color:var(--muted); margin-top:.3rem}
.stat-box .stat-sub{font-size:.75rem; color:var(--muted); margin-top:.2rem; font-style:italic}

/* ---------- Comparison tables (enhanced) ---------- */
.compare-table{width:100%; border-collapse:collapse; margin:1.2rem 0; font-size:.9rem}
.compare-table th{background:var(--brand); color:#fff; padding:.7rem .8rem; text-align:left; font-size:.82rem; text-transform:uppercase; letter-spacing:.04em}
.compare-table td{padding:.6rem .8rem; border-bottom:1px solid var(--border); vertical-align:top}
.compare-table tr:nth-child(even) td{background:var(--surface2)}
.compare-table tr:hover td{background:var(--surface)}
.compare-table .highlight td{background:#e8f5e9; font-weight:600}
[data-theme="dark"] .compare-table .highlight td{background:#1d3320}

/* ---------- Gauge / Progress ---------- */
.gauge{display:flex; align-items:center; gap:1rem; margin:.6rem 0}
.gauge-label{min-width:100px; font-size:.88rem; font-weight:600}
.gauge-track{flex:1; height:10px; background:var(--surface2); border-radius:5px; overflow:hidden}
.gauge-fill{height:100%; border-radius:5px; transition:width .4s ease}
.gauge-fill.low{background:#ef5350}
.gauge-fill.mid{background:#f4a83d}
.gauge-fill.high{background:#66bb6a}
.gauge-val{font-size:.85rem; font-weight:700; min-width:40px; text-align:right}

/* ---------- Infographic cards ---------- */
.info-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:1.2rem; display:flex; gap:1rem; align-items:flex-start; margin:.8rem 0; transition:border-color .15s}
.info-card:hover{border-color:var(--brand)}
.info-card .info-icon{font-size:2.2rem; flex-shrink:0; width:50px; text-align:center}
.info-card .info-body h4{margin:0 0 .3rem; font-size:1rem}
.info-card .info-body p{margin:0; font-size:.88rem; color:var(--muted)}

/* ---------- Seasonal calendar grid ---------- */
.season-grid{display:grid; grid-template-columns:repeat(12,1fr); gap:2px; margin:1.2rem 0; font-size:.75rem; text-align:center}
.season-header{font-weight:800; padding:.4rem .2rem; background:var(--surface2); border-radius:4px 4px 0 0}
.season-cell{padding:.5rem .2rem; border-radius:0 0 4px 4px; min-height:40px; display:flex; align-items:center; justify-content:center; font-weight:600}
.season-cell.plant{background:#c8e6c9; color:#1b5e20}
.season-cell.grow{background:#a5d6a7; color:#1b5e20}
.season-cell.harvest{background:#fff9c4; color:#f57f17}
.season-cell.rest{background:#e0e0e0; color:#616161}
.season-cell.weed{background:#bbdefb; color:#0d47a1}
.season-cell.water{background:#b3e5fc; color:#01579b}
.season-cell.fert{background:#d1c4e9; color:#4527a0}
.season-cell.peak{background:#ffcc80; color:#e65100}
[data-theme="dark"] .season-cell.plant{background:#1d3320; color:#9cdc9e}
[data-theme="dark"] .season-cell.grow{background:#2e4a31; color:#a5d6a7}
[data-theme="dark"] .season-cell.harvest{background:#3a3514; color:#f0c274}
[data-theme="dark"] .season-cell.rest{background:#2a2a2a; color:#999}
[data-theme="dark"] .season-cell.weed{background:#1a3050; color:#90caf9}
[data-theme="dark"] .season-cell.water{background:#0d3048; color:#81d4fa}
[data-theme="dark"] .season-cell.fert{background:#2a1f40; color:#b39ddb}
[data-theme="dark"] .season-cell.peak{background:#3a2d14; color:#f0c274}

/* ---------- Video embeds ---------- */
.video-section{margin:1.8rem 0}
.video-section h3{margin-bottom:.6rem}
.video-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:1.2rem}
.video-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; transition:border-color .15s, transform .12s}
.video-card:hover{border-color:var(--brand); transform:translateY(-2px)}
.video-card .video-embed{position:relative; padding-bottom:56.25%; height:0; overflow:hidden; background:#000}
.video-card .video-embed iframe{position:absolute; top:0; left:0; width:100%; height:100%; border:0}
.video-card .video-info{padding:.8rem 1rem}
.video-card .video-title{font-weight:700; font-size:.92rem; margin-bottom:.2rem}
.video-card .video-desc{font-size:.82rem; color:var(--muted); line-height:1.4}
.video-card .video-tag{display:inline-block; font-size:.72rem; font-weight:700; padding:.15rem .5rem; border-radius:999px; background:var(--surface2); color:var(--brand); margin-top:.4rem}
.video-single{max-width:700px; margin:1.2rem 0}
.video-single .video-embed{position:relative; padding-bottom:56.25%; height:0; overflow:hidden; background:#000; border-radius:var(--radius); overflow:hidden}
.video-single .video-embed iframe{position:absolute; top:0; left:0; width:100%; height:100%; border:0}
.video-single .video-caption{font-size:.85rem; color:var(--muted); margin-top:.5rem}
@media (max-width:700px){
  .video-grid{grid-template-columns:1fr}
}

/* ---------- Dark mode overrides ---------- */
[data-theme="dark"] .compare-table .highlight td{background:#1d3320; font-weight:600}
[data-theme="dark"] .season-cell.plant{background:#1d3320; color:#9cdc9e}
[data-theme="dark"] .season-cell.grow{background:#2e4a31; color:#a5d6a7}
[data-theme="dark"] .season-cell.harvest{background:#3a3514; color:#f0c274}
[data-theme="dark"] .season-cell.rest{background:#2a2a2a; color:#999}
[data-theme="dark"] .season-cell.weed{background:#1a3050; color:#90caf9}
[data-theme="dark"] .season-cell.water{background:#0d3048; color:#81d4fa}
[data-theme="dark"] .season-cell.fert{background:#2a1f40; color:#b39ddb}
[data-theme="dark"] .season-cell.peak{background:#3a2d14; color:#f0c274}
[data-theme="dark"] .gauge-fill.low{background:#e57373}
[data-theme="dark"] .gauge-fill.mid{background:#f4b350}
[data-theme="dark"] .gauge-fill.high{background:#81c784}
[data-theme="dark"] .info-card .info-body p{color:var(--muted)}

/* ---------- Responsive ---------- */
@media (max-width:700px){
  .bar-label{min-width:80px; font-size:.8rem}
  .donut{width:120px; height:120px}
  .donut-center{width:60px; height:60px; font-size:.9rem}
  .flow-step{min-width:110px; padding:.7rem}
  .season-grid{grid-template-columns:repeat(6,1fr)}
  .stat-grid{grid-template-columns:repeat(2,1fr)}
}
