/*
 * Hostelp Core front-end styles. Functional base that works with any theme;
 * the Hostelp theme sets the --hp-* colours and fonts.
 */
:root {
	--hp-primary: #ffb606;
	--hp-accent: #2eb0d1;
	--hp-text: #2a2a2a;
	--hp-muted: #6b6b6b;
	--hp-border: #e3e6e8;
	--hp-surface: #ffffff;
	--hp-soft: #f4f6f7;
	--hp-ok: #1f8a3b;
	--hp-bad: #c0392b;
	--hp-radius: 10px;
	--hp-heading-font: inherit;
}

.hp-icon { fill: currentColor; vertical-align: -4px; flex-shrink: 0; }

/* Buttons */
.hp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	border: 2px solid var(--hp-primary);
	border-radius: 999px;
	background: var(--hp-primary);
	color: #1b1b1b;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hp-btn:hover, .hp-btn:focus-visible { background: #e9a400; border-color: #e9a400; color: #1b1b1b; }
.hp-btn--ghost { background: transparent; color: var(--hp-text); border-color: var(--hp-border); }
.hp-btn--ghost:hover, .hp-btn--ghost:focus-visible { background: var(--hp-soft); border-color: var(--hp-text); color: var(--hp-text); }
.hp-btn--accent { background: var(--hp-accent); border-color: var(--hp-accent); color: #fff; }
.hp-btn--accent:hover, .hp-btn--accent:focus-visible { background: #2497b4; border-color: #2497b4; color: #fff; }
.hp-btn--lg { padding: 14px 28px; font-size: 1.05rem; }

.hp-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.hp-empty { color: var(--hp-muted); font-style: italic; }

/* Room cards */
.hp-room-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}
.hp-room-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius);
	background: var(--hp-surface);
	color: var(--hp-text);
	transition: box-shadow 0.2s, transform 0.2s;
}
.hp-room-card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1); transform: translateY(-2px); }
.hp-room-card__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--hp-soft); }
.hp-room-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.hp-room-card:hover .hp-room-card__media img { transform: scale(1.04); }
.hp-room-card__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--hp-soft), var(--hp-border)); }
.hp-room-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.hp-room-card__title { margin: 0; font-family: var(--hp-heading-font); font-size: 1.25rem; line-height: 1.3; }
.hp-room-card__title a { color: inherit; text-decoration: none; }
.hp-room-card__title a:hover { color: var(--hp-accent); }
.hp-room-card__facts { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--hp-muted); font-size: 0.92rem; }
.hp-room-card__excerpt { margin: 0; color: var(--hp-muted); font-size: 0.95rem; line-height: 1.55; }
.hp-room-card__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hp-border); }
.hp-room-card__actions { display: flex; gap: 8px; }

.hp-price { display: flex; flex-direction: column; margin: 0; line-height: 1.2; }
.hp-price__amount { font-size: 1.35rem; font-weight: 700; color: var(--hp-text); }
.hp-price__unit { font-size: 0.8rem; color: var(--hp-muted); }

/* Slider */
.hp-slider { position: relative; }
.hp-slider__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 48px) / 3);
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding: 4px 2px 16px;
	/* Same as the side padding, so the first card already sits on a snap
	   point. Otherwise the browser snap-scrolls on load, and Chrome stops
	   measuring Largest Contentful Paint at the first scroll. */
	scroll-padding-inline: 2px;
	scrollbar-width: thin;
}
.hp-slider__track > * { scroll-snap-align: start; }
.hp-slider__track:focus-visible { outline: 2px solid var(--hp-accent); outline-offset: 4px; }
.hp-slider__btn {
	position: absolute;
	top: 35%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--hp-surface);
	color: var(--hp-text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	cursor: pointer;
}
.hp-slider__btn--prev { left: -18px; }
.hp-slider__btn--next { right: -18px; }
.hp-slider__btn:disabled { opacity: 0; pointer-events: none; }
.hp-slider--static .hp-slider__btn { display: none; }
@media (max-width: 960px) {
	.hp-slider__track { grid-auto-columns: calc((100% - 24px) / 2); }
}
@media (max-width: 640px) {
	.hp-slider__track { grid-auto-columns: 85%; gap: 16px; }
	.hp-slider__btn { display: none; }
}

/* Price list */
.hp-price-list__heading { margin: 1.5em 0 0.5em; font-family: var(--hp-heading-font); }
.hp-price-list__heading:first-child { margin-top: 0; }
.hp-price-table { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.hp-price-table th, .hp-price-table td { padding: 14px 12px; border-bottom: 1px solid var(--hp-border); text-align: left; vertical-align: top; }
.hp-price-table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hp-muted); font-weight: 600; }
.hp-price-table tbody th { font-weight: 600; }
.hp-price-table tbody th a { color: inherit; }
.hp-price-table .hp-num { text-align: right; white-space: nowrap; }
.hp-price-table__kind, .hp-price-table__note, .hp-price-table__unit { display: block; font-size: 0.82rem; font-weight: 400; color: var(--hp-muted); }
.hp-price-list__note { font-size: 0.9rem; color: var(--hp-muted); }
@media (max-width: 560px) {
	.hp-price-table thead { display: none; }
	.hp-price-table td:not(.hp-num) { display: none; }
}

/* Forms */
.hp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hp-field__label { font-size: 0.85rem; font-weight: 600; color: var(--hp-text); }
.hp-field input, .hp-field select, .hp-field textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid var(--hp-border);
	border-radius: 8px;
	background: #fff;
	color: var(--hp-text);
	font: inherit;
}
/* Same height for every one-line field: browsers give date inputs and
   drop-downs different natural heights, which made the search bar uneven. */
