/**
 * CoinGape-style four-tier site header.
 */

.sn-header {
	--sn-yellow: #f5b800;
	--sn-navy: #003d4c;
	--sn-blue: #0077b6;
	--sn-black: #1a1a1a;
	--sn-green: #00c853;
	--sn-red: #ff5252;
	--sn-lime: #c8f135;
	--sn-live-red: #e53935;
	--sn-buy-green: #1b6b3a;
	--sn-max: 1400px;
	font-family: var(--sn-font);
	line-height: 1.4;
	width: 100%;
}

.sn-header *,
.sn-header *::before,
.sn-header *::after {
	box-sizing: border-box;
}

/* Bootstrap container width tuned to the header design */
.sn-header .container-xxl {
	max-width: var(--sn-max);
	padding-left: 20px;
	padding-right: 20px;
}

.sn-bar__inner {
	max-width: var(--sn-max);
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Tier 1 — Announcement */
.sn-bar--announcement {
	background: var(--sn-yellow);
	min-height: 40px;
}

.sn-bar--announcement .container-xxl {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	padding-top: 8px;
	padding-bottom: 8px;
}

.sn-announcement__text {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #111;
}

.sn-btn--vote {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: #fff;
	color: #111;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	padding: 6px 16px;
	border-radius: 999px;
	border: none;
	letter-spacing: 0.02em;
	white-space: nowrap;
	transition: opacity 0.2s;
}

.sn-btn--vote:hover {
	opacity: 0.9;
	color: #111;
}

.sn-chevron {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	margin-top: 2px;
	opacity: 0.9;
}

.sn-main-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.sn-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	background: transparent;
	color: #fff;
	cursor: pointer;
	border-radius: 4px;
}

.sn-icon-btn:hover {
	background: rgba(255, 255, 255, 0.1);
}

.sn-icon-btn.is-active,
.sn-search-toggle[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.15);
}

.sn-icon-btn svg[hidden] {
	display: none;
}

.sn-btn--ecosystem {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.85);
	font-size: 13px;
	font-weight: 500;
	padding: 7px 14px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
}

.sn-btn--ecosystem:hover {
	background: rgba(255, 255, 255, 0.08);
}

/* Tier 3 — Sub bar */
.sn-bar--sub {
	background: var(--sn-blue);
}

.sn-bar__inner--sub {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 16px;
	min-height: 40px;
	padding-top: 6px;
	padding-bottom: 6px;
	margin-left: auto;
	margin-right: auto;
	max-width: var(--sn-max);
}

.sn-sub-left {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-self: start;
}

.sn-sub-center {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
	justify-self: center;
}

.sn-lang {
	justify-self: end;
}

.sn-trophy {
	font-size: 16px;
	line-height: 1;
}

.sn-sub-link {
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.sn-sub-link:hover {
	text-decoration: underline;
	color: #fff;
}

.sn-badge {
	font-size: 10px;
	font-weight: 800;
	padding: 2px 7px;
	border-radius: 4px;
	line-height: 1.3;
	letter-spacing: 0.03em;
}

.sn-badge--new {
	background: var(--sn-lime);
	color: #111;
}

.sn-badge--live {
	background: var(--sn-live-red);
	color: #fff;
}

.sn-lang {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	border: none;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
	flex-shrink: 0;
}

.sn-lang:hover {
	background: rgba(0, 0, 0, 0.35);
}

/* Tier 4 — Ticker */
.sn-bar--ticker {
	background: var(--sn-black);
}

.sn-bar__inner--ticker {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 44px;
	padding-right: 12px;
	overflow: hidden;
}

.sn-ticker-wrap {
	flex: 1;
	overflow: hidden;
	min-width: 0;
	mask-image: linear-gradient(90deg, transparent, #000 2%, #000 98%, transparent);
}

.sn-ticker-track {
	display: flex;
	width: max-content;
	animation: sn-ticker-scroll 45s linear infinite;
}

.sn-ticker-track:hover {
	animation-play-state: paused;
}

@keyframes sn-ticker-scroll {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-50%);
	}
}

.sn-ticker-items {
	display: flex;
	align-items: center;
	gap: 0;
	flex-shrink: 0;
}

.sn-ticker-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 20px;
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 13px;
	white-space: nowrap;
}

.sn-ticker-item img {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	object-fit: cover;
}

.sn-ticker-item__symbol {
	font-weight: 700;
	color: #fff;
}

.sn-ticker-item__price {
	color: rgba(255, 255, 255, 0.9);
	font-weight: 500;
}

.sn-ticker-item__change {
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.sn-ticker-item__change--up {
	color: var(--sn-green);
}

.sn-ticker-item__change--down {
	color: var(--sn-red);
}

.sn-ticker-item__arrow {
	font-size: 10px;
}

.sn-btn--buy {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--sn-buy-green);
	color: #fff;
	border: none;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-family: inherit;
	flex-shrink: 0;
	letter-spacing: 0.04em;
}

