/*
Theme Name: 10L
Theme URI: https://www.10l.ch
Author: Jonas Schwarz
Author URI: https://www.10l.ch
Description: Thème de 10L (« dix-l », comme deals) : les bons plans de Suisse, votés par la communauté. Thème enfant de Twenty Twenty-Five, à utiliser avec l’extension 10L Deals.
Template: twentytwentyfive
Version: 1.2.0
Requires at least: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dixl
*/

/* ---------- Dark mode: follow the visitor's system setting ---------- */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--base: #15121b;
		--wp--preset--color--surface: #1f1b27;
		--wp--preset--color--contrast: #f4efe8;
		--wp--preset--color--hot: #ff6a3d;
		--wp--preset--color--good: #3ccb85;
		--wp--preset--color--muted: #a59faf;
		--wp--preset--color--line: #2e2938;
		--wp--preset--color--accent-5: #241f2d;
		--wp--preset--color--accent-6: #2e2938;
		color-scheme: dark;
	}
}

:root {
	--dixl-radius: var(--wp--custom--radius--card, 16px);
	--dixl-shadow: var(--wp--custom--shadow--card);
}

body { -webkit-font-smoothing: antialiased; }
::selection { background: var(--wp--preset--color--sun); color: #1a1523; }

/* ---------- Header ---------- */
.dixl-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--wp--preset--color--base) 86%, transparent);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .dixl-header { top: var(--wp-admin--admin-bar--height, 32px); }
.dixl-logo { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.dixl-logo svg { width: 78px; height: auto; display: block; transition: transform 0.2s; }
.dixl-logo:hover svg { transform: rotate(-6deg); }
.dixl-logo__tagline { font-size: 0.8rem; line-height: 1.2; color: var(--wp--preset--color--muted); max-width: 11rem; }
@media (max-width: 1100px) { .dixl-logo__tagline { display: none; } }
.dixl-header .wp-block-navigation__container,
.dixl-header .wp-block-navigation-item__content { flex-wrap: nowrap; white-space: nowrap; }
.dixl-header .wp-block-navigation { gap: 1rem; }
.dixl-header .wp-block-loginout a { font-size: 0.875rem; font-weight: 650; text-decoration: none; }
.dixl-header .wp-block-button__link { padding: 0.5rem 1rem; font-size: 0.875rem; }
.dixl-submit-btn .wp-block-button__link { white-space: nowrap; }
@media (max-width: 600px) {
	.dixl-header .wp-block-loginout { display: none; }
	.dixl-submit-btn .wp-block-button__link { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
}
/* Search: a quiet icon, not a second call-to-action. */
.dixl-header .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.45rem;
	width: 2.4rem;
	height: 2.4rem;
}
.dixl-header .wp-block-search__button:hover { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--hot); }
.dixl-header .wp-block-search__button svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }

/* ---------- Hero ---------- */
.dixl-hero h1 { max-width: 24ch; }
.dixl-hero mark { background: linear-gradient(transparent 58%, var(--wp--preset--color--sun) 58%); color: inherit; padding: 0 0.05em; }
@media (prefers-color-scheme: dark) {
	.dixl-hero mark { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--wp--preset--color--hot) 55%, transparent) 62%); }
}
.dixl-hero__stats { color: var(--wp--preset--color--muted); }

/* ---------- Sort tabs ---------- */
.dixl-tabs { gap: 0.4rem !important; }
.dixl-tabs p { margin: 0; }
.dixl-tabs a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
}
.dixl-tabs a:hover { border-color: var(--wp--preset--color--contrast); color: inherit; }
.dixl-tabs a.is-active { background: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

/* ---------- Deal cards ---------- */
.dixl-grid { gap: 1.25rem !important; }
.deal-card {
	position: relative;
	height: 100%;
	gap: 0 !important;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--dixl-radius);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--dixl-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.deal-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(26, 21, 35, 0.06), 0 16px 32px -14px rgba(26, 21, 35, 0.3); }
