/* IHH Frontend Booking Overview - styling matches MPHB admin calendar */

/* Full-bleed: bryd ud af temaets indholdscontainer.
 * Tving parent-elementer til at lade os strække ud,
 * uden at ændre på resten af sidens layout. */
body.page .ihh-fc-wrap,
.ihh-fc-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #333;
	width: 100vw !important;
	max-width: 100vw !important;
	position: relative;
	left: 50% !important;
	right: 50% !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	padding: 1em 24px;
	box-sizing: border-box;
}

/* Hvis et forfader-element clipper indholdet, undertryk det for vores wrap kun.
 * Vi bruger :has() (moderne browsere) og en JS-fallback i calendar.js. */
body:has(.ihh-fc-wrap) .entry-content,
body:has(.ihh-fc-wrap) .post-content,
body:has(.ihh-fc-wrap) main,
body:has(.ihh-fc-wrap) .site-content,
body:has(.ihh-fc-wrap) .content-area,
body:has(.ihh-fc-wrap) article {
	overflow: visible !important;
	max-width: none !important;
}

@media (max-width: 768px) {
	.ihh-fc-wrap {
		padding: 1em 8px;
	}
}

/* Navigation */
.ihh-fc-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.ihh-fc-nav-btn,
.ihh-fc-nav-today {
	display: inline-block;
	padding: 6px 14px;
	background: #f4f4f4;
	color: #333;
	text-decoration: none;
	border-radius: 4px;
	border: 1px solid #ddd;
	font-size: 14px;
	line-height: 1.4;
	transition: background 0.15s ease;
}
.ihh-fc-nav-btn:hover,
.ihh-fc-nav-today:hover {
	background: #e8e8e8;
	color: #000;
}
.ihh-fc-nav-current {
	font-size: 18px;
	font-weight: 600;
	color: #222;
	padding: 0 6px;
}
.ihh-fc-nav-today {
	margin-left: auto;
	background: #fff;
}

/* Month jump bar */
.ihh-fc-month-jump {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 12px;
	padding: 8px;
	background: #f4f4f4;
	border-radius: 4px;
	border: 1px solid #e5e5e5;
	align-items: center;
}
.ihh-fc-month-btn {
	display: inline-block;
	padding: 6px 12px;
	background: #fff;
	color: #333;
	border: 1px solid #d5d5d5;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	font-family: inherit;
	min-width: 48px;
}
.ihh-fc-month-btn:hover {
	background: #e8e8e8;
	border-color: #999;
}
.ihh-fc-month-btn.ihh-fc-month-current {
	background: #fff4c4;
	border-color: #d4a800;
	font-weight: 600;
}
.ihh-fc-month-btn.ihh-fc-month-active {
	background: #2271b1;
	color: #fff;
	border-color: #135e96;
}
.ihh-fc-month-btn.ihh-fc-jump-today {
	margin-left: auto;
	background: #2271b1;
	color: #fff;
	border-color: #135e96;
	font-weight: 600;
}
.ihh-fc-month-btn.ihh-fc-jump-today:hover {
	background: #135e96;
}
@media (max-width: 768px) {
	.ihh-fc-month-jump {
		padding: 6px;
		gap: 3px;
	}
	.ihh-fc-month-btn {
		padding: 5px 8px;
		font-size: 12px;
		min-width: 38px;
	}
}

/* Drag-to-scroll cursor */
.ihh-fc-scroll {
	cursor: grab;
	user-select: none;
}
.ihh-fc-scroll.ihh-fc-dragging {
	cursor: grabbing;
}

/* Optional: subtle vertical line at start of each new month */
.ihh-fc-rooms-table th.ihh-fc-day-head.ihh-fc-month-start {
	border-left: 2px solid #c0c0c0;
}

