/* American Peptides — blog / research library / compare. Values copied from the source CSS
   (source-cdp/css/merged.css: .crumbs .page-head .blog-feature .blog-grid .blog-card .article
   .prose .learn-* .article__* .cmp-table .scroll-progress), renamed to the ap- prefix.
   Scoped to body.ap-blog-ctx (added by inc/ap-blog.php). */

body.ap-blog-ctx {
	--ink: #0a1220; --navy: #0a1220; --navy-3: #14213d; --red: #da303d; --red-hi: #e84450;
	--cream: #f6f1e7; --muted: #5b6b86; --line: rgba(10, 18, 32, .1); --maxw: 1460px;
	--serif: "Fraunces", Georgia, "Times New Roman", serif;
}

.ap-blog-ctx .ap-blog-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(22px, 3.2vw, 52px); }
.ap-blog-ctx :where(.ap-blog-main) :where(h1, h2, h3) { line-height: 1.1; margin: 0; }
.ap-blog-ctx :where(.ap-blog-main) :where(img) { max-width: 100%; height: auto; display: block; }
.ap-blog-ctx :where(.ap-blog-main) :where(a) { color: inherit; text-decoration: none; }
.ap-blog-ctx .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* kicker */
.ap-blog-ctx .ap-kicker { font-size: .72rem; letter-spacing: .16em; font-weight: 700; color: var(--red); text-transform: uppercase; }

/* crumbs (blog) */
.ap-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .82rem; padding: 22px 0 4px; }
.ap-crumbs, .ap-crumbs a { color: var(--muted); }
.ap-crumbs a { transition: color .14s; }
.ap-crumbs a:hover { color: var(--red); }
.ap-crumbs span[aria-hidden] { color: rgba(10, 18, 32, .3); }

/* breadcrumb (learn / compare) */
.ap-breadcrumb { margin: 26px 0 6px; }
.ap-breadcrumb__here { color: #0f1a2e; }

/* page head */
.ap-page-head { padding: 14px 0 30px; max-width: 760px; }
.ap-page-head .ap-kicker { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--red); font-weight: 700; margin-bottom: 12px; }
.ap-page-head h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.08; color: var(--ink); font-variation-settings: "opsz" 120; }
.ap-page-head__sub { color: var(--muted); font-size: 1.02rem; line-height: 1.6; margin: 14px 0 1em; }

/* feature card */
.ap-blog-feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; align-items: stretch; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 40px; background: #fff; box-shadow: 0 26px 60px -46px rgba(10, 18, 32, .45); transition: box-shadow .18s, transform .18s; }
.ap-blog-feature:hover { box-shadow: 0 34px 70px -42px rgba(10, 18, 32, .5); transform: translateY(-2px); }
.ap-blog-feature img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.ap-blog-feature:hover img { transform: scale(1.03); }
.ap-blog-feature__body { padding: 34px; display: flex; flex-direction: column; justify-content: center; }
.ap-blog-feature__body .ap-kicker { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--red); font-weight: 700; }
.ap-blog-feature__body h2 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); margin: 12px 0; }
.ap-blog-feature__body p { color: var(--muted); line-height: 1.6; font-size: .98rem; }
.ap-blog-feature__cta { margin-top: 16px; color: var(--red); font-weight: 700; font-size: .92rem; }
@media (max-width: 720px) {
	.ap-blog-feature { grid-template-columns: 1fr; }
	.ap-blog-feature img { min-height: 220px; }
}

/* grid + cards */
.ap-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-bottom: 60px; }
@media (max-width: 900px) { .ap-blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ap-blog-grid { grid-template-columns: 1fr; } }
@media (min-width: 1360px) { .ap-blog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ap-blog-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; transition: box-shadow .16s, transform .16s; }
.ap-blog-card:hover { box-shadow: 0 24px 50px -40px rgba(10, 18, 32, .45); transform: translateY(-3px); }
.ap-blog-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ap-blog-card:hover img { transform: scale(1.04); }
.ap-blog-card__noimg { width: 100%; aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--navy); color: var(--cream); font-family: var(--serif); font-size: 1.6rem; }
.ap-blog-feature .ap-blog-card__noimg { aspect-ratio: auto; min-height: 300px; }
.ap-blog-card__body { padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.ap-blog-card__date { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 700; }
.ap-blog-card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.16rem; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); transition: color .2s ease; }
.ap-blog-card:hover h3 { color: var(--red); }
.ap-blog-card p { color: var(--muted); font-size: .9rem; line-height: 1.55; margin: 1em 0; }

