/**
 * Custom styles for Memorial Website
 */

/* Serif headings */
h1, h2, h3, h4, h5, h6 {
	font-family: Georgia, "Times New Roman", Times, serif;
	margin: 0 0 0 0;
}

/* Update fonts, size for subtitles */
p.major {
	font-size: 1.15rem;
	font-family: Georgia, "Times New Roman", Times, serif;
}

/* Adjust padding for wrappers. Template default is too high */
.wrapper.style1 > .inner {
  padding: 3rem 0rem 1rem;
}

/* Navbar */
.navbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 2rem;
	background: rgba(248, 248, 248, 0.95);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-left, .nav-right {
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.nav-right a {
	color: #333;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	transition: color 0.2s ease;
}

.nav-right a:hover {
	color: #666;
}

.nav-right a.active {
	color: #000;
	border-bottom: 2px solid #333;
}

/* Language Switcher */
.lang-switcher {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.lang-link {
	color: #999;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.2s ease;
	padding-bottom: 2px;
	border-bottom: 2px solid transparent;
}

.lang-link:hover {
	color: #666;
}

.lang-link.active {
	color: #000;
	border-bottom: 2px solid #333;
}

.lang-separator {
	color: #ccc;
	font-size: 0.85rem;
}

/* Mobile navbar */
@media screen and (max-width: 736px) {
	.navbar {
		padding: 0.75rem 1rem;
	}

	.nav-right {
		gap: 0.75rem;
	}

	.nav-right a {
		font-size: 0.8rem;
	}

	.lang-link {
		font-size: 0.8rem;
	}

	.lang-separator {
		font-size: 0.8rem;
	}
}

/* Preserve line breaks in translatable content */
[data-lang-key="hero.intro"],
[data-lang-key="about.subtitle"],
[data-lang-key="about.bio"] {
	white-space: pre-line;
}

/* Condolences Section */
#condolences .inner + .inner {
	padding-top: 0;
}

.condolences-container {
	display: grid;
	gap: 2rem;
	padding: 2rem 0.5rem;
	text-align: left;
}

.condolence-card {
	background: #f8f8f8;
	padding: 1.5rem;
	border-radius: 8px;
	border-left: 4px solid #333;
}

.condolence-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #ddd;
}

.condolence-header strong {
	font-size: 1.1em;
	color: #333;
}

.condolence-header .date {
	font-size: 0.85em;
	color: #666;
}

.condolence-message {
	line-height: 1.6;
	color: #444;
	margin: 0;
}

/* Expandable condolence messages */
.condolence-message.truncated {
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.condolence-message.expanded {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.expand-toggle {
	display: block;
	margin-top: 0.5rem;
	color: #666;
	font-size: 0.9em;
	text-decoration: underline;
}

.expand-toggle:hover {
	color: #333;
}

/* Gallery image sizing - consistent aspect ratio */
.gallery article .image img {
	width: 100%;
	height: 400px;
	object-fit: cover;
}

/* Adjust for different gallery sizes */
.gallery.small article .image img {
	height: 180px;
}

.gallery.medium article .image img {
	height: 350px;
}

.gallery.big article .image img {
	height: 600px;
}

.gallery.responsive article .image img {
  height: 40vh; 		
  min-height: 250px;
  max-height: 600px;
}

.condolence-image {
	margin-top: 1rem;
	text-align: center;
}

.condolence-image img {
	max-width: 200px;
	height: auto;
	border-radius: 4px;
	cursor: pointer;
	transition: transform 0.2s;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.condolence-image img:hover {
	transform: scale(1.05);
}

/* Native dialog modal styles */
#condolence-image-modal {
	max-width: 90vw;
	max-height: 90vh;
	border: none;
	border-radius: 8px;
	padding: 0;
	background: transparent;
}

#condolence-image-modal::backdrop {
	background: rgba(0, 0, 0, 0.8);
}

#condolence-image-modal .modal-content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

#condolence-image-modal img {
	max-width: 90vw;
	max-height: 90vh;
	height: auto;
	display: block;
	border-radius: 4px;
}

#condolence-image-modal .modal-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: white;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#condolence-image-modal .modal-close:hover {
	background: #f0f0f0;
}

/* Footer */
footer {
	background: #f5f5f5;
	color: #666;
	font-size: 0.9rem;
}

footer.wrapper.style1 > .inner {
  padding: 1rem 0rem;
}

footer.wrapper.style1 .inner p {
  margin: 0;
}

/* Responsive adjustments */
/* Mobile: */
@media screen and (max-width: 736px) {
	/* 1 column max on condolences */
	.condolences-container {
		grid-template-columns: 1fr;
	}

	.condolence-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}
	
	.content p.keep-justified {
		text-align: left;
	}

	#condolence-image-modal .modal-close {
		top: 10px;
		right: 10px;
	}
}