/* Legend */
.ihh-fc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 14px;
	font-size: 13px;
	color: #555;
}
.ihh-fc-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.ihh-fc-swatch {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 1px solid #ccc;
	border-radius: 2px;
}
.ihh-fc-swatch.ihh-fc-status-booked   { background: #cef093; }
.ihh-fc-swatch.ihh-fc-status-pending  { background: #fed24d; }
.ihh-fc-swatch.ihh-fc-status-external { background: #b0c4de; }
.ihh-fc-swatch.ihh-fc-status-blocked  { background: #ffd0d0; }

/* Calendar wrapper - horizontal scroll on small screens */
.ihh-fc-calendar-wrapper {
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
}
.ihh-fc-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* The table */
.ihh-fc-rooms-table {
	border-collapse: collapse;
	font-size: 11px;
	margin: 0;
	width: max-content;
	min-width: 100%;
	background: #fff;
}
.ihh-fc-rooms-table th,
.ihh-fc-rooms-table td {
	border: 1px solid #e5e5e5;
	margin: 0;
	padding: 0;
}

/* First column: room name - sticky on scroll */
.ihh-fc-rooms-table th.ihh-fc-room-head,
.ihh-fc-rooms-table th.ihh-fc-room-name {
	position: sticky;
	left: 0;
	z-index: 5;
	background: #f7f7f7;
	min-width: 160px;
	max-width: 200px;
	padding: 6px 10px;
	text-align: left;
	font-weight: 600;
	white-space: normal;
	box-shadow: 1px 0 0 #ddd;
}
.ihh-fc-rooms-table thead th.ihh-fc-room-head {
	z-index: 10;
	background: #f0f0f0;
}

/* Date header cells */
.ihh-fc-rooms-table th.ihh-fc-day-head {
	min-width: 22px;
	max-width: 22px;
	width: 22px;
	padding: 4px 0;
	background: #fafafa;
	text-align: center;
	color: #555;
	font-weight: 500;
	line-height: 1.1;
	vertical-align: top;
}
.ihh-fc-rooms-table th.ihh-fc-day-head .ihh-fc-day-num {
	display: block;
	font-size: 12px;
	color: #222;
	font-weight: 600;
}
.ihh-fc-rooms-table th.ihh-fc-day-head .ihh-fc-day-mon {
	display: block;
	font-size: 9px;
	color: #888;
	text-transform: uppercase;
}
.ihh-fc-rooms-table th.ihh-fc-day-head .ihh-fc-day-wd {
	display: block;
	font-size: 9px;
	color: #999;
	text-transform: uppercase;
}

/* Body cells */
.ihh-fc-rooms-table td.ihh-fc-cell {
	height: 28px;
	min-width: 22px;
	max-width: 22px;
	width: 22px;
	position: relative;
	background: #fff;
}
.ihh-fc-rooms-table td.ihh-fc-weekend {
	background: #fafafa;
}

/* Today highlight */
.ihh-fc-rooms-table .ihh-fc-today {
	background: #fffbe5 !important;
}
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-today {
	box-shadow: inset 0 0 0 1px #ffc107;
}

/* Locked cell base (full-width colored block) */
.ihh-fc-rooms-table td.ihh-fc-locked:after {
	content: '';
	position: absolute;
	top: 1px;
	right: -1px;
	bottom: 1px;
	left: 0;
	pointer-events: none;
}
.ihh-fc-rooms-table td.ihh-fc-locked.ihh-fc-status-booked:after   { background: #cef093; }
.ihh-fc-rooms-table td.ihh-fc-locked.ihh-fc-status-pending:after  { background: #fed24d; }
.ihh-fc-rooms-table td.ihh-fc-locked.ihh-fc-status-external:after { background: #b0c4de; }
.ihh-fc-rooms-table td.ihh-fc-locked.ihh-fc-status-blocked:after  { background: #ffd0d0; }

/* Check-in: only right half (left side empty for arrival diagonal feel) */
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-check-in:after {
	left: 1px;
}

/* Check-out: only left half (departure morning) */
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-check-out:before {
	content: '';
	position: absolute;
	top: 1px;
	bottom: 1px;
	left: 0;
	right: 50%;
	pointer-events: none;
}
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-check-out-booked:before   { background: #cef093; }
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-check-out-pending:before  { background: #fed24d; }
.ihh-fc-rooms-table td.ihh-fc-cell.ihh-fc-check-out-external:before { background: #b0c4de; }

/* If a cell is both check-out and locked (back-to-back booking), the locked :after still wins; that's fine. */

/* Make the room column header taller to match day-head triple-line */
.ihh-fc-rooms-table thead tr {
	height: 48px;
}

/* Mobile tweaks */
@media (max-width: 768px) {
	.ihh-fc-rooms-table th.ihh-fc-room-head,
	.ihh-fc-rooms-table th.ihh-fc-room-name {
		min-width: 120px;
		max-width: 140px;
		font-size: 10px;
		padding: 4px 6px;
	}
	.ihh-fc-rooms-table th.ihh-fc-day-head,
	.ihh-fc-rooms-table td.ihh-fc-cell {
		min-width: 18px;
		max-width: 18px;
		width: 18px;
	}
	.ihh-fc-rooms-table td.ihh-fc-cell {
		height: 26px;
	}
	.ihh-fc-nav-current {
		font-size: 16px;
	}
}
