/*
Theme Name: Upstream Imports
Theme URI: https://www.upstreamimports.com.au
Author: Needmore Designs
Author URI: https://needmoredesigns.com
Description: Custom theme for Upstream Coffee Imports — green coffee importers, Australia and beyond.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 8.1
License: Proprietary
Text Domain: upstreamimports
*/

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
	/* Brand colors */
	--color-red: #BF0B3B;
	--color-blue: #183491;
	--color-yellow: #F2B80C;
	--color-brown: #3A3433;
	--color-white: #FFFFFF;
	--color-black: #000000;

	/* Tier colors */
	--color-tier-foundation: var(--color-yellow);
	--color-tier-endeavour: var(--color-blue);
	--color-tier-topshelf: var(--color-red);

	/* Semantic colors */
	--color-body: var(--color-brown);
	--color-bg: var(--color-white);
	--color-bg-dark: var(--color-brown);
	--color-text-on-dark: var(--color-white);

	/* Typography */
	--font-heading: 'manofa-condensed', 'Georgia', 'Times New Roman', Times, serif;
	--font-body: 'finder', 'Helvetica Neue', Helvetica, Arial, sans-serif;

	--weight-body: 400;
	--weight-subhead: 700;
	--weight-heading: 500;

	/* Spacing */
	--space-xs: 0.5rem;
	--space-sm: 1rem;
	--space-md: 2rem;
	--space-lg: 4rem;
	--space-xl: 6rem;

	/* Layout */
	--content-width: 1200px;
	--narrow-width: 720px;
	--gutter: 15px;
}

@media (min-width: 640px) {
	:root {
		--gutter: 30px;
	}
}

@media (min-width: 1025px) {
	:root {
		--gutter: 60px;
	}
}

/* ==========================================================================
   Base / Reset
   ========================================================================== */

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

html {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-body);
	font-weight: var(--weight-body);
	color: var(--color-body);
	background-color: var(--color-bg);
	line-height: 1.7;
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-heading);
	font-weight: var(--weight-heading);
	line-height: 0.9;
}

h1 {
	font-size: clamp(2.75rem, 2rem + 3.5vw, 4.5rem);
}

h2 {
	font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);
}

h3 {
	font-size: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
}

/* Section labels / subheads */
.subhead {
	font-family: var(--font-body);
	font-weight: var(--weight-subhead);
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.75rem;
	line-height: 1.4;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

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

/* ==========================================================================
   Layout Utilities
   ========================================================================== */

.site-content {
	width: 100%;
}

.section-inner {
	max-width: calc(var(--content-width) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section-narrow {
	max-width: var(--narrow-width);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-block;
	font-family: var(--font-body);
	font-weight: var(--weight-subhead);
	font-size: 0.875rem;
	padding: 0.875rem 2rem;
	border-radius: 4px;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-primary {
	background-color: var(--color-brown);
	color: var(--color-white);
	border-color: var(--color-brown);
}

.btn-primary:hover {
	background-color: var(--color-black);
}

.btn-secondary {
	background-color: transparent;
	color: var(--color-brown);
	border-color: rgba(58, 52, 51, 0.2);
}

.btn-secondary:hover {
	border-color: var(--color-brown);
}

/* ==========================================================================
   Dark sections
   ========================================================================== */

.has-dark-bg {
	background-color: var(--color-bg-dark);
	color: var(--color-text-on-dark);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

.screen-reader-text:focus {
	clip: auto !important;
	clip-path: none;
	background-color: var(--color-white);
	color: var(--color-brown);
	display: block;
	font-size: 0.875rem;
	font-weight: var(--weight-subhead);
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

:focus-visible {
	outline: 2px solid var(--color-blue);
	outline-offset: 2px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	padding-block: 15px;
	color: var(--color-white);
}

.site-header__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.site-logo img {
	width: 241px;
	max-width: 40vw;
	height: auto;
}

.site-nav {
	flex: 1;
	display: flex;
	justify-content: center;
}

.site-nav__list {
	display: flex;
	list-style: none;
}

.site-nav__list a {
	font-family: var(--font-body);
	font-weight: var(--weight-subhead);
	font-size: 1.125rem;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--color-white);
	padding: 16px 20px;
	transition: opacity 0.2s ease;
}

.site-nav__list a:hover {
	opacity: 0.6;
}

.portal-login-btn {
	font-family: var(--font-body);
	font-weight: var(--weight-subhead);
	font-size: 1.125rem;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--color-white);
	border: 1px solid var(--color-white);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 19px 20px 13px;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.portal-login-btn:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.site-header__social {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
}

.site-header__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: #fff;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.site-header__social-link:hover {
	opacity: 0.7;
}

.site-header__social-link svg {
	width: 20px;
	height: 20px;
}

@media (max-width: 768px) {
	.site-nav {
		display: none;
	}

	.site-header .portal-login-btn {
		padding: 12px 14px 8px;
	}
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	padding-top: var(--space-xl);
	padding-bottom: var(--space-xl);
	background-color: var(--color-white);
	color: var(--color-brown);
}

.site-footer__main {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--space-lg);
}

.site-footer__brand {
	max-width: 300px;
	flex-shrink: 0;
}

.site-footer__brand img {
	width: 220px;
	height: auto;
	margin-bottom: var(--space-sm);
}

.site-footer__brand p {
	font-weight: 700;
	line-height: 1.5;
}

.site-footer__logos {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	grid-template-rows: auto auto;
	column-gap: var(--gutter);
	row-gap: var(--space-xs);
}

.site-footer__badge {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 2;
}

.site-footer__badge a {
	display: block;
}

.site-footer__badge img {
	width: 100%;
	max-width: 150px;
	max-height: 150px;
	height: auto;
	align-self: start;
}

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

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

.site-footer__acknowledgement {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--space-md);
	margin-top: var(--space-lg);
}

.site-footer__acknowledgement p {
	line-height: 1.6;
	max-width: 72ch;
}

.site-footer__social {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	flex-shrink: 0;
}

.site-footer__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	color: #000;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.site-footer__social-link:hover {
	opacity: 0.7;
	text-decoration: none;
}

.site-footer__social-link svg {
	width: 20px;
	height: 20px;
}

.site-footer__bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: var(--space-md);
}

.site-footer__bottom p {
}

/* Page content (Privacy Policy, Terms & Conditions, etc.) */
.page-content {
	padding-block: var(--space-xl);
	max-width: var(--narrow-width);
}

.page-content__header {
	margin-bottom: var(--space-md);
}

.page-content__body h2 {
	margin-top: var(--space-md);
	margin-bottom: var(--space-sm);
}

.page-content__body p,
.page-content__body ul,
.page-content__body ol {
	margin-bottom: var(--space-sm);
	line-height: 1.7;
}

.page-content__body ul,
.page-content__body ol {
	padding-left: var(--space-md);
}

.page-content__body li + li {
	margin-top: var(--space-xs);
}

.site-footer .portal-login-btn {
	color: var(--color-brown);
	border-color: var(--color-brown);
}

.site-footer .portal-login-btn:hover {
	background-color: rgba(58, 52, 51, 0.05);
}

/* Footer — Responsive */
@media (max-width: 768px) {
	.site-footer__main {
		flex-direction: column;
		gap: var(--space-md);
	}

	.site-footer__brand {
		max-width: none;
	}

	.site-footer__logos {
		width: 100%;
		grid-template-columns: repeat(2, 1fr);
	}

	.site-footer__badge img {
		margin-bottom: 2em;
	}

	.site-footer__acknowledgement {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-sm);
	}

	.site-footer .portal-login-btn {
		display: none;
	}
}
