﻿/* Apiam Locations Grid
   Retheme by overriding the variables below (e.g. in the template's "Design Tokens" HTML widget). */
:root {
	--al-primary: #1e9e5a;
	--al-primary-dark: #0e3b2b;
	--al-primary-tint: #e8f6ee;
	--al-ink: #14281f;
	--al-muted: #5b6b63;
	--al-line: #dfe9e3;
	--al-surface: #ffffff;
	--al-bg: #f5f8f6;
	--al-radius: 20px;
	--al-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--al-c-companion: #1e9e5a;
	--al-c-equine: #9a5b24;
	--al-c-dairy: #2f6fd0;
	--al-c-mixed: #7a4fd0;
	--al-c-production: #d9822b;
	--al-c-ancillary: #0e8fa3;
}

.al, .al * { box-sizing: border-box; }
.al { font-family: var(--al-font); color: var(--al-ink); }
.al-ico { width: 18px; height: 18px; flex: none; }

/* ---------- filter buttons (Elementor button widgets carrying .al-filter) ---------- */
.al-filter .elementor-button { transition: background-color .2s, color .2s, border-color .2s, transform .2s; }
.al-filter.is-active .elementor-button,
.al-filter.is-active .elementor-button:hover {
	background-color: var(--al-primary) !important;
	border-color: var(--al-primary) !important;
	color: #fff !important;
}

/* ---------- count ---------- */
.al__count { margin: 0 0 20px; font-size: 14px; color: var(--al-muted); }
.al__count strong { color: var(--al-ink); }
.al__empty { text-align: center; padding: 48px 16px; color: var(--al-muted); }

/* ---------- grid: 4 / 2 / 1 ---------- */
.al__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .al__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (max-width: 767px)  { .al__grid { grid-template-columns: 1fr; gap: 16px; } }

.al-card[hidden] { display: none; }
.al-card { animation: al-in .35s ease both; }
@keyframes al-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.al-card__in {
	position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
	background: var(--al-surface); border: 1px solid var(--al-line); border-radius: var(--al-radius);
	box-shadow: 0 1px 2px rgba(14, 59, 43, .04);
	transition: transform .25s, box-shadow .25s, border-color .25s;
}
.al-card__in::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--al-primary); opacity: 0; transition: opacity .25s; z-index: 3; }
.al-card__in:hover, .al-card__in:focus-within { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(14, 59, 43, .12); border-color: #c5d8cd; }
.al-card__in:hover::before, .al-card__in:focus-within::before { opacity: 1; }

.al-card__media { position: relative; height: 120px; display: flex; align-items: center; justify-content: center; background: var(--al-bg); padding: 18px; }
.al-card__media img { max-width: 70%; max-height: 100%; object-fit: contain; }
.al-mono { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 22px; letter-spacing: .5px; color: #fff; background: var(--al-primary); }
.al-mono--equine { background: var(--al-c-equine); } .al-mono--dairy { background: var(--al-c-dairy); }
.al-mono--mixed { background: var(--al-c-mixed); } .al-mono--production { background: var(--al-c-production); }
.al-mono--ancillary { background: var(--al-c-ancillary); }

.al-badge { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--al-primary-dark); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 5px 10px; border-radius: 999px; }
.al-pop__content .al-badge { position: static; display: inline-block; }

.al-card__body { display: flex; flex-direction: column; gap: 12px; padding: 20px 20px 22px; flex: 1; }

.al-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.al-tag {
	--c: var(--al-c-companion);
	font-size: 11px; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 999px; letter-spacing: .2px;
	color: color-mix(in srgb, var(--c) 78%, #000); background: color-mix(in srgb, var(--c) 12%, #fff);
}
.al-tag--equine { --c: var(--al-c-equine); } .al-tag--dairy { --c: var(--al-c-dairy); } .al-tag--mixed { --c: var(--al-c-mixed); }
.al-tag--production { --c: var(--al-c-production); } .al-tag--ancillary { --c: var(--al-c-ancillary); }

.al-card__title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 600; }
.al-card__open {
	all: unset; cursor: pointer; color: var(--al-ink); font: inherit; display: block;
}
/* stretched click target: whole card opens the popup; inner links sit above it */
.al-card__open::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.al-card__open:focus-visible { outline: 3px solid var(--al-primary); outline-offset: 4px; border-radius: 6px; }
.al-card__in:hover .al-card__open { color: var(--al-primary-dark); }

.al-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.al-row a { position: relative; z-index: 2; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--al-muted); text-decoration: none; word-break: break-word; transition: color .2s; }
.al-row a:hover { color: var(--al-primary); }
.al-row .al-ico { color: var(--al-primary); margin-top: 2px; }

