/* ============================================================
   legacy.css - restyles the original ExplainItSimply content
   classes (.hero-small, .article-content, .info-box, .card,
   .comparison-table, etc.) to match the new editorial theme
   defined in styles.css. Loaded only on converted content pages.
   ============================================================ */

/* ---- Page hero (replaces old .hero-small) ---- */
.hero-small {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: calc(var(--header-h) + 64px) 0 72px;
  overflow: hidden;
}
.hero-small::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--accent);
}
.hero-small .container { position: relative; z-index: 1; }
.hero-small h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  text-wrap: balance;
}
.hero-small > .container > p,
.hero-small p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.78);
  max-width: 640px;
  line-height: 1.7;
}
.hero-image img,
.aboutus-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ---- Narrow content column ---- */
.container-narrow { max-width: 780px; }

/* ---- Section header ---- */
.section-header { margin-bottom: 36px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.18;
  margin-bottom: 10px;
}
.section-header span { font-size: 15px; color: var(--muted); line-height: 1.65; }

/* ---- Breadcrumb (light) ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}
.breadcrumb a { color: var(--primary); font-weight: 600; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }

/* ---- Article / editorial typography ---- */
.article { background: var(--bg); padding: 64px 0 88px; }
.article-content,
.section .container-narrow {
  color: var(--fg);
}
.article-content > .article-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--muted);
}
.article-content > .article-meta span {
  background: none;
  padding: 0;
  border-radius: 0;
}

.article-content h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.12;
  margin-bottom: 18px;
  text-wrap: balance;
}
.article-content h2,
.section .container-narrow > h2 {
  font-family: var(--font-display);
  font-size: clamp(23px, 2.8vw, 30px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.25;
  margin: 40px 0 14px;
}
.article-content h3,
.section .container-narrow > h3 {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
  margin: 28px 0 10px;
}
.article-content h4 { font-size: 17px; font-weight: 700; color: var(--fg); margin: 22px 0 8px; }

.article-content p,
.section .container-narrow > p {
  font-size: 16.5px;
  color: #374151;
  line-height: 1.85;
  margin-bottom: 18px;
}
.article-content a:not(.btn),
.section .container-narrow a:not(.btn) {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content a:not(.btn):hover { color: var(--accent); }
.article-content strong,
.section .container-narrow strong { color: var(--fg); font-weight: 700; }

.article-content ul,
.article-content ol,
.section .container-narrow > ul,
.section .container-narrow > ol {
  margin: 0 0 20px 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-content li,
.section .container-narrow li {
  position: relative;
  padding-left: 26px;
  font-size: 16px;
  color: #374151;
  line-height: 1.7;
}
.article-content ul li::before,
.section .container-narrow > ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 11px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}
.article-content ol,
.section .container-narrow > ol { counter-reset: li; }
.article-content ol li::before,
.section .container-narrow > ol li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(249, 115, 22, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-muted { color: var(--muted); }

/* ---- Info boxes / callouts ---- */
.info-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}
.info-box.tip { background: #fff7ed; border-left-color: var(--accent); }
.info-box h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.info-box.tip h4 { color: var(--accent-hover); }
.info-box p { font-size: 15.5px; color: #374151; line-height: 1.75; margin: 0; }

/* ---- Cards & grids ---- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: var(--fg);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
a.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: rgba(26, 58, 107, 0.28); }
.card h3, .card h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.3;
}
.card p { font-size: 14px; color: var(--muted); line-height: 1.65; margin: 0; }
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }

/* ---- Buttons (old .btn .btn-primary) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
}
.btn.btn-primary,
a.btn.btn-primary { background: var(--accent); color: #fff; }
.btn.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); color: #fff; }
.btn.btn-secondary { background: var(--primary); color: #fff; }
.btn.btn-secondary:hover { background: var(--primary-dark); color: #fff; }

/* ---- Comparison tables ---- */
.table-wrapper {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: 15px;
  background: #fff;
}
.comparison-table thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 13px 16px;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  vertical-align: top;
  color: #374151;
}
.comparison-table tbody td:first-child { font-weight: 600; color: var(--fg); background: var(--bg-subtle); }
.comparison-table tbody tr:nth-child(even) td { background: #fafbfe; }
.comparison-table tbody tr:hover td { background: var(--primary-light); }

/* ---- Legacy back-to-top button from old pages ---- */
#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
#backToTop:hover { background: var(--primary-dark); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-small { padding: calc(var(--header-h) + 40px) 0 52px; }
}
