/* =========================
   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);
}

/* Predictable sizing */
*, *::before, *::after { box-sizing: border-box; }

/* Images */
img { max-width: 100%; height: auto; display: block; }

/* Links */
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; }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- GLOBAL ---------- */
body {
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.7;
}

/* Responsive headings */
h1, h2, h3, h4 { 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); }

/* A handy container if needed */
.container.content-main { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* =========================
   ARTICLE LAYOUT (matches your HTML template)
   ========================= */
.article--structure {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 32px;
    align-items: start;
}

.left-content { min-width: 0; } /* For long words/URLs wrapping properly */

.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 (print + edit iframe) */
.article-controls {
    display: flex;
    justify-content: flex-end; /* Align everything to the right */
    gap: 12px;
    margin-bottom: 10px;
}

.article-controls {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.controls {
    margin-left: auto; /* Push the print button group to the far right */
    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; }

/* Social share list */
.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 */
.right-sidebar {
    position: sticky;
    top: 16px;
    align-self: start;
}
.sidebar-blocks {
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-1);
    margin-bottom: 16px;
}
.sidebar-blocks .block-title {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}
.sidebar-blocks ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-blocks li + li { margin-top: 8px; }
.sidebar-blocks a { color: var(--text); font-weight: 500; }
.sidebar-blocks a:hover { color: var(--primary); text-decoration: underline; }


/* Contents Section */
.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 li + li {
  margin-top: 8px;
}
.article-contents .toc-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.article-contents .toc-link:hover {
  text-decoration: underline;
  color: var(--primary);
}
/* Contents Section Heating Indentation */
.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
   ========================= */
.popular-products {
    background: #fff;
    padding: 50px 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 ---------- */
@media (max-width: 1200px) {
    .product-row > .col-md-3 { flex: 1 1 45%; }
}

/* Tablet and below */
@media (max-width: 992px) {
    .article--structure { grid-template-columns: 1fr; }
    .right-sidebar { position: static; }
}

/* Mobile */
@media (max-width: 768px) {
    .product-row > .col-md-3,
    .notes-card,
    .featured-app { flex: 1 1 100%; min-width: 80%; }
    .notes-row,
    .featured-row { flex-direction: column; align-items: center; }
    .popular-products,
    .support-cta { margin-top: 30px; margin-bottom: 30px; }
    .popular-products h2 { margin-bottom: 25px; }
    .featured-row,
    .notes-row { margin-top: 15px; }

    /* Tighter article card padding on small screens */
    .article-body article { padding: 16px; }
}

/* ---------- PRINT ---------- */
@media print {
    /* Content only */
    .article-controls,
    .right-sidebar,
    .popular-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; }
}