:root {
  --iitk-blue: #002349;
  --iitk-gold: #e2b347;
  --light-gold: #f5e8c7;
  --light-text: #ffffff;
  --dark-text: #1a202c;
  --subtle-gray: #f9f9f9;
  --sidebar-bg: #f1f5f9;
  --image-block-bg: #e6eef6;
  --image-caption-color: #4a5568;
  --border-color: #d1d5db;
  --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-deep: 0 10px 30px rgba(0, 0, 0, 0.15);
  --memorial-gold: #d4af37;
  --memorial-silver: #c0c0c0;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  font-family: sans-serif;
  background: var(--subtle-gray);
  color: var(--dark-text);
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1350px;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.institute-header {
  background: rgba(226, 229, 233, 1);
  padding: 2.5rem 0 2rem 0;
  text-align: center;
  margin: 0 0 2rem 0;
  border-radius: 0.5rem;
}

.on-heading {
  font-size: 2.2rem;
  color: #000000;
  font-weight: 800;
  letter-spacing: 1px;
}

.on-heading::after {
  content: "";
  display: block;
  width: 130px;
  height: 5px;
  background-color: var(--iitk-gold);
  margin: 2px auto 0;
  border-radius: 4px;
}

.institute-subtitle {
  color: var(--iitk-blue);
  font-size: 1.1rem;
  margin-top: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.main-flex {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

aside {
  flex: 1 1 220px;
  max-width: 280px;
  min-width: 200px;
}

.sidebar {
  background: linear-gradient(135deg, var(--light-text) 0%, var(--sidebar-bg) 100%);
  border-radius: 16px;
  box-shadow: var(--shadow-deep);
  padding: 1.5rem;
  position: sticky;
  top: 100px;
  border: 1px solid var(--border-color);
  overflow-y: auto;
  max-height: 80vh;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: var(--iitk-gold) var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--sidebar-bg);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--iitk-gold);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--iitk-blue);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--iitk-blue), var(--iitk-gold), var(--iitk-blue));
  border-radius: 16px 16px 0 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-gold);
  position: relative;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--iitk-gold);
  border-radius: 2px;
}

