/*
Theme Name: Hiway Portal
Theme URI: https://hiwaydist.com
Author: Hiway Distributing
Description: Mirrors the Hi-Way Distributing customer portal: tall black header with logo, portal search bar, and red Shop button, a dark gray menu bar, and a "Shop by Category" card grid. The Hi-Way logo is built in (a logo set under Appearance > Customize > Site Identity overrides it); the button label and link are under Appearance > Customize > Portal Header.
Version: 1.3.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hiway-portal
*/

:root {
	--hp-header-bg: #000000;
	--hp-nav-bg: #333333;
	--hp-accent: #a6170c;
	--hp-accent-hover: #8a1209;
	--hp-text: #1b1b1b;
	--hp-muted: #5c5c5c;
	--hp-bg: #ffffff;
	--hp-tile-bg: #f5f5f5;
	--hp-border: #e2e2e2;
	--hp-max: 1760px;
	--hp-font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--hp-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--hp-text);
	background: var(--hp-bg);
}

a { color: var(--hp-accent); }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 1000;
	width: auto; height: auto; clip: auto;
	padding: 8px 16px;
	background: #fff; color: #000;
}

/* ---------- Black header ---------- */

.hp-header { background: var(--hp-header-bg); color: #fff; }

.hp-header__inner {
	max-width: var(--hp-max);
	margin: 0 auto;
	padding: 56px;
	display: flex;
	align-items: center;
	gap: 32px;
}

.hp-brand { flex: 0 0 auto; display: flex; align-items: center; }
.hp-brand a { color: #fff; text-decoration: none; }
.hp-brand .custom-logo-link { display: block; line-height: 0; }
.hp-brand .custom-logo { display: block; height: 46px; width: auto; max-width: none; }


.hp-actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 36px;
}

/* Search bar */
.hp-search form { position: relative; margin: 0; width: 380px; }

.hp-search input[type="search"] {
	width: 100%;
	height: 30px;
	padding: 0 36px 0 10px;
	border: 1px solid #c9c9c9;
	border-radius: 2px;
	background: #fff;
	color: var(--hp-text);
	font: inherit;
	font-size: 14px;
	-webkit-appearance: none;
	appearance: none;
}

.hp-search input[type="search"]::placeholder { color: #3e3e3e; }

.hp-search input[type="search"]:focus {
	outline: 2px solid #5aa0e6;
	outline-offset: 0;
}

.hp-search button {
	position: absolute;
	right: 0; top: 0;
	width: 34px; height: 30px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #3e3e3e;
	cursor: pointer;
	display: flex; align-items: center; justify-content: center;
}

.hp-search button svg { width: 16px; height: 16px; }

/* Shop button */
.hp-login {
	display: inline-flex;
	align-items: center;
	height: 39px;
	padding: 0 16px;
	border: 1px solid var(--hp-accent);
	border-radius: 4px;
	background: var(--hp-accent);
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}

.hp-login:hover, .hp-login:focus { background: var(--hp-accent-hover); border-color: var(--hp-accent-hover); color: #fff; }


/* ---------- Gray menu bar ---------- */

.hp-nav { background: var(--hp-nav-bg); }

.hp-nav__inner {
	max-width: var(--hp-max);
	margin: 0 auto;
	padding: 5px 56px;
	min-height: 44px;
	display: flex;
	align-items: center;
}

.hp-nav__inner > ul { flex: 1 1 auto; }

.hp-nav ul {
	margin: 0; padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
}

.hp-nav li { position: relative; }

.hp-nav a {
	display: block;
	padding: 4px 5px 2px;
	color: #ebebeb;
	text-decoration: none;
	font-size: 16px;
	line-height: 24px;
	border-bottom: 2px solid transparent;
}

.hp-nav a:hover { color: #fff; }

.hp-nav .current-menu-item > a,
.hp-nav .current_page_item > a {
	border-bottom-color: #fff;
}

/* Drop-downs (used for the "More" item) */
.hp-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 7px; height: 7px;
	margin: 0 0 4px 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.hp-nav .sub-menu {
	display: none;
	position: absolute;
	right: 0; top: 100%;
	z-index: 50;
	min-width: 240px;
	padding: 8px 0;
	background: #fff;
	box-shadow: 0 4px 16px rgba(0,0,0,.18);
	flex-direction: column;
}

.hp-nav .sub-menu a {
	padding: 8px 20px;
	color: var(--hp-text);
	font-size: .95rem;
	border: 0;
}

.hp-nav .sub-menu a:hover { background: #f2f2f2; color: var(--hp-text); }

.hp-nav li:hover > .sub-menu,
.hp-nav li:focus-within > .sub-menu { display: flex; }

/* ---------- Content ---------- */

.hp-main {
	max-width: var(--hp-max);
	margin: 0 auto;
	padding: 72px 102px 64px;
}

.hp-main--wide { max-width: none; padding: 0; }

.entry-title,
.hp-section-title,
.hp-page-header h1 {
	margin: 0 0 40px;
	font-size: 2.1rem;
	font-weight: 500;
	line-height: 1.25;
}

.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--hp-accent); }
.entry-meta { color: var(--hp-muted); font-size: .85rem; margin: -28px 0 24px; }

.hp-entry + .hp-entry { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--hp-border); }

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }

.alignfull { width: 100%; max-width: none; }

.wp-block-button__link,
.hp-button,
input[type="submit"] {
	display: inline-block;
	padding: 10px 20px;
	border: 0;
	border-radius: 2px;
	background: var(--hp-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.wp-block-button__link:hover,
.hp-button:hover,
input[type="submit"]:hover { background: var(--hp-accent-hover); color: #fff; }

.nav-links { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.nav-links a, .nav-links span {
	padding: 6px 12px;
	border: 1px solid var(--hp-border);
	text-decoration: none;
}

/* ---------- "Shop by Category" tiles ---------- */
/* Used by the "Category Tiles" block pattern: a Columns/Grid of images + headings,
   or any Group with the class hp-tiles containing Groups with the class hp-tile. */

.hp-tiles {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px !important;
}

.hp-tile {
	margin: 0 !important;
	background: #fff;
	border: 1px solid var(--hp-border);
	transition: box-shadow .15s ease;
}

.hp-tile:hover { box-shadow: 0 2px 12px rgba(0,0,0,.12); }

.hp-tile .wp-block-image,
.hp-tile figure {
	margin: 0;
	padding: 14px 0 0;
	background: var(--hp-tile-bg);
	aspect-ratio: 1 / 1.03;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hp-tile .wp-block-image img,
.hp-tile figure img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
}

.hp-tile h2, .hp-tile h3, .hp-tile p {
	margin: 0;
	padding: 28px 24px 30px;
	background: var(--hp-tile-bg);
	font-size: 1.15rem;
	font-weight: 500;
	line-height: 1.3;
}

.hp-tile a { color: var(--hp-text); text-decoration: none; }
.hp-tile a:hover { color: var(--hp-accent); }

/* ---------- Footer ---------- */

.hp-footer { background: var(--hp-header-bg); color: #bdbdbd; font-size: .85rem; }

.hp-footer__inner {
	max-width: var(--hp-max);
	margin: 0 auto;
	padding: 28px 56px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
}

.hp-footer a { color: #fff; text-decoration: none; }
.hp-footer a:hover { text-decoration: underline; }
.hp-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
	.hp-main { padding: 56px 48px; }
	.hp-nav ul { justify-content: flex-start; gap: 0 40px; }
}

@media (max-width: 1024px) {
	.hp-header__inner { padding: 56px 32px; flex-wrap: wrap; }
	.hp-search form { width: 300px; }
	.hp-actions { gap: 20px; }
	.hp-nav__inner { padding: 5px 32px; }
	.hp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
	.hp-header__inner { padding: 16px; gap: 14px; }
	.hp-brand .custom-logo { height: 40px; }
	.hp-actions { margin-left: 0; width: 100%; gap: 14px; }
	.hp-search { flex: 1 1 auto; }
	.hp-search form { width: 100%; }
	.hp-login { height: 34px; padding: 0 14px; }
	.hp-nav__inner { padding: 5px 16px; }
	.hp-nav ul { flex-wrap: nowrap; overflow-x: auto; gap: 0 28px; }
	.hp-nav a { white-space: nowrap; }
	.hp-nav .sub-menu { display: none !important; }
	.hp-main { padding: 32px 16px 40px; }
	.entry-title, .hp-page-header h1 { font-size: 1.6rem; margin-bottom: 24px; }
	.hp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px !important; }
	.hp-tile h2, .hp-tile h3, .hp-tile p { padding: 16px 14px; font-size: 1rem; }
	.hp-footer__inner { padding: 24px 16px; }
}
