/* Amer blog pages — templates/blogs.jinja (design/blog.html) and
 * templates/blog.jinja (design/blog-single.html). One sheet, both
 * directions; the template's own tertiary grey (#B1B2B7) as a local token.
 */
/* The dates: the look's old-price grey where it names one (looks 1-2 take
   their muted grey, 5.15:1; the template's #B1B2B7 was 2.12:1 on white,
   visual review 2026-09-23). */
.amer-blog, .amer-blog-single, .amer-blog-related { --amer-tertiary: var(--amer-price-old, #b1b2b7); }
/* The pages' own body type. These bands are not .amer-section, so every line
   without its own size fell to the root's 12px: the post's text, its date,
   «Share this post», the card summaries and the category list measured 12px
   against the template's 16px (18px for the article), 2026-09-23. */
.amer-blog, .amer-blog-single, .amer-blog-related { font-size: var(--amer-fs-body); line-height: var(--amer-lh-body); color: var(--amer-text); }

/* ---- Card (also used inside components/blog-slider.jinja) --------- */
.amer-blog-card { display: flex; flex-direction: column; gap: 16px; }
.amer-blog-card__media { display: block; aspect-ratio: 450 / 307; border-radius: 16px; overflow: hidden; background: var(--amer-surface); }
.amer-blog-card__media img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(0, 0, .44, 1.18); }
.amer-blog-card:hover .amer-blog-card__media img { transform: scale(1.1); }
.amer-blog-card__date { margin: 0 0 12px; font-size: var(--amer-fs-small); font-weight: 600; line-height: 1.57; color: var(--amer-tertiary); }
.amer-blog-card__title { margin: 0 0 8px; font-size: var(--amer-fs-h5); font-weight: var(--amer-fw-heading); line-height: 1.25; }
@media (max-width: 575px) { .amer-blog-card__title { font-size: 22px; } }
.amer-blog-card__title a { color: var(--amer-heading); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color .3s var(--amer-ease); }
.amer-blog-card__title a:hover, .amer-blog-card__title a:focus-visible { text-decoration-color: var(--amer-primary); }
.amer-blog-card__desc { margin: 0; color: var(--amer-muted); }

/* ---- Listing (blogs.jinja) ---------------------------------------------- */
.amer-blog { padding-block: 80px; }
@media (max-width: 991px) { .amer-blog { padding-block: 60px; } }
@media (max-width: 425px) { .amer-blog { padding-block: 40px; } }
.amer-blog__layout { display: grid; gap: 40px; align-items: start; }
/* The 300px column only when the categories list is there: a store with no
   blog category kept the empty column, and «no posts yet» sat 180px off the
   page's middle at 1900 (Mohamed, 2026-10-09). */
@media (min-width: 992px) { .amer-blog__layout--aside { grid-template-columns: minmax(0, 1fr) 300px; gap: 60px; } }

/* The template's .tf-grid-layout: 40px between rows, 30px between columns. */
.amer-blog__grid { display: grid; grid-template-columns: 1fr; row-gap: 40px; }
@media (min-width: 576px) { .amer-blog__grid { grid-template-columns: 1fr 1fr; column-gap: 30px; } }
.amer-blog__pagination { margin-block-start: 40px; }

.amer-blog__sidebar-title { margin: 0 0 16px; font-size: var(--amer-fs-h5); font-weight: var(--amer-fw-heading); color: var(--amer-heading); }
.amer-blog__categories { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.amer-blog__categories a { display: flex; align-items: center; justify-content: space-between; color: var(--amer-muted); text-decoration: none; transition: color .3s var(--amer-ease); }
.amer-blog__categories a:hover, .amer-blog__categories a:focus-visible, .amer-blog__categories a.is-active { color: var(--amer-heading); }
.amer-blog__categories a.is-active { font-weight: 500; }
/* Under 992 the list sat after every post (10,224px down a 390 screen, measured
   live 2026-09-23). It moves above the posts as one row of pills that scrolls
   inside itself; the page never scrolls sideways. The heading stays for screen
   readers only. */
@media (max-width: 991px) {
  .amer-blog__aside { order: -1; min-inline-size: 0; }
  .amer-blog__sidebar-title { position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .amer-blog__categories { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-inline: calc(var(--amer-gutter, 15px) * -1); padding-inline: var(--amer-gutter, 15px); }
  .amer-blog__categories::-webkit-scrollbar { display: none; }
  .amer-blog__categories li { flex: none; }
  .amer-blog__categories a { display: inline-flex; min-block-size: 40px; padding: 7px 18px; border: 1px solid var(--amer-line); border-radius: 999px; font-size: var(--amer-fs-small); line-height: 24px; white-space: nowrap; transition: color .3s var(--amer-ease), background-color .3s var(--amer-ease), border-color .3s var(--amer-ease); }
  .amer-blog__categories a:hover, .amer-blog__categories a:focus-visible { border-color: var(--amer-heading); }
  .amer-blog__categories a.is-active { border-color: var(--amer-primary); background: var(--amer-primary); color: var(--amer-on-primary); }
}

/* ---- Single post (blog.jinja) ------------------------------------------ */
/* The template's .section-page-title-single keeps 40px under the breadcrumb;
   here the cover sat 0px under it (4px on a phone, where the trail wraps). */
.amer-blog-single { padding-block-start: 40px; }
.amer-blog-single__cover { border-radius: var(--amer-radius-card); overflow: hidden; margin-block-end: 60px; aspect-ratio: 1410 / 600; background: var(--amer-surface); }
.amer-blog-single__cover picture { display: block; inline-size: 100%; block-size: 100%; }
.amer-blog-single__cover img { inline-size: 100%; block-size: 100%; object-fit: cover; }
@media (max-width: 767px) { .amer-blog-single__cover { aspect-ratio: 4 / 3; } }

.amer-blog-single__body { max-inline-size: 940px; margin-inline: auto; }
.amer-blog-single__heading { text-align: center; display: grid; justify-items: center; gap: 16px; margin-block-end: 40px; }
/* The template's .entry-tag: 16px/26 in a 40px pill. */
.amer-blog-single__tag { padding: 7px 16px; border-radius: 999px; background: var(--amer-surface); color: var(--amer-heading); font-weight: 500; font-size: var(--amer-fs-body); line-height: 26px; }
.amer-blog-single__title { margin: 0; font-size: var(--amer-fs-h3); font-weight: var(--amer-fw-heading); color: var(--amer-heading); }
.amer-blog-single__meta { display: flex; align-items: center; gap: 16px; color: var(--amer-text); }
.amer-blog-single__meta-item { display: flex; align-items: center; gap: 6px; }
.amer-blog-single__meta-item i { display: block; font-size: 18px; line-height: 1; }

/* The article: the template's .blog-content .text (18px/28, the text colour,
   not the muted grey of a caption). A post with no HTML in it (one written
   through the API; the demo's are) keeps its own paragraphs: blog.jinja marks
   it --plain, and without this it read as one wall of text. */
.amer-blog-single__content { margin-block-end: 40px; font-size: 18px; line-height: 28px; color: var(--amer-text); overflow-wrap: anywhere; }
.amer-blog-single__content--plain { white-space: pre-line; }
.amer-blog-single__content a { transition: color .3s var(--amer-ease), text-decoration-color .3s var(--amer-ease); }
.amer-blog-single__content a:is(:hover, :focus-visible) { color: var(--amer-primary); }

.amer-blog-single__footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-block-start: 24px; border-block-start: 1px solid var(--amer-line); }
.amer-blog-single__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--amer-text); }
/* A tag is a label, not a link (Zid has no page per tag), so it does not
   pretend to be one on hover. */
