/*
 * Walk Buddies public page — mobile-first, scoped under .wb-buddies.
 *
 * Colours bind to the Astra theme's global palette (joeshappytails.com)
 * with hex fallbacks for non-Astra contexts, so Customizer rebrands carry
 * through automatically. Buttons follow the site's recipe: square corners,
 * uppercase, letter-spaced Open Sans. Headings echo DM Serif Display.
 */

.wb-buddies {
	margin: 0 auto;
	--wb-accent: var(--ast-global-color-0, #6528f7);
	--wb-accent-strong: var(--ast-global-color-1, #5511f8);
	--wb-accent-soft: var(--ast-global-color-4, #f2f0fe);
	--wb-border: var(--ast-global-color-6, #d8d8f5);
	--wb-muted: var(--ast-global-color-3, #454f5e);
	--wb-heading: var(--ast-global-color-2, #0f172a);
	--wb-heading-font: "DM Serif Display", serif;
}

.wb-buddies .wb-empty {
	text-align: center;
	color: var(--wb-muted);
	padding: 2em 1em;
}

/* Tabs — styled like the site's buttons, outline when inactive */
.wb-buddies .wb-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
}

.wb-buddies .wb-tab {
	flex: 1;
	padding: 14px 16px;
	border: 1px solid var(--wb-accent-strong);
	border-radius: 0;
	background: transparent;
	color: var(--wb-accent-strong);
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 2px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wb-buddies .wb-tab.is-active {
	background: var(--wb-accent-strong);
	color: #fff;
}

/* Walk cards */
.wb-buddies .wb-walk {
	border: 1px solid var(--wb-border);
	border-radius: 4px;
	margin-bottom: 14px;
	overflow: hidden;
	background: #fff;
}

.wb-buddies .wb-walk-summary {
	list-style: none;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 4px 12px;
	align-items: center;
	padding: 14px 16px;
	cursor: pointer;
}

.wb-buddies .wb-walk-summary::-webkit-details-marker {
	display: none;
}

.wb-buddies .wb-walk-when {
	grid-column: 2;
	grid-row: 1;
}

.wb-buddies .wb-walk-summary::after {
	content: "▾";
	grid-column: 3;
	grid-row: 2;
	justify-self: end;
	color: var(--wb-muted);
	transition: transform 0.15s ease;
}

.wb-buddies .wb-walk[open] .wb-walk-summary::after {
	transform: rotate(180deg);
}

/* Avatar stack: first dog on top, the rest peeking out underneath. */
.wb-buddies .wb-stack {
	grid-column: 1;
	grid-row: 1 / span 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 48px;
}

.wb-buddies .wb-stack > * {
	position: relative;
	flex-shrink: 0;
}

.wb-buddies .wb-stack > :nth-child(1) { z-index: 4; }
.wb-buddies .wb-stack > :nth-child(2) { z-index: 3; margin-top: -32px; }
.wb-buddies .wb-stack > :nth-child(3) { z-index: 2; margin-top: -32px; }
.wb-buddies .wb-stack > :nth-child(4) { z-index: 1; margin-top: -32px; }

.wb-buddies .wb-stack-photo {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	background: var(--wb-accent-soft);
	box-sizing: border-box;
}

.wb-buddies .wb-stack-photo--none {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
}

.wb-buddies .wb-stack-more {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: var(--wb-accent-soft);
	color: var(--wb-accent-strong);
	font-size: 0.85em;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.wb-buddies .wb-walk-day {
	font-family: var(--wb-heading-font);
	font-weight: 400;
	font-size: 1.2em;
	color: var(--wb-heading);
}

.wb-buddies .wb-walk-time {
	color: var(--wb-muted);
}

.wb-buddies .wb-walk-names {
	grid-column: 2;
	grid-row: 2;
	color: var(--wb-muted);
	font-size: 0.95em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wb-buddies .wb-badge {
	grid-column: 3;
	grid-row: 1;
	justify-self: end;
	padding: 5px 10px;
	border-radius: 3px;
	background: var(--wb-accent-soft);
	color: var(--wb-accent-strong);
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	white-space: nowrap;
}

.wb-buddies .wb-badge--full {
	background: transparent;
	border: 1px solid var(--wb-border);
	color: var(--wb-muted);
}

.wb-buddies .wb-walk-detail {
	border-top: 1px solid var(--wb-border);
	padding: 8px 16px;
}

/* Dog cards */
.wb-buddies .wb-dog {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	align-items: flex-start;
}

.wb-buddies .wb-dog + .wb-dog {
	border-top: 1px solid var(--wb-border);
}

.wb-buddies .wb-panel[data-panel="dogs"] .wb-dog {
	border: 1px solid var(--wb-border);
	border-radius: 4px;
	padding: 14px 16px;
	margin-bottom: 14px;
	background: #fff;
}

.wb-buddies .wb-dog-photo {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--wb-accent-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
}

.wb-buddies .wb-dog-body {
	min-width: 0;
}

.wb-buddies .wb-dog-name {
	margin: 0 0 4px;
	font-size: 1.25em;
	color: var(--wb-heading);
}

.wb-buddies .wb-dog-chips {
	margin: 0 0 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.wb-buddies .wb-chip {
	padding: 3px 10px;
	border-radius: 3px;
	background: var(--wb-accent-soft);
	color: var(--wb-muted);
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.wb-buddies .wb-dog-desc {
	margin: 0 0 6px;
	color: inherit;
}

.wb-buddies .wb-dog-walks {
	margin: 0;
	color: var(--wb-muted);
	font-size: 0.9em;
}

/* Join flow */
.wb-buddies .wb-join {
	padding: 12px 0 8px;
	border-top: 1px solid var(--wb-border);
	margin-top: 4px;
}

.wb-buddies .wb-btn {
	display: inline-block;
	width: auto;
	padding: 16px 30px;
	border: 0;
	border-radius: 0;
	background: var(--wb-accent-strong);
	color: #fff;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 2px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wb-buddies .wb-btn:hover,
.wb-buddies .wb-btn:focus {
	background: var(--wb-muted);
	color: #fff;
}

.wb-buddies .wb-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.wb-buddies .wb-full-note {
	margin: 10px 0 6px;
	color: var(--wb-muted);
	font-weight: 600;
	text-align: center;
}

.wb-buddies .wb-join-form {
	margin-top: 12px;
}

.wb-buddies .wb-field {
	display: block;
	margin-bottom: 12px;
	font-weight: 600;
	font-size: 0.95em;
	color: var(--wb-heading);
}

.wb-buddies .wb-field input,
.wb-buddies .wb-field select,
.wb-buddies .wb-field textarea {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 10px 12px;
	border: 1px solid var(--wb-border);
	border-radius: 3px;
	font: inherit;
	font-weight: 400;
	background: #fff;
	color: inherit;
	box-sizing: border-box;
}

.wb-buddies .wb-field input:focus,
.wb-buddies .wb-field select:focus,
.wb-buddies .wb-field textarea:focus {
	outline: none;
	border-color: var(--wb-accent-strong);
}

.wb-buddies .wb-join-msg {
	color: #b32d2e;
	font-weight: 600;
	margin: 0 0 10px;
}

.wb-buddies .wb-join-success {
	color: var(--wb-accent-strong);
	font-weight: 600;
	background: var(--wb-accent-soft);
	border-radius: 3px;
	padding: 12px 14px;
	margin: 10px 0 6px;
}

.wb-buddies .wb-join-note {
	margin: 8px 0 0;
	color: var(--wb-muted);
	font-size: 0.85em;
	text-align: center;
}

/* Tappable photos + lightbox */
.wb-buddies .wb-photo-btn {
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	border-radius: 50%;
	flex-shrink: 0;
	line-height: 0;
}

.wb-buddies .wb-photo-btn .wb-dog-photo {
	display: block;
}

.wb-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(13, 6, 20, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	cursor: zoom-out;
}

.wb-lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 4px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* "This week:" walk links on the Dogs tab — rendered as date chips */
.wb-buddies .wb-dog-walks {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.wb-buddies .wb-dog-walks-label {
	margin-right: 2px;
}

.wb-buddies .wb-walk-link {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid var(--wb-border);
	border-radius: 3px;
	background: var(--wb-accent-soft);
	color: var(--wb-accent-strong);
	font-family: inherit;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wb-buddies .wb-walk-link:hover,
.wb-buddies .wb-walk-link:focus {
	background: var(--wb-accent-strong);
	border-color: var(--wb-accent-strong);
	color: #fff;
}

/* Honeypot: visually gone, still in the DOM for bots. */
.wb-buddies .wb-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (min-width: 600px) {
	.wb-buddies .wb-tabs {
		max-width: 460px;
	}
}
