/*
Theme Name:   GeneratePress Bra Sizes
Theme URI:    https://generatepress.com
Description:  A GeneratePress child theme for a bra size and price site built with the Bra Price Table plugin: a measuring-tape heatmap for the size grid, condensed figures for prices and sizes, and page patterns for the home page, size page, price drops, brands and how-it-works.
Author:       Your site
Template:     generatepress
Version:      1.3.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  gp-bra-child
*/

/* ==========================================================================
   Tokens
   The palette lives in GeneratePress's global colours (Appearance > Customize >
   Colors), which this theme sets as defaults: --contrast (ink), --contrast-2 (slate),
   --contrast-3 (mist), --base (rule), --base-2 (page), --base-3 (paper),
   --accent (thread) and --tape. The fallbacks below match them.
   ========================================================================== */

:root {
	--bra-ink: var(--contrast, #1E2130);
	--bra-slate: var(--contrast-2, #5A5F70);
	--bra-mist: var(--contrast-3, #A9ADB8);
	--bra-rule: var(--base, #D5D8D2);
	--bra-page: var(--base-2, #EEF0EC);
	--bra-paper: var(--base-3, #FFFFFF);
	--bra-thread: var(--accent, #33409A);
	--bra-tape: var(--tape, #F2C12E);
	--bra-sale: #B3261E;

	--bra-text: "Atkinson Hyperlegible", "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--bra-figures: "Barlow Condensed", "Roboto", "Arial Narrow", sans-serif;

	/* The plugin's sticky first column and pinned header take this background. */
	--bpd-bg: var(--bra-paper);
}

/* ==========================================================================
   Type
   ========================================================================== */

body,
button,
input,
select,
textarea {
	font-family: var(--bra-text);
}

body {
	color: var(--bra-ink);
	font-size: 17px;
	line-height: 1.6;
}

h1,
h2,
h3,
h4,
.main-title,
.bra-figures {
	font-family: var(--bra-figures);
	font-stretch: 75%;
	color: var(--bra-ink);
}

h1,
h2,
h3,
h4 {
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0;
}

h1,
.entry-title {
	font-size: 2.75rem;
	margin-bottom: 0.4em;
}

h2 {
	font-size: 1.85rem;
	margin: 1.6em 0 0.5em;
}

h3 {
	font-size: 1.35rem;
}

.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.bra-measure {
	max-width: 40em;
}

a {
	color: var(--bra-thread);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--bra-ink);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--bra-thread);
	outline-offset: 2px;
}

/* ==========================================================================
   Header and navigation
   ========================================================================== */

.site-header {
	border-bottom: 1px solid var(--bra-rule);
}

.main-title {
	font-size: 1.9rem;
	font-weight: 700;
	line-height: 1;
}

.main-title a,
.main-title a:hover {
	color: var(--bra-ink);
	text-decoration: none;
}

/* Logo beside the site name (GeneratePress's "Place logo next to title"). */
.site-branding-container .site-logo {
	margin-right: 12px;
}

.site-header .header-image {
	border-radius: 10px;
}

.site-description {
	color: var(--bra-slate);
	font-size: 0.9rem;
}

.main-navigation .main-nav ul li a {
	color: var(--bra-ink);
	font-weight: 700;
	font-size: 0.95rem;
}

.main-navigation .main-nav ul li[class*="current-menu-"] > a {
	text-decoration: underline;
	text-decoration-color: var(--bra-tape);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.45em;
}

/* The "Find your size" button the theme adds to the end of the menu. */
.main-navigation .menu-bar-item.bra-find-size > a {
	display: inline-block;
	margin-left: 10px;
	padding: 0 16px;
	border-radius: 4px;
	background-color: var(--bra-tape);
	color: var(--bra-ink);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 2.3;
	text-decoration: none;
}

.main-navigation .menu-bar-item.bra-find-size > a:hover,
.main-navigation .menu-bar-item.bra-find-size > a:focus {
	background-color: var(--bra-ink);
	color: var(--bra-paper);
}

/* ==========================================================================
   Content
   ========================================================================== */

.entry-header .bra-crumbs {
	margin: 0 0 0.6em;
	color: var(--bra-slate);
	font-size: 0.95rem;
}

.bra-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bra-crumbs li + li::before {
	content: "/";
	margin: 0 0.45em;
	color: var(--bra-mist);
}

.bra-crumbs a {
	color: var(--bra-slate);
}

.bra-crumbs [aria-current="page"] {
	color: var(--bra-ink);
}

/* Size pages: the heading is the size ("34DD bras"), set large. */
.bra-size-view .entry-title {
	font-size: 3.4rem;
	margin-bottom: 0.15em;
}

/* Text meant only for the size grid page, hidden on each size's page. */
.bra-size-view .bra-only-index {
	display: none;
}

/* Home page opening. */
.bra-hero-title {
	max-width: 14em;
	font-size: 3.6rem;
	line-height: 1;
	margin: 0.1em 0 0.35em;
}

.bra-hero-lead {
	color: var(--bra-slate);
	font-size: 1.2rem;
}

.wp-block-table {
	margin: 0 0 1.5em;
}

.wp-block-table table {
	font-variant-numeric: tabular-nums;
}

.wp-block-table td,
.wp-block-table th {
	padding: 0.3em 0.9em;
	border-color: var(--bra-rule);
	text-align: left;
}

.wp-block-table.bra-size-table {
	max-width: 24em;
}

.wp-block-table.bra-size-table td:first-child,
.wp-block-table.bra-size-table td:last-child,
.wp-block-table.bra-size-table th {
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.2rem;
	font-weight: 600;
}

button,
.button,
html input[type="button"],
input[type="submit"],
.wp-block-button__link {
	border-radius: 4px;
	background-color: var(--bra-ink);
	color: var(--bra-paper);
	font-weight: 700;
}

/* ==========================================================================
   Bra Price Table plugin
   ========================================================================== */

.bpd {
	--bpd-bg: var(--bra-paper);
}

.bpd-lead {
	font-size: 1.2rem;
	max-width: 40em;
}

.bpd-stats,
.bpd-meta,
.bpd-disclosure {
	color: var(--bra-slate);
}

.bpd-disclosure,
.bpd-meta {
	opacity: 1;
}

.bpd-scroll + .bpd-meta {
	margin-top: 0.8em;
}

/* Sister, cup and band links: the sizes in the figures face. */
.bpd-nearby {
	gap: 6px 22px;
	color: var(--bra-slate);
}

.bpd-nearby a,
.bpd-types strong {
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.2rem;
	font-weight: 600;
}

/* The brand page's "By type" line: the type you're on, unlinked. */
.bpd-types strong {
	color: var(--bra-ink);
}

.bpd-types a,
.bpd-types strong {
	white-space: nowrap;
}

/* Filters sit on the page tint rather than in a box. */
.bpd-filters {
	border: 0;
	border-radius: 6px;
	background-color: var(--bra-page);
}

.bpd-filters label {
	font-weight: 700;
}

.bpd-filters select,
.bpd-filters input[type="search"],
.bpd-filters input[type="number"] {
	min-height: 36px;
	padding: 4px 8px;
	border: 1px solid var(--bra-rule);
	border-radius: 4px;
	background-color: var(--bra-paper);
	color: var(--bra-ink);
	font-weight: 400;
}

.bpd-filters input[type="checkbox"] {
	accent-color: var(--bra-ink);
	width: 18px;
	height: 18px;
}

.bpd-count {
	color: var(--bra-slate);
	opacity: 1;
}

.bpd-filter-toggle {
	color: var(--bra-ink);
	background: var(--bra-paper);
}

/* Tables. */
.bpd-table {
	font-size: 0.95rem;
}

.bpd-table th,
.bpd-table td {
	border-bottom-color: var(--bra-rule);
}

.bpd-table thead th {
	border-bottom: 2px solid var(--bra-ink);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.15rem;
	font-weight: 700;
}

/* The sorted column carries a strip of tape. */
.bpd-table th[aria-sort] button {
	box-shadow: inset 0 -4px 0 var(--bra-tape);
}

.bpd-table th[aria-sort] button::after {
	content: none;
}

.bpd-table tbody tr:hover td {
	background-color: var(--bra-page);
}

.bpd-scroll .bpd-table tbody tr:hover td:first-child {
	background-color: var(--bra-page);
}

.bpd-table .bpd-key {
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.1;
}

.bpd-table .bpd-key .bpd-sub {
	font-family: var(--bra-text);
	font-stretch: 100%;
	font-size: 0.55em;
	line-height: 1.5;
}

.bpd-table td.bpd-title a {
	color: var(--bra-ink);
	font-weight: 700;
	text-decoration-color: var(--bra-rule);
}

.bpd-table td.bpd-title a:hover,
.bpd-table td.bpd-title a:focus {
	text-decoration-color: var(--bra-ink);
}

.bpd-sub {
	color: var(--bra-slate);
	opacity: 1;
}

/* The store's button under each price. */
.bpd-table .bpd-buy {
	margin-top: 6px;
	border-color: var(--bra-thread);
	color: var(--bra-thread);
	font-family: var(--bra-text);
	font-stretch: 100%;
	font-size: 0.75rem;
	line-height: 1.9;
}

.bpd-table .bpd-buy:hover,
.bpd-table .bpd-buy:focus {
	background-color: var(--bra-thread);
	color: var(--bra-paper);
	text-decoration: none;
}

/* Sales. */
.bpd-table td.bpd-num strong {
	color: var(--bra-sale);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.2rem;
}

.bpd-was {
	color: var(--bra-slate);
	opacity: 1;
}

.bpd-flag {
	color: var(--bra-sale);
	opacity: 1;
}

.bpd-table tr.bpd-sister td:not(:first-child) {
	opacity: 1;
	color: var(--bra-slate);
}

/* Deals and brands tables: the first column is a percentage or a name. */
.bpd-table td.bpd-key:not(.bpd-num) {
	font-family: var(--bra-text);
	font-stretch: 100%;
	font-size: 1rem;
}

/* ==========================================================================
   The size grid: a measuring-tape heatmap of where the stock is
   ========================================================================== */

.bpd-pick {
	gap: 12px 18px;
	padding: 14px 16px;
	border-radius: 6px;
	background-color: var(--bra-page);
}

.bpd-pick label {
	color: var(--bra-ink);
	font-size: 0.95rem;
}

.bpd-pick select {
	min-width: 6.5em;
	padding: 0 8px;
	border: 1px solid var(--bra-rule);
	border-radius: 4px;
	background-color: var(--bra-paper);
	color: var(--bra-ink);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.25rem;
	font-weight: 600;
}

.bpd-pick button {
	padding: 0 22px;
	border: 0;
	border-radius: 4px;
	background-color: var(--bra-tape);
	color: var(--bra-ink);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.25rem;
	font-weight: 700;
}

.bpd-pick button:hover,
.bpd-pick button:focus {
	background-color: var(--bra-ink);
	color: var(--bra-paper);
}

.bpd-grid {
	border-collapse: separate;
	border-spacing: 3px;
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.15rem;
}

.bpd-grid th,
.bpd-grid td {
	min-width: 2.7em;
	padding: 0;
	border: 0;
	border-radius: 3px;
	line-height: 2.3;
}

.bpd-grid thead th {
	border-bottom: 2px solid var(--bra-ink);
	border-radius: 0;
	font-size: 1.2rem;
}

.bpd-grid tbody th {
	padding-right: 8px;
	text-align: right;
}

/* Without the script, stocked cells get a light tint. */
.bpd-grid td:not(.bpd-empty) {
	background-color: rgba(242, 193, 46, 0.35);
}

/* With it, the tint follows how many bras are in stock (--heat runs 0 to 1). */
.bpd-grid td.bra-heat {
	background-color: rgba(242, 193, 46, calc(0.18 + var(--heat) * 0.82));
	background-color: color-mix(in srgb, var(--bra-tape) calc(18% + var(--heat) * 82%), var(--bra-paper));
}

.bpd-grid td a {
	color: var(--bra-ink);
	font-weight: 600;
}

.bpd-grid td a:hover,
.bpd-grid td a:focus {
	background-color: var(--bra-ink);
	color: var(--bra-paper);
	border-radius: 3px;
	text-decoration: none;
}

.bpd-grid td.bpd-empty {
	color: var(--bra-mist);
	opacity: 1;
}

.bpd-alpha a {
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.2rem;
	font-weight: 600;
}

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

.site-info {
	background-color: var(--bra-ink);
	color: var(--bra-mist);
	font-size: 0.9rem;
}

.site-info a {
	color: var(--bra-paper);
}

.inside-site-info {
	justify-content: flex-start;
}

.copyright-bar {
	text-align: left;
}

.bra-copy {
	color: var(--bra-paper);
	font-weight: 700;
}

.bra-footer-note {
	display: block;
	max-width: 46em;
	margin-top: 4px;
}

.bra-footer-links {
	margin-bottom: 14px;
}

.bra-footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bra-footer-menu a {
	color: var(--bra-paper);
	font-family: var(--bra-figures);
	font-stretch: 75%;
	font-size: 1.05rem;
	font-weight: 600;
	text-decoration: none;
}

.bra-footer-menu a:hover,
.bra-footer-menu a:focus {
	color: var(--bra-tape);
	text-decoration: underline;
}

/* The size chart page's conversion tables: as wide as their columns need. */
.bpd-table.bss-chart {
	width: auto;
	min-width: min(100%, 26em);
}

.bss-chart td,
.bss-chart th {
	text-align: left;
	vertical-align: baseline;
	padding-right: 2.5em;
}

/* ==========================================================================
   Back to top (GeneratePress's button, on by default in this theme)
   ========================================================================== */

a.generate-back-to-top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	right: 20px;
	bottom: 20px;
	border-radius: 50%;
	background-color: var(--bra-thread);
	color: var(--bra-paper);
	box-shadow: 0 2px 10px rgba(30, 33, 48, 0.25);
}

a.generate-back-to-top:hover,
a.generate-back-to-top:focus-visible {
	background-color: var(--bra-ink);
	color: var(--bra-tape);
}

a.generate-back-to-top:focus-visible {
	outline: 2px solid var(--bra-tape);
	outline-offset: 2px;
}

.generate-back-to-top .gp-icon svg {
	width: 20px;
	height: 20px;
}

/* ==========================================================================
   Phones
   ========================================================================== */

@media (max-width: 768px) {
	body {
		font-size: 16px;
	}

	h1,
	.entry-title {
		font-size: 2.2rem;
	}

	h2 {
		font-size: 1.6rem;
	}

	.bra-hero-title,
	.bra-size-view .entry-title {
		font-size: 2.7rem;
	}

	.main-navigation .menu-bar-item.bra-find-size > a {
		margin-left: 0;
		padding: 0 12px;
		font-size: 1rem;
	}

	.bpd-grid {
		border-spacing: 2px;
		font-size: 1.05rem;
	}

	.bpd-grid th,
	.bpd-grid td {
		min-width: 2.3em;
	}
}
