/* =========================
   BASE + TOKENS
   ========================= */
:root {
  --primary: #3366CC;
  --primary-2: #5F95FF;
  --primary-dark: #2851A3;
  --bg: #ffffff;
  --text: #333;
  --muted: #555;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow-1: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-2: 0 8px 20px rgba(0,0,0,0.12);
  --shadow-3: 0 6px 18px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- GLOBAL ---------- */
body {
  font-family: "Proxima Nova", "Segoe UI", "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.7;
}

h1, h2, h3, h4 {
  font-family: "Proxima Nova", "Segoe UI", "Inter", Arial, sans-serif;
  font-weight: 600;
  margin-top: 0;
  color: var(--text);
}
h1 { font-size: clamp(2.25rem, 4.5vw, 4.0rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 3.0rem); color: var(--primary); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2.5rem); }
h4 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); color: var(--primary); }

.container.content-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =========================
   ARTICLE LAYOUT
   ========================= */
.article--structure {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 32px;
  align-items: start;
}

.left-content { min-width: 0; }
.article-header .header-title { margin: 10px 0 20px; }

.article-body article {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
}

/* Controls */
.article-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.controls { margin-left: auto; display: flex; gap: 8px; }

.btn-print {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(51,102,204,0.15);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn-print:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(51,102,204,0.35);
}

/* Footer + socials */
.article-footer { margin-top: 24px; padding-top: 16px; }
.article-footer .help { color: var(--muted); }
.article-footer .help a { font-weight: 600; }

.socials-share {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.socials-share a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f0f4ff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-1);
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.socials-share a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

/* Sidebar (desktop) */
.right-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
}
.article-contents {
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
  margin-bottom: 24px;
}
.article-contents h2 {
  margin-top: 0;
  color: var(--primary);
  font-weight: 700;
}
.article-contents ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.article-contents li {
  margin-bottom: 6px;
  border-top: 1px solid #eee;
  font-size: 1.3rem;
  line-height: 1.5;
}
.article-contents .toc-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.article-contents .toc-link:hover {
  text-decoration: underline;
  color: var(--primary);
}
.toc-level-2 { margin-top: 12px; padding-top: 8px; }
.toc-level-3 { margin-top: 12px; padding-left: 20px; }
.toc-level-4 { margin-top: 12px; padding-left: 40px; }

/* =========================
   POPULAR & INTEGRATED PRODUCTS
   ========================= */
.featured-products {
    background: #fff;
    padding: 30px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
    margin-top: 50px;
    margin-bottom: 50px;
    border-radius: 0 0 15px 15px;
}

/* Flex grid */
.product-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 15px;
    margin-top: 10px;
}

/* FIXED: use > instead of &gt; */
.product-row > .col-md-3 { flex: 1 1 23%; display: flex; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    box-shadow: var(--shadow-1);
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }

.card img {
    max-height: 160px;
    margin-bottom: 18px;
    object-fit: contain;
    transition: transform 0.25s ease-in-out;
}
.card:hover img { transform: scale(1.06); }

.card-footer { margin-top: auto; }

/* ---------- BUTTONS ---------- */
.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    color: #fff !important;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(51,102,204,0.3);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    border: 0;
    cursor: pointer;
}
.btn-primary:hover {
    background: linear-gradient(90deg, var(--primary-dark), #4B7BE5);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(51,102,204,0.45);
}

/* ---------- FEATURED APPLICATIONS ---------- */
.featured-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.featured-app {
    background: #f0f4ff;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.7rem;
    font-weight: 600;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-1);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
    text-align: center;
}

/* ---------- TECH NOTES & INSTALL NOTES ---------- */
.notes-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

.notes-card {
    background: #f9fbfd;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 700;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-align: center;
    min-width: 250px;
    position: relative;
}
.notes-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    background: linear-gradient(90deg, #e6f0ff, #f9fbfd);
}

/* ---------- SUPPORT CTA ---------- */
.support-cta {
    background: #fff;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--shadow-3);
    margin: 60px auto;
    max-width: 350px;
}
.support-cta h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--primary);
}
.support-cta p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--muted);
}

/* =========================
   RESPONSIVE BEHAVIOR
   ========================= */

/* Tablet and below (use flex so order works) */
@media (max-width: 992px) {
  .article--structure {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Full width both sections */
  .left-content,
  .right-sidebar {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Sidebar (Contents) ABOVE article-body */
  .right-sidebar {
    display: none; /* Hide default position */
  }

  /* When moved into mobile slot, match card style */
  .toc-mobile-slot .article-contents,
  .article-body article {
    width: 100%;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
    border: 1px solid #eee;
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    background: #fff;
  }

  /* Add space below TOC (now above the article) */
  .toc-mobile-slot {
    margin-bottom: 16px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .toc-mobile-slot .article-contents,
  .article-body article {
    padding: 16px;
  }
}

/* ---------- PRINT ---------- */
@media print {
  .article-controls,
  .right-sidebar,
  .featured-products,
  .support-cta,
  .featured-row,
  .notes-row {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .article-body article {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  a { color: #000; text-decoration: underline; }
}
