/* ==========================================================================
   The framed list (2026-09-28) — shared component
   --------------------------------------------------------------------------
   A list of wines hung like an antique picture, opened by a section's button:

     .mve-frame    the gilded moulding — a gold sheen, bevel light from the
                   top left, pearl beading, a carved rosette in each corner
     .mve-liner    the velvet slip between moulding and picture
     .mve-canvas   the picture: aged paper, the wines set in columns

   Hosts: The Festival, section 05 "Mondial des Vins Extrêmes" (CERVIM's Grand
   Gold Medal wines, inc/mwf-vins-extremes.php) and TasteTerroir, section 04
   "Giornate del Riesling" (inc/mwf-riesling.php). Markup: inc/mwf-frame.php.
   Behaviour: js/mwf-frame.js. Enqueued only for the templates that host a
   frame (functions.php mwf_enqueue_event_assets()), so the .mwfe scope is
   exact; mwf.css stays frozen. The prefix "mve" is the component's name from
   its first use. Widths and type in rem, never px (the root scales above
   1920px).
   ========================================================================== */

/* ------------------------------------------ the host page's section index */

/* A frame's section brings a long chip ("Mondial des Vins Extrêmes",
   "Giornate del Riesling"). Up to 1100px the chip shows its short label (the
   template prints both spans when a section has a 'cap') and the index wraps
   rather than hiding its last chips past the edge (The Festival at 768px: two
   of six were off-screen); on phones that keeps it to two rows, not three. */
.mwfe .mwfe-toc-short { display: none; }
@media (max-width: 1100px) {
	.mwfe .mwfe-toc-full { display: none; }
	.mwfe .mwfe-toc-short { display: inline; }
	.mwfe .mwfe-toc-inner { flex-wrap: wrap; overflow-x: visible; }
}

/* ------------------------------------------------------------ the toggle */

/* a real <button> dressed as .mwfe-btn: undo the theme's global button look
   (style.css: grey border on hover/focus, line-height 1, appearance) */
.mwfe .mve-toggle {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	line-height: 1.65;
	background: transparent;
}
.mwfe .mve-toggle,
.mwfe .mve-toggle:hover,
.mwfe .mve-toggle:focus,
.mwfe .mve-toggle:active {
	border-color: var(--mwfe-brass);
}
.mwfe .mve-toggle:focus-visible {
	outline: 2px solid var(--mwfe-gold-light);
	outline-offset: 3px;
}
.mwfe .mve-toggle .mve-when-open { display: none; }
.mwfe .mve-toggle[aria-expanded="true"] .mve-when-open { display: inline; }
.mwfe .mve-toggle[aria-expanded="true"] .mve-when-closed { display: none; }
.mwfe .mve-toggle:hover .mwfe-arrow { transform: translateY(3px); }
.mwfe .mve-toggle[aria-expanded="true"] .mwfe-arrow { transform: rotate(180deg); }
.mwfe .mve-toggle[aria-expanded="true"]:hover .mwfe-arrow { transform: rotate(180deg) translateY(3px); }

/* ------------------------------------------------------------- the panel */

/* a full-width row under the section's figure and text */
.mwfe .mve-host .mve {
	grid-column: 1 / -1;
	order: 3;
	margin-top: -1.5rem;
	padding: 0 0 1rem;
}
.mwfe .mve[hidden] { display: none; }
/* anchors inside the list clear the section index as well as the header
   (the design system's [id] margin counts the header only) */
.mwfe .mve [id] { scroll-margin-top: calc(var(--mwfe-header-h) + 4.5rem); }

/* ----------------------------------------------------------- the moulding */

