/*
Theme Name: National Precious Metals Refinery
Theme URI: https://example.com/npm-refinery-theme
Author: SAM Precious Metals
Author URI: https://example.com
Description: The official corporate theme for National Precious Metals Refinery (NPM), a strategic precious metals refining project developed by SAM Precious Metals in partnership with Ethiopian Investment Holdings (EIH). Built as a hybrid theme — classic PHP templates plus full block editor support — with dedicated content types for press releases and institutional partners, and a typography system ready for future Amharic-language content.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
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: npm-refinery
Tags: full-site-editing, block-patterns, custom-menu, custom-post-types, translation-ready

This theme, like WordPress, is licensed under the GPL.

corporate-theme is based on underscores https://underscores.me/, (C) 2012-2026 Automattic, Inc.
underscores is distributed under the terms of the GNU GPL v2 or later.
*/

/* -------------------------------------------------------------------------
   Brand palette, sampled directly from the NPM brand guide's color chart
   (kept here as the single source of truth — theme.json below reuses the
   same hex values as its color presets):

     --npm-primary    #172611   deep forest green   (~30% of usage — header,
                                                       hero, footer surfaces)
     --npm-background #eaeae8   warm cream           (~35% — page background)
     --npm-accent     #b18f48   bronze / gold        (~20% — buttons, links,
                                                       used sparingly)
     --npm-secondary  #a2a4a6   neutral gray         (~10% — muted text,
                                                       borders, dividers)
     --npm-contrast   #353535   charcoal             (~15% — body text)

   Typography: theme.json declares font-family slots named after the brand
   guide's actual typefaces (Novantique Serif Bold / Metropolis Regular /
   Noto Serif Ethiopic). See assets/fonts/README.txt for how to drop the
   licensed English font files in; Amharic uses Google-hosted Noto Serif
   Ethiopic today (see inc/enqueue.php) since it's open-licensed.
   ---------------------------------------------------------------------- */

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

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

body {
	margin: 0;
	overflow-x: hidden;
}

img,
svg,
video,
canvas {
	max-width: 100%;
	height: auto;
}

/* Skip link (accessibility) */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	padding: 0.75em 1.25em;
	background: var(--wp--preset--color--primary, #172611);
	color: #fff;
	text-decoration: none;
}

.skip-link:focus {
	left: 0.5em;
	top: 0.5em;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* Top info bar */
.top-bar {
	background: var(--wp--preset--color--contrast, #353535);
	color: #f2f1ef;
	font-size: 0.85rem;
}

.top-bar__inner {
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto;
	padding: 0.5rem 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	justify-content: space-between;
	align-items: center;
}

.top-bar__tagline {
	opacity: 0.85;
	letter-spacing: 0.02em;
}

.top-bar__links {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.top-bar a {
	color: inherit;
	text-decoration: none;
}

.top-bar a:hover,
.top-bar a:focus {
	text-decoration: underline;
}

/* Site header */
.site-header {
	background: var(--wp--preset--color--primary, #182B0F);
	border-bottom: 1px solid rgba(23, 38, 17, 0.12);
}

.site-header__inner {
	/* max-width: var(--wp--style--global--wide-size, 1240px); */
	max-width: 1440px;
	margin: 0 auto;
	padding: 1.25rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

.site-branding img {
	max-height: 60px;
	width: auto;
}

.site-branding .custom-logo-link {
	line-height: 0;
}

.site-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.35rem;
	line-height: 1.2;
	margin: 0;
	color: var(--wp--preset--color--primary, #172611);

	display: none;
}

.site-title a {
	text-decoration: none;
	color: inherit;
}

.site-description {
	margin: 0;
	font-size: 0.8rem;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--secondary, #a2a4a6);
}

/* Primary navigation */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1.75rem;
}

.main-navigation ul ul {
	position: absolute;
	background: #fff;
	border: 1px solid rgba(23, 38, 17, 0.12);
	box-shadow: 0 8px 24px rgba(23, 38, 17, 0.08);
	padding: 0.5rem 0;
	flex-direction: column;
	gap: 0;
	display: none;
	min-width: 220px;
	z-index: 10;
}

.main-navigation li {
	position: relative;
}

.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
	display: flex;
}

.main-navigation ul ul li a {
	display: block;
	padding: 0.6rem 1.1rem;
}

.main-navigation a {
	text-decoration: none;
	color: var(--wp--preset--color--white, #ffffff);
	font-weight: 500;
	font-size: 0.95rem;
}

.main-navigation a:hover,
.main-navigation a:focus {
	color: var(--wp--preset--color--accent, #b18f48);
}

.menu-toggle {
	display: none;
	align-items: center;
	gap: 0.6rem;
	background: none;
	border: 1px solid rgba(23, 38, 17, 0.25);
	border-radius: 4px;
	padding: 0.55rem 0.7rem;
	cursor: pointer;
	color: var(--wp--preset--color--contrast, #353535);
	/* Stays above the sliding panel (z-index 50) and its backdrop (40) so
	   the hamburger-to-X animation — and a way to close the menu again —
	   stays visible and tappable the whole time the panel is open. */
	position: relative;
	z-index: 60;
}

/* Hamburger icon: three bars that morph into an X when the panel is open. */
.menu-toggle__bars {
	display: inline-flex;
	flex-direction: column;
	justify-content: space-between;
	width: 20px;
	height: 14px;
}

.menu-toggle__bars span {
	display: block;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child {
	transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child {
	transform: translateY(-6px) rotate(-45deg);
}

/* Backdrop behind the sliding panel; a plain click target, not content. */
.nav-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 24, 17, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
	z-index: 40;
}

.main-navigation.is-open + .nav-overlay {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease;
}

/* Mobile-only submenu disclosure button, hidden entirely on desktop where
   :hover / :focus-within already reveals submenus (see rules above). */
.submenu-toggle {
	display: none;
}

@media (max-width: 782px) {
	.menu-toggle {
		display: inline-flex;
	}

	.site-header__inner {
		flex-wrap: wrap;
	}

	/* The panel is the menu list itself — fixed to the viewport edge and
	   slid off-screen by default, independent of the toggle button, which
	   stays put in the header. */
	.main-navigation ul#primary-menu {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(320px, 85vw);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		margin: 0;
		padding: 5rem 1.5rem 2rem;
		background: var(--wp--preset--color--background, #eaeae8);
		box-shadow: -8px 0 24px rgba(23, 38, 17, 0.18);
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform 0.28s ease;
		z-index: 50;
	}

	.main-navigation.is-open ul#primary-menu {
		transform: translateX(0);
	}

	.main-navigation ul#primary-menu li {
		width: 100%;
	}

	.main-navigation ul#primary-menu > li {
		border-bottom: 1px solid rgba(23, 38, 17, 0.1);
	}

	.main-navigation ul#primary-menu > li > a {
		display: block;
		padding: 0.9rem 0;
	}

	/* Submenus expand in place (accordion-style) instead of the desktop
	   hover flyout, and only open on a tap of their own toggle button. */
	.main-navigation ul#primary-menu li:hover > ul,
	.main-navigation ul#primary-menu li:focus-within > ul {
		display: none;
	}

	.main-navigation ul#primary-menu li.submenu-open > ul {
		display: flex;
	}

	.main-navigation ul#primary-menu ul {
		position: static;
		border: 0;
		box-shadow: none;
		min-width: 0;
		padding: 0 0 0.5rem 1rem;
	}

	.menu-item-has-children {
		position: relative;
	}

	.submenu-toggle {
		display: block;
		position: absolute;
		top: 0;
		right: 0;
		width: 44px;
		height: 44px;
		background: none;
		border: 0;
		cursor: pointer;
		color: inherit;
	}

	.submenu-toggle::after {
		content: '';
		position: absolute;
		top: 50%;
		left: 50%;
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translate(-50%, -65%) rotate(45deg);
		transition: transform 0.2s ease;
	}

	.submenu-toggle[aria-expanded="true"]::after {
		transform: translate(-50%, -35%) rotate(-135deg);
	}

	body.nav-is-open {
		overflow: hidden;
	}
}

