/**
 * Arlowe Hardware Co. — Product Tearsheet Styles
 *
 * Standalone CSS for the print-optimised product specification page.
 * No Tailwind dependency — plain CSS for maximum print reliability.
 */

/* ============================================
   RESET + BASE
   ============================================ */

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

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

body {
	font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: #2C2C2C;
	background: #fff;
}

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

a {
	color: inherit;
	text-decoration: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.ts-font-display {
	font-family: 'Cormorant Garamond', 'Georgia', serif;
}

.ts-font-body {
	font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

/* ============================================
   LAYOUT — SCREEN PREVIEW
   ============================================ */

.tearsheet {
	max-width: 800px;
	margin: 0 auto;
	padding: 0;
	background: #fff;
}

/* ============================================
   HEADER
   ============================================ */

.ts-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 32px;
	background: #1B2E20;
	color: #FAF8F5;
}

.ts-header-logo img {
	height: 40px;
	width: auto;
}

.ts-header-meta {
	text-align: right;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(250, 248, 245, 0.6);
}

.ts-header-meta strong {
	display: block;
	color: #FAF8F5;
	font-weight: 500;
	margin-bottom: 2px;
}

/* ============================================
   PRODUCT HERO
   ============================================ */

.ts-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	padding: 32px;
	border-bottom: 1px solid #E8E4DE;
}

.ts-hero-image {
	background: #F5F0EB;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	overflow: hidden;
}

.ts-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ts-hero-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ts-product-category {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #2D5A3D;
	font-weight: 500;
	margin-bottom: 8px;
}

.ts-product-name {
	font-family: 'Cormorant Garamond', 'Georgia', serif;
	font-size: 32px;
	font-weight: 400;
	line-height: 1.15;
	color: #2C2C2C;
	margin-bottom: 8px;
}

.ts-product-desc {
	font-size: 13px;
	color: #7A7A72;
	line-height: 1.6;
	margin-bottom: 20px;
}

.ts-product-overview dt {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #7A7A72;
	font-weight: 400;
	margin-bottom: 2px;
}

.ts-product-overview dd {
	font-size: 13px;
	color: #2C2C2C;
	margin-bottom: 12px;
}

/* ============================================
   SPECIFICATIONS TABLE
   ============================================ */

.ts-section {
	padding: 24px 32px;
	border-bottom: 1px solid #E8E4DE;
}

.ts-section-title {
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #2D5A3D;
	font-weight: 500;
	margin-bottom: 16px;
}

.ts-specs-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

.ts-spec-item {
	display: flex;
	flex-direction: column;
	padding: 10px 0;
	border-bottom: 1px solid #F0ECE6;
}

.ts-spec-label {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7A7A72;
	font-weight: 400;
	margin-bottom: 2px;
}

.ts-spec-value {
	font-size: 13px;
	color: #2C2C2C;
}

/* ============================================
   FINISHES
   ============================================ */

.ts-finishes-row {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
}

