/*
 * digiloom: style guide page.
 * Source: Figma Make `StyleGuide.tsx` — four numbered sections, each opening
 * with a rule-underlined heading, then a grid of specimen panels.
 */

.digiloom-sg-section {
	position: relative;
	z-index: 1;
}

.digiloom-sg-section__head {
	border-bottom: 1px solid var(--wp--preset--color--slate-line);
	margin-bottom: 32px;
	padding-bottom: 16px;
}

.digiloom-sg-section__head > * {
	margin-left: 0 !important;
	margin-right: auto !important;
}

.digiloom-sg-section__note {
	color: var(--wp--preset--color--slate-muted);
}

.digiloom-sg-subhead {
	color: #1e293b;
	margin: 40px 0 16px;
}

/* Grids -------------------------------------------------------------- */

.digiloom-sg-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 782px) {

	.digiloom-sg-grid--two { grid-template-columns: repeat(2, 1fr); gap: 32px; }
	.digiloom-sg-grid--three { grid-template-columns: repeat(3, 1fr); gap: 32px; }
	.digiloom-sg-grid--four { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 781px) {

	.digiloom-sg-grid--two,
	.digiloom-sg-grid--three { grid-template-columns: 1fr; gap: 24px; }
}

/* Logo lockups ------------------------------------------------------- */

.digiloom-lockup {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--slate-line);
	border-radius: var(--wp--custom--radius--xl);
	padding: 48px;
	text-align: center;
}

.digiloom-lockup--dark {
	background-color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink-soft);
}

.digiloom-lockup__label {
	color: var(--wp--preset--color--slate-muted);
	font-size: 12px;
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: 0.12em;
	margin: 0;
	text-transform: uppercase;
}

.digiloom-lockup__icon {
	margin: 0;
}

.digiloom-lockup__word {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 36px;
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: -0.02em;
	line-height: 1;
	margin: 0;
}

.digiloom-lockup--dark .digiloom-lockup__word {
	color: var(--wp--preset--color--white);
}

/* Colour swatches ---------------------------------------------------- */

.digiloom-swatch {
	border-radius: var(--wp--custom--radius--lg);
	box-shadow: var(--wp--preset--shadow--light);
	color: var(--wp--preset--color--white);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 128px;
	padding: 20px;
	position: relative;
	transition: transform var(--wp--custom--transition--slow);
}

.digiloom-swatch:hover {
	transform: translateY(-4px);
}

.digiloom-swatch--dark-text {
	color: var(--wp--preset--color--ink);
}

.digiloom-swatch > * {
	margin-left: 0 !important;
	margin-right: auto !important;
}

.digiloom-swatch__name {
	color: inherit;
	font-size: var(--wp--preset--font-size--xx-small);
	font-weight: var(--wp--custom--font-weight--semi-bold);
	letter-spacing: 0.08em;
	margin: 0 0 auto;
	text-transform: uppercase;
}

.digiloom-swatch__hex {
	color: inherit;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: var(--wp--custom--font-weight--bold);
	margin: 0;
}

.digiloom-swatch__token {
	color: inherit;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 10px;
	margin: 2px 0 0;
	opacity: 0.75;
	overflow-wrap: anywhere;
}

/* Copy affordance, revealed on hover; becomes a tick once copied. */
.digiloom-swatch::after {
	background-color: currentColor;
	content: "";
	height: 16px;
	opacity: 0;
	position: absolute;
	right: 16px;
	top: 16px;
	transition: opacity var(--wp--custom--transition--base);
	width: 16px;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.digiloom-swatch:hover::after,
.digiloom-swatch:focus-visible::after,
.digiloom-swatch.is-copied::after {
	opacity: 1;
}

.digiloom-swatch.is-copied::after {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* Specimen panels ---------------------------------------------------- */

.digiloom-sg-panel {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--slate-line);
	border-radius: var(--wp--custom--radius--xl);
	box-shadow: var(--wp--preset--shadow--light);
	padding: 32px;
}

.digiloom-sg-panel > * {
	margin-left: 0 !important;
	margin-right: auto !important;
}

.digiloom-sg-panel__title {
	margin: 0 0 8px;
}

/* Typography specimen ------------------------------------------------ */

.digiloom-type-specimen {
	display: grid;
	gap: 40px;
	grid-template-columns: 1fr;
	padding: 32px;
}

@media (min-width: 1024px) {

	.digiloom-type-specimen {
		gap: 64px;
		grid-template-columns: repeat(2, 1fr);
		padding: 48px;
	}
}

.digiloom-type-specimen__col > * {
	margin-left: 0 !important;
	margin-right: auto !important;
}

.digiloom-type-specimen__kicker {
	color: var(--wp--preset--color--indigo);
	font-size: var(--wp--preset--font-size--xx-small);
	font-weight: var(--wp--custom--font-weight--bold);
	letter-spacing: 0.08em;
	margin: 0;
	text-transform: uppercase;
}

.digiloom-type-specimen__kicker--pink {
	color: var(--wp--preset--color--pink);
}

.digiloom-type-specimen__face {
	border-bottom: 1px solid var(--wp--preset--color--slate-tint);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 36px;
	font-weight: var(--wp--custom--font-weight--bold);
	margin: 0;
	padding-bottom: 16px;
}

.digiloom-type-specimen__face--body {
	font-family: var(--wp--preset--font-family--body);
	font-weight: var(--wp--custom--font-weight--semi-bold);
}

/* Heading scale rows — the label is a CSS-generated gutter so the visible
   text stays a single editable string. */
.digiloom-type-row {
	align-items: baseline;
	color: var(--wp--preset--color--ink);
	display: flex;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--wp--custom--font-weight--bold);
	gap: 24px;
	margin: 0;
}

