/* ══════════════════════════════════════════════════════════════════
   OKKAI · Fashion Tea card
   One card component, three places: the /fashion-tea grid, and the
   "Related Reads" + "You Might Like This" rows on /article/<slug>.
   Markup comes from OkkaiBlogs.cardHtml() so all three stay identical.

   Figma: "icons and cards" → Frame 48095665 / Frame 48095676.

   FLAGGED — values the design asks for that the token set has no name
   for, so they are literals here:
     - --ft-tint: rgba(0,122,255,0.15), the blue wash behind the tag
       pills and the attribution strip. Not the brand accent, and the
       only place on the site that uses it.
     - backdrop-filter: blur(12px) on the attribution strip.
     - the 10px stat counters and 14/12px attribution type sit below
       --fs-2xs (12px); the scale has no step for them.
   Everything else resolves to a token.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --ft-tint: rgba(0, 122, 255, 0.15);
}

.ft-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  /* The design pads the text 13px in from the card's own edge. */
  --ft-card-pad: 13px;
}

/* ── Media + attribution strip ─────────────────────────────────── */

.ft-card__media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ft-card__img {
  display: block;
  /* Anchors a cropped thumbnail, which blogs.js positions absolutely. */
  position: relative;
  width: 100%;
  aspect-ratio: 435 / 313;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.ft-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Zoom the frame, not the <img>. A cropped thumbnail carries its own
   transform: translate() inline, and a hover rule on the image itself would
   overwrite it and snap the crop back to the image's top-left corner. */
.ft-card:hover .ft-card__img { transform: scale(1.04); }

/* Author strip, overlaying the bottom of the photo. */
.ft-card__attr {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 49px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 var(--ft-card-pad);
  background: var(--ft-tint);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-overlay-text);
}

.ft-card__avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 24px;
  display: block;
}

.ft-card__avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.28);
  color: var(--color-overlay-text);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 1;
}

.ft-card__attr-text {
  min-width: 0;
  margin-left: 4px;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ft-card__author {
  font-size: 14px;
  font-weight: var(--fw-medium);
  line-height: 20px;
  color: var(--color-overlay-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-card__date {
  font-size: 12px;
  font-weight: var(--fw-regular);
  line-height: 18px;
  color: var(--color-overlay-text);
  white-space: nowrap;
}

.ft-card__share {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ft-card__share:hover { background: rgba(255, 255, 255, 0.22); }
.ft-card__share img { display: block; }

/* ── Tags ──────────────────────────────────────────────────────── */

.ft-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  padding: 0 var(--ft-card-pad);
}

.ft-tag {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 16px;
  border-radius: 100px;
  background: var(--ft-tint);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  line-height: 20px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

/* ── Copy ──────────────────────────────────────────────────────── */

.ft-card__title {
  margin-top: 6px;
  padding: 0 var(--ft-card-pad);
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  line-height: 1.44;
  color: var(--text);
}

/* The grid has no tags row when a story carries no keywords. */
.ft-card__media + .ft-card__title { margin-top: 15px; }

.ft-card__title a {
  color: inherit;
  text-decoration: none;
}

.ft-card:hover .ft-card__title a { color: var(--accent); }

.ft-card__desc {
  margin-top: 8px;
  padding: 0 var(--ft-card-pad);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  color: var(--muted);
  /* The design reserves three lines of blurb so every card's footer row
     lines up across the grid. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Footer row: View Post · likes · comments ───────────────────── */

.ft-card__foot {
  margin-top: auto;
  padding: 24px var(--ft-card-pad) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ft-card__view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.ft-card__view:hover { opacity: 1; color: var(--accent); }
.ft-card__view img { display: block; }

.ft-card__stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ft-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ft-card__stat:hover { opacity: 0.65; }
.ft-card__stat:disabled { cursor: default; opacity: 0.5; }
.ft-card__stat img { display: block; }

.ft-card__count {
  font-size: 10px;
  font-weight: var(--fw-regular);
  line-height: 20px;
  color: rgba(0, 0, 0, 0.7);
}

/* A like this browser has already given. The icon is a flat asset, so the
   state is carried by the count and a subtle lift rather than a fill. */
.ft-card__like.is-liked img { transform: translateY(-1px) scale(1.08); }
.ft-card__like.is-liked .ft-card__count {
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

/* ══ Card rows on the article page ═══════════════════════════════
   "Related Reads" and "You Might Like This" — a centred 32px heading
   over a row of cards, each row preceded by a full-bleed hairline. */

.ft-row {
  border-top: 1px solid var(--color-hairline);
  padding-top: 44px;
  margin-top: 44px;
}

.ft-row[hidden] { display: none; }

.ft-row__heading {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  color: var(--text);
  text-align: center;
}

.ft-row__cards {
  margin-top: 54px;
  display: grid;
  gap: 48px 27px;
}

/* Related Reads is a narrower, centred pair; You Might Like fills the row. */
.ft-row--related .ft-row__cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 897px;
  margin-left: auto;
  margin-right: auto;
}

.ft-row--suggested .ft-row__cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ══ Responsive ═══════════════════════════════════════════════════ */

@media (max-width: 820px) {
  .ft-row { padding-top: 32px; margin-top: 32px; }
  .ft-row__heading { font-size: var(--fs-2xl); }
  .ft-row__cards { margin-top: 32px; gap: 32px 20px; }
  .ft-row--suggested .ft-row__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ft-card__title { font-size: var(--fs-md); }
}

@media (max-width: 540px) {
  .ft-row--related .ft-row__cards,
  .ft-row--suggested .ft-row__cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