/* article (blog post + library) */
.ap-article { max-width: 74ch; margin: 0 auto; padding: 0 0 40px; }
.ap-article__head { max-width: 760px; margin: 0 auto 8px; padding: 8px 0 4px; }
.ap-article__meta { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 700; }
.ap-article__head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -.02em; color: var(--ink); margin: 12px 0 14px; font-variation-settings: "opsz" 120; }
.ap-article__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.ap-tag-chip { font-size: .72rem; background: #f2eee4; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.ap-article__hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: 16px; margin: 18px 0 30px; }

/* prose (blog body) */
.ap-prose h1 { font-size: 1.9rem; letter-spacing: -.015em; margin: 34px 0 12px; }
.ap-prose h1, .ap-prose h2 { font-family: var(--serif); font-weight: 500; color: var(--ink); }
.ap-prose h2 { font-size: 1.5rem; letter-spacing: -.01em; margin: 32px 0 10px; font-variation-settings: "opsz" 90; line-height: 1.1; }
.ap-prose h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; letter-spacing: -.01em; color: var(--ink); margin: 26px 0 9px; font-variation-settings: "opsz" 80; line-height: 1.1; }
.ap-prose h3:first-child { margin-top: 0; }
.ap-prose h4 { font-weight: 700; font-size: 1.05rem; color: var(--ink); margin: 22px 0 8px; }
.ap-prose p { color: #41506a; line-height: 1.72; font-size: 1rem; margin: 0 0 16px; }
.ap-prose ol, .ap-prose ul { color: #41506a; line-height: 1.7; font-size: 1rem; margin: 0 0 18px; padding-left: 1.3em; }
.ap-prose li { margin: 0 0 8px; }
.ap-prose a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.ap-prose a:hover { color: var(--red-hi); }
.ap-prose strong { color: var(--ink); font-weight: 700; }
.ap-prose blockquote { border-left: 3px solid var(--red); margin: 20px 0; padding: 6px 0 6px 18px; color: var(--muted); font-style: italic; }
.ap-prose img { max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0; }
.ap-prose hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.ap-prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .92rem; display: block; overflow-x: auto; }
.ap-prose td, .ap-prose th { border: 1px solid var(--line); padding: 9px 12px; text-align: left; color: #41506a; }
.ap-prose th { background: #f7f4ec; color: var(--ink); font-weight: 700; }
.ap-prose code { background: #f2eee4; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.ap-article--post .ap-article__body { max-width: 760px; margin: 0 auto; }

/* related sections under a post */
.ap-blog-related { border-top: 1px solid var(--line); padding-top: 34px; margin-top: 20px; }
.ap-blog-related .ap-section-head { text-align: left; margin: 0 0 18px; }
.ap-blog-related .ap-section-head .ap-kicker { margin-bottom: 12px; }
.ap-blog-related .ap-section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; letter-spacing: -.02em; line-height: 1.08; color: var(--ink); font-variation-settings: "opsz" 140; }
.ap-blog-related .ap-section-head p { margin: 6px 0 0; color: var(--muted, #5b6472); font-size: .95rem; }
.ap-blog-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-bottom: 0; }
@media (max-width: 900px) { .ap-blog-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 560px) { .ap-blog-products { gap: 12px; } }
@media (min-width: 1360px) { .ap-blog-products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ap-blog-products__item { display: flex; min-width: 0; }
.ap-blog-products__item > * { width: 100%; min-width: 0; }
.ap-blog-back { padding: 8px 0 60px; }
.ap-blog-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: .98rem; font-weight: 600; padding: 14px 26px; border-radius: 999px; background: var(--navy); color: var(--cream) !important; transition: transform .16s ease, background .16s ease; }
.ap-blog-btn:hover { background: var(--navy-3); transform: translateY(-1px); }

/* reading progress */
.ap-scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--red), var(--red-hi)); transform-origin: 0 50%; transform: scaleX(0); z-index: 1200; pointer-events: none; }

/* learn / compare article */
.ap-library-h1 { font-size: 2.3rem; letter-spacing: -0.02em; margin: 6px 0 12px !important; color: var(--ink); }
.ap-library-h1--compare { font-size: 2.2rem; margin: 6px 0 14px !important; }
.ap-article--library .ap-kicker { font-size: .72rem; letter-spacing: .16em; }
.ap-article__body { color: #26303f; font-size: 1.02rem; line-height: 1.75; }
.ap-article--library .ap-article__body { max-width: 760px; margin: 0 auto; }
.ap-article__body h2 { font-size: 1.5rem; letter-spacing: -.01em; color: var(--ink); margin: 34px 0 10px; }
.ap-article__body h3 { font-size: 1.15rem; color: var(--ink); margin: 24px 0 8px; }
.ap-article__body p { margin: 0 0 16px; }
.ap-article__lede { font-size: 1.18rem; line-height: 1.65; color: #384456; margin: 0 0 24px; }
.ap-article__profile { margin: 22px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ap-article__profile table { width: 100%; border-collapse: collapse; }
.ap-article__profile td, .ap-article__profile th { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ap-article__profile th { width: 42%; color: var(--muted); font-weight: 600; background: #fbfcfd; }
.ap-article__profile td { color: var(--ink); font-family: ui-monospace, SF Mono, Menlo, monospace; }
.ap-article__profile tr:last-child td, .ap-article__profile tr:last-child th { border-bottom: none; }
.ap-cmp-table { width: 100%; border-collapse: collapse; margin: 22px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ap-cmp-table td, .ap-cmp-table th { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; text-align: left; vertical-align: top; }
.ap-cmp-table thead th { background: var(--navy); color: #fff; font-weight: 600; }
.ap-cmp-table tbody th { background: #fbfcfd; color: var(--muted); font-weight: 600; width: 26%; }
.ap-cmp-table td { font-family: ui-monospace, SF Mono, Menlo, monospace; color: var(--ink); }
.ap-article__faq { margin: 30px 0 0; }
.ap-article__faq h2 { font-size: 1.5rem; letter-spacing: -.022em; color: var(--ink); margin: 0; }
.ap-article__faq details { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; margin: 0 0 10px; background: #fff; }
.ap-article__faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 12px 0; list-style: none; }
.ap-article__faq summary::-webkit-details-marker { display: none; }
.ap-article__faq details[open] summary { color: var(--red); }
.ap-article__faq p { margin: 0 0 14px; color: #384456; line-height: 1.65; font-size: .96rem; }
.ap-article__cta { margin: 30px 0 0; padding: 22px 24px; background: linear-gradient(160deg, #0a1426, #12285c); border-radius: 16px; color: #fff; }
.ap-article__cta h3 { margin: 0 0 6px; color: #fff; font-size: 1.2rem; }
.ap-article__cta p { margin: 0 0 14px; color: #c7d4ef; font-size: .95rem; }
.ap-article__related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ap-article__related a { padding: 8px 14px; background: #fff; color: var(--navy); border-radius: 8px; font-weight: 600; font-size: .86rem; text-decoration: none; }
.ap-article__related a:hover { background: var(--red); color: #fff; }
.ap-ruo-note { color: var(--muted); font-size: .82rem; padding: 4px 0 60px; }

/* learn index */
.ap-learn-hero { max-width: 74ch; margin: 34px 0 8px; }
.ap-learn-hero__h1 { font-size: 2.4rem; letter-spacing: -0.02em; margin: 6px 0 12px !important; color: var(--ink); }
.ap-learn-hero__sub { color: var(--muted); font-size: 1.08rem; line-height: 1.65; margin: 0; }
.ap-learn-sec-title { margin: 30px 0 4px; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.ap-learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 22px 0 48px; }
@media (max-width: 900px) { .ap-learn-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ap-learn-grid { grid-template-columns: 1fr; } }
.ap-learn-card { display: flex; flex-direction: column; padding: 18px 18px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.ap-learn-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(10, 20, 38, .1); border-color: rgba(218, 48, 61, .28); }
.ap-learn-card__kicker { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--red); }
.ap-learn-card h3 { margin: 7px 0 5px; font-size: 1.12rem; letter-spacing: -.01em; color: var(--ink); }
.ap-learn-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; flex: 1 1; }
.ap-learn-card__go { margin-top: 12px; font-size: .82rem; font-weight: 700; color: var(--navy); }
.ap-ruo-note.ap-learn-foot { margin: 20px 0 60px; padding: 4px 0 60px; }

.ap-blog-pagination { margin: 0 0 60px; }

@media (prefers-reduced-motion: reduce) {
	.ap-blog-card, .ap-blog-card img, .ap-blog-feature, .ap-blog-feature img, .ap-learn-card { transition: none; }
	.ap-blog-card:hover img, .ap-blog-feature:hover img { transform: none; }
}
