/*
 * cando-site.css - shared header, menu and footer for every page that includes incMenu.cfm / incBottom.cfm.
 * New logos: image/canadian-domain-logo-wide.png (500x150) and image/canadian-domain-logo-footer.png (300x90),
 * both on solid red B80000, so the header and footer use that red. Logos are drawn at no more than half their
 * pixel width so they stay sharp on 2x screens.
 * Everything is scoped to cd- classes so the pages' own styles (cando.css, inline tables) are left alone, except
 * the phone rules for .cd-content, which stop the pages' fixed-width tables and images running off the screen.
 * Colours: page background soft blue-grey E9EDF2 (was beige F5F5DC), header/footer red B80000, menu navy 003162.
 */

/* Page background around the 1100px page. CSS beats the bgcolor="#F5F5DC" that incMenu.cfm and many pages
   still put on <body>, so this one rule sets it everywhere. */
body { background-color: #E9EDF2; }

.cd-page, .cd-page * { box-sizing: border-box; }

.cd-page {
	max-width: 1100px;
	margin: 0 auto;
	background-color: #FFFFFF;
	/* thin edge line and a soft shadow where the page meets the background (only seen on screens wider than 1100px) */
	box-shadow: 0 0 0 1px #D3DAE4, 0 2px 14px rgba(0, 49, 98, 0.10);
}

/* ---------- header ---------- */
.cd-header {
	background: #B80000;
	padding: 4px 16px;
	text-align: center;
}
.cd-header a { display: inline-block; line-height: 0; }
.cd-header img { width: 250px; height: auto; border: 0; }
/* home page: the logo sits in an h1 for search engines; no heading margins or size, so it looks the same */
.cd-logo-h1 { margin: 0; padding: 0; font-size: inherit; line-height: 0; }
/* home page "Domain Registrations" bar: an h2 drawn like the old <font size="2"><b> text */
.cd-bar-h2 { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; color: #FFFFFF; }

/* ---------- menu (desktop: navy bar with hover drop-downs) ---------- */
.cd-nav {
	background-color: #003162;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
}
.cd-nav-check { position: absolute; opacity: 0; pointer-events: none; }
.cd-nav-btn { display: none; }

.cd-menu, .cd-menu ul { list-style: none; margin: 0; padding: 0; }
.cd-menu { display: flex; flex-wrap: wrap; justify-content: center; }
.cd-menu li { position: relative; margin: 0; }
.cd-menu a, .cd-menu a:link, .cd-menu a:visited, .cd-menu .cd-menu-label {
	display: block;
	padding: 7px 12px;
	color: #FFFFFF;
	background-color: #003162;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
}
.cd-menu .cd-has-sub > a::after, .cd-menu .cd-has-sub > .cd-menu-label::after { content: " \25BE"; font-size: 11px; }
.cd-menu li:hover > a, .cd-menu li:hover > .cd-menu-label,
.cd-menu li:focus-within > a, .cd-menu li:focus-within > .cd-menu-label,
.cd-menu a:hover, .cd-menu a:focus { color: #000000; background-color: #FFFFFF; }
.cd-menu ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 100%;
	z-index: 1000;
	border: 1px solid #003162;
	box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.cd-menu li:hover > ul, .cd-menu li:focus-within > ul { display: block; }

/* ---------- page content (the page's own markup) ---------- */
.cd-content { padding: 0; }

/* ---------- footer ---------- */
.cd-footer {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #B80000;
	padding: 10px 16px;
	margin-top: 10px;
	text-align: left;
}
.cd-footer img { width: 150px; height: auto; flex: 0 0 auto; border: 0; }
.cd-footer-text {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	font-weight: normal;
	line-height: 1.55;
	color: #FFFFFF;
	border-left: 1px solid rgba(255, 255, 255, 0.45);
	padding-left: 16px;
}
.cd-footer-text strong { font-size: 14px; }

/* ---------- renewal log-in box (DSRenewals/Login.cfm) ---------- */
.dsr-login {
	max-width: 520px;
	margin: 30px auto;
	padding: 20px;
	background-color: #F5F5DC;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
}
.dsr-login h1 { font-size: 20px; font-weight: normal; margin: 0 0 6px; }
.dsr-login p { font-size: 13px; margin: 0 0 18px; }
.dsr-login form { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.dsr-login label { font-size: 13px; font-weight: bold; }
.dsr-login input[type="text"] { font-size: 16px; padding: 4px 6px; width: 200px; max-width: 100%; }

/* ---------- info tooltips (pricing.cfm, webhosting/WHPlans.cfm; replaces <cftooltip>, which Lucee lacks) ----------
   Shown on mouse hover, or on tap / keyboard focus (tabindex="0"). */
.cd-tip { position: relative; display: inline-block; cursor: help; }
.cd-tip img { vertical-align: middle; border: 0; }
.cd-tip-text {
	display: none;
	position: absolute;
	z-index: 1000;
	top: 100%;
	right: 0;
	width: 280px;
	padding: 8px 10px;
	background-color: #FFFFE6;
	color: #000000;
	border: 1px solid #003162;
	box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
}
.cd-tip:hover .cd-tip-text, .cd-tip:focus .cd-tip-text { display: block; }

/* ---------- whois result (CltWhois.cfm / GetWhois.cfm) ---------- */
.cd-whois { max-width: 860px; margin: 20px auto 30px; padding: 0 16px; font-family: Arial, Helvetica, sans-serif; }
.cd-whois-title { margin: 0 0 4px; font-size: 20px; font-weight: normal; color: #003162; }
.cd-whois-title span { font-weight: bold; }
.cd-whois-src { margin: 0 0 12px; font-size: 12px; color: #666666; }
.cd-whois-msg { font-size: 14px; line-height: 1.5; }
.cd-whois-text {
	margin: 0;
	padding: 14px 16px;
	background-color: #F7F7F2;
	border: 1px solid #DDDDD0;
	border-left: 4px solid #003162;
	font-family: Consolas, "Courier New", Courier, monospace;
	font-size: 13px;
	line-height: 1.5;
	color: #222222;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.cd-whois-notice { margin-top: 10px; }
.cd-whois-notice summary { cursor: pointer; font-size: 13px; color: #3333FF; }
.cd-whois-notice .cd-whois-text { margin-top: 8px; font-size: 12px; color: #555555; border-left-color: #AAAAAA; }
.cd-whois-again { margin: 18px 0 0; font-size: 14px; }

/* ---------- tablets and small laptops (up to 1100px): fixed-width content fitted to the screen ----------
   The viewport tag in incMenu.cfm makes tablets use their real width instead of zooming out to 980px, so
   the pages' 1024px / 800px tables must shrink to fit. Layout (columns side by side) stays as on desktop. */
@media (max-width: 1100px) {
	.cd-content { overflow-x: auto; }
	.cd-content table { max-width: 100%; }
	.cd-content table[width]:not([width$="%"]), .cd-content table[id] {
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.cd-content td[width]:not([width$="%"]), .cd-content th[width]:not([width$="%"]) { width: auto !important; }
	.cd-content img, .cd-content embed, .cd-content object, .cd-content iframe, .cd-content video,
	.cd-content input, .cd-content select, .cd-content textarea { max-width: 100%; }
	/* fixed widths set inline or by the page's own styles (rant-post: 700px agreement box and 900px
	   .scrollBox; rant-type: 800px .dropcontent and a 500px drop-down) */
	.cd-content div[style*="width"], .cd-content p[style*="width"], .cd-content select[style*="width"],
	.cd-content .scrollBox, .cd-content .dropcontent {
		width: auto !important;
		max-width: 100%;
	}
}

/* ---------- phones: collapsible menu, content fitted to the screen ---------- */
@media (max-width: 760px) {
	body { margin: 0; }

	.cd-header img { width: 200px; }

	.cd-nav-btn {
		display: block;
		padding: 10px 16px;
		color: #FFFFFF;
		font-size: 16px;
		font-weight: bold;
		cursor: pointer;
		user-select: none;
	}
	.cd-menu { display: none; flex-direction: column; }
	.cd-nav-check:checked ~ .cd-menu { display: flex; }
	.cd-nav-check:focus-visible ~ .cd-nav-btn { outline: 2px solid #FFFFFF; outline-offset: -4px; }
	.cd-menu a, .cd-menu a:link, .cd-menu a:visited, .cd-menu .cd-menu-label {
		padding: 12px 16px;
		border-top: 1px solid rgba(255, 255, 255, 0.15);
		white-space: normal;
		font-size: 15px;
	}
	/* sub-menus are always open on phones (no hover on touch screens) */
	.cd-menu ul { display: block; position: static; border: 0; box-shadow: none; }
	.cd-menu ul a, .cd-menu ul a:link, .cd-menu ul a:visited { padding-left: 34px; background-color: #0A3D6E; }
	.cd-menu .cd-has-sub > a::after, .cd-menu .cd-has-sub > .cd-menu-label::after { content: ""; }

	/* The pages lay out their content in fixed-width tables (500 to 1100px wide). On a phone, let those
	   tables and their cells shrink to the screen, and scale images and form fields down to fit. Anything
	   that still cannot shrink scrolls sideways inside the content area instead of widening the whole page. */
	.cd-content { padding: 0 6px; overflow-x: auto; word-wrap: break-word; }
	/* Tables: full screen width, no side margins. The !important beats the width attributes and the fixed
	   widths and margins set by id in cando.css (800px / 700px tables with 50-80px side margins). */
	.cd-content table { width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; }
	.cd-content td, .cd-content th { width: auto !important; padding-left: 4px !important; padding-right: 4px !important; }
	/* Data tables (a row of 5 or more cells: the cart, order summaries): smaller text, and if one is still
	   wider than the screen, that table alone scrolls sideways. The zid-table tables of the domain order pages
	   (/cando-order.css) are left out: on phones their rows turn into cards instead. */
	.cd-content table:not(.zid-table):has(> tbody > tr > :nth-child(5)),
	.cd-content table:not(.zid-table):has(> tr > :nth-child(5)) {
		display: block;
		overflow-x: auto;
		/* a screen-based limit (not %) so a table nested inside other tables cannot widen them */
		max-width: calc(100vw - 40px);
		font-size: 12px;
	}
	.cd-content table:has(> tbody > tr > :nth-child(5)) font,
	.cd-content table:has(> tr > :nth-child(5)) font { font-size: 12px; }
	/* 4-column tables (SSL comparison, hosting plans): smaller text so the four columns fit. */
	.cd-content table:not(.zid-table):has(> tbody > tr > :nth-child(4)):not(:has(> tbody > tr > :nth-child(5))),
	.cd-content table:not(.zid-table):has(> tbody > tr > :nth-child(4)):not(:has(> tbody > tr > :nth-child(5))) :is(td, th, font, a) { font-size: 12px; }
	.cd-content table:not(.zid-table):has(> tbody > tr > :nth-child(4)):not(:has(> tbody > tr > :nth-child(5))) :is(td, th) { padding-left: 2px !important; padding-right: 2px !important; }
	/* Page-layout tables (a table that holds other tables: text column | picture column, spacer columns):
	   on phones the columns stack, the way index-test.cfm does it, without side padding at each level. */
	.cd-content table:has(table):not(:has(> tbody > tr > :nth-child(5))) > tbody > tr > td,
	.cd-content table:has(table):not(:has(> tr > :nth-child(5))) > tr > td {
		display: block;
		width: 100% !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
	/* Form rows (label | text field, as in the order and contact forms): on phones each cell goes on its own
	   line, so the label sits above its field. Rows of the 5+ column data tables are left as they are. */
	.cd-content table:not(.zid-table):not(:has(> tbody > tr > :nth-child(5))) > tbody > tr:has(> td input[type="text"], > td input:not([type]), > td input[type="password"], > td input[type="email"], > td select, > td textarea) > td {
		display: block;
		width: 100% !important;
	}
	/* Blocks given a fixed pixel width by the pages' own stylesheets (goMobi/style/default.css: 922px,
	   672px, 640px, 239px boxes) take the screen width instead, so side-by-side boxes stack. */
	.cd-content div, .cd-content p, .cd-content h1, .cd-content h2, .cd-content h3, .cd-content h4,
	.cd-content ul, .cd-content ol, .cd-content form, .cd-content hr, .cd-content center {
		width: auto !important;
		max-width: 100%;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.cd-content img { max-width: 100%; height: auto; }
	.cd-content embed, .cd-content object, .cd-content iframe, .cd-content video { max-width: 100%; }
	/* Form fields: never wider than the screen (rant-type has a 500px drop-down; contact forms use size="60"). */
	.cd-content input, .cd-content select, .cd-content textarea { max-width: 100% !important; }
	.cd-content select, .cd-content textarea, .cd-content input[size] { width: auto !important; }
	/* Long text fields (size 20 and up) and fixed-width drop-downs take the full width of their cell, so
	   they can shrink with it; short ones (postal code, phone parts, expiry month) keep their size. */
	.cd-content input[size="20"], .cd-content input[size="22"], .cd-content input[size="24"],
	.cd-content input[size="25"], .cd-content input[size="26"], .cd-content input[size="30"],
	.cd-content input[size="35"], .cd-content input[size="40"], .cd-content input[size="45"],
	.cd-content input[size="50"], .cd-content input[size="60"], .cd-content input[size="70"],
	.cd-content select[style*="width"], .cd-content textarea { width: 100% !important; }

	/* info tooltips: a box along the bottom of the screen (a sideways-scrolling table would cut it off) */
	.cd-tip-text { position: fixed; top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; font-size: 14px; }

	/* whois result: a little smaller so record lines wrap less */
	.cd-whois { padding: 0 4px; }
	.cd-whois-text { padding: 10px; font-size: 12px; }

	.cd-footer { flex-direction: column; text-align: center; gap: 8px; }
	.cd-footer-text { border-left: 0; padding-left: 0; }
}