.mwfe .mve-frame {
	--mve-mold: clamp(.85rem, 2.1vw, 1.8rem);
	position: relative;
	max-width: 80rem;
	margin: 0 auto;
	padding: var(--mve-mold);
	border-radius: .18rem;
	overflow: hidden; /* keeps the glint on the glass; the cast shadow is outside and stays */
	background: linear-gradient(135deg, #5e4213 0%, #c9a24b 11%, #f6e3a1 19%, #b98f37 31%, #6f5118 45%, #caa550 58%, #f3dd92 70%, #a27a2c 84%, #5a3f12 100%);
	box-shadow:
		0 0 0 1px #2c1f07,
		inset 0 0 0 1px rgba(255, 246, 210, .75),
		inset 0 0 0 .22rem rgba(94, 66, 19, .5),
		inset .35rem .35rem .7rem rgba(255, 244, 205, .35),
		inset -.35rem -.35rem .8rem rgba(46, 32, 8, .55),
		0 2.8rem 5rem -1.6rem rgba(0, 0, 0, .85),
		0 .8rem 1.4rem -.5rem rgba(0, 0, 0, .6);
}

/* pearl beading along the moulding */
.mwfe .mve-frame::before {
	content: "";
	position: absolute;
	inset: calc(var(--mve-mold) * .3);
	z-index: 1;
	border: .19rem dotted rgba(255, 241, 196, .85);
	border-radius: .1rem;
	pointer-events: none;
}

/* light passing over the glass, once, as the picture is unveiled */
.mwfe .mve-frame::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -40%;
	width: 30%;
	z-index: 3;
	pointer-events: none;
	opacity: 0;
	background: linear-gradient(90deg, rgba(255, 252, 235, 0), rgba(255, 252, 235, .14) 42%, rgba(255, 255, 255, .26) 50%, rgba(255, 252, 235, .14) 58%, rgba(255, 252, 235, 0));
	transform: skewX(-14deg);
}

