/* Cose Theme - main stylesheet */

@font-face {
	font-family: 'HAL Timezone';
	src: url('../fonts/HALTimezone-Regular.woff2') format('woff2'),
		url('../fonts/HALTimezone-Regular.woff') format('woff'),
		url('../fonts/HALTimezone-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* Medium: the hover weight (brief: Regular -> Medium). Only the OTF was supplied. */
@font-face {
	font-family: 'HAL Timezone';
	src: url('../fonts/HALTimezone-Medium.otf') format('opentype');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'HAL Timezone';
	src: url('../fonts/HALTimezone-Italic.woff2') format('woff2'),
		url('../fonts/HALTimezone-Italic.woff') format('woff'),
		url('../fonts/HALTimezone-Italic.ttf') format('truetype');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: 'HAL Timezone Mono';
	src: url('../fonts/HALTimezoneMono-Regular.woff2') format('woff2'),
		url('../fonts/HALTimezoneMono-Regular.woff') format('woff'),
		url('../fonts/HALTimezoneMono-Regular.ttf') format('truetype');
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

* {
	box-sizing: border-box;
}

/* The site's one text size: every small text is 1rem. */
html {
	font-size: 10.5px;
}

body {
	margin: 0;
	font-size: 1rem;
	letter-spacing: 0;
	font-family: 'HAL Timezone', Arial, sans-serif;
	/* macOS draws text heavier than the design tools do (Regular read as a
	   bold); grayscale antialiasing gives the weight the layouts show. And no
	   weight or italic is ever faked by the browser. */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-synthesis: none;
}

img {
	max-width: 100%;
	display: block;
}

/* Global hover/focus state (brief_cliente.md): every clickable element
   (nav links, filters, CTA buttons, WooCommerce add-to-cart) goes from
   Regular (400) to Medium (500/600) on hover/focus, WITHOUT shifting any
   layout when it does.
   A real font-weight switch swaps in wider glyphs, which changes the
   element's own width and shoves whatever comes after it (e.g. the next nav
   item) sideways - that's the "menu items move" problem. main.js measures
   each element at the heavier weight and pins that as min-width (see
   cosePrepareHoverWeightReservation), so by the time hover/focus switches
   the weight here, the box is already sized for it and nothing moves.
   min-width has no effect on the default `display: inline` a link renders
   as - the browser just ignores it - hence the inline-block below; that's
   what let this get set with no visible effect and still shift on hover. */
a,
button,
.button,
input[type="submit"],
input[type="button"],
.main-nav a,
.product-filters a,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce #respond input#submit,
.single_add_to_cart_button {
	display: inline-block;
	font-weight: 400;
}

a:hover,
a:focus,
button:hover,
button:focus,
.button:hover,
.button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="button"]:hover,
input[type="button"]:focus,
.main-nav a:hover,
.main-nav a:focus,
.product-filters a:hover,
.product-filters a:focus,
.woocommerce a.button:hover,
.woocommerce a.button:focus,
.woocommerce button.button:hover,
.woocommerce button.button:focus,
.woocommerce #respond input#submit:hover,
.woocommerce #respond input#submit:focus,
.single_add_to_cart_button:hover,
.single_add_to_cart_button:focus {
	font-weight: 500;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	/* Same inset as .home-title's left offset, so the nav lines up with the logo.
	   The items sit high, as in the layouts; the bottom padding keeps the
	   header's height (the pages below are spaced from it). */
	padding: 18px 40px 62px;
	text-transform: uppercase;
	position: relative;
	z-index: 10;
}

.main-nav ul {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav li:not(:last-child)::after {
	content: ",";
	margin-right: 0.4em;
}

.main-nav a {
	text-decoration: none;
	color: inherit;
}

.header-utility {
	display: flex;
	align-items: center;
	gap: 90px;
	text-transform: none;
}

.header-utility a,
.header-utility span {
	text-decoration: none;
	color: inherit;
}

/* New Issue, Instagram and Cart stay Regular on hover (main.js reserves no
   hover width for them either). */
.header-utility a:hover,
.header-utility a:focus {
	font-weight: 400;
}

.header-utility .cart-contents {
	/* Cart sits apart from the New Issue/Instagram text group, hugging the edge. */
	margin-left: 210px;
}

/* Site logo: fixed to the same spot on screen on every page (stays put
   while the page scrolls), black by default. home.css switches it to
   white, since only there does it sit over dark hero photography instead
   of a plain page background. */
.site-logo {
	position: fixed;
	top: 50%;
	left: 40px;
	transform: translateY(-50%);
	z-index: 5;
	line-height: 0;
}

.site-logo img {
	display: block;
	width: clamp(220px, 22vw, 320px);
	height: auto;
	filter: brightness(0);
}


/* The only heavier weight on the site is Medium (HALTimezone-Medium); what
   the browser would otherwise render bold (headings, strong, labels, table
   heads) uses it instead of a synthesized bold. */
h1, h2, h3, h4, h5, h6,
strong, b, th, label, dt {
	font-weight: 500;
}

/* Links inside running text are inline-blocks too (see above), so their
   baseline follows their own font's metrics - and the Medium file's differ
   by a fraction of a pixel from Regular's, which on hover nudged the line
   (and everything below it) by 1px. Aligning them to the line's top, with the
   line's own height, removes the baseline from the equation. */
p a,
li a,
dd a,
td a {
	vertical-align: top;
	line-height: inherit;
}

/* --- Small screens (matches the Mobile designs) ---
   Header: New Issue on the left, Menu and Cart on the right. The nav and
   Instagram move into a full-screen menu opened by Menu; the logo sits along
   the bottom of the screen at (almost) full width. Everything is in the
   same ~20px inset (5vw) the designs use. */

.menu-toggle,
.menu-backdrop {
	display: none;
}

@media (max-width: 900px) {
	.site-header {
		padding: 18px 20px 26px;
		gap: 22px;
	}

	.header-utility {
		display: contents;
	}

	.header-utility .new-issue-link {
		margin-right: auto;
	}

	.header-utility .cart-contents {
		margin-left: 0;
	}

	.header-utility .social-link,
	.main-nav {
		display: none;
	}

	.menu-toggle {
		display: block;
		min-width: 3.4em;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		font: inherit;
		font-weight: 400;
		text-transform: none;
		text-align: left;
		cursor: pointer;
	}

	.menu-toggle:hover {
		font-weight: 500;
	}

	/* Logo: bottom of the screen, 20px in from the sides. Above the menu
	   backdrop, never in the way of a tap. */
	.site-logo {
		top: auto;
		bottom: 20px;
		left: 20px;
		right: 20px;
		transform: none;
		z-index: 11;
		pointer-events: none;
	}

	.site-logo img {
		width: 100%;
	}

	/* Open menu: white sheet; nav and Instagram in the right-hand column
	   (72% in), Close where Menu was. */
	body.menu-open {
		overflow: hidden;
	}

	body.menu-open .menu-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: #fff;
		z-index: -1;
	}

	/* html-prefixed: must beat the home page's white header and logo. */
	html body.menu-open .site-header,
	html body.menu-open .site-header a,
	html body.menu-open .site-header button {
		color: #000;
	}

	html body.menu-open .site-logo img {
		filter: brightness(0);
	}

	/* The menu always shows the big logo, also on the pages that hide it
	   (Info, cart, checkout, Privacy, Cookie). */
	html body.menu-open .site-logo {
		display: block;
	}

	body.menu-open .main-nav {
		display: block;
		position: fixed;
		left: 72.3vw;
		top: 138px;
	}

	body.menu-open .main-nav ul {
		flex-direction: column;
		gap: 16px;
	}

	body.menu-open .main-nav li::after {
		content: none;
	}

	body.menu-open .header-utility .social-link {
		display: block;
		position: fixed;
		left: 72.3vw;
		top: 334px;
	}

	body.menu-open .header-utility .cart-contents {
		visibility: hidden;
	}

	/* Close: in the header's row, on the same left edge as the nav and
	   Instagram below it (Mobile/Menu.png). */
	body.menu-open .menu-toggle {
		position: absolute;
		left: 72.3vw;
		top: 18px;
	}

	/* The header is fixed while the menu is open (so Close stays reachable
	   after a scroll on the home page, where it already is). */
	body.menu-open .site-header {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
	}
}

/* Text for search engines and screen readers only (the pages' hidden <h1>):
   takes no room and shows nothing, but stays in the page. */
.cose-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
