/* Blog: index, category pages and articles (server-rendered by blog.cjs on top of storefront.css). Phone first. */

.blog-page-head { padding-bottom: 20px; }
.blog-page-head h1 { font-size: clamp(36px, 9vw, 72px); }
.blog-page-head p { font-size: 16px; }

/* Category filter: one scrollable row on phones, wraps on wide screens. */
.blog-cats { display: flex; gap: 8px; margin: 0 -16px 24px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.blog-cats::-webkit-scrollbar { display: none; }
.blog-cats a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--btn-radius); background: var(--panel); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.blog-cats a:hover { border-color: var(--accent); color: var(--text); }
.blog-cats a.is-current { background: var(--text); border-color: var(--text); color: var(--bg); }

/* Cards */
.blog-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.blog-card { display: grid; grid-template-rows: auto 1fr; overflow: clip; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: transform .4s var(--spring), border-color .3s, box-shadow .4s; }
.blog-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 24px 40px -30px rgba(0,0,0,.45); }
.blog-card-art { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e9e4d8; }
.blog-card-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; transition: transform .7s var(--ease); }
.blog-card:hover .blog-card-art img { transform: scale(1.04); }
.blog-card-ph { display: grid; place-items: center; height: 100%; padding: 16px; background: linear-gradient(135deg, #f3d9c9, #efe7d6 60%, #e3eadf); color: var(--accent-2); font-size: 20px; font-weight: 750; text-align: center; letter-spacing: -.02em; }
.blog-card-body { display: grid; align-content: start; gap: 8px; padding: 16px 18px 18px; }
.blog-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--muted); font-size: 13px; }
.blog-card-meta a { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--accent-2); font-weight: 650; text-decoration: none; }
.blog-card-title { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.02em; font-weight: 720; }
.blog-card-title a { text-decoration: none; }
.blog-card-desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.blog-badge { display: inline-block; justify-self: start; margin: 0; padding: 3px 9px; border-radius: 999px; background: #ffe9a8; color: #5b4300; font-size: 12px; font-weight: 700; }
.blog-empty { padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; line-height: 1.6; }

.blog-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }
.blog-pages a, .blog-pages span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--btn-radius); text-decoration: none; font-weight: 650; }
.blog-pages span[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
.blog-pages a { white-space: nowrap; }
.blog-pages a span { display: inline; min-width: 0; min-height: 0; padding: 0; border: 0; white-space: pre; }
/* Phones: numbers and «Вперёд →» stay on one row. With both «Назад» and «Вперёд» only the arrows are drawn
   (the words stay for screen readers). */
@media (max-width: 480px) {
  .blog-pages { flex-wrap: nowrap; gap: 6px; }
  .blog-pages a, .blog-pages > span { min-width: 40px; padding: 0 10px; }
  .blog-pages:has(a[rel="prev"]):has(a[rel="next"]) .blog-pages-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Article */
.blog-article-head { display: grid; gap: 14px; max-width: 820px; margin-bottom: 24px; }
.blog-article-head h1 { margin: 0; font-size: clamp(32px, 8.4vw, 60px); line-height: 1.04; letter-spacing: -.04em; font-weight: 760; text-wrap: balance; }
.blog-lead { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; color: var(--muted); font-size: 14px; }
/* The cover keeps its own proportions (width/height attributes), so nothing is cropped and no bars appear around it.
   Tall and square pictures are only limited in width, otherwise a portrait shot would fill two phone screens. */
.blog-cover { margin: 0 0 28px; overflow: hidden; border-radius: var(--radius); background: #e9e4d8; }
.blog-cover img { width: 100%; height: auto; }
.blog-cover.is-portrait { max-width: 280px; }
.blog-cover.is-square { max-width: 343px; }

.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.blog-toc { padding: 16px 18px; border: 1px solid var(--line); border-radius: calc(var(--radius) * .75); background: var(--panel); }
.blog-toc-title { margin: 0 0 8px; font-weight: 750; }
.blog-toc ol { display: grid; gap: 2px; margin: 0; padding-left: 1.3em; color: var(--muted); }
.blog-toc a { display: block; padding-block: 7px; color: var(--text); text-decoration: none; line-height: 1.35; }
.blog-toc a:hover { color: var(--accent-2); }

.blog-body { max-width: 70ch; font-size: 17px; line-height: 1.7; }
.blog-body > :first-child { margin-top: 0; }
.blog-body h2 { margin: 44px 0 14px; font-size: clamp(25px, 6vw, 34px); line-height: 1.15; letter-spacing: -.03em; scroll-margin-top: calc(var(--header-h) + 16px); }
.blog-body h3 { margin: 30px 0 10px; font-size: 21px; line-height: 1.25; letter-spacing: -.015em; scroll-margin-top: calc(var(--header-h) + 16px); }
.blog-body p { margin: 0 0 18px; }
.blog-body ul, .blog-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.blog-body li { margin-bottom: 8px; }
.blog-body li::marker { color: var(--accent-2); font-weight: 700; }
.blog-body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.blog-body a:hover { color: var(--text); }
.blog-body strong { font-weight: 700; }
.blog-body code { padding: 1px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); font-size: .9em; }
.blog-body hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.blog-body blockquote { margin: 26px 0; padding: 16px 20px; border-left: 4px solid var(--accent); border-radius: 0 16px 16px 0; background: var(--panel); }
.blog-body blockquote p { margin: 0 0 10px; font-size: 18px; }
.blog-body blockquote p:last-child { margin-bottom: 0; }
.blog-figure { margin: 28px 0; }
.blog-figure img { width: 100%; height: auto; border-radius: calc(var(--radius) * .75); }
.blog-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
/* A table wider than the screen scrolls sideways. The edge that hides more columns gets a shadow: the two «cover»
   gradients move with the content and hide the shadow at the start and at the end of the scroll. */
.blog-table { margin: 0 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background-color: var(--panel);
  background-image: linear-gradient(90deg, var(--panel) 40%, transparent), linear-gradient(270deg, var(--panel) 40%, transparent),
    linear-gradient(90deg, rgba(41,49,45,.3), transparent), linear-gradient(270deg, rgba(41,49,45,.3), transparent);
  background-position: 0 0, 100% 0, 0 0, 100% 0; background-size: 48px 100%, 48px 100%, 18px 100%, 18px 100%; background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll; }
/* The hint a reader cannot miss: a line above the table and a shaded edge with an arrow where columns are hidden.
   storefront.js sets is-scrollable / can-left / can-right; without the script the background shadow above remains. */
.blog-table-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 24px; }
.blog-table-wrap > .blog-table { grid-area: 2 / 1; margin: 0; }
.blog-table-wrap.is-ready > .blog-table { background-image: none; }
.blog-table-hint { display: none; grid-area: 1 / 1; margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.3; }
.blog-body .blog-table-hint { margin: 0 0 8px; }
.blog-table-hint span { color: var(--accent-2); }
.blog-table-wrap.is-scrollable .blog-table-hint { display: block; }
.blog-table-edge { grid-area: 2 / 1; z-index: 1; display: none; width: 44px; pointer-events: none; }
.blog-table-edge.is-right { justify-self: end; border-radius: 0 16px 16px 0; background: linear-gradient(270deg, rgba(41,49,45,.34), rgba(41,49,45,0)); }
.blog-table-edge.is-left { justify-self: start; border-radius: 16px 0 0 16px; background: linear-gradient(90deg, rgba(41,49,45,.34), rgba(41,49,45,0)); }
.blog-table-edge::after { content: '›'; position: absolute; top: 50%; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; background: var(--text); color: var(--bg); font: 700 18px/1 'Onest', sans-serif; padding-bottom: 2px; box-sizing: border-box; }
.blog-table-edge { position: relative; }
.blog-table-edge.is-right::after { right: 6px; }
.blog-table-edge.is-left::after { content: '‹'; left: 6px; }
.blog-table-wrap.can-right .blog-table-edge.is-right, .blog-table-wrap.can-left .blog-table-edge.is-left { display: block; }
.blog-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
/* Two columns fit a phone; only tables with three or more columns keep a minimum width and scroll. */
.blog-table table:has(tr > :nth-child(3)) { min-width: 520px; }
.blog-table th, .blog-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.blog-table th { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; }
.blog-table tr:last-child td { border-bottom: 0; }

.blog-cta { margin: 32px 0; padding: 20px; }
.blog-cta .blog-cta-title { margin: 0 0 6px; color: var(--text); font-size: 21px; font-weight: 750; line-height: 1.2; letter-spacing: -.02em; }
.blog-cta p { font-size: 15px; }
.blog-cta .sf-btn { width: 100%; text-decoration: none; }
.blog-body .blog-cta a.sf-btn { color: var(--accent-ink); }

.blog-faq { margin-top: 48px; }
.blog-faq h2 { margin-top: 0; }
.blog-faq details p { margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.6; }

.blog-related { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--line); }
.blog-related h2 { margin: 0 0 20px; font-size: clamp(26px, 6vw, 40px); letter-spacing: -.03em; }
/* An article opened on the other site: one line naming its home site, with a link there. */
.blog-home-note { margin: 16px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #f1ede3; font-size: 14px; line-height: 1.5; }
.blog-home-note a { color: var(--accent-2); font-weight: 650; white-space: nowrap; }
.blog-back { margin: 32px 0 0; }
.blog-back a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-2); font-weight: 650; text-decoration: none; }