.hp-field input:not([type="checkbox"]):not([type="radio"]), .hp-field select { height: 48px; min-height: 0; line-height: normal; }

/* Own arrow for drop-downs, inset from the edge like the other fields */
.hp-field select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232a2a2a'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 20px;
	cursor: pointer;
}
.hp-field select::-ms-expand { display: none; }
.hp-field input:focus, .hp-field select:focus, .hp-field textarea:focus { outline: 2px solid var(--hp-accent); outline-offset: 0; border-color: var(--hp-accent); }
.hp-field [aria-invalid="true"] { border-color: var(--hp-bad); }
.hp-field__error { display: block; color: var(--hp-bad); font-size: 0.85rem; grid-column: 1 / -1; }
.hp-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.hp-check input { margin-top: 4px; width: 18px; height: 18px; flex-shrink: 0; }
.hp-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Search bar */
.hp-search-bar {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	align-items: end;
	gap: 14px;
	padding: 20px;
	border-radius: var(--hp-radius);
	background: var(--hp-surface);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.hp-search-bar .hp-btn { height: 48px; }
@media (max-width: 760px) {
	.hp-search-bar { grid-template-columns: 1fr 1fr; }
	.hp-search-bar .hp-field:nth-child(3), .hp-search-bar .hp-btn { grid-column: 1 / -1; }
}

/* Booking form */
.hp-booking { scroll-margin-top: 100px; }
.hp-booking-form { display: grid; gap: 24px; }
.hp-fieldset {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 22px;
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius);
	background: var(--hp-surface);
}
.hp-fieldset legend { padding: 0 8px; font-family: var(--hp-heading-font); font-size: 1.15rem; font-weight: 700; }
.hp-field--full, .hp-calendars, .hp-quote { grid-column: 1 / -1; }
@media (max-width: 560px) {
	.hp-fieldset { grid-template-columns: 1fr; padding: 16px; }
}
.hp-field[hidden] { display: none; }
.hp-booking-form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0; }
.hp-booking-form__note { color: var(--hp-muted); font-size: 0.9rem; }

.hp-quote { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; min-height: 1.5em; padding: 0; font-size: 0.95rem; }
.hp-quote:empty { display: none; }
.hp-quote.is-ok, .hp-quote.is-bad, .hp-quote.is-loading { padding: 12px 14px; border-radius: 8px; background: var(--hp-soft); }
.hp-quote.is-ok .hp-quote__status { color: var(--hp-ok); font-weight: 600; }
.hp-quote.is-bad { color: var(--hp-bad); font-weight: 600; }
.hp-quote__note { width: 100%; color: var(--hp-muted); font-size: 0.85rem; }

.hp-notice { padding: 16px 18px; border-radius: var(--hp-radius); margin: 0 0 20px; }
.hp-notice h3 { margin: 0 0 6px; }
.hp-notice p { margin: 6px 0 0; }
.hp-notice--success { background: #e8f6ec; border: 1px solid #b7e1c3; color: #11461f; }
.hp-notice--error { background: #fdecea; border: 1px solid #f3c2bc; color: #7a1d12; }

/* Calendars: check-in and check-out side by side */
.hp-calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; }
.hp-calendars .hp-calendar__legend { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) {
	.hp-calendars { grid-template-columns: 1fr; }
}
.hp-calendar { min-width: 0; }
.hp-calendar__label { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--hp-text); }
.hp-calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hp-calendar__title { text-transform: capitalize; }
.hp-calendar__nav { width: 36px; height: 36px; border: 1px solid var(--hp-border); border-radius: 50%; background: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--hp-text); }
.hp-calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.hp-calendar__wd { text-align: center; font-size: 0.72rem; text-transform: uppercase; color: var(--hp-muted); padding: 4px 0; }
.hp-calendar__day { height: 40px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--hp-text); padding: 0; }
.hp-calendar__day--empty { cursor: default; }
.hp-calendar__day.is-free { background: #e8f6ec; }
.hp-calendar__day.is-few { background: #fff3d1; }
.hp-calendar__day.is-full { background: #f7dcd8; color: #9a3b2f; text-decoration: line-through; }
.hp-calendar__day.is-off { color: #c3c7ca; cursor: not-allowed; }
.hp-calendar__day:disabled { cursor: not-allowed; }
.hp-calendar__day.is-range { box-shadow: inset 0 0 0 2px var(--hp-check-in, #8fd3f4); }
/* Check-in light blue, check-out dark blue */
.hp-calendar__day.is-start { background: var(--hp-check-in, #8fd3f4); color: #0b2f4a; font-weight: 700; text-decoration: none; }
.hp-calendar__day.is-end { background: var(--hp-check-out, #1b4f8a); color: #fff; font-weight: 700; text-decoration: none; }
.hp-calendar__day:not(:disabled):hover { outline: 2px solid var(--hp-accent); }
.hp-calendar__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 0.8rem; color: var(--hp-muted); }
.hp-calendar__legend i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.hp-calendar__legend .is-free { background: #e8f6ec; }
.hp-calendar__legend .is-few { background: #fff3d1; }
.hp-calendar__legend .is-full { background: #f7dcd8; }
.hp-calendar__legend .is-start { background: var(--hp-check-in, #8fd3f4); }
.hp-calendar__legend .is-end { background: var(--hp-check-out, #1b4f8a); }
