/* Pacific Cable Products: one stylesheet for every page. Mobile first; the desktop layout (60rem and up) keeps the
   site's original 950px design: logo and header photo with the navigation on its dark band, two columns below. */

:root {
	--navy: #004677;     /* headings, links, the header shape and the banner */
	--red: #cd1041;      /* feature headings */
	--band: #001038;     /* the dark band along the bottom of the header photo */
	--banner-edge: #034fa0;
	--banner-deep: #001a4f;
	--rule: #6b92b1;     /* footer line */
	--line: #ccc;        /* sidebar navigation rules */
	--text: #111;
	--page: #fff;
	--gutter: 1rem;
	color-scheme: light;
}

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

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

body {
	margin: 0;
	background: var(--page);
	color: var(--text);
	font: 1rem/1.5 Tahoma, Verdana, "Segoe UI", system-ui, sans-serif;
}

img, picture, svg, iframe { display: block; max-width: 100%; height: auto; }

a { color: var(--navy); text-underline-offset: 0.15em; }
a:hover { color: var(--red); }
/* links that open in a new tab: a small arrow in the link's own color (the words are in the visually-hidden span) */
a[target="_blank"]::after {
	content: "";
	display: inline-block;
	width: 0.7em; height: 0.7em;
	margin-left: 0.25em;
	vertical-align: -0.05em;
	background-color: currentColor;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M5 1.5H1.5v9h9V7M7 1.5h3.5V5M10.5 1.5 5 7' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E");
	mask-repeat: no-repeat;
	mask-position: center;
	mask-size: contain;
}
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

