diff --git a/site/css/components.css b/site/css/components.css index ec7dc58..6c61a5d 100644 --- a/site/css/components.css +++ b/site/css/components.css @@ -1733,18 +1733,11 @@ .gallery { grid-template-columns: 1fr; } } +/* Card = flush container. NO padding here so the thumb fills edge-to-edge + without negative-margin tricks. The inner .gallery__body carries the + padding + grid for the text rows. */ .gallery__item { - display: grid; - grid-template-areas: - "thumb thumb" - "num name" - "num shape" - "num desc" - "num open"; - grid-template-columns: 4rem 1fr; - grid-template-rows: auto repeat(4, auto); - gap: 0 var(--space-md); - padding: var(--space-lg); + display: block; text-decoration: none; color: inherit; background: var(--color-paper); @@ -1770,22 +1763,17 @@ outline-offset: 3px; } +/* Thumb = top of card, fills full width naturally. No negative margins, + no width:calc(...). Just width:100% + aspect-ratio. */ .gallery__thumb { - grid-area: thumb; display: block; - /* Width must EXCEED content area by 2*padding so the negative margins - reach the card's inside-border edge on both sides. width: 100% would - only fill the content area, leaving padding visible on the right. */ - width: calc(100% + 2 * var(--space-lg)); - margin-inline: calc(-1 * var(--space-lg)); - margin-block-start: calc(-1 * var(--space-lg)); - margin-block-end: var(--space-lg); + width: 100%; border-block-end: var(--rule-card, 1px) solid var(--color-rule); background: var(--color-paper-2); overflow: hidden; position: relative; - font-size: 0; /* kill any inline-element gap */ - aspect-ratio: 16 / 10; /* explicit, so the image always fits */ + font-size: 0; + aspect-ratio: 16 / 10; } .gallery__thumb img { @@ -1793,10 +1781,24 @@ width: 100%; height: 100%; object-fit: cover; - object-position: top left; /* keep hero region; crop empty right */ + object-position: top left; transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1); } +/* Body = padded grid for text rows. Replaces the grid the card itself + used to carry. Same row layout, same num-column width. */ +.gallery__body { + display: grid; + grid-template-areas: + "num name" + "num shape" + "num desc" + "num open"; + grid-template-columns: 4rem 1fr; + gap: 0 var(--space-md); + padding: var(--space-lg); +} + @media (hover: hover) and (pointer: fine) { .gallery__item:hover .gallery__thumb img, .gallery__item:focus-visible .gallery__thumb img { diff --git a/site/index.html b/site/index.html index b9fdff8..327776c 100644 --- a/site/index.html +++ b/site/index.html @@ -1,14 +1,17 @@ +