/**
 * Hospedus — base design system: reset, typography, layout, and component
 * classes (buttons, cards, forms, badges, nav, header, footer, icons,
 * spacing utilities), ported from task/html-models/design-system.css so the
 * guest-facing screens match the approved HTML models exactly.
 *
 * The --hsp-* token block itself is NOT repeated here — it is already
 * published by b-easy-stays' hospedus-tokens.css (this file depends on it).
 *
 * Two small corrections versus the source model, both real contrast bugs on
 * the dark .footer background that the model's own pages never exercised:
 * headings default to --hsp-primary-700 (invisible on --hsp-primary-900) and
 * .text-muted defaults to a mid-gray with poor contrast there too.
 */

/* Reset & Base */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-base);
	line-height: var(--hsp-lh-normal);
	color: var(--hsp-text-primary);
	background: var(--hsp-surface-base);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--hsp-font-brand);
	font-weight: 600;
	line-height: var(--hsp-lh-tight);
	color: var(--hsp-heading);
}

h1 { font-size: var(--hsp-text-4xl); }
h2 { font-size: var(--hsp-text-3xl); }
h3 { font-size: var(--hsp-text-2xl); }
h4 { font-size: var(--hsp-text-xl); }
h5 { font-size: var(--hsp-text-lg); }
h6 { font-size: var(--hsp-text-base); }

p {
	margin-bottom: var(--hsp-space-4);
}

a {
	color: var(--hsp-action);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--hsp-action-hover);
	text-decoration: underline;
}

/* Container */
.container {
	max-width: var(--hsp-container);
	margin: 0 auto;
	padding: 0 var(--hsp-space-4);
}

.container-lg {
	max-width: var(--hsp-container);
	margin: 0 auto;
	padding: 0 var(--hsp-space-5);
}

.container-narrow {
	max-width: var(--hsp-measure);
	margin: 0 auto;
	padding: 0 var(--hsp-space-4);
}

/* Grid System */
.grid {
	display: grid;
	gap: var(--hsp-space-5);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--hsp-space-2);
	padding: var(--hsp-space-3) var(--hsp-space-5);
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	font-weight: 500;
	line-height: 1;
	border: none;
	border-radius: var(--hsp-radius-md);
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
}

.btn:hover {
	text-decoration: none;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--hsp-action);
	color: var(--hsp-on-action);
}

.btn-primary:hover:not(:disabled) {
	background: var(--hsp-action-hover);
	color: var(--hsp-on-action);
	transform: translateY(-1px);
}

.btn-accent {
	background: var(--hsp-accent);
	color: var(--hsp-on-accent);
}

.btn-accent:hover:not(:disabled) {
	background: var(--hsp-accent-text);
	color: var(--hsp-on-accent);
	transform: translateY(-1px);
}

.btn-ghost {
	background: transparent;
	color: var(--hsp-action);
	border: 1px solid var(--hsp-action);
}

.btn-ghost:hover:not(:disabled) {
	background: var(--hsp-action-soft);
}

.btn-white {
	background: var(--hsp-surface-raised);
	color: var(--hsp-action);
}

.btn-white:hover:not(:disabled) {
	background: var(--hsp-surface-base);
}

.btn-lg {
	padding: var(--hsp-space-4) var(--hsp-space-6);
	font-size: var(--hsp-text-base);
}

.btn-sm {
	padding: var(--hsp-space-2) var(--hsp-space-3);
	font-size: var(--hsp-text-xs);
}

.btn-full {
	width: 100%;
}

/* Cards */
.card {
	background: var(--hsp-surface-raised);
	border: 1px solid var(--hsp-border-subtle);
	border-radius: var(--hsp-radius-lg);
	padding: var(--hsp-space-5);
	box-shadow: var(--hsp-shadow-sm);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
	box-shadow: var(--hsp-shadow-md);
	transform: translateY(-2px);
}

/* Property Card (used in grids across the site) */
.property-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--hsp-surface-raised);
	border-radius: var(--hsp-radius-lg);
	overflow: hidden;
	box-shadow: var(--hsp-shadow-sm);
	transition: all 0.2s ease;
}

