/**
 * Thrift Weekly Community — homepage blocks.
 *
 * Structure and spacing only. Every colour is one of the runtime tokens the
 * plugin already emits from Finds → Settings → Appearance, so changing the
 * palette there changes the homepage with it, and nothing here has to be
 * edited to re-skin the site.
 *
 * Section chrome — background, outer padding, headings, the gap between one
 * section and the next — is deliberately absent. That belongs to the
 * Elementor container the shortcode sits in, styled from the normal panels.
 */

/* ==========================================================================
   Shared
   ========================================================================== */

.twc-thumb-placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	background:
		linear-gradient(
			135deg,
			color-mix(in srgb, var(--twc-ink) 8%, var(--twc-white)),
			color-mix(in srgb, var(--twc-ink) 14%, var(--twc-white))
		);
}

.twc-empty-note {
	margin: 0;
	padding: var(--twc-space-4);
	border: 1px dashed var(--twc-gray-border);
	border-radius: var(--twc-radius-btn, var(--twc-radius));
	background: var(--twc-gray-light);
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-small);
	line-height: var(--twc-lh-small);
	color: var(--twc-ink-subtle);
}

.twc-metalink {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-meta);
	line-height: var(--twc-lh-meta);
	color: var(--twc-ink-muted);
	text-decoration: none;
	transition: var(--twc-transition);
}

.twc-metalink:hover,
.twc-metalink:focus-visible {
	color: var(--twc-cyan);
}

.twc-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: transparent;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-pill);
	line-height: var(--twc-lh-pill);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink-muted);
	text-decoration: none;
	transition: var(--twc-transition);
}

.twc-chip:hover,
.twc-chip:focus-visible {
	border-color: var(--twc-cyan);
	color: var(--twc-cyan);
}

/* ==========================================================================
   Hero — [tw_hero]
   ========================================================================== */

.twc-hero {
	position: relative;
}

.twc-hero__swiper {
	overflow: hidden;
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
}

.twc-hero__slide {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	align-items: stretch;
	background: var(--twc-white);
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
	overflow: hidden;
}

.twc-hero__media {
	display: block;
	position: relative;
	min-height: 260px;
	background: var(--twc-gray-light);
}

.twc-hero__media img,
.twc-hero__media .twc-thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	aspect-ratio: auto;
}

.twc-hero__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--twc-space-3);
	padding: var(--twc-space-6);
	min-width: 0;
}

.twc-hero__eyebrow {
	align-self: flex-start;
	padding: 4px 10px;
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: var(--twc-gold-tint);
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-pill);
	line-height: var(--twc-lh-pill);
	font-weight: var(--twc-fw-semi);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--twc-ink);
}

.twc-hero__title {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-hero);
	line-height: var(--twc-lh-hero);
	font-weight: var(--twc-fw-bold);
	color: var(--twc-ink);
}

.twc-hero__title a {
	color: inherit;
	text-decoration: none;
}

.twc-hero__title a:hover,
.twc-hero__title a:focus-visible {
	color: var(--twc-brand);
}

.twc-hero__excerpt {
	margin: 0;
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-body);
	line-height: var(--twc-lh-body);
	color: var(--twc-ink-muted);
}

.twc-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--twc-space-3);
	margin-top: var(--twc-space-2);
}

/* No Swiper: stack the slides instead of clipping everything but the first. */
.twc-hero--static .twc-hero__swiper {
	overflow: visible;
}

.twc-hero--static .swiper-wrapper {
	display: grid;
	gap: var(--twc-space-5);
}

.twc-hero--static .twc-hero__nav,
.twc-hero--static .twc-hero__dots {
	display: none;
}

.twc-hero__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-btn, var(--twc-radius));
	background: var(--twc-white);
	color: var(--twc-ink);
	cursor: pointer;
	transition: var(--twc-transition);
}

.twc-hero__nav:hover {
	border-color: var(--twc-brand);
	color: var(--twc-brand);
}

.twc-hero__nav--prev {
	left: var(--twc-space-3);
}

.twc-hero__nav--next {
	right: var(--twc-space-3);
}

.twc-hero__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: var(--twc-space-4);
}

