/* =========================================================================
   ENTRY LIST — /entry-list/ and /entry-list/{competition}/
   (inc/entry-list.php, dna-entry-list.php, dna-entry-list-one.php)

   The list is the Competitions page's frame — the one-line heading, the chip
   row, the card grid — so the two read as one site. A card leads with the
   day that matters, set on the photograph in a solid pill (prize photography
   changes with every competition, so nothing is laid on it see-through), and
   says where the competition stands in a word and a colour, never colour
   alone. One competition's page is a reading page: the narrow measure, its
   facts, the result once drawn, then the search and the entries table.
   ========================================================================= */

/* --- The list ------------------------------------------------------------ */
.ecard { position: relative; }

/* The key date, on the photograph. Above it, but never in the way of a tap. */
.ecard__when {
	position: absolute; z-index: 2; top: 0.75rem; left: 0.75rem;
	display: inline-flex; align-items: center; gap: 0.4rem; max-width: calc(100% - 1.5rem);
	padding: 0.4rem 0.8rem 0.4rem 0.65rem; border-radius: 999px;
	font-family: var(--f-display); font-weight: 700; font-size: 0.8rem; line-height: 1.2;
	font-variant-numeric: tabular-nums; white-space: nowrap;
	background: var(--navy); color: var(--ivory);
	box-shadow: 0 6px 16px -8px rgb(7 12 17 / 0.6);
	pointer-events: none;
}
.ecard__when time { overflow: hidden; text-overflow: ellipsis; }
.ecard__when--draw   { background: var(--gold); color: var(--navy); }
.ecard__when--closed { background: var(--surface); color: var(--navy); }
.ecard__when--drawn  { color: var(--champagne); }

