/* ==========================================================================
   APPS 365 AI - Articles (blog) styles. Loads after redesign.css.
   ========================================================================== */

/* ---- Listing hero ---- */
.art-hero { padding-bottom: clamp(28px, 4vw, 44px); }
.art-hero .r-h1 { color: #fff; max-width: 15ch; }
.art-hero .r-lead { color: #b8cae4; }
.art-hero .r-eyebrow { color: #7fc0ff; background: rgba(0,112,224,.16); border-color: rgba(120,180,255,.3); }

/* ---- Card grid ---- */
.art__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.art__grid--lg { gap: 26px; }
.art-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-card); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.art-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(10,22,40,.34); border-color: #cfe0f7; }
.art-card__img { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0b1730, #12233f); overflow: hidden; }
.art-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.art-card__cat { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.art-card__body h3 { font-size: 19px; line-height: 1.25; color: var(--ink); margin: 0; font-weight: 700; }
.art-card__body p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.art-card__meta { margin-top: auto; font-size: 12.5px; color: var(--ink-2); padding-top: 6px; }
.art-empty { text-align: center; padding: 60px 20px; color: var(--ink-2); }

/* Featured (first) article on the listing */
.art-featured { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; background: #fff; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow-card); margin-bottom: 28px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.art-featured:hover { transform: translateY(-4px); box-shadow: 0 28px 60px -28px rgba(10,22,40,.36); border-color: #cfe0f7; }
.art-featured__img { background: linear-gradient(135deg, #0b1730, #12233f); min-height: 320px; }
.art-featured__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-featured__body { padding: clamp(26px, 3vw, 40px); display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.art-featured__body h2 { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.art-featured__body p { margin: 0; color: var(--ink-2); font-size: 16.5px; line-height: 1.6; }
@media (max-width: 760px) { .art-featured { grid-template-columns: 1fr; } .art-featured__img { min-height: 200px; aspect-ratio: 16/9; } }

/* ---- Single article ---- */
.art__head { max-width: 800px; padding-top: clamp(28px, 5vw, 56px); }
.art__crumb { font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; }
.art__crumb a { color: var(--ink-2); text-decoration: none; }
.art__crumb a:hover { color: var(--primary); }
.art__crumb span { margin: 0 6px; opacity: .6; }
.art__cat { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--mist); border: 1px solid #d7e6ff; padding: 5px 12px; border-radius: 999px; }
.art__title { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); margin: 16px 0 0; }
.art__lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-2); margin: 16px 0 0; }
.art__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: 14px; color: var(--ink-2); align-items: center; }
.art__meta span { display: inline-flex; align-items: center; }
.art__meta span + span::before { content: "\2022"; margin-right: 18px; opacity: .5; }
.art__author { font-weight: 600; color: var(--ink); }
.art__avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand-strong); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; margin-right: 9px; }

/* Reading progress bar */
.art-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.art-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .1s linear; }

/* Table of contents */
.art__toc { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px 20px; margin: 0 0 34px; }
.art__toc-title { margin: 0 0 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.art__toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; display: grid; gap: 8px; }
.art__toc li { counter-increment: toc; font-size: 15.5px; line-height: 1.4; padding-left: 30px; position: relative; }
.art__toc li::before { content: counter(toc); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 6px; background: var(--mist); color: var(--primary); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.art__toc a { color: var(--ink); text-decoration: none; }
.art__toc a:hover { color: var(--primary); text-decoration: underline; }
.art__body > h2 { scroll-margin-top: 90px; }

.art__hero { margin: clamp(24px, 4vw, 40px) 0 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-md); background: var(--ink-900); }
.art__hero img { display: block; width: 100%; height: auto; }

.art__wrap { display: flex; justify-content: center; }
.art__body { max-width: 760px; width: 100%; padding-top: clamp(28px, 4vw, 44px); }

/* Long-form typography */
.art__body > h2 { font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; font-weight: 800; color: var(--ink); margin: 44px 0 14px; letter-spacing: -0.01em; }
.art__body > h3 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 30px 0 10px; }
.art__body p { font-size: 17.5px; line-height: 1.72; color: #2c3a4d; margin: 0 0 20px; }
.art__body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.art__body a:hover { color: var(--primary-dark); }
.art__body ul, .art__body ol { margin: 0 0 22px; padding-left: 0; display: grid; gap: 10px; }
.art__body li { position: relative; list-style: none; padding-left: 32px; font-size: 17px; line-height: 1.6; color: #2c3a4d; }
.art__body ul li::before { content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230070e0' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center no-repeat; }
.art__body ol { counter-reset: li; }
.art__body ol li { counter-increment: li; }
.art__body ol li::before { content: counter(li); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.art__body blockquote { margin: 26px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--primary); color: var(--ink); font-size: 19px; line-height: 1.5; font-style: italic; }
.art__body figure { margin: 26px 0; }
.art__body figure img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); display: block; }
.art__body figcaption { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; text-align: center; }
.art__body strong { color: var(--ink); font-weight: 700; }

/* Callout / key-takeaway box */
.art__body .callout { background: var(--mist); border: 1px solid #d7e6ff; border-radius: 14px; padding: 20px 22px; margin: 26px 0; }
.art__body .callout p:last-child { margin-bottom: 0; }
.art__body .callout strong { color: var(--primary-dark); }

/* Answer-first / TL;DR box */
.art__body .tldr { background: linear-gradient(180deg, #f2f7ff, #fff); border: 1px solid #d7e6ff; border-left: 4px solid var(--primary); border-radius: 12px; padding: 18px 22px; margin: 0 0 30px; }
.art__body .tldr strong { display: block; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.art__body .tldr p { margin: 0; font-size: 17px; line-height: 1.6; }

/* Stat row inside articles */
.art__body .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0; }
.art__body .stat-row > div, .art__body .stat-row .stat { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.art__body .stat-row b, .art__body .stat-row .stat-num, .art__body .stat-row .stat-number { display: block; font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.art__body .stat-row span { display: block; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.art__body .stat-row .stat-num, .art__body .stat-row .stat-number { margin-top: 0; }
.art__body .stat-row .stat-label { font-size: 13.5px; color: var(--ink-2); }

/* Comparison table */
.art__body .table-wrap { overflow-x: auto; margin: 26px 0; }
.art__body table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.art__body th, .art__body td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.art__body thead th { background: var(--surface-alt); color: var(--ink); font-weight: 700; }
.art__body sup a { text-decoration: none; font-size: 12px; }

/* FAQ + CTA */
.art__faq { margin-top: 48px; }
.art__faq h2 { font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; color: var(--ink); margin: 0 0 18px; }
.art__cta { margin-top: 44px; background: var(--grad-brand-strong); color: #fff; border-radius: 20px; padding: clamp(28px, 4vw, 40px); text-align: center; }
.art__cta h2 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.art__cta p { color: rgba(255,255,255,.9); margin: 0 auto 20px; max-width: 46ch; }
.art__cta .r-btn--primary { background: #fff; color: var(--primary-dark); }

.art__related { margin-top: clamp(40px, 6vw, 72px); }
.art__related .r-h2 { margin-bottom: 24px; }

@media (max-width: 900px) { .art__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .art__grid { grid-template-columns: 1fr; }
  .art__body .stat-row { grid-template-columns: 1fr; }
}
