/*
 * tt-shop header, announcement bar and footer (Phase 2).
 * Matches design/Main.dc.html and design/Checkout.dc.html.
 */

/* ---------- Announcement bar ---------- */
.tt-announcement-bar {
	background: var(--wp--preset--color--brand-purple);
	color: #fff;
	padding-top: 10px;
	padding-bottom: 10px;
}
.tt-announcement {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.4;
}
.tt-announcement__dot {
	opacity: 0.6;
	padding: 0 10px;
}

/* ---------- Header ---------- */
.tt-header {
	background: var(--wp--preset--color--surface);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.tt-header .tt-header__inner {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	padding: 14px 0; /* L/R gutter comes from the theme's root padding (24px); don't double it. */
	gap: 16px;
}
.tt-header--checkout .tt-header__inner {
	max-width: 1100px;
}

/* Logo + SHOP pill */
.tt-logo {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
}
/* `.tt-logo .tt-logo__img` (0,2,0) beats WooCommerce's `.woocommerce-page img`
 * (0,1,1) which forces `height:auto` on cart/checkout and blows the logo up. */
.tt-logo .tt-logo__img {
	height: 58px;
	width: auto;
	display: block;
}
.tt-logo__pill {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
	font-weight: 900;
	font-size: 11px;
	letter-spacing: 0.08em;
	padding: 2px 5px 0px 5px;
	border-radius: 999px;
}

/* Main nav */
.tt-nav {
	gap: 6px;
}
.tt-nav .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink);
	font-weight: 700;
	text-decoration: none;
	padding: 10px 14px;
	border-radius: 10px;
}
.tt-nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary);
}
.tt-nav .current-menu-item .wp-block-navigation-item__content,
.tt-nav .wp-block-navigation-item.current-menu-item > a {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: 6px;
}

/* Header actions */
.tt-header__actions {
	gap: 10px;
}
.tt-back-to-quizzes {
	margin: 0;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}
.tt-back-to-quizzes a {
	text-decoration: none;
	padding: 10px 12px;
}

/* Cart link pill */
.tt-cart-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 18px;
	border: 2px solid var(--wp--preset--color--brand-purple);
	border-radius: 12px;
	color: var(--wp--preset--color--brand-purple);
	font-weight: 800;
	text-decoration: none;
}
.tt-cart-link:hover {
	color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
}

/* Checkout header */
.tt-secure-checkout {
	margin: 0;
	font-weight: 800;
	color: var(--wp--preset--color--success);
}
.tt-back-to-cart {
	margin: 0;
	font-weight: 800;
}
.tt-back-to-cart a {
	text-decoration: none;
}

/* ---------- Footer ---------- */
.tt-footer {
	background: var(--wp--preset--color--footer);
	color: var(--wp--preset--color--footer-text);
}
.tt-footer a {
	color: var(--wp--preset--color--footer-text);
	text-decoration: none;
}
.tt-footer a:hover {
	text-decoration: underline;
}
.tt-footer__cols {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	padding-top: 48px;
	padding-bottom: 32px;
	gap: 32px;
}
.tt-footer__title {
	font-size: 22px;
	font-weight: 900;
	color: #fff;
	margin: 0;
}
.tt-footer__heading {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 800;
	color: #fff !important;
	margin: 0 0 4px;
}
.tt-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 17px;
}
.tt-footer__email {
	color: var(--wp--preset--color--accent);
	font-weight: 800;
	font-size: 17px;
}
.tt-footer__bottom {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	padding: 18px 0 28px;
	border-top: 1px solid #47406a;
	font-size: 15px;
	gap: 12px;
}
.tt-footer__bottom p {
	margin: 0;
}
.tt-footer__legal {
	gap: 18px;
}

/* ---------- Header responsive: collapse to the hamburger below desktop ----------
 * The full nav + "Back to quizzes" + cart only fit on one row at ~1150px+.
 * Below that the core Navigation block would wrap awkwardly, so we force its
 * mobile overlay early and keep logo + Menu + cart on one row (matches the
 * design's mobile header). */
@media (max-width: 1150px) {
	.tt-back-to-quizzes {
		display: none;
	}
	.tt-header .tt-header__inner {
		flex-wrap: nowrap;
		gap: 12px;
	}
	/* Show the hamburger toggle and hide the inline menu until opened. Size the
	 * toggle to match the 48px cart pill so they sit level on the row. */
	.tt-nav .wp-block-navigation__responsive-container-open {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 48px;
		min-width: 48px;
	}
	.tt-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}
	/* Push the nav toggle next to the cart on the right and centre it vertically. */
	.tt-header__inner > .tt-nav {
		margin-left: auto;
		display: flex;
		align-items: center;
	}
	.tt-header__actions {
		align-items: center;
	}
}

/* ---------- Mobile menu overlay (open state) ----------
 * Core Navigation ships the overlay unstyled; give it padding, bold/large
 * links in the ink colour, and a divider between each item. */
.tt-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--surface);
	padding: 24px 20px;
}
.tt-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	width: 100%;
}
.tt-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0;
	width: 100%;
}
.tt-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.tt-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:last-child {
	border-bottom: 0;
}
.tt-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 16px 4px;
	font-size: 20px;
	font-weight: 800;
	color: var(--wp--preset--color--ink);
}

/* ---------- Phone: tighten the header so logo + hamburger + cart fit snugly ---------- */
@media (max-width: 781px) {
	.tt-header.alignfull {           /* beats .has-global-padding (root 24px) */
		padding-left: 16px;
		padding-right: 16px;
	}
	.tt-logo .tt-logo__img {
		height: 45px;
	}
	.tt-cart-link {
		padding: 0 8px;
		min-height: 42px;
	}
	.tt-nav .wp-block-navigation__responsive-container-open {
		min-height: 42px;
		min-width: 42px;
	}
}