h1, h2, h3 { margin: 0 0 0.75rem; font-weight: normal; line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.75rem; }
h2.feature { font-size: 1.5rem; color: var(--red); margin-top: 0; }
p, ul, dl, address { margin: 0 0 1rem; }
address { font-style: normal; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip {
	position: absolute; left: var(--gutter); top: -3rem; z-index: 10;
	padding: 0.5rem 1rem;
	background: var(--navy); color: #fff;
}
.skip:focus { top: 0.5rem; }

.site { width: min(100% - 2 * var(--gutter), 950px); margin-inline: auto; }

/* ---------- header ---------- */
.masthead { display: grid; gap: 1rem; padding-top: 1rem; }
.logo { justify-self: start; width: min(60vw, 243px); }
.subpage .logo { width: min(45vw, 153px); }
.logo img { width: 100%; }
.hero img { width: 100%; }
/* home: the logo stays beside the photo at every width, in the desktop design's proportions */
.home .masthead { grid-template-columns: minmax(0, 32fr) minmax(0, 64fr); column-gap: 4%; align-items: center; }
.home .logo { width: 100%; max-width: 243px; }
.home .primary { grid-column: 1 / -1; }

.primary ul {
	display: flex; flex-wrap: wrap; justify-content: center;
	margin: 0; padding: 0.25rem 0;
	list-style: none;
	background: var(--band);
}
.primary a {
	display: block;
	padding: 0.6rem 0.7rem;
	color: #fff;
	text-decoration: none;
	font-size: 0.9375rem;
}
.primary a:hover, .primary a[aria-current="page"] { text-decoration: underline; color: #fff; }

/* ---------- layout ---------- */
main { padding-top: 1.5rem; }
.pages { display: none; }            /* the sidebar repeats the main navigation: shown on wide screens only */

.media img { width: 100%; max-width: 337px; }

.links { padding: 0; list-style: none; }
.links li { margin-bottom: 0.5rem; }

/* the blue banner on the home page (was two GIF slices; now CSS) */
.banner {
	display: grid;
	margin-top: 1.5rem;
	padding: 1.5rem 1rem;
	border: 2px solid var(--banner-edge);
	border-radius: 20px;
	background: linear-gradient(var(--navy) 0 70%, var(--banner-deep));
	color: #fff;
}
.banner section {
	display: grid;
	grid-template-columns: 78px 1fr;
	align-items: start;
	column-gap: 1.25rem;
	padding: 0.5rem 0;
}
.banner section + section { border-top: 1px solid #fff; padding-top: 1.5rem; }
.banner img { grid-row: span 2; width: 78px; }
.banner h2 { margin: 0.25rem 0 0.5rem; color: #fff; font-size: 1.25rem; }
.banner ul { margin: 0; padding: 0; list-style: none; line-height: 2; }
.banner a { color: #fff; }
.banner a:hover { color: #ccc; text-decoration: none; }

.resources-intro { display: flex; align-items: flex-start; gap: 1.25rem; }
.resources-intro img { width: 77px; flex: none; }
.resources-intro h1 { margin-top: 1.5rem; }

.calculator iframe { width: 300px; height: 415px; border: 0; }

dl { margin-bottom: 1.25rem; }
dt { font-weight: bold; }
dd { margin-left: 1.5rem; }

/* ---------- footer ---------- */
.site-footer {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem;   /* credit left, copyright right */
	margin-top: 2rem;
	padding: 0.625rem 0 2rem;
	border-top: 3px solid var(--rule);
	font-size: 0.8125rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer a:hover { text-decoration: none; }

/* ---------- tablet: banner side by side ---------- */
@media (min-width: 40rem) {
	.primary a { padding-inline: 0.9rem; }
	.banner { grid-template-columns: 1fr 1fr; padding: 2rem 0 1.5rem; }
	.banner section { padding: 0.5rem 1.75rem; }
	.banner section + section { border-top: 0; border-left: 1px solid #fff; padding-top: 0.5rem; }
}

/* ---------- desktop: the original 950px design ---------- */
@media (min-width: 60rem) {
	body { font-size: 0.875rem; }

	/* header: logo left, photo right, navigation on the photo's dark band */
	.masthead { position: relative; display: block; height: 328px; padding: 0; }
	.logo { position: absolute; left: 0; top: 80px; width: 243px; }
	.hero { position: absolute; right: 0; top: 0; width: 666px; }
	.primary { position: absolute; right: 0; top: 304px; width: 368px; }   /* the original's last three slots of 112px */
	.primary ul { flex-wrap: nowrap; justify-content: flex-start; gap: 12px; padding: 0; background: none; }
	.primary li { min-width: 100px; text-align: center; }
	.primary a { display: inline-block; padding: 0 0 0 22px; font-size: 0.75rem; line-height: 1.2; white-space: nowrap; }
	.primary li + li a { border-left: 1px solid #fff; }

	.subpage .masthead { height: 143px; margin-bottom: 20px; }
	.subpage .logo { top: 20px; width: 153px; }
	.subpage .hero { width: 722px; }
	.subpage .primary { top: 123px; right: 120px; }
	.subpage .primary ul { gap: 10px; }

	main { padding-top: 2.25rem; }

	/* home: text left, picture right, banner across */
	.home main { display: grid; grid-template-columns: 510px 1fr; column-gap: 40px; }
	.home .media { justify-self: end; }
	.home .media img { width: 337px; }
	.banner { grid-column: 1 / -1; width: 891px; justify-self: center; margin-top: 1.75rem; }

	/* inner pages: sidebar navigation left, content right */
	.subpage main { display: grid; grid-template-columns: 210px 700px; justify-content: space-between; padding-top: 0; }
	.pages { display: block; align-self: start; }
	.pages ul { margin: 0; padding: 7px 0; list-style: none; border-block: 1px solid var(--line); font-size: 1rem; }
	.pages li { padding: 7px 0; }
	.pages a { text-decoration: none; }
	.pages a:hover, .pages a[aria-current="page"] { color: #333; text-decoration: underline; }

	.resources { display: grid; grid-template-columns: 250px 400px; justify-content: space-between; }
	.resources-intro { display: grid; grid-template-columns: 77px 1fr; column-gap: 20px; }
	.resources-intro h1 { margin-top: 28px; }
}

@media print {
	.skip, .primary, .pages, .hero, .calculator { display: none !important; }
	.masthead { height: auto !important; display: block; }
	.logo { position: static !important; }
	a { color: inherit; }
	.banner { background: none; color: inherit; border-color: currentColor; }
	.banner a, .banner h2 { color: inherit; }
	.banner img { display: none; }
}