.sidebar h2 {
  font-size: 1.3rem;
  color: var(--iitk-blue);
  font-weight: 700;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.memorial-list {
  list-style: none;
  margin-bottom: 1rem;
  padding-left: 0px;
}

.memorial-list li {
  margin-bottom: 0.3rem;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.memorial-list li::before {
  content: "";
  position: absolute;
  color:#000000;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--image-block-bg);
  transition: width 0.3s ease;
  z-index: 1;
}

.memorial-list li:hover::before {
  width: 100%;
  color:black;
}

.memorial-link {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--dark-text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  border-radius: 10px;
}

.memorial-list li:hover .memorial-link {
  /* color: var(--light-text); */
  transform: translateX(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.memorial-list li.active {
  background: var(--light-gold);
  box-shadow: var(--shadow-light);
  /* transform: translateX(4px); */
}

.memorial-list li.active .memorial-link {
  /* color: var(--light-text); */
  font-weight: 500;
}

.hidden-item {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.view-all-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #bdc3c7;
  border: none;
  border-radius: 12px;
  color:black;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.view-all-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.view-all-btn:hover::before {
  left: 100%;
}

.view-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-deep);
  background: linear-gradient(135deg, #f4d03f, var(--iitk-gold));
}

.view-all-btn:active {
  transform: translateY(0);
}

.btn-icon {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.news-list {
  flex: 3 1 0;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  min-width: 0;
}

.memorial-tribute {
  position: relative;
  background: linear-gradient(145deg, var(--light-text) 0%, #fefefe 50%, var(--light-gold) 100%);
  border-radius: 20px;
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 3rem 2.5rem;
  border: 3px solid transparent;
  background-clip: padding-box;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.memorial-tribute::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.memorial-tribute:hover::before {
  opacity: 1;
}

.memorial-tribute:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(212, 175, 55, 0.3);
}

.news-card-content {
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.news-img-gallery {
  float: left;
  width: 200px;
  margin-right: 30px;
  margin-bottom: 20px;
  box-sizing: content-box;
}

.image-frame {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border: 3px solid var(--memorial-gold);
  background: linear-gradient(45deg, var(--memorial-gold), var(--memorial-silver));
  padding: 3px;
}

.image-frame img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.6s ease;
  display: block;
  position: relative;
  z-index: 1;
}

.image-frame img.loaded {
  opacity: 1;
  transform: scale(1);
}

.image-overlay {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 35, 73, 0.1) 100%);
  border-radius: 12px;
  pointer-events: none;
  z-index: 2;
}

.image-caption {
  font-size: 1rem;
  color: var(--memorial-gold);
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-family: "Georgia", serif;
}

.news-text {
  overflow: hidden;
}

.memorial-name {
  font-size: 1.8rem;
  color: var(--iitk-blue);
  font-weight: 800;
  margin-bottom: 0.5rem;
  font-family: "Georgia", serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.memorial-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--memorial-gold), var(--iitk-gold));
  margin: 0.5rem 0 1rem 0;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.news-meta {
  font-size: 1.1rem;
  color: var(--memorial-gold);
  margin-bottom: 1.5rem;
  font-style: italic;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.date-icon {
  color: var(--memorial-gold);
  font-size: 1rem;
  text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.news-card p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--dark-text);
  margin-bottom: 1.5rem;
  text-align: justify;
  font-family: "Arial", sans-serif;
}

.memorial-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--light-gold);
  text-align: center;
  position: relative;
  clear: both;
}

.memorial-footer::before {
  content: "✦ ✦ ✦";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--light-text);
  color: var(--memorial-gold);
  padding: 0 15px;
  font-size: 0.8rem;
}
.news-card.highlighted {
  animation: memorialHighlight 2s ease;
}
/* Add to your existing obituaries.css file */

/* Year Filter Styles */
.year-filter-block {
  margin-bottom: 1.3rem;
  padding: 0.7rem 0 0.2rem 0;
  border-bottom: 1px solid var(--light-gold);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.year-filter-label {
  font-size: 1rem;
  color: var(--iitk-blue);
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: 0.3px;
}

.year-filter-select {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  background: var(--sidebar-bg);
  color: var(--dark-text);
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.year-filter-select:focus {
  border-color: var(--iitk-gold);
}

@media (max-width: 900px) {
  .year-filter-block {
    margin-bottom: 1rem;
    padding: 0.5rem 0 0.2rem 0;
  }
  .year-filter-label {
    font-size: 0.95rem;
  }
  .year-filter-select {
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .year-filter-block {
    margin-bottom: 0.7rem;
    padding: 0.3rem 0 0.2rem 0;
  }
  .year-filter-label {
    font-size: 0.9rem;
  }
  .year-filter-select {
    font-size: 0.9rem;
  }
}


@keyframes memorialHighlight {
  0%,
  100% {
    box-shadow: var(--shadow-deep);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.8), var(--shadow-deep);
    transform: translateY(-5px) scale(1.01);
  }
}

.news-card strong {
  color: var(--iitk-blue);
  font-weight: 700;
}

@media (max-width: 900px) {
  .news-img-gallery {
    float: none;
    display: block;
    margin: 0 auto 20px auto;
    width: 180px;
  }

  .image-caption {
    margin: 10px auto 20px auto;
    width: 100%;
  }

  .sidebar {
    position: static;
    margin-bottom: 1.5rem;
    max-width: 100%;
  }

  .memorial-list li {
    margin-bottom: 0.3rem;
  }

  .memorial-link {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .memorial-tribute {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 600px) {
  aside {
    flex: 1 0 100%;
    max-width: 100%;
  }

  .sidebar-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .memorial-tribute {
    padding: 1.5rem 1rem;
  }

  .memorial-name {
    font-size: 1.5rem;
  }

  .news-list {
    gap: 2rem;
  }

  .main-flex {
    gap: 1rem;
  }
}