@media (min-width: 640px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .blog-cta .sf-btn { width: auto; }
  .blog-cta { padding: 24px 28px; }
  .blog-cover.is-portrait { max-width: 320px; }
  .blog-cover.is-square { max-width: 420px; }
}
@media (min-width: 901px) {
  .blog-cats { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .blog-page-head p { font-size: 18px; }
  .blog-lead { font-size: 19px; }
  .blog-cover { margin-bottom: 40px; }
  .blog-cover.is-landscape { max-width: 960px; }
  .blog-cover.is-portrait { max-width: 360px; }
  .blog-cover.is-square { max-width: 480px; }
}
@media (min-width: 1100px) {
  .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .blog-layout.has-toc { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; }
  .blog-toc { position: sticky; top: calc(var(--header-h) + 20px); }
  .blog-body { font-size: 18px; }
}

/* Landing pages for gift occasions (landing.cjs: /podarok-uchitelyu/, /korporativnye-podarki/ …). Phone first. */
.lp-hero { display: grid; gap: 24px; padding: 8px 0 32px; }
.lp-kicker { margin: 0 0 10px; color: var(--accent-2); font-size: 13px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.lp-hero h1 { margin: 0 0 14px; font-size: clamp(32px, 8.4vw, 60px); line-height: 1.04; letter-spacing: -.04em; font-weight: 760; text-wrap: balance; }
.lp-lead { margin: 0 0 20px; max-width: 60ch; color: var(--muted); font-size: 17px; line-height: 1.6; }
.lp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.lp-actions .sf-btn { width: 100%; }
.lp-more { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-2); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.lp-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.lp-facts li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }
.lp-hero-art { margin: 0; }
.lp-hero-art img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: #e9e4d8; }
.lp-hero-art figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.lp-body { max-width: 760px; }
.lp-block { margin: 40px 0; }
.lp-block h2 { margin-top: 0; }
.lp-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.blog-body .lp-steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: calc(var(--radius) * .7); background: var(--panel); }
.lp-step-n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.lp-steps b { display: block; margin-bottom: 2px; font-size: 18px; }
.blog-body .lp-steps p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.lp-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lp-styles figure { margin: 0; }
.lp-styles img { display: block; width: 100%; height: auto; aspect-ratio: 786 / 1176; object-fit: cover; border-radius: calc(var(--radius) * .6); background: #e9e4d8; }
.lp-styles figcaption { margin-top: 8px; font-size: 14px; line-height: 1.4; }
.lp-styles figcaption b { display: block; font-size: 16px; }
.lp-styles figcaption span { display: none; color: var(--muted); }
.lp-price dl { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: calc(var(--radius) * .7); background: var(--panel); overflow: hidden; }
.lp-price dl > div { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.lp-price dl > div:last-child { border-bottom: 0; }
.lp-price dt { font-weight: 700; }
.lp-price dd { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.lp-related { max-width: 760px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.lp-related h2 { margin: 0 0 16px; font-size: clamp(25px, 6vw, 34px); letter-spacing: -.03em; }
.lp-related ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lp-related a { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: calc(var(--radius) * .6); background: var(--panel); color: var(--text); text-decoration: none; }
.lp-related a:hover { border-color: var(--accent); }
.lp-related b { font-size: 17px; line-height: 1.3; }
.lp-related span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.lp > .lp-cta { max-width: 760px; margin-bottom: 48px; }

@media (min-width: 640px) {
  .lp-actions .sf-btn { width: auto; }
  .lp-styles { gap: 16px; }
  .lp-styles figcaption span { display: block; }
  .lp-price dl > div { grid-template-columns: 180px 1fr; gap: 16px; }
}
@media (min-width: 1000px) {
  .lp-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; padding-bottom: 48px; }
  .lp-lead { font-size: 19px; }
  .lp-related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Pet landing (landing.cjs, `subject: pet`): photo → example sketch pairs. */
.lp-pets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lp-pet-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.lp-pet-pair > div { position: relative; }
.lp-pet-pair img, .lp-hero-pet img { display: block; width: 100%; height: auto; aspect-ratio: 480 / 718; object-fit: cover; border-radius: calc(var(--radius) * .6); background: #e9e4d8; }
.lp-pet-pair span { position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; background: rgba(255,253,250,.92); color: var(--ink); font-size: 13px; font-weight: 600; }
.lp-pet-pair figcaption { grid-column: 1 / -1; font-size: 15px; font-weight: 650; }
.lp-hero-pet { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lp-hero-pet figcaption { grid-column: 1 / -1; }
@media (max-width: 640px) { .lp-pets { grid-template-columns: 1fr; } }
