/*
 * Efficiency Guru: site styles that theme.json can't express.
 * Library-style hubs: .eg-hub-intro, .eg-new-here, .eg-cards (grid), .eg-card.
 * Colours come from the theme.json palette, so a palette change in theme.json follows through here.
 */

/* Utility bar above the header: Questions and Get the Daily Brief. */
.eg-utility {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
}
.eg-utility a {
	color: var(--wp--preset--color--base);
	text-decoration: none;
	font-weight: 600;
}
.eg-utility a:hover,
.eg-utility a:focus {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent-1);
}

/* Header and footer rules. */
.eg-header {
	border-bottom: 3px solid var(--wp--preset--color--accent-1);
}
.eg-footer {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}
.eg-footer a,
.eg-footer .wp-block-site-title a {
	color: var(--wp--preset--color--base);
}

/* Hub intro: the short opening under a hub's title. */
.eg-hub-intro {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.45;
}

/* New here? call-out. */
.eg-new-here {
	padding: var(--wp--preset--spacing--40);
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--accent-2);
	border-left: 6px solid var(--wp--preset--color--accent-1);
	border-radius: 6px;
}
.eg-new-here > :first-child {
	margin-top: 0;
}
.eg-new-here > :last-child {
	margin-bottom: 0;
}
.eg-new-here h2 {
	font-size: var(--wp--preset--font-size--x-large);
}

/* Small label above a heading (navy-safe amber, 4.8:1 on cream). */
.eg-kicker {
	color: var(--wp--preset--color--amber-ink);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
}

/* Card grid: one column on a phone, two on a tablet, three on a desktop. */
.eg-cards {
	display: grid !important;
	grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--40);
}
@media (min-width: 640px) {
	.eg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
	.eg-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.eg-cards.eg-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.eg-cards > * {
	margin: 0 !important;
}

/* A card: image, title, one-line teaser, Explore button. The image is optional. */
.eg-card {
	display: flex !important;
	flex-direction: column;
	background: var(--wp--preset--color--accent-5);
	border: 1px solid var(--wp--preset--color--accent-6);
	border-top: 4px solid var(--wp--preset--color--accent-1);
	border-radius: 6px;
	overflow: hidden;
	height: 100%;
}
.eg-card .wp-block-image,
.eg-card figure {
	margin: 0 !important;
}
.eg-card .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}
.eg-card .eg-card-body {
	padding: var(--wp--preset--spacing--30);
	display: flex !important;
	flex-direction: column;
	flex: 1;
	gap: 0.6rem;
}
.eg-card .eg-card-body > * {
	margin: 0 !important;
}
.eg-card h2,
.eg-card h3 {
	font-size: var(--wp--preset--font-size--large);
}

/* Home hero: room above the first heading. */
.eg-hero {
	padding-top: var(--wp--preset--spacing--50);
}
.eg-card .eg-card-teaser {
	color: var(--wp--preset--color--accent-4);
	font-size: var(--wp--preset--font-size--medium);
	flex: 1;
}
.eg-card .wp-block-buttons {
	margin-top: 0.4rem !important;
}

/* Numbered list for the Daily Brief format and similar. */
.eg-steps li {
	margin-bottom: 0.5rem;
}

/* Text left for Neil or Sharyn to fill shows in red so it can't be missed (Automation Principles). */
.eg-gap {
	color: #C00000;
	font-weight: 700;
}

/* Visible keyboard focus everywhere. */
a:focus-visible,
.wp-element-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-1);
	outline-offset: 2px;
}

/* Tables in page content (the cookie list) fit a phone screen: long cookie names wrap. */
.wp-block-post-content table {
	width: 100%;
	table-layout: fixed;
	font-size: var(--wp--preset--font-size--medium);
}
.wp-block-post-content th,
.wp-block-post-content td {
	overflow-wrap: anywhere;
	vertical-align: top;
}