.al-card__more { margin-top: auto; padding-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; color: var(--al-primary); }
.al-card__more .al-ico { width: 16px; height: 16px; transition: transform .2s; }
.al-card__in:hover .al-card__more .al-ico { transform: translateX(4px); }

/* ---------- full-screen popup ---------- */
html.al-lock { overflow: hidden; }
.al-modal {
	position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
	margin: 0; padding: 0; border: 0; background: var(--al-surface); color: var(--al-ink); font-family: var(--al-font);
	overflow: hidden;
}
.al-modal:not([open]) { display: none; }
.al-modal[open] { animation: al-modal-in .28s ease both; }
@keyframes al-modal-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.al-modal__close {
	position: absolute; top: 16px; right: 16px; z-index: 10; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
	background: #fff; color: var(--al-ink); box-shadow: 0 4px 16px rgba(0, 0, 0, .18); display: grid; place-items: center; transition: transform .2s, background .2s, color .2s;
}
.al-modal__close:hover { background: var(--al-primary); color: #fff; transform: rotate(90deg); }
.al-modal__close .al-ico { width: 22px; height: 22px; }

.al-modal__body { height: 100%; }
.al-pop { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); height: 100%; }
.al-pop__photo { position: relative; background: var(--al-primary-dark); min-height: 0; }
.al-pop__photo > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-pop__ph { height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: rgba(255, 255, 255, .8); font-size: 14px; background: linear-gradient(145deg, var(--al-primary-dark), var(--al-primary)); }
.al-pop__ph .al-ico { width: 56px; height: 56px; opacity: .7; }
.al-pop__ph--equine { background: linear-gradient(145deg, #3d2410, var(--al-c-equine)); }
.al-pop__ph--dairy { background: linear-gradient(145deg, #12295a, var(--al-c-dairy)); }
.al-pop__ph--mixed { background: linear-gradient(145deg, #2d1b5a, var(--al-c-mixed)); }
.al-pop__ph--production { background: linear-gradient(145deg, #5a3208, var(--al-c-production)); }
.al-pop__ph--ancillary { background: linear-gradient(145deg, #053a44, var(--al-c-ancillary)); }
.al-pop__logo { position: absolute; left: 24px; bottom: 24px; width: 96px; height: 96px; border-radius: 20px; background: #fff; display: grid; place-items: center; padding: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.al-pop__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.al-pop__content { overflow-y: auto; padding: 72px clamp(24px, 5vw, 80px) 56px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.al-pop__title { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.12; font-weight: 700; letter-spacing: -.5px; }
.al-pop__blurb { font-size: 16px; line-height: 1.75; color: var(--al-muted); max-width: 62ch; }
.al-pop__blurb > :first-child { margin-top: 0; } .al-pop__blurb > :last-child { margin-bottom: 0; }
.al-meta--lg { gap: 12px; } .al-meta--lg .al-row a { font-size: 16px; color: var(--al-ink); }
.al-meta--lg .al-row a:hover { color: var(--al-primary); }
.al-pop__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.al-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; border: 1.5px solid var(--al-line); font-size: 15px; font-weight: 600; text-decoration: none; color: var(--al-ink); background: #fff; transition: all .2s; }
.al-btn:hover { border-color: var(--al-primary); color: var(--al-primary); }
.al-btn--primary { background: var(--al-primary); border-color: var(--al-primary); color: #fff; }
.al-btn--primary:hover { background: var(--al-primary-dark); border-color: var(--al-primary-dark); color: #fff; }
.al-pop__map { width: 100%; height: 340px; border-radius: 16px; overflow: hidden; background: var(--al-bg); border: 1px solid var(--al-line); }
.al-pop__map:empty { display: none; }
.al-pop__map iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 1024px) {
	.al-pop__content { padding: 48px 32px 48px; }
}
@media (max-width: 767px) {
	.al-modal__close { top: 12px; right: 12px; width: 44px; height: 44px; }
	.al-modal__body { overflow-y: auto; }
	.al-pop { display: block; height: auto; }
	.al-pop__photo { height: 240px; }
	.al-pop__logo { width: 72px; height: 72px; left: 16px; bottom: -28px; border-radius: 16px; padding: 10px; }
	.al-pop__content { overflow: visible; padding: 44px 20px 40px; gap: 16px; }
	.al-pop__map { height: 260px; }
	.al-pop__actions .al-btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.al-card, .al-modal[open] { animation: none; }
	.al-card__in, .al-card__in * { transition: none !important; }
}