.twc-hero__dots .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--twc-gray-border);
	opacity: 1;
	cursor: pointer;
	transition: var(--twc-transition);
}

.twc-hero__dots .swiper-pagination-bullet-active {
	width: 22px;
	border-radius: 4px;
	background: var(--twc-brand);
}

/* ==========================================================================
   Category strip — [tw_category_strip]
   ========================================================================== */

.twc-catstrip__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--twc-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.twc-catstrip__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: var(--twc-white);
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-nav);
	line-height: var(--twc-lh-nav);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink);
	text-decoration: none;
	transition: var(--twc-transition);
}

.twc-catstrip__link:hover,
.twc-catstrip__link:focus-visible {
	border-color: var(--twc-brand);
	color: var(--twc-brand);
}

.twc-catstrip__count {
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-meta);
	font-weight: var(--twc-fw-regular);
	color: var(--twc-ink-subtle);
}

/* ==========================================================================
   Find grid — [tw_finds_grid]
   ========================================================================== */

.twc-grid {
	display: grid;
	gap: var(--twc-space-5);
}

.twc-grid--1 { grid-template-columns: minmax(0, 1fr); }
.twc-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.twc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.twc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.twc-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.twc-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.twc-grid__more {
	margin: var(--twc-space-5) 0 0;
	text-align: center;
}

.twc-tile {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
	background: var(--twc-white);
	overflow: hidden;
	transition: var(--twc-transition);
}

.twc-tile:hover {
	border-color: color-mix(in srgb, var(--twc-brand) 45%, var(--twc-gray-border));
}

.twc-tile__media {
	display: block;
	position: relative;
	background: var(--twc-gray-light);
}

.twc-tile__media img,
.twc-tile__media .twc-thumb-placeholder {
	display: block;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.twc-tile__flag {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 8px;
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: var(--twc-gold);
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-pill);
	line-height: var(--twc-lh-pill);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink);
}

.twc-tile__body {
	display: flex;
	flex-direction: column;
	gap: var(--twc-space-2);
	padding: var(--twc-space-4);
	min-width: 0;
}

.twc-tile__cat {
	align-self: flex-start;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-pill);
	line-height: var(--twc-lh-pill);
	font-weight: var(--twc-fw-semi);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--twc-cyan);
	text-decoration: none;
}

.twc-tile__title {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-card);
	line-height: var(--twc-lh-card);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink);
}

.twc-tile__title a {
	color: inherit;
	text-decoration: none;
}

.twc-tile__title a:hover,
.twc-tile__title a:focus-visible {
	color: var(--twc-brand);
}

.twc-tile__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--twc-space-3);
	margin-top: auto;
	padding-top: var(--twc-space-2);
}

/* ==========================================================================
   Find of the Week — [tw_find_of_week]
   ========================================================================== */

.twc-fotw {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
	background: var(--twc-white);
	overflow: hidden;
}

.twc-fotw__media {
	display: block;
	min-height: 280px;
	background: var(--twc-gray-light);
}

.twc-fotw__media img,
.twc-fotw__media .twc-thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	aspect-ratio: auto;
}

.twc-fotw__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--twc-space-3);
	padding: var(--twc-space-6);
	min-width: 0;
}

.twc-fotw__eyebrow {
	align-self: flex-start;
	padding: 4px 10px;
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: var(--twc-gold);
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-pill);
	line-height: var(--twc-lh-pill);
	font-weight: var(--twc-fw-semi);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--twc-ink);
}

.twc-fotw__title {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-title);
	line-height: var(--twc-lh-title);
	font-weight: var(--twc-fw-bold);
	color: var(--twc-ink);
}

.twc-fotw__title a {
	color: inherit;
	text-decoration: none;
}

.twc-fotw__title a:hover,
.twc-fotw__title a:focus-visible {
	color: var(--twc-brand);
}

.twc-fotw__prize {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-meta);
	line-height: var(--twc-lh-meta);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-gold);
}

.twc-fotw__excerpt {
	margin: 0;
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-body);
	line-height: var(--twc-lh-body);
	color: var(--twc-ink-muted);
}

.twc-fotw__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--twc-space-3);
}

.twc-fotw__cta {
	margin: var(--twc-space-2) 0 0;
}