/* carved corner blocks, each with its rosette */
.mwfe .mve-rosette {
	position: absolute;
	z-index: 2;
	width: var(--mve-mold);
	height: var(--mve-mold);
	background:
		radial-gradient(circle, #fff6d2 0 9%, #a57d2c 11% 15%, rgba(0, 0, 0, 0) 16.5%),
		radial-gradient(circle, rgba(0, 0, 0, 0) 0 46%, #5a3f12 47% 49.5%, #e3c677 50.5% 52%, #bf953c 53%),
		repeating-conic-gradient(from 7.5deg, #f6e3a1 0deg 15deg, #9c752a 15deg 30deg);
	box-shadow:
		0 0 0 1px rgba(44, 31, 7, .65),
		inset 0 0 0 1px rgba(255, 246, 210, .7),
		inset .12rem .12rem .25rem rgba(255, 244, 205, .45),
		inset -.12rem -.12rem .3rem rgba(46, 32, 8, .55);
}
.mwfe .mve-rosette--tl { top: 0; left: 0; }
.mwfe .mve-rosette--tr { top: 0; right: 0; }
.mwfe .mve-rosette--bl { bottom: 0; left: 0; }
.mwfe .mve-rosette--br { bottom: 0; right: 0; }

/* ------------------------------------------------------------- the liner */

.mwfe .mve-liner {
	position: relative;
	z-index: 1;
	padding: clamp(.55rem, 1.5vw, 1.25rem);
	background:
		radial-gradient(ellipse at 30% 15%, rgba(125, 42, 50, .55), rgba(125, 42, 50, 0) 60%),
		linear-gradient(160deg, var(--mwfe-wine-mid), #2c0f13);
	box-shadow:
		0 0 0 .12rem #4f3910,
		0 0 0 .26rem #e8cd82,
		0 0 0 .34rem #6b4c14,
		0 0 1rem .35rem rgba(0, 0, 0, .5),
		inset 0 .25rem .8rem rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------ the canvas */

.mwfe .mve-canvas {
	--mve-ink: #3a2517;
	--mve-ink-soft: #6a4b2f;
	--mve-rule: rgba(140, 109, 31, .45);
	position: relative;
	padding: clamp(1.7rem, 4.4vw, 4rem) clamp(1.15rem, 4.2vw, 4rem) clamp(1.6rem, 3.6vw, 3.2rem);
	background-color: #efe4c9;
	background-image:
		radial-gradient(ellipse 85% 55% at 50% 30%, rgba(255, 252, 240, .8), rgba(255, 252, 240, 0) 70%),
		radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 62%, rgba(128, 88, 38, .26) 100%);
	box-shadow:
		0 0 0 .1rem #b8913a,
		0 0 0 .18rem #4f3910,
		inset 0 0 3.5rem rgba(120, 82, 36, .32);
	color: var(--mve-ink);
	font-family: var(--mwfe-serif);
	text-align: left;
}
/* paper fibres (every data-URI SVG carries its own width/height) */
.mwfe .mve-canvas::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: .22;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.47 0 0 0 0 0.33 0 0 0 0 0.16 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E");
}
.mwfe .mve-canvas > * { position: relative; }

/* the head of the picture */
.mwfe .mve-head {
	max-width: 42rem;
	margin: 0 auto clamp(1.4rem, 3vw, 2.2rem);
	text-align: center;
}
.mwfe .mve-eyebrow {
	margin: 0 0 .7rem;
	font-family: var(--mwfe-sans);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .3em;
	text-transform: uppercase;
	color: var(--mwfe-gold-dark);
}
.mwfe .mve-title {
	clear: none;
	margin: 0;
	font-family: var(--mwfe-serif);
	font-size: clamp(2.1rem, 4.2vw, 3.3rem);
	font-style: italic;
	font-weight: 500;
	line-height: 1.05;
	text-align: center;
	color: var(--mwfe-wine);
}
.mwfe .mve-line {
	margin: .5rem 0 0;
	font-size: clamp(1.05rem, 1.6vw, 1.3rem);
	font-style: italic;
	color: var(--mve-ink-soft);
}
/* a second line (the Riesling list's "all of the 2024 vintage") reads with the first */
.mwfe .mve-line + .mve-line { margin-top: .1rem; }
.mwfe .mve-counts {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .9em;
	margin: 1.1rem 0 0;
	font-family: var(--mwfe-sans);
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--mve-ink);
}
.mwfe .mve-counts::before,
.mwfe .mve-counts::after {
	content: "";
	flex: 0 1 3.5rem;
	height: 1px;
	background: var(--mve-rule);
}

/* the countries, as a line of links */
.mwfe .mve-index {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .15rem 0;
	max-width: 60rem;
	margin: 0 auto clamp(1.8rem, 4vw, 3rem);
	padding: .8rem 0;
	border-top: 1px solid var(--mve-rule);
	border-bottom: 1px solid var(--mve-rule);
	font-family: var(--mwfe-serif);
	font-size: 1.08rem;
	font-style: italic;
	line-height: 1.5;
}
.mwfe .mve-index a {
	position: relative;
	padding: .1rem .6rem;
	color: var(--mve-ink);
	text-decoration: none;
	transition: color .2s;
}
/* the separator trails its country, so a wrapped line never opens with one */
.mwfe .mve-index a:not(:last-child)::after {
	content: "·";
	position: absolute;
	right: -.12rem;
	color: var(--mwfe-gold-dark);
	font-style: normal;
}
.mwfe .mve-index a:hover { color: var(--mwfe-wine); }
.mwfe .mve-index a:focus-visible,
.mwfe .mve-close:focus-visible {
	outline: 2px solid var(--mwfe-wine);
	outline-offset: 2px;
}

/* ---------------------------------------------------------- the list */

.mwfe .mve-list {
	columns: 3 16.5rem; /* three from ~1190px, two on tablets, one on phones */
	column-gap: clamp(1.8rem, 3.5vw, 3.2rem);
	column-rule: 1px solid var(--mve-rule);
}
.mwfe .mve-group { margin: 0 0 1.4rem; }
/* the columns break between wines, never inside one, and never between a
   heading and its first wine (the markup groups those, see the renderer) */
.mwfe .mve-keep,
.mwfe .mve-wines li {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
}
.mwfe .mve-group-name {
	display: flex;
	align-items: center;
	gap: .6rem;
	clear: none;
	margin: 0 0 .35rem;
	font-family: var(--mwfe-serif);
	font-size: 1.55rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1.15;
	text-align: left;
	color: var(--mwfe-wine);
}
.mwfe .mve-group-name::after {
	content: "";
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, var(--mve-rule), rgba(140, 109, 31, 0));
}
.mwfe .mve-sub {
	clear: none;
	margin: .8rem 0 .2rem;
	font-family: var(--mwfe-sans);
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .26em;
	line-height: 1.4;
	text-align: left;
	text-transform: uppercase;
	color: var(--mwfe-gold-dark);
}
.mwfe .mve-group-name + .mve-sub { margin-top: .3rem; }

.mwfe .mve-entry {
	padding: .5rem 0 .65rem;
	border-bottom: 1px dotted var(--mve-rule);
}
.mwfe .mve-group > .mve-entry:last-child { border-bottom: 0; }

.mwfe .mve-wines {
	margin: 0;
	padding: 0;
	list-style: none;
}
.mwfe .mve-wines li { margin: 0; padding: .2rem 0; }
.mwfe .mve-row {
	display: flex;
	align-items: flex-end;
	gap: .4rem;
}
.mwfe .mve-wine {
	min-width: 0;
	overflow-wrap: break-word;
	font-size: .98rem;
	font-weight: 600;
	letter-spacing: .015em;
	line-height: 1.3;
	color: var(--mve-ink);
}
.mwfe .mve-dots {
	flex: 1 0 .9rem;
	margin-bottom: .34em;
	border-bottom: 1px dotted rgba(106, 75, 47, .55);
}
.mwfe .mve-vint {
	flex: none;
	font-size: 1.04rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1.3;
	font-variant-numeric: oldstyle-nums;
	color: var(--mwfe-wine);
}
.mwfe .mve-by {
	margin: .3rem 0 0;
	font-family: var(--mwfe-sans);
	font-size: .64rem;
	font-weight: 600;
	letter-spacing: .12em;
	line-height: 1.55;
	text-transform: uppercase;
	color: var(--mve-ink-soft);
}
.mwfe .mve-maker { font-weight: 700; color: var(--mve-ink); }
.mwfe .mve-place::before { content: "· "; color: var(--mwfe-gold-dark); }

/* the Gran Premio CERVIM — the competition's highest score: a ribbon and a note */
.mwfe .mve-prize {
	display: block;
	margin: .3rem 0 .15rem;
	font-size: .98rem;
	font-style: italic;
	line-height: 1.5;
	color: var(--mwfe-wine);
}
.mwfe .mve-prize b {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	margin-right: .3em;
	padding: .16rem .7rem .16rem .5rem;
	border-radius: 999px;
	background: var(--mwfe-wine);
	font-family: var(--mwfe-sans);
	font-size: .6rem;
	font-style: normal;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.4;
	text-transform: uppercase;
	vertical-align: .12em;
	color: #f6e3a1;
}
.mwfe .mve-prize b::before {
	content: "★";
	font-size: .8rem;
	letter-spacing: 0;
	color: #f3d27a;
}

/* ------------------------------------------ a logo on the picture (Riesling) */

/* at most this tall, never taller than the file itself: a small logo (CERVIM's
   is 146px) is not blown up soft, a large one (the Rieslingtage one) is capped */
.mwfe .mve-logo {
	width: auto;
	height: auto;
	max-height: clamp(8rem, 14vw, 11rem); /* the logo's own lettering stays legible on a phone */
	margin: 0 auto 1.2rem;
}

/* --------------------------------------- one wine per winery (Giornate del Riesling)
   the list number, the winery in the engraved capitals of the wine lines,
   an organic badge, then the wine: its name in italics, its denomination
   in small capitals */

.mwfe .mve-rl {
	display: grid;
	grid-template-columns: 1.9rem minmax(0, 1fr);
	column-gap: .55rem;
	align-items: baseline;
}
.mwfe .mve-rl-no {
	font-size: 1.05rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1.3;
	text-align: right;
	font-variant-numeric: oldstyle-nums;
	color: var(--mwfe-wine);
}
.mwfe .mve-rl-main { min-width: 0; line-height: 1.3; } /* the block's own line height: a winery name that wraps stays one tight block */
.mwfe .mve-rl-maker {
	overflow-wrap: break-word;
	font-size: .98rem;
	font-weight: 600;
	letter-spacing: .015em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--mve-ink);
}
.mwfe .mve-rl-bio {
	display: inline-block;
	margin-left: .45em;
	padding: .04rem .5rem;
	border: 1px solid rgba(74, 106, 42, .7);
	border-radius: 999px;
	font-family: var(--mwfe-sans);
	font-size: .56rem;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.45;
	text-transform: uppercase;
	vertical-align: .18em;
	color: #4a6a2a;
}
.mwfe .mve-rl-wine {
	display: block;
	margin-top: .08rem;
	font-size: 1.04rem;
	font-style: italic;
	line-height: 1.35;
	color: var(--mve-ink-soft);
}
.mwfe .mve-rl-class {
	display: block;
	margin-top: .12rem;
	font-family: var(--mwfe-sans);
	font-size: .62rem;
	font-weight: 600;
	letter-spacing: .12em;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--mve-ink-soft);
}

