/*
 * Baltic Agro site elements (includes/shortcodes.php): baseline layout only. Every selector is wrapped in :where()
 * (specificity 0), so any rule of the theme wins. Colours come from the theme's tokens with fallbacks.
 */

/* Product and post card lists ([ba_products], [ba_posts]) */
:where(.ba-inline-products, .ba-inline-posts) { margin: 28px 0 36px; }
:where(.ba-inline-products__list, .ba-inline-posts__list) { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; }
:where(.ba-inline-products__list) { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
:where(.ba-inline-posts__list) { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px; }
:where(.ba-inline-posts--scroll .ba-inline-posts__list) { grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
:where(.ba-inline-posts--scroll .ba-inline-posts__list > li) { scroll-snap-align: start; }
:where(.ba-inline-products__list, .ba-inline-posts__list) > :where(li) { display: flex; margin: 0; padding: 0; min-width: 0; }
:where(.ba-inline-products__list, .ba-inline-posts__list) > :where(li)::marker { content: none; }
:where(.ba-inline-products, .ba-inline-posts, .ba-banner) :where(.ba-card) { position: relative; display: flex; flex-direction: column; flex: 1; background: #fff; border: 1px solid var(--ba-border, #e8e8e0); border-radius: var(--ba-r-card, 10px); overflow: hidden; }
:where(.ba-inline-products, .ba-inline-posts) :where(.ba-card__media) { display: block; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
:where(.ba-inline-posts) :where(.ba-card__media) { aspect-ratio: 3 / 2; background: #eef0e4; }
:where(.ba-card__media) :where(img) { width: 100%; height: 100%; object-fit: contain; display: block; }
:where(.ba-card__media--cover) :where(img) { object-fit: cover; }
:where(.ba-pcard, .ba-bcard, .ba-banner) :where(.ba-card__body) { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
:where(.ba-pcard__title, .ba-bcard__title, .ba-banner__title) { font-size: 16px; line-height: 1.3; font-weight: 700; margin: 0; }
:where(.ba-pcard__title, .ba-bcard__title, .ba-banner__title) :where(a) { color: inherit; text-decoration: none; }
:where(.ba-bcard__tag) { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ba-green, #426716); margin: 0; }
:where(.ba-bcard__excerpt, .ba-banner__text) { font-size: 14px; line-height: 1.6; margin: 0; }
:where(.ba-card__cta) { font-size: 13px; font-weight: 700; color: var(--ba-green, #426716); }
:where(.ba-card__link)::after { content: ""; position: absolute; inset: 0; z-index: 1; }
:where(.ba-pack-tile) { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-weight: 800; color: var(--ba-green-deep, #1e3405); background: var(--ba-surface-chip, #f1f3e6); }

/* MEELESPEA ([ba_remember]) */
:where(.ba-remember) { background: var(--ba-surface, #f7f8f2); border: 1px solid var(--ba-divider, #ecede2); border-radius: var(--ba-r-lg, 12px); padding: 24px 26px; margin: 28px 0 34px; }
:where(.ba-remember__label) { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ba-green, #426716); margin: 0 0 14px; }
:where(.ba-remember__list) { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
:where(.ba-remember__list) > :where(li) { display: flex; gap: 14px; align-items: baseline; margin: 0; padding: 0; }
:where(.ba-remember__n) { font-weight: 800; color: var(--ba-green, #426716); min-width: 26px; flex-shrink: 0; }
:where(.ba-remember__text) { min-width: 0; }
:where(.ba-remember__text) :where(h2, h3, h4, h5) { font-size: inherit; line-height: inherit; margin: 0 0 4px; }
:where(.ba-remember__text) > :where(:last-child) { margin-bottom: 0; }

/* Info box / info table ([ba_infobox], [ba_infotable]) */
:where(.ba-infobox) { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 24px; }
:where(.ba-infobox__icon) { flex-shrink: 0; color: var(--ba-green, #426716); line-height: 0; }
:where(.ba-infobox__icon) :where(svg) { width: 28px; height: 28px; }
:where(.ba-infobox__body) { min-width: 0; }
:where(.ba-infobox__title) { font-size: 18px; line-height: 1.35; margin: 0 0 6px; }
:where(.ba-infobox__text) > :where(:last-child), :where(.ba-infotable__body) > :where(:last-child) { margin-bottom: 0; }
:where(.ba-infotable) { border: 1px solid var(--ba-border-green, #dfe4c6); border-radius: var(--ba-r-lg, 12px); overflow: hidden; margin: 0 0 24px; }
:where(.ba-infotable__title) { background: var(--ba-green, #426716); color: #fff; font-size: 17px; line-height: 1.35; margin: 0; padding: 14px 20px; }
:where(.ba-infotable__body) { padding: 16px 20px; }

/* Image card ([ba_banner]) */
:where(.ba-banner) { position: relative; display: flex; flex-direction: column; height: calc(100% - 24px); margin: 0 0 24px; }
:where(.ba-banner__media) { aspect-ratio: 2 / 1; overflow: hidden; background: #eef0e4; }

/* Social links ([ba_social_links]) */
:where(.ba-social-links) { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 24px; padding: 0; }
:where(.ba-social-links) > :where(li) { margin: 0; padding: 0; }
:where(.ba-social-links__link) { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ba-green, #426716); color: #fff; }
:where(.ba-social-links__link) :where(svg) { width: 22px; height: 22px; }
:where(.ba-social-links__label) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/*
 * A few rules with normal class specificity, so the elements stay usable on pages whose content CSS (WPBakery/The7
 * legacy pages) styles img/ul/a/h3 generically. Theme rules with the same or higher specificity loaded later win.
 */
.ba-inline-posts .ba-card__media { aspect-ratio: 3 / 2; }
.ba-inline-posts .ba-card__media img, .ba-banner .ba-banner__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-inline-products .ba-card__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ba-banner .ba-banner__media { aspect-ratio: 2 / 1; overflow: hidden; }
.ba-infotable .ba-infotable__title { color: #fff; background: var(--ba-green, #426716); }
.ba-social-links, .ba-inline-products__list, .ba-inline-posts__list, .ba-remember__list { list-style: none; padding-left: 0; }
.ba-social-links > li::before, .ba-inline-products__list > li::before, .ba-inline-posts__list > li::before, .ba-remember__list > li::before { content: none; }
.ba-social-links.ba-social-links > li, .ba-inline-products__list.ba-inline-products__list > li, .ba-inline-posts__list.ba-inline-posts__list > li, .ba-remember__list.ba-remember__list > li { list-style: none; }
.ba-social-links .ba-social-links__link { color: #fff; background: var(--ba-green, #426716); }

@media (prefers-reduced-motion: reduce) {
	:where(.ba-inline-posts--scroll .ba-inline-posts__list) { scroll-behavior: auto; }
}