/* Where it stands: a word, and a dot in the same colour. */
.ecard__state { color: var(--ink-dim); }
.ecard__state .panel__pip { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ecard__state--ok    { color: #1E5A40; }
.ecard__state--warn  { color: #7A5310; }
.ecard__state--info  { color: var(--navy); }
.ecard__state--ok .panel__pip { box-shadow: 0 0 0 3px color-mix(in srgb, #2E7D5B 18%, transparent); }

/* The published winner. */
.ecard__won {
	display: flex; align-items: flex-start; gap: 0.5rem;
	padding: 0.6rem 0.75rem; border-radius: var(--r-sm);
	background: var(--bg-warm); color: var(--ink);
	font-size: var(--fs-meta); line-height: 1.4;
}
.ecard__won .dna-icon { margin-top: 1px; color: var(--gold-ink); }
.ecard__won strong { font-variant-numeric: tabular-nums; }

.ecard__foot { padding-top: 0.5rem; }
/* A link here (a label on the Competitions page's cards): no underline. */
.ecard .card__cta { text-decoration: none; }
.ecard__n { font-size: var(--fs-meta); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ecard__n strong { color: var(--ink); font-weight: 700; }

/* Pages of the list. */
.pager {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
	gap: 0.5rem 0.75rem; margin-top: clamp(2rem, 4vw, 3rem);
}
.pager__list { display: flex; align-items: center; gap: 0.35rem; }
.pager__n, .pager__step {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
	min-width: 44px; height: 44px; padding: 0 1rem; border-radius: 999px;
	border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
	font-family: var(--f-display); font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums;
	transition: background-color var(--t-micro) var(--ease), color var(--t-micro) var(--ease), border-color var(--t-micro) var(--ease), transform var(--t-micro) var(--ease);
}
.pager__n { padding: 0 0.5rem; }
.pager__n.is-on { background: var(--navy); border-color: var(--navy); color: var(--ivory); }
.pager__step .dna-icon { transition: transform var(--t-ui) var(--ease); }
@media (hover: hover) and (pointer: fine) {
	a.pager__n:hover, .pager__step:hover { border-color: var(--navy); }
	.pager__step[rel="next"]:hover .dna-icon { transform: translateX(3px); }
	.pager__step[rel="prev"]:hover .dna-icon { transform: translateX(-3px); }
}
a.pager__n:active, .pager__step:active { transform: scale(0.96); transition-duration: var(--t-press); }
.pager__gap { padding-inline: 0.15rem; color: var(--ink-dim); }

/* Nothing in this part of the list. */
.elist .empty {
	display: grid; justify-items: start; gap: 1.1rem;
	padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: var(--r-md);
	background: var(--bg-warm);
}
.elist .empty__h { font-size: var(--fs-card); }
.elist .empty__p { max-width: 52ch; color: var(--ink-dim); }

/* --- Draw Results (dna-draw-results.php, template-parts/result-card.php) ---
   The Entry List's cards, finished: a solid band across the foot of the
   photograph says so with the day it was drawn, and the winning tickets sit
   in the warm box the Entry List gives a winner. No filter row here, so a
   hairline closes the heading instead. */
.is-draw-results .lhead { border-bottom: 1px solid var(--line); }
.dres { padding-top: clamp(1.35rem, 2.4vw, 2.25rem); }

.rcard__pic { position: relative; }
.rcard__band {
	position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
	display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
	padding: 0.6rem 1rem 0.55rem;
	background: var(--navy); color: var(--on-dark-dim);
	font-size: 0.8rem; line-height: 1.2; white-space: nowrap;
	pointer-events: none;
}
/* The site's gold seam along its top edge, as on the competition panel. */
.rcard__band::before {
	content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
	background: linear-gradient(90deg, var(--gold-deep), var(--gold) 50%, var(--champagne));
}
.rcard__fin {
	display: inline-flex; align-items: center; gap: 0.4rem;
	font-family: var(--f-display); font-weight: 800; font-size: 0.78rem;
	letter-spacing: 0.2em; text-transform: uppercase; color: var(--champagne);
}
.rcard__fin .dna-icon { stroke-width: 2.4; }
.rcard__date { overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--ivory); font-variant-numeric: tabular-nums; }

.rcard__won {
	display: grid; gap: 0.35rem;
	padding: 0.7rem 0.85rem 0.75rem; border-radius: var(--r-sm);
	background: var(--bg-warm);
}
.rcard__wonh {
	display: inline-flex; align-items: center; gap: 0.4rem;
	font-family: var(--f-display); font-size: var(--fs-label); font-weight: 800;
	letter-spacing: 0.13em; text-transform: uppercase; color: var(--gold-ink);
}
.rcard__list { display: grid; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.rcard__row { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.rcard__tk {
	flex: none; font-family: var(--f-display); font-weight: 900; font-size: 1.05rem;
	letter-spacing: -0.02em; color: var(--navy); font-variant-numeric: tabular-nums;
}
.rcard__tk [aria-hidden] { color: var(--gold-ink); }
.rcard__who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.rcard__more, .rcard__note { font-size: var(--fs-meta); color: var(--ink-dim); }

/* --- One competition's entries ------------------------------------------ */
.eone { padding-block: clamp(1rem, 2.6vw, 2.25rem) var(--s-sec); }

.eone__back {
	display: inline-flex; align-items: center; gap: 0.45rem; padding-block: 0.6rem;
	font-size: var(--fs-meta); font-weight: 600; color: var(--ink-dim); text-decoration: none;
	transition: color var(--t-micro) var(--ease);
}
.eone__back .dna-icon { transition: transform var(--t-ui) var(--ease); }
@media (hover: hover) and (pointer: fine) {
	.eone__back:hover { color: var(--ink); }
	.eone__back:hover .dna-icon { transform: translateX(-3px); }
}

.eone__head {
	display: grid; grid-template-columns: clamp(104px, 14vw, 160px) minmax(0, 1fr);
	gap: clamp(1rem, 2.4vw, 2rem); align-items: start;
	margin-top: 0.5rem; padding-bottom: clamp(1.25rem, 2.4vw, 2rem);
	border-bottom: 1px solid var(--line);
}
.eone__media {
	position: relative; display: block; aspect-ratio: 1; overflow: hidden;
	border-radius: var(--r-md); background: var(--ph, var(--bg-warm)); box-shadow: var(--sh-1);
}
.eone__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.eone__text { display: grid; justify-items: start; gap: 0.6rem; min-width: 0; }
.eone__title {
	font-size: clamp(1.75rem, 3.4vw, 2.75rem); font-weight: 900; font-stretch: 112%;
	letter-spacing: -0.04em; line-height: 1.02; color: var(--navy); overflow-wrap: anywhere;
}
.eone__cash { font-size: var(--fs-meta); color: var(--ink-dim); }

.eone__facts { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; margin: 0.2rem 0 0; }
.eone__facts > div { display: grid; gap: 0.1rem; }
.eone__facts dt {
	font-family: var(--f-display); font-size: var(--fs-label); font-weight: 800;
	letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-ink);
}
.eone__facts dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.eone__go {
	display: inline-flex; align-items: center; gap: 0.4rem; padding-block: 0.4rem;
	font-family: var(--f-display); font-weight: 700; color: var(--ink);
	transition: color var(--t-micro) var(--ease);
}
.eone__go .dna-icon { transition: transform var(--t-ui) var(--ease); }
@media (hover: hover) and (pointer: fine) {
	.eone__go:hover { color: var(--gold-ink); }
	.eone__go:hover .dna-icon { transform: translateX(3px); }
}

/* The published result. */
.eone__result {
	display: grid; gap: 0.75rem; margin-top: clamp(1.25rem, 2.4vw, 2rem);
	padding: clamp(1.1rem, 2.4vw, 1.6rem); border-radius: var(--r-md);
	background: var(--navy); color: var(--on-dark);
}
.eone__result-h { display: flex; align-items: center; gap: 0.55rem; font-size: clamp(1.15rem, 1.8vw, 1.4rem); color: var(--champagne); }
.eone__won { display: grid; gap: 0.45rem; }
.eone__won li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.75rem; }
.eone__ticket { font-family: var(--f-display); font-size: 1.15rem; font-weight: 800; color: var(--ivory); font-variant-numeric: tabular-nums; }
.eone__prize, .eone__when { font-size: var(--fs-meta); color: var(--on-dark-dim); }

/* The entries, with their search. */
.eone__list { margin-top: clamp(1.75rem, 3.4vw, 2.75rem); scroll-margin-top: var(--stick); }
.eone__list-h { margin-bottom: 1rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); scroll-margin-top: calc(var(--stick) + 1rem); }

/* minmax(0, 1fr): the field's own width must never push the button off a phone. */
.esearch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.45rem; max-width: 560px; margin-bottom: 1.5rem; }
.esearch__label {
	font-family: var(--f-display); font-size: var(--fs-label); font-weight: 800;
	letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim);
}
.esearch__row { display: flex; gap: 0.5rem; }
.esearch__input {
	flex: 1 1 auto; width: 100%; min-width: 0; height: 48px; padding: 0 1.15rem;
	border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
	font: inherit; font-size: 1rem;
	transition: border-color var(--t-micro) var(--ease);
}
.esearch__input::placeholder { color: var(--ink-dim); opacity: 1; }
@media (hover: hover) and (pointer: fine) { .esearch__input:hover { border-color: color-mix(in srgb, var(--navy) 40%, transparent); } }
.esearch__input:focus-visible { border-color: var(--navy); outline: 2.5px solid var(--gold); outline-offset: 2px; }
.esearch__btn { flex: none; height: 48px; padding-block: 0; }

.public-entries__clear { margin-left: 0.35rem; font-weight: 600; white-space: nowrap; }

@media (max-width: 860px) {
	/* The Competitions page swaps its chips for a filter sheet here; the Entry
	   List has three or four, so they stay, in a row that scrolls. */
	.is-entry-list .filterbar__chips { display: flex; }
}

@media (max-width: 640px) {
	/* One row on a 360px phone even in the widest case (← 1 … 4 5 6 … 9 →):
	   arrows instead of words, 38px targets, tighter gaps. Narrower still, it wraps. */
	.pager { gap: 0.35rem; }
	.pager__n, .pager__step { min-width: 38px; height: 38px; }
	.pager__step { padding: 0; }
	.pager__step span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.pager__list { gap: 0.2rem; }
	.pager__gap { padding-inline: 0; }

	.eone__head { grid-template-columns: 88px minmax(0, 1fr); }
	.eone__facts { gap: 0.5rem 1.25rem; }
}

/* Romanian typography (see main.css): the comma of Ș Ț hangs 0.44em under
   the baseline, so a competition name needs a 1.2 line, and the one-line
   date pill opens its clip below the comma without moving the text. */
:lang(ro) .eone__title { line-height: 1.2; }
:lang(ro) .ecard__when time { padding-block: 0.12em 0.3em; margin-block: -0.12em -0.3em; }
