/* Card model "tile" — hotel, restaurant, hairdresser.
   Blog: image-led tiles, the title and meta sit over a dark gradient at the
   foot of the picture; entries without a picture get the layout accent as a
   canvas. Single post: hero banner above a large title. Shop: image tiles
   with the price as a badge. Loaded after the layout file and reads its
   --page-* tokens. */

/* --- Blog index / archives --- */
body.cards-tile .post-list {
  gap: 1.5rem;
}

body.cards-tile .post-list > article,
body.cards-tile .post-list > article.clickable-card {
  padding: 0;
  min-height: 340px;
  border: 0;
  border-radius: calc(var(--border-radius) * 1.5);
  overflow: hidden;
  background: var(--page-accent, var(--primary-color));
  box-shadow: var(--shadow-sm);
}

body.cards-tile .post-list > article:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

body.cards-tile .post-list .card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-height: 340px;
  padding: 1.5rem;
  color: #ffffff;
  isolation: isolate;
}

body.cards-tile .post-list .post-thumbnail {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -2;
}

body.cards-tile .post-list .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

body.cards-tile .post-list .card-link:hover .post-thumbnail img {
  transform: scale(1.04);
}

body.cards-tile .post-list .clickable-card .post-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-ink, var(--text-primary));
  box-shadow: none;
}

body.cards-tile .post-list .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* A light veil over the whole photo plus a deep scrim where the text sits:
     meta, category and title stay readable on snow and on a busy kitchen,
     not only on a dark cellar. */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.28) 40%, rgba(0, 0, 0, 0.9) 100%);
}

body.cards-tile .post-list .entry-header {
  margin: 0;
  order: 2;
}

body.cards-tile .post-list .entry-title,
body.cards-tile .post-list .card-link .entry-title,
body.cards-tile .post-list .card-link:hover .entry-title {
  display: block;
  min-height: 0;
  -webkit-line-clamp: unset;
  font-family: var(--page-display, var(--font-display));
  font-size: 1.5rem;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 12px rgba(0, 0, 0, 0.45);
}

body.cards-tile .post-list .entry-meta {
  order: 1;
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.45);
}

body.cards-tile .post-list .entry-meta a,
body.cards-tile .post-list .entry-meta .author,
body.cards-tile .post-list .entry-meta .categories {
  color: inherit;
}

body.cards-tile .post-list .excerpt-content {
  display: none;
}

body.cards-tile .post-list .read-more-link,
body.cards-tile .clickable-card .read-more-link,
body.cards-tile .clickable-card:hover .read-more-link {
  order: 3;
  align-self: flex-start;
  margin: 0.9rem 0 0;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: none;
}

/* The hover pill is white in both modes, so its text is a fixed dark, not
   --page-ink, which is light in the layouts' dark mode (white on white). */
body.cards-tile .post-list .card-link:hover .read-more-link {
  background: #ffffff;
  color: #1a1a1a;
  text-shadow: none;
}

body.cards-tile .blog-page-title,
body.cards-tile .page-title {
  font-family: var(--page-display, var(--font-display));
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--page-accent, var(--accent-color));
  display: inline-block;
}

/* --- Single post --- */
body.cards-tile .post-content {
  max-width: 860px;
}

body.cards-tile.single-post .entry-hero {
  margin: 0 0 1.75rem;
  aspect-ratio: 21 / 9;
  border-radius: calc(var(--border-radius) * 1.5);
  overflow: hidden;
}

body.cards-tile.single-post .entry-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.cards-tile.single-post .entry-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
}

body.cards-tile.single-post .entry-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-accent, var(--accent-color)) 12%, transparent);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.cards-tile.single-post .entry-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* --- Generic pages --- */
body.cards-tile.page:not(.home) .entry-header h1 {
  font-family: var(--page-display, var(--font-display));
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--page-accent, var(--accent-color));
}

/* --- Shop: image tiles with a price badge --- */
body.cards-tile .rtsb-product-card,
body.cards-tile .products .rtsb-product-card:not(.storefront-product-card) {
  padding: 0;
  border: 0;
  border-radius: calc(var(--border-radius) * 1.5);
  background: var(--page-paper, var(--white));
  box-shadow: var(--shadow-sm);
}

body.cards-tile .rtsb-product-link {
  position: relative;
}

body.cards-tile .rtsb-product-link .rtsb-product-image {
  order: -1;
  height: 260px;
}

body.cards-tile .rtsb-product-link .rtsb-product-image img {
  transition: transform 0.6s ease;
}

body.cards-tile .rtsb-product-link:hover .rtsb-product-image img {
  transform: scale(1.04);
}

body.cards-tile .rtsb-product-price,
body.cards-tile .products .rtsb-product-price {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--page-ink, var(--text-primary));
  color: var(--page-paper, var(--white)) !important;
  font-family: var(--page-display, var(--font-display));
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

body.cards-tile .rtsb-product-price del,
body.cards-tile .rtsb-product-price ins,
body.cards-tile .rtsb-product-price span,
body.cards-tile .rtsb-product-price bdi {
  color: inherit !important;
}

body.cards-tile .rtsb-product-title {
  padding: 1rem 1.25rem 0;
  min-height: 0;
  font-family: var(--page-display, var(--font-display));
  font-size: 1.25rem;
  line-height: 1.25;
}

body.cards-tile .rtsb-product-card .rtsb-product-rating {
  padding: 0 1.25rem;
}

body.cards-tile .rtsb-product-excerpt {
  padding: 0.5rem 1.25rem 0;
  min-height: 0;
  -webkit-line-clamp: 2;
}

body.cards-tile .rtsb-product-action {
  padding: 1rem 1.25rem 1.25rem;
}

@media (max-width: 640px) {
  body.cards-tile .post-list > article,
  body.cards-tile .post-list .card-link {
    min-height: 280px;
  }
}

/* The tile shows the monogram in the layout's paper tone; the title sits below it on the gradient. */
body.cards-tile .post-list .clickable-card .post-thumbnail-placeholder::before {
  content: attr(data-initial);
  font-family: var(--page-display, var(--font-display));
  font-size: clamp(5rem, 10vw, 8rem);
  font-weight: 500;
  line-height: 1;
  color: var(--page-paper, #ffffff);
  opacity: 0.14;
  transform: translateY(-0.35em);
}

/* The layouts restyle .read-more-link in their companion rules; on the tile
   the label always sits on the dark gradient, so keep it white. */
body.cards-tile .post-list .card-link .read-more-link {
  color: #ffffff !important;
}

body.cards-tile .post-list .card-link:hover .read-more-link {
  color: #1a1a1a !important;
}
