/*
Theme Name: AW Base
Theme URI: https://actuallyworks.com.au
Author: Actually Works
Author URI: https://actuallyworks.com.au
Description: Base block-compatible theme for Actually Works Platform builds. Forked per client. Tokens drive every visual decision; no hard-coded values. Consumes aw-admin, aw-fields, and aw-blocks.
Version: 0.1.0
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 8.1
License: Proprietary
License URI: https://actuallyworks.com.au
Text Domain: aw
Tags: block-patterns, custom-logo, custom-menu, featured-images, full-site-editing-optional
*/

/* Base reset and rhythm. Values come only from tokens.css. */

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

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

body {
	margin: 0;
	background: var(--aw-color-bg);
	color: var(--aw-color-text);
	font-family: var(--aw-font-body);
	font-size: var(--aw-font-size-base);
	line-height: var(--aw-line-height);
}

h1,
h2,
h3,
h4 {
	font-family: var(--aw-font-heading);
	line-height: var(--aw-line-height-heading);
	margin: 0 0 var(--aw-space-sm);
}

h1 {
	font-size: var(--aw-font-size-h1);
}

h2 {
	font-size: var(--aw-font-size-h2);
}

h3 {
	font-size: var(--aw-font-size-h3);
}

p,
ul,
ol {
	margin: 0 0 var(--aw-space-sm);
}

a {
	color: var(--aw-color-link);
	transition: color var(--aw-transition-fast);
}

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

/* Visible keyboard focus everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: var(--aw-focus-ring);
	outline-offset: 2px;
}

/* Layout container shared by chrome and content. */
.aw-container {
	width: 100%;
	max-width: var(--aw-content-width);
	margin-inline: auto;
	padding-inline: var(--aw-space-sm);
}

/* Content column width for non-block (classic) post and page bodies. */
.aw-site-main {
	display: block;
}

.aw-entry {
	max-width: var(--aw-content-width-narrow);
	margin-inline: auto;
	padding-block: var(--aw-space-lg);
	padding-inline: var(--aw-space-sm);
}

/* Full-width blocks (alignfull) escape the entry column. */
.aw-entry > .alignfull {
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
}

.aw-entry > .alignwide {
	max-width: var(--aw-content-width-wide);
	margin-inline: calc(50% - 50vw);
	margin-inline: auto;
}

.aw-entry__title {
	font-size: var(--aw-font-size-h1);
	margin-bottom: var(--aw-space-md);
}

.aw-entry__meta {
	color: var(--aw-color-muted);
	font-size: var(--aw-font-size-small);
	margin-bottom: var(--aw-space-md);
}

/* Skip link: hidden until focused. */
.aw-skip-link {
	position: absolute;
	left: var(--aw-space-xs);
	top: calc(-1 * var(--aw-space-xl));
	z-index: 100;
	padding: var(--aw-space-xs) var(--aw-space-sm);
	background: var(--aw-color-accent);
	color: var(--aw-color-accent-text);
	border-radius: var(--aw-radius);
	transition: top var(--aw-transition-base);
}

.aw-skip-link:focus {
	top: var(--aw-space-xs);
}

/* Site header. */
.aw-site-header {
	background: var(--aw-header-bg);
	color: var(--aw-header-text);
	border-bottom: var(--aw-border-width) solid var(--aw-color-border);
	padding-block: var(--aw-header-padding-block);
}

.aw-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--aw-space-md);
	flex-wrap: wrap;
}

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

.aw-site-branding__title {
	font-size: var(--aw-font-size-lead);
	font-weight: 700;
	margin: 0;
}

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

.aw-custom-logo {
	max-height: 3rem;
	width: auto;
}

/* Navigation. */
.aw-primary-nav ul,
.aw-footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--aw-space-md);
}

.aw-primary-nav a,
.aw-footer-nav a {
	color: inherit;
	text-decoration: none;
	font-weight: 600;
}

.aw-primary-nav a:hover,
.aw-primary-nav a:focus,
.aw-footer-nav a:hover,
.aw-footer-nav a:focus {
	text-decoration: underline;
}

/* Site footer. */
.aw-site-footer {
	background: var(--aw-footer-bg);
	color: var(--aw-footer-text);
	padding-block: var(--aw-footer-padding-block);
	margin-top: var(--aw-space-xl);
}

.aw-site-footer a {
	color: inherit;
}

.aw-site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aw-space-md);
	justify-content: space-between;
	align-items: flex-start;
}

.aw-site-footer__org p {
	margin: 0 0 var(--aw-space-xs);
}

.aw-site-footer__legal {
	margin-top: var(--aw-space-md);
	color: var(--aw-footer-muted);
	font-size: var(--aw-font-size-small);
}

/* Search form. */
.aw-search-form {
	display: flex;
	gap: var(--aw-space-xs);
	max-width: var(--aw-content-width-narrow);
}

.aw-search-form__field {
	flex: 1 1 auto;
	padding: var(--aw-space-xs) var(--aw-space-sm);
	border: var(--aw-border-width) solid var(--aw-color-border);
	border-radius: var(--aw-radius);
	font: inherit;
}

.aw-search-form__submit {
	padding: var(--aw-space-xs) var(--aw-space-md);
	border: none;
	border-radius: var(--aw-radius);
	background: var(--aw-color-accent);
	color: var(--aw-color-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* Post list (index, archive, search). */
.aw-post-list {
	max-width: var(--aw-content-width-narrow);
	margin-inline: auto;
	padding-block: var(--aw-space-lg);
	padding-inline: var(--aw-space-sm);
}

.aw-post-card {
	padding-block: var(--aw-space-md);
	border-bottom: var(--aw-border-width) solid var(--aw-color-border);
}

.aw-post-card__title {
	margin-bottom: var(--aw-space-xs);
}

.aw-post-card__title a {
	text-decoration: none;
}

.aw-post-card__excerpt {
	color: var(--aw-color-muted);
}

/* Pagination. */
.aw-pagination {
	display: flex;
	gap: var(--aw-space-sm);
	margin-top: var(--aw-space-lg);
}

/* 404 and empty states. */
.aw-empty {
	max-width: var(--aw-content-width-narrow);
	margin-inline: auto;
	padding-block: var(--aw-space-xl);
	padding-inline: var(--aw-space-sm);
	text-align: center;
}

/* Accessible-only text. */
.screen-reader-text {
	border: 0;
	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;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
