/* Site header */
:root,
html[data-theme="dark"] {
	--swd-bg-main: #0b0d0e;
	--swd-bg-header: #0b0d0e;
	--swd-bg-surface: #14191d;
	--swd-bg-hover: #1c2329;
	--swd-text-primary: #f3efe2;
	--swd-text-secondary: #c7c2b3;
	--swd-text-muted: #a9a496;
	--swd-accent: #56c2f5;
	--swd-accent-text: #0b0d0e;
	--swd-border: rgba(243, 239, 226, 0.14);
}

html[data-theme="light"] {
	--swd-bg-main: #ffffff;
	--swd-bg-header: #ffffff;
	--swd-bg-surface: #f4f6f8;
	--swd-bg-hover: #e9eef3;
	--swd-text-primary: #111518;
	--swd-text-secondary: #374151;
	--swd-text-muted: #5b6573;
	--swd-accent: #0284c7;
	--swd-accent-text: #ffffff;
	--swd-border: rgba(17, 21, 24, 0.14);
}

html,
body {
	background-color: var(--swd-bg-main);
	color: var(--swd-text-primary);
	overflow-x: clip;
}

html[data-theme="light"] .swd-front-wrap,
html[data-theme="light"] .swd-hero-banner,
html[data-theme="light"] .swd-search-wrap,
html[data-theme="light"] .swd-search-banner,
html[data-theme="light"] .swd-licence-wrap {
	background: var(--swd-bg-main) !important;
	color: var(--swd-text-primary) !important;
}

html[data-theme="light"] .swd-video-card,
html[data-theme="light"] .swd-empty-state,
html[data-theme="light"] .swd-licence-box,
html[data-theme="light"] .swd-pagination .page-numbers {
	background: var(--swd-bg-surface) !important;
	border-color: var(--swd-border) !important;
	color: var(--swd-text-primary) !important;
}

html[data-theme="light"] .swd-video-thumb,
html[data-theme="light"] .swd-retry-input,
html[data-theme="light"] .swd-field input,
html[data-theme="light"] .swd-field textarea {
	background: #ffffff !important;
	border-color: var(--swd-border) !important;
	color: var(--swd-text-primary) !important;
}

html[data-theme="light"] .swd-hero-title,
html[data-theme="light"] .swd-hero-copy,
html[data-theme="light"] .swd-catalog-heading,
html[data-theme="light"] .swd-video-title a,
html[data-theme="light"] .swd-search-title,
html[data-theme="light"] .swd-licence-title,
html[data-theme="light"] .swd-field label {
	color: var(--swd-text-primary) !important;
}

html[data-theme="light"] .swd-video-excerpt,
html[data-theme="light"] .swd-search-count,
html[data-theme="light"] .swd-video-placeholder {
	color: var(--swd-text-secondary) !important;
}

html[data-theme="light"] .swd-licence-btn,
html[data-theme="light"] .swd-retry-btn,
html[data-theme="light"] .swd-submit-btn {
	background: var(--swd-accent) !important;
	color: var(--swd-accent-text) !important;
}

.swd-site-header {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 990;
	background: var(--swd-bg-header);
	border-bottom: 1px solid var(--swd-border);
	color: var(--swd-text-primary);
}