.property-card:hover {
	box-shadow: var(--hsp-shadow-lg);
	transform: translateY(-4px);
}

.property-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
}

.property-badge {
	position: absolute;
	top: var(--hsp-space-3);
	right: var(--hsp-space-3);
	background: var(--hsp-action);
	color: white;
	padding: var(--hsp-space-1) var(--hsp-space-3);
	border-radius: var(--hsp-radius-full);
	font-size: var(--hsp-text-xs);
	font-weight: 500;
}

.property-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--hsp-space-4);
	/* Without this, a flex item never shrinks below its content's natural
	   width — a long title would widen the card instead of truncating. */
	min-width: 0;
}

/* Pins the CTA to the bottom of the card regardless of how much text sits
   above it, so every card in a row lines up. */
.property-content > .btn {
	margin-top: auto;
}

.property-title {
	font-family: var(--hsp-font-brand);
	font-size: calc(var(--hsp-text-lg) - 2px);
	font-weight: 600;
	margin-bottom: var(--hsp-space-2);
	color: var(--hsp-text-primary);
	overflow: hidden;
}

.property-title a {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: inherit;
}

.property-location {
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	color: var(--hsp-text-secondary);
	margin-bottom: var(--hsp-space-3);
}

.property-rating {
	display: flex;
	align-items: center;
	gap: var(--hsp-space-2);
	margin-bottom: var(--hsp-space-3);
	font-size: var(--hsp-text-sm);
}

.property-rating__stars {
	color: var(--hsp-accent);
}

.property-amenities {
	display: flex;
	gap: var(--hsp-space-3);
	margin-bottom: var(--hsp-space-4);
	font-size: var(--hsp-text-xs);
	color: var(--hsp-text-secondary);
}

.property-price {
	font-family: var(--hsp-font-brand);
	font-size: var(--hsp-text-xl);
	font-weight: 600;
	color: var(--hsp-action);
	margin-bottom: var(--hsp-space-3);
}

.property-price span {
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	color: var(--hsp-text-secondary);
	font-weight: 400;
}

/* Section Header (grid sections with a "view all" link) */
.section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--hsp-space-5);
}

.section-title {
	font-family: var(--hsp-font-brand);
	font-size: var(--hsp-text-2xl);
	font-weight: 600;
	color: var(--hsp-text-primary);
}

.section-link {
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	color: var(--hsp-action);
	text-decoration: none;
}

/* Forms */
.form-group {
	margin-bottom: var(--hsp-space-4);
}

.form-label {
	display: block;
	margin-bottom: var(--hsp-space-2);
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	font-weight: 500;
	color: var(--hsp-text-primary);
}

.form-input {
	width: 100%;
	padding: var(--hsp-space-3);
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	color: var(--hsp-text-primary);
	background: var(--hsp-surface-raised);
	border: 1px solid var(--hsp-border-subtle);
	border-radius: var(--hsp-radius-md);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
	outline: none;
	border-color: var(--hsp-action);
	box-shadow: var(--hsp-focus-ring);
}

.form-input::placeholder {
	color: var(--hsp-text-muted);
}

.form-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A5C68' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

/* Badge */
.badge {
	display: inline-flex;
	align-items: center;
	padding: var(--hsp-space-1) var(--hsp-space-3);
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-xs);
	font-weight: 500;
	border-radius: var(--hsp-radius-full);
}

.badge-primary { background: var(--hsp-primary-100); color: var(--hsp-action-text); }
.badge-accent { background: var(--hsp-accent-soft); color: var(--hsp-accent-text); }
.badge-success { background: var(--hsp-success-bg); color: var(--hsp-success); }

/* Navigation */
.nav {
	display: flex;
	align-items: center;
	gap: var(--hsp-space-4);
}

.nav-link {
	padding: var(--hsp-space-2) var(--hsp-space-3);
	font-family: var(--hsp-font-ui);
	font-size: var(--hsp-text-sm);
	color: var(--hsp-text-secondary);
	text-decoration: none;
	border-radius: var(--hsp-radius-md);
	transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
	color: var(--hsp-action);
	background: var(--hsp-action-soft);
	text-decoration: none;
}