/* ==========================================================================
   Notification bell — [tw_notification_bell]
   ========================================================================== */

.twc-bell {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--twc-radius-btn, var(--twc-radius));
	color: var(--twc-ink);
	text-decoration: none;
	transition: var(--twc-transition);
}

.twc-bell:hover,
.twc-bell:focus-visible {
	background: var(--twc-gray-light);
	color: var(--twc-brand);
}

.twc-bell__badge {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--twc-orange);
	font-family: var(--twc-font-display);
	font-size: 11px;
	line-height: 17px;
	font-weight: var(--twc-fw-semi);
	text-align: center;
	color: var(--twc-on-action, var(--twc-white));
}

/* ==========================================================================
   Link card — [tw_link_card]
   ========================================================================== */

.twc-linkcard {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--twc-space-3);
	height: 100%;
	padding: var(--twc-space-5);
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
	background: var(--twc-white);
	transition: var(--twc-transition);
}

.twc-linkcard:hover {
	border-color: color-mix(in srgb, var(--twc-cyan) 45%, var(--twc-gray-border));
}

.twc-linkcard__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: var(--twc-radius-chip, var(--twc-radius-sm));
	background: var(--twc-cyan-tint, var(--twc-gray-light));
	color: var(--twc-cyan);
}

.twc-linkcard__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.twc-linkcard__title {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-card);
	line-height: var(--twc-lh-card);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink);
}

.twc-linkcard__text {
	margin: 0;
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-small);
	line-height: var(--twc-lh-small);
	color: var(--twc-ink-muted);
}

.twc-linkcard__cta {
	margin-top: auto;
}

/* ==========================================================================
   Newsletter — [tw_newsletter]
   ========================================================================== */

.twc-newsletter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--twc-space-5);
	padding: var(--twc-space-6);
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-card, var(--twc-radius-lg));
	background: var(--twc-white);
}

.twc-newsletter__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	flex: 1 1 260px;
}

.twc-newsletter__title {
	margin: 0;
	font-family: var(--twc-font-display);
	font-size: var(--twc-fs-section);
	line-height: var(--twc-lh-section);
	font-weight: var(--twc-fw-semi);
	color: var(--twc-ink);
}

.twc-newsletter__text {
	margin: 0;
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-body);
	line-height: var(--twc-lh-body);
	color: var(--twc-ink-muted);
}

.twc-newsletter__form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--twc-space-2);
	margin: 0;
	flex: 1 1 320px;
}

.twc-newsletter__input {
	flex: 1 1 180px;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--twc-gray-border);
	border-radius: var(--twc-radius-btn, var(--twc-radius));
	background: var(--twc-white);
	font-family: var(--twc-font-body);
	font-size: var(--twc-fs-body);
	line-height: var(--twc-lh-body);
	color: var(--twc-ink);
}

.twc-newsletter__input:focus {
	outline: none;
	border-color: var(--twc-cyan);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--twc-cyan) 18%, transparent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.twc-grid--4,
	.twc-grid--5,
	.twc-grid--6 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 880px) {
	.twc-hero__slide,
	.twc-fotw {
		grid-template-columns: minmax(0, 1fr);
	}

	.twc-hero__media,
	.twc-fotw__media {
		min-height: 0;
	}

	.twc-hero__media img,
	.twc-fotw__media img {
		aspect-ratio: 16 / 9;
		height: auto;
	}

	.twc-hero__body,
	.twc-fotw__body {
		padding: var(--twc-space-5);
	}

	.twc-hero__nav {
		display: none;
	}

	.twc-grid--3,
	.twc-grid--4,
	.twc-grid--5,
	.twc-grid--6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.twc-grid {
		gap: var(--twc-space-4);
	}

	.twc-grid--2,
	.twc-grid--3,
	.twc-grid--4,
	.twc-grid--5,
	.twc-grid--6 {
		grid-template-columns: minmax(0, 1fr);
	}

	.twc-newsletter {
		padding: var(--twc-space-5);
	}
}

@media (prefers-reduced-motion: reduce) {
	.twc-tile,
	.twc-linkcard,
	.twc-hero__nav,
	.twc-bell,
	.twc-chip,
	.twc-metalink,
	.twc-catstrip__link {
		transition: none;
	}
}
