/*
Theme Name: DMB Portal
Theme URI: https://assetportal.thedmbgroup.co.uk/
Author: DMB Digital Ltd
Description: The asset portal theme. Carries the header, navigation, hero and footer so a new client portal is a fresh WordPress plus this — nothing to rebuild per client. Colours and logo come from the DMB Portal plugin's Branding screen.
Version: 1.5.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: dmb-portal-theme
*/

/*
 * Deliberately almost empty. Everything the portal renders is styled by the
 * plugin's portal.css, which is written entirely in CSS custom properties so
 * the Branding screen can restyle it. Putting styles here as well would mean
 * two places to change a colour, and one of them would get missed.
 *
 * What lives here is only the site chrome the plugin doesn't render: the
 * header bar, navigation and footer.
 */

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

body {
	margin: 0;
	font-family: 'Poppins', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #22384c;
	background: #fff;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

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

.site-header {
	background: #fff;
	border-bottom: 1px solid #eef1f3;
}

.site-header-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 1.1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
}

/*
 * Logo height comes from the Branding screen.
 *
 * Logos aren't comparable by height alone — a wide wordmark and a square mark
 * set to the same number look nothing like the same size — so this is a setting
 * per portal rather than a figure in a stylesheet that needs a code change
 * every time a client's logo is a different shape.
 */
.site-logo img {
	display: block;
	max-height: var( --dmb-logo-height, 52px );
	width: auto;
}

@media (max-width: 600px) {
	/* Never taller than 46px on a phone, whatever the setting says: the logo
	   and the menu button share the row and the button loses. */
	.site-logo img {
		max-height: min( 46px, var( --dmb-logo-height, 52px ) );
	}
}

.site-logo-text {
	font-size: 1.3rem;
	font-weight: 700;
	text-decoration: none;
	color: #22384c;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 1.75rem;
	margin-left: auto;
}

.site-nav a {
	text-decoration: none;
	font-size: 1.02rem;
	font-weight: 500;
	color: #22384c;
	white-space: nowrap;
}

.site-nav a:hover {
	opacity: 0.7;
}

/* --- Where you are ---------------------------------------------------------
 *
 * An underline that sits below the text rather than a background or a colour
 * change. The nav sits on the header's white, the portal already uses its
 * accent for actions, and a filled pill here would compete with the Logout
 * button two links along — the one thing in this bar that genuinely is a
 * button.
 *
 * Both selectors on purpose. .is-here is the plugin's own navigation;
 * .current-menu-item is what WordPress puts on a hand-built menu assigned to
 * the theme location. Whichever the site uses, the current page is marked.
 * ------------------------------------------------------------------------- */

.site-nav a.is-here,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	position: relative;
	color: var( --dmb-accent, #22384c );
	font-weight: 600;
	opacity: 1;
}

.site-nav a.is-here::after,
.site-nav .current-menu-item > a::after,
.site-nav .current_page_item > a::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: -0.55rem;
	left: 0;
	height: 2px;
	border-radius: 2px;
	background: var( --dmb-accent, #22384c );
}

/* The logout pill is already the loudest thing in the bar; it should never
 * also wear the current-page marker. */
.site-nav .nav-logout.is-here::after {
	display: none;
}

/* The logout pill, as on the existing portal. */
.site-nav .nav-logout {
	padding: 0.7rem 1.9rem;
	border-radius: 999px;
	background: var(--dmb-grey, #8e9296);
	color: #fff;
	font-weight: 500;
}

.site-nav .nav-logout:hover {
	opacity: 1;
	background: var(--dmb-grey-dark, #74787c);
}

/* Small screens: the nav becomes a disclosure rather than wrapping into a
   mess. No JavaScript — a checkbox and a sibling selector do it. */
.nav-toggle,
.nav-toggle-label {
	display: none;
}

@media (max-width: 900px) {
	.nav-toggle-label {
		display: block;
		cursor: pointer;
		padding: 0.5rem;
		font-size: 1.5rem;
		line-height: 1;
		margin-left: auto;
	}

	.site-nav {
		display: none;
		width: 100%;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
		margin: 0.75rem 0 0;
	}

	.nav-toggle:checked ~ .site-nav {
		display: flex;
	}

	.site-header-inner {
		flex-wrap: wrap;
	}

	/* Stacked on a phone, so an underline under the text reads as a stray
	 * rule between rows. The marker moves to the left edge instead. */
	.site-nav a.is-here::after,
	.site-nav .current-menu-item > a::after,
	.site-nav .current_page_item > a::after {
		top: 0;
		right: auto;
		bottom: 0;
		left: -0.75rem;
		width: 2px;
		height: auto;
	}

	.site-nav a {
		display: block;
		width: 100%;
		padding: 0.6rem 0;
	}

	.site-nav .nav-logout {
		display: inline-block;
		width: auto;
		margin-top: 0.5rem;
	}
}

/* ---------------------------------------------------------------- content */

.site-main {
	min-height: 50vh;
}

.page-content {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2.5rem 1.25rem 4rem;
}

/*
 * Pages that are just words — terms, privacy, anything similar.
 *
 * Narrower than the grids on purpose. A line of body text running the full
 * 1200px is tiring to read: the eye loses its place coming back to the start
 * of the next line. Around 70 characters is the comfortable measure.
 */
.page-content-text {
	max-width: 820px;
}

.page-content-text h1 {
	margin: 0 0 1.5rem;
	font-size: 2.1rem;
	font-weight: 700;
	line-height: 1.15;
	color: #22384c;
}

.page-content-text h2 {
	margin: 2.25rem 0 0.6rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #22384c;
}

.page-content-text h3 {
	margin: 1.75rem 0 0.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	color: #22384c;
}

.page-content-text p,
.page-content-text li {
	line-height: 1.65;
	color: #22384c;
}

.page-content-text p {
	margin: 0 0 1rem;
}

.page-content-text ul,
.page-content-text ol {
	margin: 0 0 1.25rem;
	padding-left: 1.4rem;
}

.page-content-text li {
	margin-bottom: 0.4rem;
}

.page-content-text a {
	color: #22384c;
}

@media (max-width: 600px) {
	.page-content-text h1 {
		font-size: 1.7rem;
	}
}

/* ---------------------------------------------------------------- footer */

.site-footer {
	border-top: 1px solid #eef1f3;
	padding: 1.75rem 1.5rem;
	background: #fff;
}

.site-footer-inner {
	max-width: 1400px;
	margin: 0 auto;
	font-size: 0.95rem;
	font-weight: 600;
	color: #22384c;
}

.site-footer a {
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}