/* Tablet: 2 columns */
@media screen and (min-width: 737px) and (max-width: 1200px) {
    .condolences-container {
        grid-template-columns: repeat(2, 1fr);
    }

	.content p.keep-justified {
		text-align: justify;
	}
}

/* Desktop: 3 columns max */
@media screen and (min-width: 1201px) {
    .condolences-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Gallery Toggle Navigation
   ======================================== */
.gallery-toggle {
	text-align: center;
	padding: 2rem 1rem 1rem;
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 99;
}

.gallery-toggle .toggle-link {
	font-size: 1.5rem;
	font-weight: 600;
	color: #666;
	text-decoration: none;
	padding: 0.5rem 1rem;
	transition: color 0.2s;
}

.gallery-toggle .toggle-link:hover,
.gallery-toggle .toggle-link.active {
	color: #000;
}

.gallery-toggle .toggle-separator {
	color: #ccc;
	margin: 0 0.5rem;
}

/* Section visibility - default shows professional, hides family */
/* Using height:0 + overflow:hidden to preserve lazy loading while collapsing space */
#family {
	height: 0;
	overflow: hidden;
	visibility: hidden;
}

#family.active {
	height: auto;
	overflow: visible;
	visibility: visible;
}

#professional.hidden {
	height: 0;
	overflow: hidden;
	visibility: hidden;
}

/* Gallery separator line */
.gallery-separator {
	border: none;
	border-top: 1px solid #ddd;
	margin: 0 2rem 1rem;
}

/* Override main.css rule that removes box-shadow from first child */
#wrapper.divided > #professional {
	box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.075) !important;
}

/* Gallery page container padding */
#professional .gallery.style1,
#family .gallery.style1 {
	padding: 1rem 2rem;
}

/* Override gallery grid to max 3 columns (instead of template default 4) */
@media screen and (min-width: 1281px) {
	.gallery.style1 article {
		width: 33.33333%;
	}
}

/* Add spacing between gallery images */
.gallery.style1 article {
	padding: 0.5rem;
	box-sizing: border-box;
}

/* Grid image sizing for style1 gallery */
.gallery.style1 article .image img {
	height: 300px;
	object-fit: cover;
}

@media screen and (max-width: 980px) {
	#professional .gallery.style1,
	#family .gallery.style1 {
		padding: 1rem 1.5rem;
	}
}

@media screen and (max-width: 480px) {
	.gallery-toggle .toggle-link {
		font-size: 1.2rem;
		padding: 0.25rem 0.5rem;
	}

	#professional .gallery.style1,
	#family .gallery.style1 {
		padding: 1rem;
	}

	.gallery.style1 article .image img {
		height: 250px;
	}
}

/* ========================================
   Service Page - Two Column Layout
   ======================================== */
.service-columns {
	display: flex;
	gap: 3rem;
	align-items: flex-start;
	text-align: left;
}

.service-column {
	flex: 1;
	min-width: 0;
}

.service-column h2 {
	margin-bottom: 0.5rem;
}

.service-column .major {
	margin-bottom: 1.5rem;
}

/* YouTube video container - fixed height to match tombstone */
.video-container {
	position: relative;
	height: 400px;
	overflow: visible;
	border-radius: 4px;
	margin-bottom: 1.5rem;
}

.video-container iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* Tombstone image styling - same height as video */
.tombstone-image {
	width: 100%;
	height: 400px;
	object-fit: cover;
	border-radius: 4px;
	margin-bottom: 1rem;
}

/* Memorial content - collapsible */
.memorial-content {
	line-height: 1.7;
	color: #444;
	white-space: pre-line;
}

.memorial-content.truncated {
	display: -webkit-box;
	-webkit-line-clamp: 8;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.memorial-content.expanded {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.memorial-subtitle {
	font-style: italic;
	color: #666;
	margin-bottom: 1rem;
}

/* Tablet/Mobile: stack columns vertically */
@media screen and (max-width: 1280px) {
	.service-columns {
		flex-direction: column;
		gap: 2rem;
		padding: 0 2rem;
	}

	.service-column {
		width: 100%;
	}

	.video-container,
	.tombstone-image {
		height: 500px;
	}
}

@media screen and (max-width: 736px) {
	.service-columns {
		padding: 0 1.5rem;
	}

	.video-container,
	.tombstone-image {
		height: 280px;
	}
}

@media screen and (max-width: 480px) {
	.service-columns {
		padding: 0 1rem;
	}

	.video-container,
	.tombstone-image {
		height: 220px;
	}
}