.digiloom-type-row::before {
	color: var(--wp--preset--color--slate-muted);
	flex: 0 0 48px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--wp--preset--font-size--xx-small);
	font-weight: var(--wp--custom--font-weight--regular);
}

.digiloom-type-row--h1 { font-size: 48px; }
.digiloom-type-row--h1::before { content: "H1"; }
.digiloom-type-row--h2 { font-size: 36px; }
.digiloom-type-row--h2::before { content: "H2"; }
.digiloom-type-row--h3 { font-size: 30px; }
.digiloom-type-row--h3::before { content: "H3"; }
.digiloom-type-row--h4 { font-size: 24px; }
.digiloom-type-row--h4::before { content: "H4"; }

.digiloom-type-label {
	color: var(--wp--preset--color--slate-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: var(--wp--preset--font-size--xx-small);
	margin: 0;
}

.digiloom-type-sample {
	color: #334155;
	line-height: var(--wp--custom--line-height--body);
	margin: 0;
}

.digiloom-type-sample--lg {
	font-size: var(--wp--preset--font-size--small);
}

.digiloom-type-sample--sm {
	color: var(--wp--preset--color--slate-muted);
	font-size: var(--wp--preset--font-size--xx-small);
}

/* Button specimens --------------------------------------------------- */

.digiloom-sg-buttons {
	gap: 16px;
	width: 100%;
}

.digiloom-sg-buttons .wp-block-button {
	width: 100%;
}

.digiloom-sg-buttons .wp-block-button__link {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	padding: 10px 20px;
	text-align: center;
	width: 100%;
}

.digiloom-button--secondary .wp-block-button__link {
	background-color: #faf5ff;
	border: 1px solid #e9d5ff;
	color: #7e22ce;
}

.digiloom-button--secondary .wp-block-button__link:hover,
.digiloom-button--secondary .wp-block-button__link:focus {
	background-color: #f3e8ff;
}

.digiloom-button--outline .wp-block-button__link {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--slate-line);
	color: #334155;
}

.digiloom-button--outline .wp-block-button__link:hover,
.digiloom-button--outline .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--base);
}

.digiloom-button--accent .wp-block-button__link {
	background-color: var(--wp--preset--color--pink);
}

.digiloom-button--accent .wp-block-button__link:hover,
.digiloom-button--accent .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--pink-deep);
}

/* Form specimen ------------------------------------------------------ */

.digiloom-sg-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.digiloom-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
}

.digiloom-field__label {
	color: #334155;
	font-size: var(--wp--preset--font-size--xx-small);
	font-weight: var(--wp--custom--font-weight--medium);
}

.digiloom-field__input {
	background-color: var(--wp--preset--color--base);
	opacity: 1;
}

.digiloom-field--check {
	align-items: center;
	flex-direction: row;
	gap: 12px;
	padding-top: 8px;
}

.digiloom-field__checkbox {
	accent-color: var(--wp--preset--color--indigo);
	height: 20px;
	width: 20px;
}

.digiloom-field--check .digiloom-field__label {
	color: var(--wp--preset--color--slate);
}

/* Content card specimen ---------------------------------------------- */

.digiloom-demo-card__media {
	align-items: flex-end;
	display: flex;
	background-image: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	border-radius: var(--wp--custom--radius--lg);
	color: var(--wp--preset--color--white);
	display: flex;
	font-size: 11px;
	font-weight: var(--wp--custom--font-weight--semi-bold);
	height: 128px;
	letter-spacing: 0.08em;
	margin: 0;
	overflow: hidden;
	padding: 24px;
	position: relative;
}

/* The faint target motif, bottom right. */
.digiloom-demo-card__media::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M 10 50 L 90 50' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='M 50 10 L 50 90' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
	bottom: -40px;
	content: "";
	height: 192px;
	opacity: 0.2;
	position: absolute;
	right: -40px;
	width: 192px;
}

/* The chip sits above the motif. */
.digiloom-demo-card__chip {
	background-color: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(12px);
	border-radius: var(--wp--custom--radius--full);
	color: var(--wp--preset--color--white);
	font-size: 11px;
	font-weight: var(--wp--custom--font-weight--semi-bold);
	letter-spacing: 0.08em;
	margin: 0;
	padding: 4px 12px;
	position: relative;
	text-transform: uppercase;
	z-index: 1;
}

.digiloom-demo-card__title {
	margin: 0;
}

.digiloom-demo-card__text {
	color: var(--wp--preset--color--slate);
	font-size: var(--wp--preset--font-size--xx-small);
	line-height: var(--wp--custom--line-height--body);
	margin: 0;
}

.digiloom-arrow-link--sm a {
	font-size: var(--wp--preset--font-size--xx-small);
	font-weight: var(--wp--custom--font-weight--semi-bold);
}

.digiloom-arrow-link--sm a::after {
	height: 14px;
	width: 14px;
}
