/* hubs.css — shared styles for category hubs (Finance, DIY, etc.) */

/* Layout */
.tool-container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.main-wrapper { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.calculator-column { min-width: 0; }
.info-column { min-width: 0; position: sticky; top: 16px; height: fit-content; }

/* Mobile */
@media (max-width: 992px) {
  .main-wrapper { grid-template-columns: 1fr; }
  .info-column { position: static; }
}

/* Breadcrumb */
.breadcrumb { margin: 8px 0 16px; font-size: .9rem; color: #666; }
.breadcrumb a { color: #5563DE; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 16px; box-shadow: 0 4px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; justify-content: space-between; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0 0 12px; color: #555; }
.btn { display: inline-block; padding: 10px 14px; border-radius: 8px; background: #5563DE; color: #fff; text-decoration: none; font-weight: 500; }
.btn:hover { background: #4652c4; }

/* Link lists */
.link-list { list-style: none; padding-left: 0; margin: 0; }
.link-list li { padding: 8px 0; border-bottom: 1px solid #f0f0f5; }
.link-list li:last-child { border-bottom: 0; }
.link-list a { color: #1a0dab; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }

/* Comparison table */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.compare-table thead th { background: #f7f8ff; font-weight: 600; }
.compare-table tbody tr:hover { background: #fafbff; }
.compare-table td a { color: #5563DE; font-weight: 600; }

/* CTA / sections */
.cta { background: #f7f9ff; border: 1px solid #e6eaff; border-radius: 10px; padding: 16px; }
.site-header .tool-title { margin: 8px 0 6px; }

/* Info column */
#infoContent section { background: #fff; border: 1px solid #f0f0f5; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
#infoContent pre { background: #0b102a; color: #e6ecff; padding: 12px; border-radius: 8px; overflow: auto; font-size: .9rem; }

/* Share/search spacing */
.share-section { margin-top: 24px; }

/* A11y */
.card a.btn:focus, .compare-table a:focus, .link-list a:focus { outline: 2px solid #5563DE; outline-offset: 2px; border-radius: 6px; }

/* Mini top disclaimer */
.mini-disclaimer{margin:12px 0 20px;font-size:.95rem;color:#5a5a5a;background:#fffbe6;border:1px solid #ffe58f;border-radius:8px;padding:10px 12px;}

/* Full disclaimer */
.disclaimer-text{font-size:.95rem;color:#555;padding:16px;border:1px solid #ffcc00;background:#fffacd;border-radius:8px;line-height:1.5;margin-top:20px;}
.disclaimer-container{margin:20px 0;}
.disclaimer-text .indented-list{list-style:disc;padding-left:20px;margin:10px 0;}
.disclaimer-text .indented-list li{margin-bottom:6px;}

/* Generic indented list used elsewhere on page */
.indented-list{list-style:disc;padding-left:20px;margin:10px 0;}
.indented-list li{margin:6px 0;}

/* TOC (if not already added) */
.toc{background:#fff;border:1px solid #f0f0f5;border-radius:10px;padding:16px;}
.toc ol{list-style:none;padding-left:0;margin:0;}
.toc li{margin:6px 0;}
.toc a{color:#1a0dab;text-decoration:none;}
.toc a:hover{text-decoration:underline;}

/* Unit Converters: emphasize the All-in-One card and surface it first on mobile */
body[data-category="Unit Converters"] .card-grid .card { position: relative; }

/* Optional desktop highlight (very subtle) */
body[data-category="Unit Converters"] .card-grid .card--prime {
  border: 1.5px solid #e5e8ff;
  background: #fff;
}

/* Mobile: make All-in-One appear first + visually pop */
@media (max-width: 700px) {
  /* If your grid is already responsive, this won't fight it; it's scoped to this page only */
  body[data-category="Unit Converters"] .card-grid { gap: 12px; }

  /* Fallback using a class */
  body[data-category="Unit Converters"] .card-grid .card--prime {
    order: -1;             /* works if the container is flex */
    grid-row: 1;           /* helps if the container is grid */
    box-shadow: 0 8px 18px rgba(85,99,222,.18);
    border: 2px solid #5563DE;
    background: linear-gradient(0deg, rgba(85,99,222,.06), rgba(85,99,222,.06)), #fff;
  }

  /* Modern browsers: target by link (no HTML change required) */
  @supports selector(.card:has(a[href*="/tools/unit-converter"])) {
    body[data-category="Unit Converters"] .card-grid .card:has(a[href*="/tools/unit-converter"]) {
      order: -1;
      grid-row: 1;
      box-shadow: 0 8px 18px rgba(85,99,222,.18);
      border: 2px solid #5563DE;
      background: linear-gradient(0deg, rgba(85,99,222,.06), rgba(85,99,222,.06)), #fff;
    }
  }

  /* Tiny ribbon */
  body[data-category="Unit Converters"] .card-grid .card--prime::after,
  body[data-category="Unit Converters"] .card-grid .card:has(a[href*="/tools/unit-converter"])::after {
    content: "Recommended";
    position: absolute;
    top: 10px; right: 10px;
    font-size: .72rem; font-weight: 700;
    color: #fff; background: #5563DE;
    border-radius: 999px; padding: 4px 8px;
  }
}