@media (prefers-reduced-motion: reduce) {
	.main-navigation ul#primary-menu,
	.nav-overlay,
	.menu-toggle__bars span {
		transition: none;
	}
}

/* Site main */
.site-main {
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto;
}

/* Cards used by Partner / Press archives */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.card {
	border: 1px solid rgba(23, 38, 17, 0.12);
	border-radius: 6px;
	padding: 1.5rem;
	background: #fff;
}

.card .card-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.75rem;
	color: var(--wp--preset--color--accent, #b18f48);
	font-weight: 600;
}

.card .card-title {
	margin: 0.4rem 0 0.6rem;
	font-family: var(--wp--preset--font-family--heading);
}

.card .card-title a {
	text-decoration: none;
	color: var(--wp--preset--color--primary, #172611);
}

.card .card-logo {
	max-height: 60px;
	width: auto;
	margin-bottom: 1rem;
}

/* Site footer */
.site-footer {
	background: var(--wp--preset--color--primary, #172611);
	color: #eef1ea;
}

/*
 * The footer's three columns come from an editable synced pattern (a
 * `wp_block` post seeded by inc/footer-pattern.php and rendered with
 * do_blocks()) — see Appearance > Patterns > Site Footer. This wrapper
 * only needs to size and space whatever block content lands inside it;
 * the content's own colors come from the block editor (has-accent-color,
 * has-base-color, etc.), not from rules here.
 */
.footer-pattern {
	max-width: var(--wp--style--global--wide-size, 1240px);
	margin: 0 auto;
	padding: 6rem 1.5rem;
}

.footer-pattern a {
	color: #d7ddd1;
}

/* Defensive fallback: core's own block-library stylesheet already makes
   .wp-block-columns stack below 782px, but since this content renders
   late (inside footer.php, after wp_head() has already run) rather than
   through the normal post content flow, this repeats that one rule here
   in case a caching/optimization plugin ever strips the on-demand style. */
@media (max-width: 782px) {
	.footer-pattern .wp-block-columns {
		flex-wrap: wrap;
		gap: 1.5rem;
	}

	.footer-pattern .wp-block-column {
		flex-basis: 100% !important;
	}
}

.site-info {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding: 1.25rem 1.5rem;
	font-size: 0.85rem;
	text-align: center;
	color: #b7c0ae;
}

.site-info a {
	color: inherit;
}

/* Comments */
.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	list-style: none;
	margin-left: 2rem;
	padding: 0;
}

.alignwide,
.alignfull {
	clear: both;
}

.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.alignwide {
	max-width: var(--wp--style--global--wide-size, 1240px);
}