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

/* Buttons, inputs and dropdowns don't use the page font unless told to */
button, input, select, textarea {
	font-family: inherit;
}

html, body {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-family: "Barlow", Arial, Helvetica, sans-serif;  /* Arial only shows if Google Fonts can't load */
}

.site-wrapper {
	text-align: center;
	background-color: white;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.main {
	flex: 1;
}

/* ── Find birders page (/people): search + Following/Followers ───────────────── */
.people-panel {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	width: min(100%, 560px);
	padding: 1.1rem;
	text-align: left;
	background: white;
	border: 2px solid #000;
	box-shadow: 4px 4px #000;
}

.friend-search input {
	width: 100%;
	padding: 0.55rem 0.7rem;
	font: inherit;
	border: 2px solid #000;
	background: #f7f7f2;
}

.friend-search input:focus { outline: none; background: white; box-shadow: 3px 3px #8499B4; }

.friend-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

#people-results:not(:empty) {
	margin-top: 0.5rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px dashed lightgray;
}

.friend-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.35rem;
	border: 2px solid transparent;
}

.friend-row:hover { border-color: lightgray; }

.friend-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
	color: #000;
	text-decoration: none;
	font-weight: bold;
	overflow-wrap: anywhere;
}

.friend-link:hover span { text-decoration: underline; }

.friend-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.friend-status { font-size: 0.75rem; color: gray; }

.mini-btn {
	padding: 0.2rem 0.55rem;
	font: inherit;
	font-size: 0.85rem;
	font-weight: bold;
	background: #EFF0C7;
	border: 2px solid #000;
	box-shadow: 2px 2px #000;
	cursor: pointer;
}