.ts-finish-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ts-finish-swatch {
	width: 48px;
	height: 48px;
	border-radius: 2px;
	border: 1px solid #E8E4DE;
	flex-shrink: 0;
	overflow: hidden;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

.ts-finish-swatch--img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ts-finish-name {
	font-size: 13px;
	color: #2C2C2C;
}

/* ============================================
   VARIATIONS / PRICING TABLE
   ============================================ */

.ts-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ts-table thead th {
	text-align: left;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7A7A72;
	font-weight: 500;
	padding: 8px 12px 8px 0;
	border-bottom: 1px solid #2C2C2C;
}

.ts-table tbody td {
	padding: 8px 12px 8px 0;
	border-bottom: 1px solid #F0ECE6;
	color: #2C2C2C;
	vertical-align: top;
}

.ts-table .ts-finish-group td {
	padding-top: 16px;
	font-weight: 500;
}

.ts-table .ts-price {
	font-weight: 500;
	color: #2D5A3D;
}

/* ============================================
   FOOTER
   ============================================ */

.ts-footer {
	padding: 24px 32px;
	background: #F5F0EB;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
}

.ts-footer-brand {
	font-family: 'Cormorant Garamond', 'Georgia', serif;
	font-size: 16px;
	font-weight: 400;
	color: #2C2C2C;
	margin-bottom: 4px;
}

.ts-footer-contact {
	font-size: 12px;
	color: #7A7A72;
	line-height: 1.5;
}

.ts-footer-legal {
	font-size: 11px;
	color: #7A7A72;
	line-height: 1.5;
}

.ts-footer-date {
	font-size: 11px;
	color: #7A7A72;
	text-align: right;
	white-space: nowrap;
}

/* ============================================
   ALL-FINISHES IMAGE GALLERY
   ============================================ */

.ts-finish-images-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.ts-finish-image-item {
	text-align: center;
}

.ts-finish-image-wrap {
	background: #F3F1EB;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 8px;
}

.ts-finish-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ts-finish-image-label {
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7A7A72;
	font-weight: 400;
}

/* ============================================
   SCREEN-ONLY STYLES
   ============================================ */

@media screen {
	body {
		background: #E8E4DE;
		padding: 40px 20px;
	}

	.tearsheet {
		box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
	}

	/* Action bar — sharing + print row */
	.ts-action-bar {
		display: flex;
		justify-content: center;
		gap: 8px;
		max-width: 800px;
		margin: 0 auto 20px;
		flex-wrap: wrap;
	}

	.ts-action-btn {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		font-family: 'DM Sans', system-ui, sans-serif;
		font-size: 12px;
		font-weight: 500;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: #FAF8F5;
		background: #505048;
		border: none;
		padding: 10px 20px;
		cursor: pointer;
		transition: background 0.2s;
		text-decoration: none;
		line-height: 1;
	}

	.ts-action-btn:hover {
		background: #2C2C2C;
	}

	.ts-action-btn--primary {
		background: #2D5A3D;
	}

	.ts-action-btn--primary:hover {
		background: #1B2E20;
	}

	.ts-action-btn svg {
		flex-shrink: 0;
	}
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
	@page {
		size: A4;
		margin: 15mm 12mm;
	}

	body {
		background: #fff;
		padding: 0;
		font-size: 12px;
	}

	.tearsheet {
		max-width: none;
		box-shadow: none;
	}

	.ts-action-bar {
		display: none !important;
	}

	/* Force background colours to print */
	.ts-header,
	.ts-finish-swatch,
	.ts-finish-image-wrap,
	.ts-footer {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* Finish images grid — tighten for print */
	.ts-finish-images-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}

	.ts-finish-image-wrap {
		max-height: 140px;
	}

	.ts-finish-image-wrap img {
		max-height: 140px;
		object-fit: contain;
	}

	/* Prevent awkward page breaks */
	.ts-hero,
	.ts-section {
		page-break-inside: avoid;
		break-inside: avoid;
	}

	/* Let the variations table break across pages if needed */
	.ts-section--variations {
		page-break-inside: auto;
		break-inside: auto;
	}

	.ts-table thead {
		display: table-header-group;
	}

	.ts-table tr {
		page-break-inside: avoid;
		break-inside: avoid;
	}

	/* Footer always at end */
	.ts-footer {
		page-break-before: auto;
	}

	/* Shrink hero image for print */
	.ts-hero-image {
		max-height: 200px;
	}

	.ts-hero-image img {
		max-height: 200px;
		object-fit: contain;
	}

	/* Tighten spacing */
	.ts-hero {
		padding: 20px 24px;
		gap: 20px;
	}

	.ts-section {
		padding: 16px 24px;
	}

	.ts-header {
		padding: 16px 24px;
	}

	.ts-footer {
		padding: 16px 24px;
	}
}
