/* House ads (app/lib/house-ads.php): one layout per slot size, colors from each site's brand */
.house-ad {
  --ha-muted: color-mix(in srgb, var(--ha-ink) 72%, transparent);
  position: relative; box-sizing: border-box; display: flex; overflow: hidden;
  width: 100%; height: 100%; background: var(--ha-bg); color: var(--ha-ink);
  border: 1px solid color-mix(in srgb, var(--ha-ink) 12%, transparent); border-radius: 10px;
  text-decoration: none; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.25;
  transition: box-shadow .15s, transform .15s;
}
.house-ad *, .house-ad *::before { box-sizing: border-box; }
.house-ad:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .12); color: var(--ha-ink); }
.house-ad:focus-visible { outline: 3px solid var(--ha-accent); outline-offset: 2px; }
.house-ad p { margin: 0; }
.house-ad em { font-style: normal; color: var(--ha-accent); }
.ha-font-serif .ha-head { font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.ha-font-rounded .ha-head, .ha-font-rounded .ha-cta { font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif; }

.ha-badge { position: absolute; top: 4px; right: 4px; z-index: 2; font: 600 9px/1 system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: rgba(0, 0, 0, .45); border-radius: 3px; padding: 2px 4px; }
.ha-head { font-weight: 800; letter-spacing: -.01em; }
.ha-text { color: var(--ha-muted); }
.ha-site, .ha-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ha-accent); }
.ha-cta { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap;
  background: var(--ha-cta); color: var(--ha-cta-ink); font-weight: 700; border-radius: 999px; }
.ha-photo { overflow: hidden; flex: none; }
.ha-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ha-art { display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ha-accent) 10%, var(--ha-bg)); }
.ha-photo.ha-art img { width: auto; height: auto; max-width: 70%; max-height: 80%; object-fit: contain; }
.ha-icon { flex: none; border-radius: 8px; object-fit: contain; }

/* 728x90 leaderboard: icon | copy | button */
.ha-728x90 { align-items: center; gap: 16px; padding: 10px 18px 10px 12px; }
.ha-728x90 .ha-icon { width: 66px; height: 66px; }
.ha-728x90 .ha-copy { flex: 1; min-width: 0; }
.ha-728x90 .ha-head { font-size: 21px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-728x90 .ha-text { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-728x90 .ha-cta { font-size: 14px; padding: 11px 18px; }

/* 320x50 mobile anchor: icon | headline | button */
.ha-320x50 { align-items: center; gap: 8px; padding: 0 8px 0 5px; border-radius: 0; border-width: 0; }
.ha-320x50 .ha-icon { width: 40px; height: 40px; border-radius: 6px; }
.ha-320x50 .ha-head { flex: 1; min-width: 0; font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-320x50 .ha-cta { font-size: 12px; padding: 7px 11px; }
.ha-320x50 .ha-badge { top: 2px; right: auto; left: 2px; font-size: 8px; padding: 1px 3px; }

/* 336x280 and 300x250 rectangles: photo on top, copy below */
.ha-336x280, .ha-300x250 { flex-direction: column; }
.ha-336x280 .ha-photo { height: 118px; }
.ha-300x250 .ha-photo { height: 112px; }
.ha-336x280 .ha-body, .ha-300x250 .ha-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 14px 12px; min-height: 0; }
.ha-336x280 .ha-head { font-size: 18px; }
.ha-300x250 .ha-head { font-size: 17px; }
.ha-336x280 .ha-text { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ha-336x280 .ha-cta, .ha-300x250 .ha-cta { margin-top: 8px; align-self: flex-start; font-size: 13px; padding: 8px 16px; }

/* 300x600 sidebar: logo, tall photo, copy, bullets, button */
.ha-300x600 { flex-direction: column; }
.ha-300x600 .ha-top { flex: none; height: 74px; display: flex; align-items: center; justify-content: center; padding: 10px 18px; background: #fff; }
.ha-300x600 .ha-logo { max-width: 100%; max-height: 54px; width: auto; height: auto; }
.ha-300x600 .ha-photo { height: 236px; }
.ha-300x600 .ha-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 16px 18px 18px; min-height: 0; }
.ha-300x600 .ha-head { font-size: 23px; line-height: 1.15; }
.ha-300x600 .ha-list { list-style: none; margin: 2px 0 0; padding: 0; font-size: 13.5px; display: grid; gap: 5px; }
.ha-300x600 .ha-list li { position: relative; padding-left: 20px; }
.ha-300x600 .ha-list li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--ha-accent); }
.ha-300x600 .ha-cta { margin-top: 10px; font-size: 15px; padding: 12px 18px; }

/* The ad slot wrapper keeps its reserved size; house ads fill it */
.ad-house { display: block; margin-left: auto; margin-right: auto; max-width: 100%; }
.ad-house.ad-leader { height: 90px; }
.ad-house.ad-rect { height: 280px; }
.ad-house.ad-rect-sm { height: 250px; }
.ad-house.ad-sky { height: 600px; }
.ad-house.ad-mobile { height: 50px; }
.ad-house-label { display: none; }
@media print { .house-ad { display: none !important; } }
/* Tall logos (taller than wide-ish) show as icon + site name in the sidebar ad */
.ha-300x600 .ha-top--mark { gap: 10px; justify-content: center; }
.ha-300x600 .ha-top--mark .ha-icon { width: 54px; height: 54px; }
.ha-wordmark { font-weight: 800; font-size: 21px; color: var(--ha-ink); }
.ha-font-serif .ha-wordmark { font-family: Georgia, "Times New Roman", serif; }

/* Book ads (storybooks): the cover sits beside the copy; the tall size shows it large */
.ha-cover { flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ha-cover img { display: block; height: 100%; width: auto; object-fit: contain; }
.ha-book.ha-728x90 { padding-top: 6px; padding-bottom: 6px; }
.ha-book.ha-728x90 .ha-cover { height: 76px; width: 56px; }
.ha-book.ha-320x50 .ha-cover { height: 46px; width: 34px; }
.ha-book.ha-336x280, .ha-book.ha-300x250 { flex-direction: row; align-items: stretch; }
.ha-book.ha-336x280 .ha-cover { width: 138px; padding: 12px 0 12px 12px; }
.ha-book.ha-300x250 .ha-cover { width: 120px; padding: 12px 0 12px 10px; }
.ha-book.ha-336x280 .ha-body, .ha-book.ha-300x250 .ha-body { padding: 16px 14px 14px 12px; gap: 6px; }
.ha-book.ha-336x280 .ha-head { font-size: 18px; }
.ha-book.ha-300x250 .ha-head { font-size: 16.5px; }
.ha-book .ha-eyebrow { font-size: 10px; }
.ha-book.ha-336x280 .ha-text { -webkit-line-clamp: 4; }
.ha-book.ha-336x280 .ha-cta, .ha-book.ha-300x250 .ha-cta { padding: 8px 13px; }
.ha-cover--tall { height: 250px; padding: 14px 0 4px; }
/* Copy and button sit together, centered in the space left by the image (no gap above the button) */
.ha-book.ha-300x250 .ha-text { font-size: 12.5px; line-height: 1.35; }
.ha-300x600 .ha-text { font-size: 13.5px; line-height: 1.4; }