.swd-header-inner {
	max-width: 1360px;
	margin: 0 auto;
	height: 68px;
	padding: 0 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.swd-header-left {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	flex-shrink: 0;
}

.swd-brand-link {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	text-decoration: none;
	color: var(--swd-text-primary);
	font-weight: 800;
	font-size: 1.15rem;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

.swd-brand-logo-img {
	height: 30px;
	width: auto;
	max-width: 130px;
	object-fit: contain;
	display: block;
	border-radius: 4px;
}

.swd-brand-dot {
	width: 11px;
	height: 11px;
	border-radius: 999px;
	background: var(--swd-accent);
	box-shadow: 0 0 12px rgba(86, 194, 245, 0.65);
	flex-shrink: 0;
}

.swd-brand-sub {
	color: var(--swd-accent);
	font-weight: 700;
}

.swd-header-search {
	flex: 1 1 420px;
	max-width: 580px;
	position: relative;
	display: flex;
	align-items: center;
}

.swd-search-icon {
	position: absolute;
	left: 14px;
	color: var(--swd-text-muted);
	pointer-events: none;
	display: inline-flex;
	align-items: center;
}

.swd-search-input {
	width: 100%;
	height: 42px;
	padding: 0 1rem 0 2.65rem;
	border-radius: 999px;
	border: 1px solid var(--swd-border);
	background: var(--swd-bg-surface);
	color: var(--swd-text-primary);
	font-size: 0.92rem;
	outline: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.swd-search-input::placeholder {
	color: var(--swd-text-muted);
}

.swd-search-input:focus {
	border-color: var(--swd-accent);
	background: var(--swd-bg-hover);
}

.swd-header-right {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-shrink: 0;
}

.swd-login-link {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 0.95rem;
	border-radius: 8px;
	border: 1px solid var(--swd-border);
	background: var(--swd-bg-surface);
	color: var(--swd-text-primary);
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 700;
	white-space: nowrap;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.swd-login-link:hover,
.swd-login-link:focus-visible {
	border-color: var(--swd-accent);
	color: var(--swd-accent);
	background: var(--swd-bg-hover);
	outline: none;
}

.swd-library-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 8px;
	border: 1px solid var(--swd-border);
	background: var(--swd-bg-surface);
	color: var(--swd-text-primary);
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.swd-library-link:hover,
.swd-library-link:focus-visible {
	border-color: var(--swd-accent);
	color: var(--swd-accent);
	background: var(--swd-bg-hover);
	outline: none;
}

.swd-account-menu {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.swd-avatar-badge {
	width: 38px;
	height: 38px;
	border-radius: 8px;
	background: var(--swd-bg-surface);
	border: 1px solid var(--swd-border);
	color: var(--swd-accent);
	font-weight: 800;
	font-size: 0.95rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.swd-avatar-badge:hover,
.swd-avatar-badge:focus-visible,
.swd-avatar-badge[aria-expanded="true"] {
	border-color: var(--swd-accent);
	background: var(--swd-bg-hover);
	outline: none;
}

.swd-account-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 190px;
	background: var(--swd-bg-surface);
	border: 1px solid var(--swd-border);
	border-radius: 10px;
	padding: 0.4rem;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
	z-index: 1000;
}

.swd-account-dropdown.is-open {
	display: block;
}

.swd-account-dropdown-header {
	padding: 0.45rem 0.65rem;
	border-bottom: 1px solid var(--swd-border);
	margin-bottom: 0.3rem;
	font-size: 0.78rem;
	color: var(--swd-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.swd-account-dropdown a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.65rem;
	border-radius: 7px;
	color: var(--swd-text-primary);
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.swd-account-dropdown a:hover,
.swd-account-dropdown a:focus-visible {
	background: var(--swd-bg-hover);
	color: var(--swd-accent);
	outline: none;
}

.swd-account-dropdown .swd-signout-link {
	border-top: 1px solid var(--swd-border);
	margin-top: 0.3rem;
	padding-top: 0.65rem;
	border-radius: 0 0 7px 7px;
}

.swd-upload-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	height: 40px;
	padding: 0 1rem;
	border-radius: 8px;
	background: var(--swd-accent);
	color: var(--swd-accent-text) !important;
	font-weight: 800;
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease, transform 0.15s ease;
}

.swd-upload-cta:hover {
	filter: brightness(1.06);
}

@media (max-width: 760px) {
	.swd-header-inner {
		height: auto;
		min-height: 64px;
		padding: 0.65rem 0.9rem;
		flex-wrap: wrap;
	}
	.swd-header-search {
		order: 3;
		flex: 1 1 100%;
		max-width: 100%;
	}
	.swd-upload-cta span {
		display: none;
	}
	.swd-upload-cta {
		padding: 0 0.7rem;
	}
}

/* Phones: logo, name and all the buttons stay on ONE line; the search box sits on its own line below. */
@media (max-width: 760px) {
	/* A two-column grid (name | buttons, then search across both) lays out the same in every browser, including iPhone Safari. */
	.swd-header-inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "left right" "search search";
		align-items: center;
		gap: 0.55rem 0.5rem;
	}
	.swd-header-left {
		grid-area: left;
		min-width: 0;
		overflow: hidden;
	}
	.swd-header-right {
		grid-area: right;
		display: flex;
		flex-wrap: nowrap;
		gap: 0.3rem;
		white-space: nowrap;
	}
	.swd-header-search {
		grid-area: search;
		width: 100%;
		min-width: 0;
	}
	.swd-brand-link {
		min-width: 0;
		gap: 0.45rem;
		font-size: 1rem;
	}
	.swd-brand-link > span {
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.swd-brand-logo-img {
		flex: none;
	}
	.swd-library-link,
	.swd-avatar-badge {
		width: 34px;
		height: 34px;
		flex: none;
	}
	.swd-login-link {
		height: 34px;
		padding: 0 0.6rem;
		font-size: 0.82rem;
	}
	.swd-upload-cta {
		height: 34px;
		padding: 0 0.6rem;
		flex: none;
	}
}

/* Very narrow phones: keep the logo, drop the written name so nothing has to wrap. */
@media (max-width: 359px) {
	.swd-brand-link > span {
		display: none;
	}
}

/* Site footer */
.swd-site-footer {
	background: #0b0d0e;
	border-top: 1px solid rgba(243, 239, 226, 0.14);
	color: #c7c2b3;
	margin-top: 3rem;
	font-family: inherit;
}

.swd-footer-inner {
	max-width: 1360px;
	margin: 0 auto;
	padding: 3rem 1.25rem 2.25rem;
	display: grid;
	grid-template-columns: minmax(220px, 1.15fr) minmax(160px, 0.9fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(220px, 1.15fr);
	gap: 2rem;
}

.swd-footer-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
	color: #f3efe2;
	font-weight: 800;
	font-size: 1.2rem;
	letter-spacing: -0.02em;
	margin-bottom: 0.85rem;
	white-space: nowrap;
	transition: opacity 0.15s ease;
}

.swd-footer-brand:hover,
.swd-footer-brand:focus-visible {
	opacity: 0.92;
	outline: none;
}

.swd-footer-brand:hover .swd-footer-brand-label,
.swd-footer-brand:focus-visible .swd-footer-brand-label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swd-footer-brand-img {
	height: 32px;
	width: auto;
	max-width: 130px;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
	border-radius: 4px;
}

.swd-footer-brand-label {
	display: inline-block;
}

.swd-footer-brand-accent {
	color: #56c2f5;
}

.swd-footer-copy {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.6;
	color: #c7c2b3;
	max-width: 38ch;
}

.swd-footer-heading {
	margin: 0 0 0.9rem;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: #f3efe2;
}

.swd-footer-social-btns,
.swd-footer-policy-btns {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.swd-footer-policy-btns {
	margin: 0 0 0.75rem;
}

.swd-footer-icon-btn {
	width: 38px;
	height: 38px;
	border-radius: 8px;
	background: #14191d;
	border: 1px solid rgba(243, 239, 226, 0.14);
	color: #56c2f5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.swd-footer-icon-btn:hover,
.swd-footer-icon-btn:focus-visible {
	border-color: #56c2f5;
	background: #1c2329;
	color: #f3efe2;
	outline: none;
}

.swd-footer-rights-copy {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: #c7c2b3;
}

.swd-footer-info-text {
	margin: 0 0 0.55rem;
	font-size: 0.86rem;
	line-height: 1.55;
	color: #c7c2b3;
}

.swd-footer-inline-link {
	color: #56c2f5;
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 600;
}

.swd-footer-inline-link:hover,
.swd-footer-inline-link:focus-visible {
	opacity: 0.85;
	outline: none;
}

.swd-footer-bottom {
	border-top: 1px solid rgba(243, 239, 226, 0.14);
	background: #14191d;
}

.swd-footer-bottom-inner {
	max-width: 1360px;
	margin: 0 auto;
	padding: 1rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.7rem;
	text-align: center;
	font-size: 0.84rem;
	color: #a9a496;
}

.swd-footer-install {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 40px;
	padding: 0 1rem;
	border: 1px solid rgba(243, 239, 226, 0.25);
	border-radius: 999px;
	background: transparent;
	color: #f3efe2;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}
.swd-footer-install:hover,
.swd-footer-install:focus-visible {
	border-color: #6fbcf0;
	color: #6fbcf0;
}
.swd-footer-install[hidden] {
	display: none;
}

.swd-footer-copyright-line {
	margin: 0;
	line-height: 1.55;
	text-align: center;
	color: #a9a496;
}

@media (max-width: 1180px) {
	.swd-footer-inner {
		grid-template-columns: repeat(3, minmax(210px, 1fr));
	}
}

@media (max-width: 760px) {
	.swd-footer-inner {
		grid-template-columns: repeat(2, minmax(180px, 1fr));
	}
}

@media (max-width: 540px) {
	.swd-footer-inner {
		grid-template-columns: 1fr;
		padding: 2.25rem 1rem 1.75rem;
		gap: 1.75rem;
	}
}

/* Header shortlist count */
.swd-shortlist-link {
	position: relative;
}
.swd-shortlist-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--swd-accent);
	color: var(--swd-accent-text, #0b0d0e);
	font-size: 0.7rem;
	font-weight: 800;
	line-height: 18px;
	text-align: center;
	box-sizing: border-box;
}
.swd-shortlist-count[hidden] {
	display: none;
}

/* Header icon tooltips (instant, styled; replaces the slow browser tooltip) */
.swd-library-link,
.swd-avatar-badge {
	position: relative;
}
.swd-library-link[data-tooltip]::after,
.swd-avatar-badge[data-tooltip]::after {
	content: attr(data-tooltip);
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	padding: 0.35rem 0.6rem;
	border-radius: 6px;
	background: #1d252b;
	border: 1px solid var(--swd-border);
	color: #ffffff;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
}
/* Last icon sits at the screen edge: anchor its tooltip to the right so it is never clipped */
.swd-avatar-badge[data-tooltip]::after {
	left: auto;
	right: 0;
	transform: none;
}
.swd-library-link[data-tooltip]:hover::after,
.swd-library-link[data-tooltip]:focus-visible::after,
.swd-avatar-badge[data-tooltip]:hover::after,
.swd-avatar-badge[data-tooltip]:focus-visible::after {
	opacity: 1;
	visibility: visible;
}
.swd-avatar-badge[aria-expanded="true"]::after {
	display: none;
}

/* Verified tick beside a contributor or partner name */
.swd-verified {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	margin-left: 0.3rem;
	line-height: 1;
}
.swd-verified svg {
	display: block;
}

/* Pop-up window for Privacy and Cookies */
.swd-popup {
	width: min(860px, calc(100vw - 2rem));
	height: min(80vh, 760px);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--bg-main);
	color: var(--text-primary);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
	overflow: hidden;
}
.swd-popup[open] {
	display: flex;
	flex-direction: column;
}
.swd-popup::backdrop {
	background: rgba(0, 0, 0, 0.65);
}
.swd-popup__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.7rem 1rem;
	border-bottom: 1px solid var(--border);
	background: var(--bg-card);
}
.swd-popup__title {
	margin: 0;
	font-size: 1.05rem;
}
.swd-popup__close {
	width: 40px;
	height: 40px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: transparent;
	color: var(--text-primary);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.swd-popup__close:hover,
.swd-popup__close:focus-visible {
	border-color: var(--accent);
	color: var(--accent);
}
.swd-popup__frame {
	flex: 1 1 auto;
	width: 100%;
	border: 0;
	background: var(--bg-main);
}
html.swd-popup-open {
	overflow: hidden;
}
@media (max-width: 640px) {
	.swd-popup {
		width: 100vw;
		height: 100dvh;
		max-width: 100vw;
		max-height: 100dvh;
		border-radius: 0;
	}
}