.mini-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.mini-btn.accept { background: #1F3F00; color: #EFF0C7; }
.mini-btn:disabled { opacity: 0.5; }

.people-empty { font-size: 0.9rem; color: gray; }

/* Shared chunky button */
.chunky-btn {
	display: inline-block;
	padding: 0.45rem 0.9rem;
	font: inherit;
	font-weight: bold;
	color: #000;
	text-decoration: none;
	background: #EFF0C7;
	border: 2px solid #000;
	box-shadow: 3px 3px #000;
	cursor: pointer;
	transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.chunky-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px #000; }
.chunky-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 #000; }
.chunky-btn.muted { background: white; font-weight: normal; }
.chunky-btn.bd-join { background: #1F3F00; color: #EFF0C7; }  /* the main "go" button: Join, Post, Create… */

/* Profile pictures */
.avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #000;
	object-fit: cover;
	flex-shrink: 0;
}

.avatar-initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: #1F3F00;
	color: #EFF0C7;
	font-size: 1.4rem;
	font-weight: bold;
}

.avatar-small {
	width: 34px;
	height: 34px;
	font-size: 1rem;
}

.avatar-large {
	width: 128px;
	height: 128px;
	font-size: 3.5rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
	background-color: #8499B4;
	width: 100%;
}

.footer-divider {
	width: 100%;
	height: 2px;
	background: linear-gradient(to right, transparent, #8499B4, transparent);
}

/* Three columns (links | copyright | brand) so nothing can overlap; the middle one stays centered */
.footer-content {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 1.8rem 2.5rem;
	gap: 1.5rem;
}

.footer-nav {
	display: flex;
	flex-direction: row;
	gap: clamp(0.5rem, 1.5vw, 2rem);
	justify-self: start;
	overflow: hidden;
}

.footer-nav a {
	text-decoration: none;
	color: #EFF0C7;
}

/* Copyright */
.footer-copy {
	font-family: "Oswald", Arial, sans-serif;
	font-size: 0.7rem;
	letter-spacing: 1px;
	color: black;
	text-align: center;
	white-space: nowrap;
}

/* Business branding */
.footer-brand {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-direction: row-reverse;
	text-decoration: none;
}

.footer-logo {
	width: 42px;
	height: 42px;
	object-fit: contain;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.footer-brand:hover .footer-logo {
	opacity: 1;
}

.footer-brand-name {
	font-family: "Oswald", Arial, sans-serif;
	font-size: 0.8rem;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: black;
	transition: color 0.2s ease;
}

.footer-brand:hover .footer-brand-name {
	opacity: 0.7;
}

/* Responsive */
/* Medium screens: not enough room to center the copyright between the sides, so just put it on the left */
@media screen and (min-width: 769px) and (max-width: 1100px) {
	.footer-content { grid-template-columns: auto 1fr auto; }
	.footer-copy { text-align: left; }
}

@media screen and (max-width: 768px) {
	.footer-content {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 1.5rem 1rem;
		gap: 1.2rem;
	}

	.footer-copy {
		position: static;
		transform: none;
	}

	.footer-social {
		align-items: center;
	}

	.footer-brand {
		flex-direction: column;
	}
}
/* ── Bird names you can click (open the info card) ─────────────────────────── */
.bird-link {
	padding: 0;
	font: inherit;
	color: inherit;
	text-align: left;
	background: none;
	border: none;
	border-bottom: 2px dotted #8499B4;
	cursor: pointer;
}

.bird-link:hover { color: #1F3F00; border-bottom-style: solid; }

/* ── Bird info card ─────────────────────────────────────────────────────────── */
/* Phones: photo on top, info below. Wide screens: photo left, info right.
   Either way the card never gets taller than the screen; only the info side scrolls if it must. */
.bird-card {
	width: min(calc(100vw - 2rem), 480px);
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	text-align: left;
	background: white;
	border: 3px solid #000;
	box-shadow: 6px 6px #000;
}

.bird-card[open] { display: flex; flex-direction: column; }
.bird-card::backdrop { background: rgba(0, 0, 0, 0.45); }

.bird-card-body {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow-y: auto;
}

.bird-card-close {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	width: 2.25rem;
	height: 2.25rem;
	font-weight: bold;
	background: #EFF0C7;
	border: 2px solid #000;
	box-shadow: 3px 3px #000;
	cursor: pointer;
}

.bird-card-photo {
	position: relative;
	flex-shrink: 0;
	height: clamp(150px, 30vh, 260px);
	margin: 0;
	background: #e6ecf4;
	border-bottom: 3px solid #000;
}

.bird-card-photo { overflow: hidden; }

/* Phones: show the whole photo (no cropping) over a blurred copy of itself */
.bird-card-photo::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--photo) center / cover no-repeat;
	filter: blur(18px) brightness(0.85);
	transform: scale(1.15);  /* hides the soft blurred edges */
}

.bird-card-photo img {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.bird-card-photo figcaption {
	position: absolute;
	z-index: 1;
	right: 0.4rem;
	bottom: 0.4rem;
	padding: 0.1rem 0.4rem;
	font-size: 0.65rem;
	color: white;
	background: rgba(0, 0, 0, 0.55);
}

.bird-card-info { display: flex; flex-direction: column; }

.bird-card-head { padding: 0.9rem 1.1rem 0; }
.bird-card-head h2 { font-family: "Oswald", Arial, sans-serif; font-size: 1.6rem; line-height: 1.1; padding-right: 2.75rem; }
.bird-card-sci { font-style: italic; color: #555; margin-top: 0.1rem; }
.bird-card-family {
	display: inline-block;
	margin-top: 0.4rem;
	padding: 0.1rem 0.5rem;
	font-size: 0.75rem;
	font-weight: bold;
	background: #8499B4;
	border: 2px solid #000;
}

.bird-card-summary {
	padding: 0.7rem 1.1rem 0;
	font-size: 0.9rem;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bird-card-mine {
	margin: 0.8rem 1.1rem 0;
	padding: 0.7rem 0.8rem;
	background: #EFF0C7;
	border: 2px solid #000;
}

.bird-card-mine h3 { font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.4rem; }

.bird-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; text-align: center; }
.bird-card-stat { display: flex; flex-direction: column; min-width: 0; }
.bird-card-stat strong { font-size: 0.8rem; }
.bird-card-stat span { font-size: 0.6rem; color: #555; text-transform: uppercase; }
.bird-card-friends { margin-top: 0.5rem; font-size: 0.85rem; }
.bird-card-friends a { color: #1F3F00; font-weight: bold; }
.bird-card-empty { font-size: 0.9rem; color: #555; }

.bird-card-links { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0.9rem 1.1rem 1.1rem; }
.bird-card-links .chunky-btn { padding: 0.35rem 0.75rem; font-size: 0.9rem; }

.bird-card-loading { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 3rem 1rem; color: gray; }
.bird-card-spinner {
	width: 2rem;
	height: 2rem;
	border: 4px solid #e6ecf4;
	border-top-color: #8499B4;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Wide screens: side by side, so the card is short and wide */
@media (min-width: 760px) {
	.bird-card { width: min(calc(100vw - 4rem), 820px); }
	.bird-card-body.has-photo { flex-direction: row; overflow: hidden; }
	.bird-card-body.has-photo .bird-card-photo {
		width: 44%;
		height: auto;
		min-height: 360px;
		border-bottom: none;
		border-right: 3px solid #000;
	}
	.bird-card-body.has-photo .bird-card-info { flex: 1; min-width: 0; overflow-y: auto; }
	/* Desktop has room for a tall frame, so fill it edge to edge */
	.bird-card-photo::before { display: none; }
	.bird-card-photo img { object-fit: cover; object-position: center 30%; }
	.bird-card-summary { -webkit-line-clamp: 7; }
}

/* Short screens (landscape phones, small laptops): trim the photo and text more */
@media (max-height: 640px) {
	.bird-card-photo { height: clamp(110px, 24vh, 180px); }
	.bird-card-summary { -webkit-line-clamp: 3; }
}


/* Small red count bubble (Big Day invites, admin reports) */
.nav-badge {
	margin-left: auto;
	min-width: 1.4rem;
	padding: 0 0.35rem;
	font-size: 0.8rem;
	font-weight: bold;
	text-align: center;
	color: white;
	background: #C0392B;
	border: 2px solid #000;
	border-radius: 999px;
}

/* Pulsing red dot for anything "live" */
.live-dot {
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	flex-shrink: 0;
	background: #C0392B;
	border: 2px solid #000;
	border-radius: 50%;
	animation: live-pulse 1.4s ease-in-out infinite;
}

@keyframes live-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6); }
	50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); }
}

/* Following / Followers tabs (Find birders page) */
.follow-tabs { display: flex; border: 2px solid #000; }
.follow-tab {
	flex: 1;
	padding: 0.4rem;
	font: inherit;
	font-size: 0.85rem;
	font-weight: bold;
	background: white;
	border: none;
	cursor: pointer;
}
.follow-tab + .follow-tab { border-left: 2px solid #000; }
.follow-tab.active { background: #8499B4; }
.follow-tab-count:not(:empty)::before { content: "· "; }

.mini-btn.following { background: white; font-weight: normal; }
.mini-btn.following:hover { background: #fbe4e1; }

.bird-card-links .bird-card-page { background: #1F3F00; color: #EFF0C7; flex-basis: 100%; text-align: center; }

/* Round bird photo used in trending lists (filled in by thumbs.js) */
.bird-thumb {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 3.2rem;
	height: 3.2rem;
	font-size: 1.4rem;
	background: #e6ecf4 center / cover no-repeat;
	border: 2px solid #000;
	border-radius: 50%;
}
.bird-thumb.loaded { font-size: 0; }

/* ── Site header: logo · main tabs · bell + account menu ("pill bar") ─────── */
.site-header {
	display: flex;
	flex-shrink: 0;  /* long pages must not squeeze the header */
	align-items: center;
	gap: 1.5rem;
	min-height: 5rem;
	padding: 0.75rem 2rem;
	box-sizing: border-box;
	position: relative;
	z-index: 50;
}

.site-logo { display: inline-flex; flex-shrink: 0; line-height: 0; transition: transform 0.15s ease; }
.site-logo:hover { transform: translateY(-2px) rotate(-2deg); }
.site-logo:focus-visible { outline: 3px solid #8499B4; outline-offset: 4px; }
.site-logo img { width: auto; height: 2.6rem; }

/* The tabs: one pill group in the middle */
.main-tabs {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0 auto;
	padding: 0.3rem;
	background: #EFF0C7;
	border: 2px solid #000;
	border-radius: 999px;
	box-shadow: 4px 4px #000;
}

.main-tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1.05rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 999px;
	transition: background 0.15s ease;
}

.main-tab:hover { background: rgba(132, 153, 180, 0.35); }
.main-tab.active { background: #1F3F00; color: #EFF0C7; font-weight: 700; }
.main-tab:focus-visible { outline: 3px solid #8499B4; outline-offset: 2px; }
.main-tab .nav-badge { margin-left: 0; }

/* Right side: bell + account */
.header-actions { display: flex; align-items: center; gap: 0.9rem; flex-shrink: 0; margin-left: auto; }
.main-tabs + .header-actions { margin-left: 0; }
.header-actions .main-tab { border: 2px solid #000; background: #EFF0C7; }
.header-actions .main-tab.signup { background: #1F3F00; color: #EFF0C7; box-shadow: 3px 3px #000; }

.header-bell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	color: #000;
	background: white;
	border: 2px solid #000;
	border-radius: 50%;
	box-sizing: border-box;
}
.header-bell:hover { background: #EFF0C7; }

.count-badge {
	position: absolute;
	top: -0.4rem;
	right: -0.4rem;
	min-width: 1.3rem;
	height: 1.3rem;
	padding: 0 0.3rem;
	box-sizing: border-box;
	font-size: 0.75rem;
	font-weight: bold;
	line-height: 1rem;
	text-align: center;
	color: white;
	background: #C0392B;
	border: 2px solid #000;
	border-radius: 999px;
}

.account { position: relative; }

.account-button {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.15rem 0.45rem 0.15rem 0.15rem;
	color: #000;
	background: #8499B4;
	border: 2px solid #000;
	border-radius: 999px;
	box-shadow: 3px 3px #000;
	cursor: pointer;
}
.account-button .avatar { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
.account-button[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-chevron { transition: transform 0.15s ease; }
.account-dot {
	position: absolute;
	top: -0.2rem;
	right: -0.2rem;
	width: 0.8rem;
	height: 0.8rem;
	background: #C0392B;
	border: 2px solid #000;
	border-radius: 50%;
}

.account-menu {
	position: absolute;
	top: calc(100% + 0.7rem);
	right: 0;
	width: 16.5rem;
	text-align: left;
	background: white;
	border: 2px solid #000;
	box-shadow: 6px 6px #000;
	z-index: 100;
}
.account-menu[hidden] { display: none; }

.account-menu a,
.account-menu-logout {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.7rem 1rem;
	box-sizing: border-box;
	font: inherit;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	text-align: left;
	background: none;
	border: none;
	border-bottom: 1px solid #ddd;
	cursor: pointer;
}
.account-menu a:hover, .account-menu-logout:hover { background: #EFF0C7; }
.account-menu a[aria-current="page"] { box-shadow: inset 4px 0 #1F3F00; }

.account-menu .account-menu-head {
	justify-content: flex-start;
	gap: 0.7rem;
	padding: 0.85rem 1rem;
	background: #EFF0C7;
	border-bottom: 2px solid #000;
}
.account-menu-head span { display: flex; flex-direction: column; min-width: 0; }
.account-menu-head strong { overflow-wrap: anywhere; }
.account-menu-head small { font-weight: normal; color: #444; }
.account-menu .account-menu-admin { border-bottom: 2px solid #000; }
.account-menu-logout { color: #A3261B; font-weight: 700; border-bottom: none; }

/* Tablets and phones: logo + buttons on top, tabs in a swipeable row underneath */
@media (max-width: 1100px) {
	.site-header { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 1rem 0.9rem; }
	.header-actions, .main-tabs + .header-actions { margin-left: auto; }
	.main-tabs {
		order: 3;
		width: calc(100% + 2rem);
		margin: 0 -1rem;
		padding: 0.3rem 1rem 0.5rem;
		gap: 0.5rem;
		background: none;
		border: none;
		border-radius: 0;
		box-shadow: none;
		overflow-x: auto;
		scrollbar-width: none;
	}
	.main-tabs::-webkit-scrollbar { display: none; }
	.main-tab { flex-shrink: 0; padding: 0.6rem 1rem; background: #EFF0C7; border: 2px solid #000; }
	.main-tab.active { box-shadow: 3px 3px #000; }
	.main-tab:hover { background: #EFF0C7; }
	.main-tab.active:hover { background: #1F3F00; }
}

@media (max-width: 600px) {
	/* Leave room for the bell + account button on the same row, even on a 320px phone */
	.site-logo img { height: min(2rem, calc((100vw - 11.5rem) / 5.36)); }
	.header-actions { gap: 0.6rem; }
}

/* Small number in a pill next to a heading (e.g. Discussion 4) */
.count-pill:not(:empty) {
	min-width: 1.5rem;
	padding: 0 0.4rem;
	font-size: 0.85rem;
	text-align: center;
	background: #8499B4;
	border: 2px solid #000;
	border-radius: 999px;
}