/* ------------------------------------------------------------- the foot */

.mwfe .mve-foot {
	margin-top: clamp(1.4rem, 3vw, 2.4rem);
	padding-top: 1.3rem;
	border-top: 1px solid var(--mve-rule);
	text-align: center;
}
.mwfe .mve-close {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: .6em;
	margin: 0;
	padding: .7em 1.6em;
	border: 1px solid rgba(103, 30, 38, .55);
	border-radius: 999px;
	background: transparent;
	font-family: var(--mwfe-sans);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .22em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--mwfe-wine);
	cursor: pointer;
	transition: background-color .25s, color .25s, border-color .25s;
}
.mwfe .mve-close:hover,
.mwfe .mve-close:focus,
.mwfe .mve-close:active {
	border-color: var(--mwfe-wine);
}
.mwfe .mve-close:hover {
	background: var(--mwfe-wine);
	color: #f6e3a1;
}

/* ----------------------------------------------- unveiling (js/mwf-frame.js) */

@media (prefers-reduced-motion: no-preference) {
	.mwfe .mve.is-opening .mve-frame { animation: mve-hang .95s cubic-bezier(.2, .75, .25, 1) both; }
	.mwfe .mve.is-opening .mve-canvas > * { animation: mve-ink .9s .35s ease-out both; }
	.mwfe .mve.is-opening .mve-canvas > .mve-list { animation-delay: .5s; }
	.mwfe .mve.is-opening .mve-frame::after { animation: mve-glint 1.9s .55s cubic-bezier(.35, .1, .25, 1) both; }
}
@keyframes mve-hang {
	from { opacity: 0; transform: translateY(2.2rem) scale(.975); }
	to   { opacity: 1; transform: none; }
}
@keyframes mve-ink {
	from { opacity: 0; transform: translateY(.6rem); }
	to   { opacity: 1; transform: none; }
}
@keyframes mve-glint {
	0%   { opacity: 0; transform: translateX(0) skewX(-14deg); }
	12%  { opacity: 1; }
	88%  { opacity: 1; }
	100% { opacity: 0; transform: translateX(420%) skewX(-14deg); }
}

/* --------------------------------------------------------------- phones */

@media (max-width: 700px) {
	/* a little of the page gutter goes to the picture */
	.mwfe .mve-frame { --mve-mold: .8rem; margin-inline: calc(var(--mwfe-gutter) * -.5); }
	.mwfe .mve-liner { padding: .45rem; }
	.mwfe .mve-canvas { padding: 1.6rem 1.05rem 1.4rem; }
	.mwfe .mve-index { font-size: 1rem; }
	.mwfe .mve-wine { font-size: .94rem; }
	.mwfe .mve-counts { letter-spacing: .14em; }
	.mwfe .mve-counts::before,
	.mwfe .mve-counts::after { display: none; }
}

/* without scripting there is no button to press: the list is simply open */
@media (scripting: none) {
	.mwfe .mve[hidden] { display: block; }
	.mwfe .mve-toggle,
	.mwfe .mve-close { display: none; }
}