.amer-blog-single__tag-pill { padding: 3px 15px; border: 1px solid var(--amer-line); border-radius: 999px; background: var(--amer-surface); color: var(--amer-muted); font-size: var(--amer-fs-small); line-height: 22px; }
.amer-blog-single__share { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--amer-text); }
/* components/blogs/blog-share.jinja. Its links carried Bootstrap's .text-dark
   (`color: #343a40 !important`), which beat both the look's heading colour at
   rest and the light glyph on hover: on hover the icon went dark on the dark
   fill and disappeared (measured live on looks 1 and 6, 2026-09-23). */
.amer-share { display: flex; align-items: center; gap: 8px; }
.amer-share__btn { box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex: none; inline-size: 32px; block-size: 32px; margin: 0; padding: 0; border-radius: 50%; border: 1px solid var(--amer-line); color: var(--amer-heading); background: transparent; font: inherit; line-height: 1; text-decoration: none; cursor: pointer; transition: background-color .3s var(--amer-ease), border-color .3s var(--amer-ease), color .3s var(--amer-ease); }
.amer-share__btn svg { display: block; inline-size: 16px; block-size: 16px; }
.amer-share__btn:is(:hover, :focus-visible) { border-color: var(--amer-heading); background: var(--amer-heading); color: var(--amer-bg); text-decoration: none; }
/* The same buttons in the component's earlier markup (Bootstrap's .d-flex
   wrapper and .text-dark links), for a store whose templates have not been
   replaced yet: the three oldest demo copies served it on 2026-09-23 with
   this sheet already current. !important only to beat .text-dark's own. */
