/* Blog cards V2 (owner request 16/11/2026): one template for every article card — blog lists FR / EN / AR and « related
   articles » under each article (markup: gogo-core gi_blog_card(), unchanged). Loaded on blog pages only (functions.php),
   after identity.css, so it overrides the card rules of redesign.css.
   - Photo frame 4:3 on a white background, object-fit: contain → product photos shown whole, never cropped.
   - Equal card heights; title clamped to 3 lines and excerpt to 3 lines (display only: the HTML text is complete, SEO unchanged);
     category, date and « Lire l'article / Read the article » kept, the link aligned at the bottom of every card.
   - Placeholder for articles without an authorised image: brand panel (logo, red rule, fine grid pattern).
   - Phones: one column, image above, text below. Logical properties: right-to-left safe. */

.gi-blog__grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; align-items: stretch; } /* 3 across on desktop: long titles fit in 3 lines */

.gi-blog-card { position: relative; display: flex; flex-direction: column; height: 100%; border: 1px solid var(--gi-border-color); border-radius: 12px; background: var(--gi-bg, #FFFFFF);
  box-shadow: 0 1px 2px rgba(20, 23, 26, .04); transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease; }
.gi-blog-card:hover { border-color: #D3D7DC; box-shadow: 0 12px 28px rgba(20, 23, 26, .09); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .gi-blog-card, .gi-blog-card:hover { transition: none; transform: none; } }

/* image frame: same size for every card, the whole photo visible */
.gi-blog-card__img { position: relative; display: block; flex: none; aspect-ratio: 4 / 3; overflow: hidden; border-block-end: 1px solid var(--gi-border-color); background: #FFFFFF; }
.gi-blog-card__img > img { display: block; width: 100%; height: 100%; padding: 14px; object-fit: contain; object-position: center; background: #FFFFFF; }

/* placeholder (no image with confirmed rights) */
.gi-blog-card .gi-blog__ph { position: relative; gap: 14px; background-color: #14171A;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px; }
.gi-blog-card .gi-blog__ph img { height: 30px; padding: 0; background: none; object-fit: contain; opacity: .95; }
.gi-blog-card .gi-blog__ph::after { width: 44px; height: 3px; border-radius: 2px; background: var(--gi-red); }

/* text */
.gi-blog-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 18px 20px 16px; }
.gi-blog-card__meta { gap: 6px 12px; font-size: 13px; }
.gi-blog-card__t { display: -webkit-box; overflow: hidden; margin: 2px 0 0; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  min-height: calc(2em * 1.32); font-size: 18px; line-height: 1.32; text-wrap: pretty; } /* 2 lines reserved: the excerpts start at the same height */
.gi-blog-card__t a { color: var(--gi-ink); text-decoration: none; }
.gi-blog-card__t a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; } /* whole card clickable */
.gi-blog-card__t a:hover { color: var(--gi-red-text); text-decoration: underline; text-underline-offset: 3px; }
.gi-blog-card__t a:focus-visible { outline: none; }
.gi-blog-card:has(.gi-blog-card__t a:focus-visible) { outline: 3px solid var(--gi-focus, #1A5FB4); outline-offset: 2px; }
.gi-blog-card__d { display: -webkit-box; overflow: hidden; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  color: var(--gi-muted); font-size: 14.5px; line-height: 1.55; }
.gi-blog-card__more { position: relative; z-index: 2; margin-block-start: auto; padding-block-start: 6px; }

/* related articles under an article: same template, 3 across */
.gi-post__related .gi-blog__grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gi-post__related .gi-blog-card__t { font-size: 17px; }

/* phones: one column, image above, text below */
@container gi (max-width: 560px) {
  .gi-blog__grid, .gi-post__related .gi-blog__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .gi-blog-card__img { aspect-ratio: 16 / 10; }
  .gi-blog-card__img > img { padding: 12px; }
  .gi-blog-card__body { padding: 16px 16px 14px; }
  .gi-blog-card__t { font-size: 17px; }
}

/* Blog list hero: workshop photo (owner approval 16/11/2026) on the right, faded into the dark band so the text stays readable.
   Image: theme assets/img/blog/blog-hero-sauterelles.webp (1128 x 520). Tablets and phones (≤ 1000 px): photo behind the text under a dark veil. */
.gi-blog__hero { position: relative; overflow: hidden; min-height: 300px;
  background: linear-gradient(90deg, #121212 0%, #121212 38%, rgba(18, 18, 18, .82) 50%, rgba(18, 18, 18, .25) 66%, rgba(18, 18, 18, 0) 80%),
    url("../img/blog/blog-hero-sauterelles.webp") right center / auto 100% no-repeat, #121212; }
[dir="rtl"] .gi-blog__hero { background: linear-gradient(270deg, #121212 0%, #121212 38%, rgba(18, 18, 18, .82) 50%, rgba(18, 18, 18, .25) 66%, rgba(18, 18, 18, 0) 80%),
    url("../img/blog/blog-hero-sauterelles.webp") left center / auto 100% no-repeat, #121212; }
.gi-blog__hero > * { position: relative; max-width: 620px; }
@container gi (max-width: 1000px) { /* tablets and phones: photo behind the text */
  .gi-blog__hero, [dir="rtl"] .gi-blog__hero { min-height: 0;
    background: linear-gradient(180deg, rgba(18, 18, 18, .93) 0%, rgba(18, 18, 18, .86) 60%, rgba(18, 18, 18, .70) 100%),
      url("../img/blog/blog-hero-sauterelles.webp") 70% center / cover no-repeat, #121212; }
}