.sn-btn--buy:hover {
	background: #22884a;
}

.sn-chevron--light {
	border-top-color: #fff;
}

/* Tablet — compress sub bar */
@media (max-width: 960px) {
	.sn-sub-center {
		gap: 8px;
	}

	.sn-sub-link {
		font-size: 12px;
	}
}

@media (max-width: 768px) {
	.sn-sub-center {
		display: none;
	}

	.sn-bar__inner--sub {
		display: flex;
		justify-content: space-between;
	}

	.sn-sub-center,
	.sn-lang {
		justify-self: auto;
	}
}

@media (max-width: 600px) {
	.sn-announcement__text {
		font-size: 12px;
		text-align: center;
	}

	.sn-btn--buy {
		padding: 8px 12px;
		font-size: 12px;
	}
}

/* Reset block theme wrapper spacing around custom header */
header.sn-header {
	margin: 0;
	max-width: none !important;
}

.wp-block-html:has(.sn-header) {
	margin: 0 !important;
	max-width: none !important;
	width: 100%;
}

/* Pull header out of constrained layout */
.wp-block-template-part:has(.sn-header),
.wp-block-template-part:has(.sn-header) > *,
.wp-block-html:has(.sn-header) {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body .wp-site-blocks {
	padding-top: 0 !important;
}

.wp-site-blocks > .wp-block-template-part:first-child {
	margin-top: 0 !important;
}

/* Search panel — smooth expand below ticker */
.sn-search-panel {
	background: #2b2b2b;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition:
		max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.35s ease;
}

.sn-header.is-search-open .sn-search-panel {
	max-height: 120px;
	opacity: 1;
}

.sn-search-panel__inner {
	max-width: var(--sn-max);
	margin: 0 auto;
	padding: 20px;
}

.sn-search-form {
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
}

.sn-search-form__input {
	flex: 1;
	min-width: 0;
	background: #3a3a3a;
	border: none;
	border-radius: 4px 0 0 4px;
	color: #fff;
	font-size: 15px;
	font-family: inherit;
	padding: 14px 18px;
	outline: none;
	transition: background 0.2s;
}

.sn-search-form__input::placeholder {
	color: rgba(255, 255, 255, 0.45);
}

.sn-search-form__input:focus {
	background: #444;
}

.sn-search-form__submit {
	flex-shrink: 0;
	background:#0077b6;
	color: #fff;
	border: none;
	font-size: 13px;
	font-weight: 700;
	font-family: inherit;
	padding: 0 28px;
	letter-spacing: 0.06em;
	cursor: pointer;
	border-radius: 0 4px 4px 0;
	transition: background 0.2s;
}

.sn-search-form__submit:hover {
	background: #0088cc;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Light theme — white pattern */
html.sn-theme-light {
	color-scheme: light;
}

html.sn-theme-light body {
	background: #f5f5f5;
	color: #1a1a1a;
}

html.sn-theme-light .wp-site-blocks {
	background: #f5f5f5;
}

html.sn-theme-light .wp-site-blocks main,
html.sn-theme-light .wp-site-blocks main .wp-block-heading,
html.sn-theme-light .wp-site-blocks main a {
	color: #1a1a1a;
}

html.sn-theme-light .sn-header {
	--sn-navy: #ffffff;
	--sn-blue: #e8f4fc;
	--sn-black: #f0f0f0;
}

html.sn-theme-light .sn-bar--announcement {
	background: #ffe566;
}

html.sn-theme-light .sn-bar--sub {
	background: #0077b6;
}

html.sn-theme-light .sn-sub-link,
html.sn-theme-light .sn-lang {
	color: #fff;
}

html.sn-theme-light .sn-bar--ticker {
	background: #fff;
	border-top: 1px solid #e8e8e8;
	border-bottom: 1px solid #e8e8e8;
}

html.sn-theme-light .sn-ticker-item {
	border-right-color: #e0e0e0;
	color: #111;
}

html.sn-theme-light .sn-ticker-item__symbol {
	color: #111;
}

html.sn-theme-light .sn-ticker-item__price {
	color: #444;
}

html.sn-theme-light .sn-ticker-wrap {
	mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

html.sn-theme-light .sn-search-panel {
	background: #fff;
	border-top: 1px solid #e0e0e0;
}

html.sn-theme-light .sn-search-form__input {
	background: #f3f3f3;
	color: #111;
}

html.sn-theme-light .sn-search-form__input::placeholder {
	color: #888;
}

html.sn-theme-light .sn-search-form__input:focus {
	background: #ebebeb;
}

@media (max-width: 600px) {
	.sn-search-panel__inner {
		padding: 14px 16px;
	}

	.sn-search-form {
		flex-direction: column;
	}

	.sn-search-form__input {
		border-radius: 4px 4px 0 0;
	}

	.sn-search-form__submit {
		border-radius: 0 0 4px 4px;
		padding: 12px;
	}

	.sn-header.is-search-open .sn-search-panel {
		max-height: 160px;
	}
}