.deal-card__media { position: relative; width: 100%; margin: 0 !important; background: #fff; }
.deal-card__media .wp-block-post-featured-image { margin: 0; }
.deal-card__media img { padding: 0.75rem; box-sizing: border-box; }
.deal-card__badges { position: absolute; top: 0.6rem; left: 0.6rem; right: 0.6rem; margin: 0 !important; z-index: 2; }
/* Deals without a picture: a soft tag-coloured block keeps the grid even. */
.deal-card__media:not(:has(img)) { aspect-ratio: 4 / 3; background: linear-gradient(135deg, color-mix(in srgb, var(--wp--preset--color--hot) 14%, var(--wp--preset--color--surface)), var(--wp--preset--color--accent-5)); }
.deal-card__media:not(:has(img))::after { content: "10L"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 2.5rem; letter-spacing: -0.04em; color: color-mix(in srgb, var(--wp--preset--color--hot) 35%, transparent); }
.deal-card__body { flex: 1; width: 100%; box-sizing: border-box; padding: 0.9rem 1rem 1rem; gap: 0.45rem !important; }
.deal-card__title { margin: 0; font-size: 1.02rem !important; line-height: 1.3; letter-spacing: -0.01em; }
.deal-card__title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Whole card is clickable; the vote and deal button stay on top. */
.deal-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.deal-card__foot { margin-top: auto !important; padding-top: 0.4rem; position: relative; z-index: 3; }
.deal-card__foot .tenl-cta.wp-element-button { padding: 0.45rem 0.95rem; font-size: 0.875rem; }
.deal-card .tenl-badges, .deal-card .tenl-meta a { position: relative; z-index: 3; }

/* Hot deals glow a little; finished ones fade. */
.deal-card:has(.tenl-heat--top) { border-color: #ffb000; box-shadow: 0 0 0 1px #ffb000, 0 12px 30px -14px rgba(232, 64, 28, 0.55); }
.deal-card:has(.tenl-heat--hot) { border-color: color-mix(in srgb, var(--wp--preset--color--hot) 45%, var(--wp--preset--color--line)); }
.deal-card:has(.tenl-badge--expired) { opacity: 0.62; filter: grayscale(0.7); }
.deal-card:has(.tenl-badge--expired):hover { opacity: 0.9; filter: none; }

/* ---------- Single deal ---------- */
.dixl-deal__top { gap: 2.5rem !important; }
.dixl-deal__image { margin: 0; background: #fff; border-radius: var(--dixl-radius); border: 1px solid var(--wp--preset--color--line); overflow: hidden; }
.dixl-deal__image img { padding: 1.25rem; box-sizing: border-box; }
.dixl-deal__panel { position: sticky; top: 6rem; align-self: flex-start; }
.dixl-deal__vote {
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--radius--small, 10px);
	background: var(--wp--preset--color--accent-5);
	justify-content: space-between;
}
.dixl-deal__vote p { margin: 0; }
.dixl-deal__by { color: var(--wp--preset--color--muted); }
.dixl-deal__by { gap: 0.3em !important; }
.dixl-deal__by > * { margin: 0 !important; }
.dixl-deal__by .wp-block-post-date::before { content: "· "; }
.dixl-deal .wp-block-post-content { font-size: 1.0625rem; }
.dixl-deal .wp-block-post-content h2 { font-size: var(--wp--preset--font-size--large); margin-top: 2rem; }
@media (max-width: 781px) { .dixl-deal__panel { position: static; } }

/* ---------- Footer ---------- */
.dixl-footer { background: #1a1523; color: #f4efe8; }
.dixl-footer a { color: inherit; }
.dixl-footer a:hover { color: #ffc83d; }
.dixl-footer .dixl-logo svg { width: 96px; }
.dixl-footer__small { color: #a59faf; }
.dixl-footer .dixl-say { font-style: italic; }

/* ---------- Misc ---------- */
.wp-block-query-pagination a, .wp-block-query-pagination .current {
	display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 0.6rem;
	border-radius: 999px; text-decoration: none;
}
.wp-block-query-pagination .current { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.wp-block-query-pagination a:hover { background: var(--wp--preset--color--line); color: inherit; }
.dixl-empty { padding: 3rem 1rem; text-align: center; border: 2px dashed var(--wp--preset--color--line); border-radius: var(--dixl-radius); }

/* ---------- About page ---------- */
.dixl-about h1 { max-width: 20ch; }
.dixl-about mark { background: linear-gradient(transparent 58%, var(--wp--preset--color--sun) 58%); color: inherit; }
@media (prefers-color-scheme: dark) {
	.dixl-about mark { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--wp--preset--color--hot) 55%, transparent) 62%); }
}
.dixl-kicker { margin: 0; color: var(--wp--preset--color--hot); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.dixl-steps { gap: 1.25rem !important; }
.dixl-step {
	padding: 1.5rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--dixl-radius);
	background: var(--wp--preset--color--surface);
	box-shadow: var(--dixl-shadow);
}
.dixl-step h3 { margin-top: 0.5rem; }
.dixl-step__num {
	display: grid;
	place-items: center;
	width: 2.6rem;
	height: 2.6rem;
	margin: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--hot);
	color: #fff;
	font-weight: 800;
	font-size: 1.2rem;
}
.dixl-about-cols { gap: 2.5rem !important; }
.dixl-checks { list-style: none; padding-left: 0; }
.dixl-checks li { position: relative; padding-left: 1.8rem; margin-bottom: 0.8rem; }
.dixl-checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--wp--preset--color--good); font-weight: 800; }
.dixl-rules { padding: 1.5rem 1.75rem; border-radius: var(--dixl-radius); background: var(--wp--preset--color--accent-5); }
.dixl-rules h2 { margin-top: 0; }
.dixl-rules li { margin-bottom: 0.5rem; }
.dixl-about-cta { padding: 2.5rem 1.5rem; border-radius: var(--dixl-radius); border: 2px dashed var(--wp--preset--color--line); }
.dixl-about-cta h2 { margin-top: 0; }
.is-style-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--contrast); border: 2px solid currentColor; }
.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

@media (prefers-reduced-motion: reduce) {
	.deal-card, .dixl-logo svg { transition: none; }
	.deal-card:hover { transform: none; }
}

/* À propos : « Pourquoi 10L ? » */
.dixl-why { gap: 2.5rem !important; align-items: flex-start; }
.dixl-why > .wp-block-column:last-child {
	background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line);
	border-radius: 1.25rem; padding: 1.25rem 1.5rem;
}
.dixl-lexicon { list-style: none; padding-left: 0; margin: 0; }
.dixl-lexicon li { padding: 0.45rem 0; border-bottom: 1px dashed var(--wp--preset--color--line); }
.dixl-lexicon li:last-child { border-bottom: 0; }

/* Partage, page d’un 10L */
.dixl-deal__panel .tenl-share { margin-top: 0.25rem; }

/* Footer newsletter */
.dixl-footer__news { margin-top: 1.25rem; max-width: 26rem; }
.dixl-deal__panel .tenl-report { margin-top: 0.25rem; }
