/* CSS Document */

#kids {
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

#kids #content {
	width: 100%;
	max-width: 1000px; /* Limit overall max width */
	margin: 0 auto;
}

#kids #content table {
	width: 100%;
	table-layout: fixed; /* Keep fixed layout */
	border-spacing: 0;
	border-collapse: separate; /* Or collapse, depending on desired border look */
}

/* Left/Right cells containing thumbnails */
#kids #content table td.cell {
	vertical-align: top;
	width: 20%; /* Keep side columns at 20% */
	padding: 5px;
	text-align: center;
	box-sizing: border-box;
}

/* Middle cell containing info and story */
#kids #content table td[width="*"] {
	width: 60% !important; /* Keep middle column at 60% */
	vertical-align: top; /* Align content to top */
	box-sizing: border-box;
	padding: 5px;
	text-align: center; /* Center the blocks inside, like #info and #story */
}

/* Info block (Name, Age, Votes) */
#kids #content #info {
	width: 306px; /* Keep original fixed width for this specific element */
	background-image: url(images/kid.jpg);
	background-position: bottom center;
	background-repeat: no-repeat;
	padding: 0 10px 10px 10px;
	margin: 0 auto 20px auto; /* Center horizontally, add bottom margin */
	box-sizing: border-box; /* Include padding in width */
}

#kids #content #info .top {
	height: 15px;
	width: 100%; /* Make top span full width of #info */
	background-image: url(images/kid_top.jpg);
	background-position: top center;
	background-repeat: no-repeat;
}

/* Story/Bio block */
#kids #content #story {
	/* width: 380px; */ /* REMOVED fixed width */
	width: 100%; /* Allow block to use available width within the middle cell */
	max-width: 600px; /* Optional: Set a max-width if needed for very wide text */
	margin: 0 auto; /* Center the story block within the middle cell */
	padding: 10px;
	text-align: left; /* Keep text left-aligned */
	/* background-image: url(images/kid_quote.jpg);
	background-position: bottom right;
	background-repeat: no-repeat; */
	box-sizing: border-box;
	/* overflow: hidden; */ /* REMOVED overflow hidden */
	min-height: 100px; /* Optional: Ensure a minimum height if background needs it */
}

/* Text container inside the story block */
#kids #content #story #text {
	text-indent: 15px;
	padding: 10px; /* Adjusted padding */
	/* padding: 40px 10px 10px 10px; /* Removed excessive top padding */
}

/* Styling for individual thumbnail images */
.image {
	margin-bottom: 15px;
}

/* Cell placeholder for empty cells (appears unused in view.php) */
.cell-placeholder {
	width: 140px; /* Match thumbnail size */
	height: 140px; /* Match thumbnail size */
	margin: 0 auto;
}

/* Removed the unused .bio-container style rule */
/*
.bio-container { ... }
*/

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	#kids #content table tr {
		display: flex;
		flex-direction: column; /* Stack columns */
	}

	#kids #content table td.cell,
	#kids #content table td[width="*"] {
		width: 100% !important; /* Make all columns full width */
		display: block;
		padding: 10px;
		margin-bottom: 10px; /* Add space between stacked cells */
	}

	#kids #content #info {
		width: 90%; /* Make info block slightly less than full width */
		margin-bottom: 10px;
	}

	#kids #content #story {
		width: 100%; /* Story takes full width */
		max-width: none; /* Remove max-width on small screens if needed */
		margin: 0 auto; /* Ensure centering */
		min-height: 0; /* Reset min-height if needed */
		background-size: contain; /* Adjust background size if needed, or remove */
		/* background-image: none; */ /* Optional: remove background on small screens */
	}
}

/* Lightbox styles */
body.lightbox-open {
	overflow: hidden;
}

.lightbox {
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	display: none !important;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease-in-out;
	z-index: 9999;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.lightbox.is-visible {
	display: flex !important;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.lightbox__backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: rgba(0, 0, 0, 0.85);
}

.lightbox__dialog {
	position: relative;
	z-index: 1;
	max-width: 90vw;
	max-height: 90vh;
	padding: 20px 60px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lightbox__dialog img {
	max-width: 100%;
	max-height: 70vh;
	border-radius: 6px;
	box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
	background: #fff;
	margin-bottom: 15px;
}

.lightbox__caption {
	color: #fff;
	font-size: 0.95em;
	text-align: center;
}

.lightbox__close {
	position: absolute;
	top: 10px;
	right: 10px;
	border: 0;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 22px;
	cursor: pointer;
}

.lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 24px;
}

.lightbox__nav--prev {
	left: 10px;
}

.lightbox__nav--next {
	right: 10px;
}

@media screen and (max-width: 600px) {
	.lightbox__dialog {
		padding: 20px 30px;
	}

	.lightbox__nav--prev {
		left: 0;
	}

	.lightbox__nav--next {
		right: 0;
	}
}