.amer-blog-single__share .d-flex.align-items-center { display: flex; align-items: center; gap: 8px; }
.amer-blog-single__share .d-flex.align-items-center > :is(a, button) { box-sizing: border-box; display: flex; align-items: center; justify-content: center; inline-size: 32px; block-size: 32px; margin: 0 !important; padding: 0; border-radius: 50%; border: 1px solid var(--amer-line); background: transparent; color: var(--amer-heading) !important; font: inherit; cursor: pointer; transition: background-color .3s var(--amer-ease), border-color .3s var(--amer-ease), color .3s var(--amer-ease); }
.amer-blog-single__share .d-flex.align-items-center > :is(a, button) svg { inline-size: 16px; block-size: 16px; }
.amer-blog-single__share .d-flex.align-items-center > :is(a, button):is(:hover, :focus-visible) { border-color: var(--amer-heading); background: var(--amer-heading); color: var(--amer-bg) !important; }

/* ---- Related / featured carousels (blog.jinja, product-slider reused) -- */
.amer-blog-related { padding-block: 40px 80px; }
@media (max-width: 991px) { .amer-blog-related { padding-block: 30px 60px; } }
/* Featured products then related posts: one band's spacing between them,
   not both (they stood 120px apart, 90px on a phone). */
.amer-blog-related + .amer-blog-related { padding-block-start: 0; }
.amer-blog-slider__viewport { position: relative; }
/* Fewer posts or products than the row holds (a post with two related posts
   under a centred heading): the row is centred instead of leaving a third of
   the width empty on one side. Swiper marks its arrows -lock only then, and
   the row does not move while locked, so centring cannot fight its offset. */
.amer-blog-slider__viewport:has(> .swiper-button-lock) .swiper-wrapper { justify-content: center; }
/* Swiper's gap is a margin after every slide, the last included (inline, so
   only !important reaches it): without this the centred row sat 15px off. */
.amer-blog-slider__viewport:has(> .swiper-button-lock) .swiper-slide:last-child { margin-inline-end: 0 !important; }
/* Every card in the row is the same height (a two-line name made one bordered
   card taller than its neighbour). */
.amer-blog-slider__swiper .swiper-slide { block-size: auto; display: flex; }
.amer-blog-slider__swiper .swiper-slide > * { flex: 1 1 auto; min-inline-size: 0; }
/* Arrows: outside the row where the page has room for them (1500 and up),
   8px inside it below that, and swipe only on a phone — the product page's
   related row does the same (product.css). They sat 22px outside the row at
   every width from 1280, which put half of each arrow past the edge of a 1440
   screen. Vertically they sit on the pictures, not on the whole card. */
.amer-blog-slider__prev, .amer-blog-slider__next { position: absolute; inset-block-start: 38%; transform: translateY(-50%); z-index: 2; }
.amer-blog-slider__prev { inset-inline-start: -22px; }
.amer-blog-slider__next { inset-inline-end: -22px; }
/* Posts: the middle of the cover exactly — the cover is 450:307 of a slide,
   and a slide is the row less its gaps over the posts per view (ui.js: two
   15px apart from 768, three 30px apart from 1200). */
.amer-blog-slider__viewport { container-type: inline-size; }
.amer-blog-slider:has(.amer-blog-card) :is(.amer-blog-slider__prev, .amer-blog-slider__next) { inset-block-start: calc((100cqi - 15px) / 2 * 307 / 450 / 2); }
@media (min-width: 1200px) { .amer-blog-slider:has(.amer-blog-card) :is(.amer-blog-slider__prev, .amer-blog-slider__next) { inset-block-start: calc((100cqi - 60px) / 3 * 307 / 450 / 2); } }
@media (max-width: 1499px) { .amer-blog-slider__prev { inset-inline-start: 8px; } .amer-blog-slider__next { inset-inline-end: 8px; } }
/* Two classes: core.css (linked after this sheet) sets .amer-sw-nav to
   inline-flex at one class, which won and pushed the prev arrow 7px past a
   390 screen (sideways scroll on every post, measured live 2026-09-23). */
@media (max-width: 767px) { .amer-sw-nav.amer-blog-slider__prev, .amer-sw-nav.amer-blog-slider__next { display: none; } }
.amer-sw-nav.amer-blog-slider__prev .ai, .amer-sw-nav.amer-blog-slider__next .ai { display: block; line-height: 1; }