/* Header */
.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hsp-space-3);
	padding: var(--hsp-space-4) var(--hsp-space-5);
	background: var(--hsp-surface-raised);
	border-bottom: 1px solid var(--hsp-border-subtle);
	position: sticky;
	top: 0;
	z-index: 100;
}

.header-logo {
	display: flex;
	align-items: center;
	font-family: var(--hsp-font-brand);
	font-size: var(--hsp-text-xl);
	font-weight: 600;
	color: var(--hsp-action);
	text-decoration: none;
}

.header-logo:hover {
	text-decoration: none;
}

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

/* Footer */
.footer {
	background: var(--hsp-surface-inverse);
	color: var(--hsp-text-on-inverse);
	padding: var(--hsp-space-7) var(--hsp-space-5);
}

.footer a {
	color: var(--hsp-text-on-inverse-muted);
}

.footer a:hover {
	color: var(--hsp-text-on-inverse);
}

.footer h3,
.footer h4 {
	color: var(--hsp-text-on-inverse);
}

.footer .text-muted {
	color: var(--hsp-text-on-inverse-muted);
}

/* Icons */
.icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.15em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.icon-fill {
	fill: currentColor;
	stroke: none;
}

/* Utilities */
.bdw-fe-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--hsp-text-muted); }
.text-primary { color: var(--hsp-action); }
.text-accent { color: var(--hsp-accent); }
.text-success { color: var(--hsp-success); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }

.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }

.gap-1 { gap: var(--hsp-space-1); }
.gap-2 { gap: var(--hsp-space-2); }
.gap-3 { gap: var(--hsp-space-3); }
.gap-4 { gap: var(--hsp-space-4); }

.mt-1 { margin-top: var(--hsp-space-1); }
.mt-2 { margin-top: var(--hsp-space-2); }
.mt-3 { margin-top: var(--hsp-space-3); }
.mt-4 { margin-top: var(--hsp-space-4); }
.mt-5 { margin-top: var(--hsp-space-5); }
.mt-6 { margin-top: var(--hsp-space-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--hsp-space-1); }
.mb-2 { margin-bottom: var(--hsp-space-2); }
.mb-3 { margin-bottom: var(--hsp-space-3); }
.mb-4 { margin-bottom: var(--hsp-space-4); }
.mb-5 { margin-bottom: var(--hsp-space-5); }
.mb-6 { margin-bottom: var(--hsp-space-6); }

.p-1 { padding: var(--hsp-space-1); }
.p-2 { padding: var(--hsp-space-2); }
.p-3 { padding: var(--hsp-space-3); }
.p-4 { padding: var(--hsp-space-4); }
.p-5 { padding: var(--hsp-space-5); }
.p-6 { padding: var(--hsp-space-6); }

.pt-1 { padding-top: var(--hsp-space-1); }
.pt-2 { padding-top: var(--hsp-space-2); }
.pt-3 { padding-top: var(--hsp-space-3); }
.pt-4 { padding-top: var(--hsp-space-4); }
.pt-5 { padding-top: var(--hsp-space-5); }
.pt-6 { padding-top: var(--hsp-space-6); }

/* Responsive */
@media (max-width: 768px) {
	.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

	.container, .container-lg, .container-narrow {
		padding: 0 var(--hsp-space-4);
	}

	h1 { font-size: var(--hsp-text-3xl); }
	h2 { font-size: var(--hsp-text-2xl); }
	h3 { font-size: var(--hsp-text-xl); }
}

@media (min-width: 769px) and (max-width: 1024px) {
	.grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Loading States */
.skeleton {
	background: linear-gradient(90deg, var(--hsp-surface-sunken) 25%, var(--hsp-surface-base) 50%, var(--hsp-neutral-100) 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Tabular Numbers */
.tabular-nums {
	font-variant-numeric: tabular-nums;
}
