/* ICS xcard v2.1 styles. Behaviour and usage: header of ics-xcard.js. */
:root { --ics-xcard-dur: 560ms; --ics-xcard-dur-close: 480ms; }
:where(.ics-xgrid) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(304px, 100%), 1fr)); align-items: stretch; }
.ics-xgrid > .ics-xcard.ics-xcard { width: auto; max-width: none; min-width: 0; }
.ics-xcard { position: relative; cursor: pointer; scroll-margin-top: 120px; -webkit-tap-highlight-color: transparent; }
.ics-xcard:focus { outline: none; }
.ics-xcard.ics-xcard:focus-visible { outline: 3px solid #ed1d85; outline-offset: 4px; }
.ics-xcard.ics-xcard > .ics-xcard__more { display: none; }
/* Open: the whole row (grid-column 1 / -1); the grid reflows around it. */
.ics-xcard.ics-xcard.is-open { grid-column: 1 / -1 !important; cursor: default; overflow: visible; --ics-off: 6px; }
/* Selected underlay: same pink halftone torn layer as ics-hover (ics-card-hover.css), no rotation (a rotated wide card skews into a slab). */
.ics-xcard.ics-xcard.is-open::after { content: ''; display: block; position: absolute; inset: 0; z-index: -2; pointer-events: none; background-color: var(--ics-pink-brand, #ed1d85); background-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.22) 0 0.9px, transparent 1.2px), radial-gradient(circle at center, rgba(0, 0, 0, 0.22) 0 0.9px, transparent 1.2px); background-size: 6px 6px; background-position: 0 0, 3px 3px; background-repeat: repeat; -webkit-mask: url(/wp-content/uploads/ics-torn/card-torn-mask-a-r2.svg) center / 100% 100% no-repeat; mask: url(/wp-content/uploads/ics-torn/card-torn-mask-a-r2.svg) center / 100% 100% no-repeat; transform-origin: 0 100%; animation: ics-xcard-under var(--ics-xcard-dur, 560ms) cubic-bezier(.22, .61, .36, 1) both; }
@keyframes ics-xcard-under { from { opacity: 0; transform: translate(0, 0) rotate(0deg); } to { opacity: 1; transform: translate(var(--ics-ul-off, 7.5px), var(--ics-ul-off, 7.5px)) rotate(var(--ics-ul-rot, 1.9deg)); } }
.ics-xcard.ics-xcard.is-open > :not(.ics-xcard__more) { display: none !important; }
.ics-xcard.ics-xcard.is-open > .ics-xcard__more { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: var(--sp-m, 16px); align-items: start; position: relative; padding: var(--sp-m, 16px); background: var(--bg, #fff); }
.ics-xcard__photo { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--yellow-200, #fff3a0); }
.ics-xcard__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ics-xcard__text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-s, 12px); min-width: 0; }
.ics-xcard__title { margin: 0; padding-right: 56px; }
.ics-xcard__title:focus { outline: none; }
.ics-xcard__chips { display: flex; flex-wrap: wrap; gap: var(--sp-xs, 8px); }
.ics-xcard__chips .nw-chip.nw-chip { display: inline-flex; width: auto; margin: 0; padding: var(--sp-2xs, 4px) var(--sp-xs, 8px); border-radius: var(--radius-pill, 999px); background: var(--pink-200, #fbd3e6); color: var(--pink-800, #7a0c40); font-family: 'Google Sans Code', monospace; font-size: var(--fs-xs, 12px); line-height: var(--lh-xs, 1.4); white-space: normal; }
.ics-xcard__bio { line-height: 1.6; }
.ics-xcard__bio > :first-child { margin-top: 0; }
.ics-xcard__close { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 0; background: #111; color: #fff; cursor: pointer; }
.ics-xcard__close:hover { background: #ed1d85; }
.ics-xcard__close:focus { outline: none; }
.ics-xcard__close:focus-visible { outline: 3px solid #ed1d85; outline-offset: 2px; }
@media (max-width: 767px) {
  .ics-xcard.ics-xcard.is-open > .ics-xcard__more { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .ics-xcard__photo { aspect-ratio: 4 / 3; }
  .ics-xcard__title { padding-right: 56px; }
}
@media (prefers-reduced-motion: reduce) { .ics-xcard.ics-xcard.is-open::after { animation: none; } }
/* v3.1 (place cards): the site's image rules size the photo img larger than its box; force the photo to fill the 420 px square. */
.ics-xcard.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo { position: relative; overflow: hidden; width: 100% !important; max-width: 100% !important; aspect-ratio: 1 / 1 !important; height: auto !important; }
.ics-xcard.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo > img, .ics-xcard.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo img { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: cover !important; object-position: center !important; margin: 0 !important; }
/* v3.2: hide the card's own (closed) children while open, beating the place-card rules (html body .pl-card... > .ics-torn-photo). */
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > :not(.ics-xcard__more), html body .ics-xcard.ics-xcard.is-open > :not(.ics-xcard__more) { display: none !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more { display: grid !important; }

/* v3.3 (owner 2026-11-04, place cards): expanded = collapsed + extra rows below. Same photo box (4:3, card padding inset), same text inset (sp-l), same order (chip, title, rest). No white panel, no size jump. */
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open { --ics-ul-off: -6px; --ics-ul-rot: 0deg; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more { display: flex !important; flex-direction: column; align-items: stretch; grid-template-columns: none !important; gap: 0 !important; padding: 0 !important; margin: 0 !important; background: none !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo { flex: none; width: 100% !important; max-width: 100% !important; aspect-ratio: 4 / 3 !important; height: auto !important; margin: 0 !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__text { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-s); padding: var(--sp-l); margin: 0; min-width: 0; max-width: 100%; box-sizing: border-box; }
html body .ics-xcard__chips { order: -1; margin: 0; }
html body .ics-xcard__title { order: 0; margin: 0; padding: 0; font-family: 'EB Garamond', Georgia, serif; font-size: var(--fs-sub2); line-height: var(--lh-sub); letter-spacing: var(--ls-h4); font-weight: 600; }
html body .ics-xcard__desc { order: 1; margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); }
html body .ics-xcard__desc:empty { display: none; }
html body .ics-xcard__info { order: 2; margin: 0; }
html body .ics-xcard__text > .nw-links { order: 3; margin: 0; padding: 0; }
html body .pl-card .nw-links.nw-links a { border: 1px solid var(--border-ui); }
html body .pl-card.nw-card--static.nw-card--static .nw-links.nw-links a:hover { box-shadow: none; }
/* H101: place-link pill pink hover border removed (owner 2026-11-05) */
/* v3.3b (desktop/tablet): the open card spans the row; cap the photo at the collapsed photo width (~24rem) and the text column, so the photo does not become a slab. Insets unchanged. */
@media (min-width: 768px) {
  html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo { width: min(100%, 24rem) !important; }
  html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__text { max-width: 44rem; }
}
/* v3.3c: empty description / email rows take no space (Bricks text elements render empty when the place has no value). */
html body .ics-xcard__desc:empty, html body .ics-xcard__email:empty { display: none; }
html body .ics-xcard__email { margin: 0; }
/* v3.3d: hover pink on place links only where hover is real (hover:hover + pointer:fine); !important beats the global outline-pill border shorthand. */

/* v4 (owner 2026-11-04, place cards): no fade, flash or tap highlight on click. Appended block; earlier rules unchanged. */
html body .pl-card.ics-xcard.is-open::after, .ics-xcard.ics-xcard.is-open::after { animation: none !important; opacity: 1 !important; }
html body .pl-card.ics-xcard.is-open { transition: none !important; }
html body .pl-card.ics-xcard.is-open > .ics-xcard__more, html body .pl-card.ics-xcard.is-open > .ics-xcard__more * { animation: none !important; transition: none !important; }
html body .pl-card.ics-xcard.is-open > .ics-xcard__more { opacity: 1 !important; transform: none !important; }
html body .pl-card.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo, html body .pl-card.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo img { opacity: 1 !important; transform: none !important; }
html body .pl-card.ics-xcard, html body .pl-card.ics-xcard a, html body .pl-card.ics-xcard button, html body .pl-card.ics-xcard .ics-xcard__close, html body .pl-card.ics-xcard .nw-links.nw-links a { -webkit-tap-highlight-color: transparent; }
@media (hover: none), (pointer: coarse) {
html body .ics-torn-card.ics-torn-card.pl-card.ics-xcard:not(.is-open)::after { z-index: 1 !important; background-color: var(--torn-bg, var(--neutral-50)) !important; background-image: none !important; box-shadow: none !important; transform: none !important; opacity: 1 !important; -webkit-mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-a-r2.svg) center / 100% 100% no-repeat !important; mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-a-r2.svg) center / 100% 100% no-repeat !important; -webkit-mask-composite: xor !important; mask-composite: exclude !important; }
html body .ics-torn-card.ics-torn-card.pl-card.ics-xcard:not(.is-open):nth-child(3n+2)::after { z-index: 1 !important; background-color: var(--torn-bg, var(--neutral-50)) !important; background-image: none !important; box-shadow: none !important; transform: none !important; opacity: 1 !important; -webkit-mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-b-r2.svg) center / 100% 100% no-repeat !important; mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-b-r2.svg) center / 100% 100% no-repeat !important; -webkit-mask-composite: xor !important; mask-composite: exclude !important; }
html body .ics-torn-card.ics-torn-card.pl-card.ics-xcard:not(.is-open):nth-child(3n+3)::after { z-index: 1 !important; background-color: var(--torn-bg, var(--neutral-50)) !important; background-image: none !important; box-shadow: none !important; transform: none !important; opacity: 1 !important; -webkit-mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-c-r2.svg) center / 100% 100% no-repeat !important; mask: linear-gradient(#000 0 0), url(/wp-content/uploads/ics-torn/card-torn-mask-c-r2.svg) center / 100% 100% no-repeat !important; -webkit-mask-composite: xor !important; mask-composite: exclude !important; }
html body .ics-xcard__close:hover, html body .ics-xcard__close:focus { background: #111 !important; }
}

/* v5 (owner 2026-11-04, place cards): title and buttons identical in both states. Expanded photo = collapsed photo size (JS sets --ics-pw/--ics-ph); title line-height = collapsed 1.5; buttons right after the title; expanded-only rows (desc, info) after the buttons. */
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__photo { width: var(--ics-pw, 100%) !important; max-width: none !important; height: var(--ics-ph, auto) !important; aspect-ratio: auto !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open .ics-xcard__title { line-height: 1.5 !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__text > .nw-links { order: 1 !important; margin: 0 !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__text > .ics-xcard__desc { order: 2 !important; }
html body .pl-card.nw-card--static.nw-card--static.ics-xcard.is-open > .ics-xcard__more > .ics-xcard__text > .ics-xcard__info { order: 3 !important; }

/* a11y v1: the card title is the only control (real button). Keeps the title look; focus ring for keyboard. */
.ics-xcard__toggle { all: unset; cursor: pointer; }
.ics-xcard__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }

/* H106 find-help card toggle (the card title button): box raised to the 44px hit height (--ics-hit) with padding-block that is cancelled by an equal negative margin-block, so the line box, card height and text position stay identical. */
.ics-xcard__toggle {
  display: inline-block;
  padding-block: max(0px, calc((var(--ics-hit, 44px) - 1lh) / 2));
  margin-block: calc(-1 * max(0px, calc((var(--ics-hit, 44px) - 1lh) / 2)));
  min-width: var(--ics-hit, 44px);
}
