/* 컬렉션 카드 — 레퍼런스(회색 바탕 위 미색 카탈로그 카드)를 따른다.
   위: 여백을 두고 앉힌 사진(대부분 흑백, 가끔 컬러). 아래: 큰 번호 + NUMBERING GEISHA 라벨,
   자간 넓은 농장명, 이름 | 품종·가공, 맨 아래 설명 세 줄. 글은 모두 영어.
   카드 비율 279:535 = 레퍼런스(279:505)보다 조금 길쭉하게 (실물 가안 70×134mm). 지금 빈카드 크기(54×85mm 세로)는 .cd-s. 글자는 카드 폭(cqw) 기준. */
:root { --cd-paper: #ebe4bc; --cd-ink: #1c160c; --cd-ph: #ababab; }

/* 레퍼런스 실측(카드 폭 279px 기준)을 cqw로 옮겼다: 사진 여백 10px, 사진 258×334, 글자 7~9px */
.cd { container-type: inline-size; aspect-ratio: var(--cd-ar, 279 / 535); position: relative; color: var(--cd-ink); }
.cd-face { position: absolute; inset: 0; background: var(--cd-paper); display: flex; flex-direction: column;
  padding: 3.58cqw 3.58cqw 0; font-family: "Source Serif 4", Georgia, serif; font-weight: 600; letter-spacing: 0; line-height: 1.38;
  font-optical-sizing: auto; box-shadow: 0 .2cqw 1cqw rgba(0,0,0,.12); overflow: hidden; text-align: left; }

/* 앞면 */
.cd-ph { position: relative; aspect-ratio: var(--cd-ph-ar, 258 / 356); background: var(--cd-ph); overflow: hidden; flex: none; }
.cd-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.cd-front:not(.is-color) .cd-ph img { filter: grayscale(1); }
.cd-front.is-color .cd-ph img { filter: saturate(.9); }
.cd-tx { flex: 1; display: flex; flex-direction: column; padding: 0 0 var(--cd-pb, .95cqw) .4cqw; min-height: 0; }

/* 로마 숫자 자리: 번호 + 컬렉션 이름 */
.cd-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--cd-h1, 7.4cqw); font-size: 3.15cqw; line-height: 1; font-weight: 500; }
.cd-num { font-variant-numeric: lining-nums; }
.cd-set { font-size: .8em; letter-spacing: .18em; text-transform: uppercase; margin-right: -.18em; }
.cd-farm { display: block; margin-top: var(--cd-h2, 3.3cqw); text-align: center; font-weight: 600; font-size: 2.7cqw; line-height: 1; letter-spacing: .31em; text-transform: uppercase; padding-left: .3em; }
.cd-row { display: flex; justify-content: space-between; gap: 3cqw; margin-top: var(--cd-h3, 9.55cqw); padding: 0 13.9cqw 0 13.3cqw; font-size: 3.08cqw; line-height: 1; }
.cd-row span:last-child { text-align: right; }
.cd-d { margin-top: auto; font-size: 2.98cqw; line-height: 1.385; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 빈 카드: 회색 사진 자리 + 번호 */
.cd-empty .cd-ph { background: #b3b2ad; }
.cd-empty .cd-head { opacity: .55; }
.cd-empty .cd-farm { opacity: .4; }

/* 뒷면: 앞면과 같은 글자 — 번호 줄, 농장, 이름 줄, 라벨 정보, 긴 설명 */
.cd-back { padding: 6.5cqw 6.5cqw 0; }
.cd-back .cd-head { margin-top: 0; }
.cd-back .cd-farm { margin-top: 9cqw; }
.cd-back .cd-row { margin-top: 5.4cqw; padding: 0 6cqw; }
.cd-label { display: grid; grid-template-columns: auto 1fr; gap: 1.5cqw 5cqw; margin-top: 9cqw; padding-top: 5cqw; border-top: .18cqw solid rgba(28,22,12,.35); font-size: 2.98cqw; line-height: 1.3; }
.cd-label dt { letter-spacing: .2em; text-transform: uppercase; font-size: .84em; font-weight: 500; opacity: .62; padding-top: .14em; }
.cd-label dd { min-width: 0; }
.cd-story { margin-top: 5cqw; padding-top: 5cqw; border-top: .18cqw solid rgba(28,22,12,.35); font-size: 2.98cqw; line-height: 1.385; overflow: hidden; min-height: 0; flex: 1; }
.cd-story p + p { margin-top: .7em; }
.cd-foot { display: flex; justify-content: space-between; gap: 3cqw; padding: 3.4cqw 0 4.6cqw; font-size: 2.3cqw; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; opacity: .7; }

/* 뒤집기 */
.cd-flip { perspective: 1800px; }
.cd-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3,.7,.2,1); }
.cd-flip .cd-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cd-flip .cd-back { transform: rotateY(180deg); }
.cd-flip.is-back .cd-inner { transform: rotateY(180deg); }

/* 작은 카드(휴대폰 2열 등)에서는 설명을 접는다 */
@container (max-width: 200px) { .cd-d { display: none; } .cd-row { padding: 0; } .cd-set { display: none; } }

/* 지금 빈카드 크기(85×54mm를 세로로): 글 영역은 그대로, 사진만 낮춘다 */
.cd-s { --cd-ar: 54 / 85; --cd-ph-ar: 92.84 / 96; }
.cd-s .cd-back .cd-farm { margin-top: 6cqw; } .cd-s .cd-label { margin-top: 6cqw; padding-top: 4cqw; gap: .9cqw 5cqw; } .cd-s .cd-story { margin-top: 4cqw; padding-top: 4cqw; }
