/*<======== CATEGORIES ========>*/

.funeral-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: calc(4 * 280px + 2 * 64px);
  justify-items: center;
  gap: 24px 64px;
  margin: 0 auto;
  padding: 20px 0;
}

.funeral-category {
  all: unset;
  -webkit-user-drag: none;
  user-drag: none;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 560px;
  min-width: 230px;
  width: 100%;
  max-width: calc(310px + 40px);
  
  background-color: #f8f4e6;
  border: 1px solid #e5e4e2;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.funeral-category:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.category-image {
  width: 100%;
  max-height: fit-content;
  margin-bottom: 16px;
  overflow: hidden;
  border: 3px solid rgba(51, 48, 47, 1);
  border-radius: 12px;
}

.category-image img {
  -webkit-user-drag: none;
  user-drag: none;
  
  width: 100%;
  max-width: 310px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.category-title h3{
  font-family: Rubik;
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 0.4px;
  font-weight: 900;
  text-transform: uppercase;
  color: rgba(51, 48, 47, 1);
  
  margin-bottom: 10px;
  max-height: calc(1.6em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-description {
  font-family: Inter;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: justify;
  color: rgba(32, 30, 29, 1);
  
  align-self: flex-start;
  max-height: calc(1.4em * 4);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/*<======== ITEMS ========>*/


.funeral-items-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin: 0 auto;
  padding: 20px 0;
  justify-content: center;
}


.funeral-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  
  background-color: #f8f4e6;
  border: 1px solid #e5e4e2;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.funeral-item:hover {
  transform: scale(1.05) translateY(-8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.item-image {
  width: 100%;
  max-height: 180px;
  overflow: hidden;
}

.item-image img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
}

.item-title {
  font-family: Inter;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(32, 30, 29, 1);
  
  max-height: calc(1.3em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-description {
  font-family: Inter;
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: start;
  color: rgba(89, 89, 89, 1);
  
  max-height: calc(1.2em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-view {
  position: relative;
  display: inline-block;
  margin-top: 12px;
  padding: 12px 24px;
  border: 3px solid rgba(51, 48, 47, 1);
  background-color: transparent;
  color: rgba(51, 48, 47, 1);
  font-family: Inter;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.item-view:hover {
  background: rgba(51, 48, 47, 1);
  color: rgba(229, 228, 226, 1);
}

/*<======== GALLERY ========>*/

body.blurred {
  overflow: hidden;
}

#funeral-gallery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  transition: opacity 0.3s ease;
}

#funeral-gallery-overlay.hidden {
  display: none;
}

.gallery-card-expanded {
	display: flex;
	flex-direction: column;
	background: transparent;
	width: 512px;
	min-height: 400px;
	padding: 1rem;
	border-radius: 1rem;
	position: relative;
	animation: fadeInScale 0.3s ease;
}

.gallery-card-expanded .item-title {
	font-size: 1.4rem;
    line-height: 1.2;
}

.gallery-card-expanded .item-description {
	font-size: 0.9rem;
}

.gallery-card-expanded .item-image {
	align-self: center;
	width: 100%;
	max-height: none;
	background: #fff;
    border-radius: 8px;
}

.gallery-card-expanded .item-image img {
  width: 100%;
  border-radius: 0.5rem;
  display: block;
}

.gallery-card-expanded .close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #333;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============== MEDIA QUERIES ============== */
/* Mobile Approach */
@media (hover: none) and (pointer: coarse) {
.funeral-category-section {
  padding: 20px 0;
}
.funeral-items-grid {
  grid-template-columns: repeat(2, 1fr);
}
}
/* Tablet Approach */
@media (min-width: 641px) and (hover: none) and (pointer: coarse) {
.funeral-items-grid {
  grid-template-columns: repeat(4, 1fr);
}
}
/* Desktop Approach */
@media (min-width: 1024px) and (pointer: fine) {

}
