/* Blog Page - Soothing & Formal Design */

/* Color Palette - Soothing earth tones */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --accent-color: #e8f4f0;
  --text-primary: #2c3e50;
  --text-secondary: #5d6d7e;
  --text-light: #85929e;
  --background-light: #f8fffe;
  --card-shadow: rgba(44, 62, 80, 0.08);
  --hover-shadow: rgba(44, 62, 80, 0.15);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-soft: linear-gradient(135deg, #e8f4f0 0%, #f0f8f5 100%);
}

.container-fluid {
  min-height: 100vh;
}

/* Recent Update Section */
#recentUpdate {
  padding: 60px;
  background: var(--gradient-soft);
  border-radius: 50px;
  margin-bottom: 80px;
  margin-top: 30px;
  position: relative;
  overflow: hidden;
}

#recentUpdate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="grain" width="100" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="30" cy="5" r="0.3" fill="%23ffffff" opacity="0.08"/><circle cx="50" cy="15" r="0.4" fill="%23ffffff" opacity="0.06"/><circle cx="70" cy="8" r="0.2" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="20" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

#recentUpdate .row {
  align-items: center;
}

#recentUpdate h2 {
  font-size: 3.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  text-shadow: 0 2px 4px rgba(44, 62, 80, 0.1);
  line-height: 1.2;
}

#recentUpdate h2 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

#recentUpdate img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  transition: transform 0.3s ease;
}

#recentUpdate img:hover {
  transform: translateY(-5px);
}

/* Blog Cards Section */
#blogs {
  padding: 0 0 100px;
}

#blogs .row {
  gap: 30px 0;
}

/* Flip Card Styling */
.flip {
  background-color: transparent;
  width: 100%;
  height: 350px;
  perspective: 1000px;
  margin-bottom: 40px;
  border-radius: 20px;
  overflow: hidden;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 70%;
  text-align: center;
  border-radius: 20px;
  overflow: hidden;
}


.thisDiv {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px var(--card-shadow);
  transition: box-shadow 0.3s ease;
}

.flip:hover .thisDiv {
  box-shadow: 0 20px 40px var(--hover-shadow);
}

.thisDiv img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.flip:hover .thisDiv img {
  transform: scale(1.05);
}

/* Back side of flip card */
.thisDiv::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.6s ease;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(255, 255, 255);
  font-size: 1.1rem;
  padding: 20px;
  text-align: center;
}

/* Red Div - Content Area */
.redDiv {
  background: white;
  padding: 30px 25px;
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--card-shadow);
  transition: all 0.3s ease;
  border: 1px solid rgba(44, 62, 80, 0.05);
}

.flip:hover .redDiv {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px var(--hover-shadow);
}

.dateAndName {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.dateAndName i {
  color: var(--secondary-color);
  margin-right: 8px;
  font-size: 1rem;
}

.redDiv h5 {
  color: var(--text-primary);
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 0;
  font-weight: 600;
  transition: color 0.3s ease;
}

.flip:hover .redDiv h5 {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Link Styling */
.flip a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.flip a:hover {
  color: inherit;
}

/* Newsletter Section (commented out in HTML but keeping styles) */
#latestNews {
  padding: 60px 0;
  background: var(--accent-color);
  border-radius: 30px;
  margin: 60px 0;
}

.newsBox {
  background: white;
  border-radius: 20px;
  padding: 50px;
  box-shadow: 0 15px 35px var(--card-shadow);
}

.newsLeft h3 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
}

.newsRight .input-group {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--card-shadow);
}

.newsRight input {
  border: none;
  padding: 18px 20px;
  font-size: 1rem;
  background: var(--background-light);
}

.newsRight input:focus {
  box-shadow: none;
  outline: none;
  background: white;
}

/* Comprehensive Responsive Design */

/* Extra Large Desktops (1400px and up) */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  #recentUpdate h2 {
    font-size: 3.8rem;
  }
  
  .flip {
    height: 380px;
  }
  
  .redDiv h5 {
    font-size: 1.4rem;
  }
}

/* Large Desktops (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  #recentUpdate h2 {
    font-size: 3.4rem;
  }
  
  .flip {
    height: 360px;
  }
}

/* Medium Desktops (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  #recentUpdate {
    padding: 50px;
  }
  
  #recentUpdate h2 {
    font-size: 3rem;
  }
  
  .flip {
    height: 360px;
    margin-bottom: 35px;
  }
  
  .redDiv {
    padding: 28px 22px;
  }
  
  .redDiv h5 {
    font-size: 1.25rem;
  }
}

/* Tablets (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  #recentUpdate {
    padding: 40px;
    margin-bottom: 60px;
  }
  
  #recentUpdate h2 {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 1rem;
  }
  
  #recentUpdate .order2 {
    order: -1;
    margin-bottom: 30px;
  }
  
  #recentUpdate img {
    max-width: 400px;
    margin: 0 auto;
    display: block;
  }
  
  .flip {
    height: 320px;
    margin-bottom: 30px;
  }
  
  .redDiv {
    padding: 25px 20px;
  }
  
  .redDiv h5 {
    font-size: 1.2rem;
  }
  
  #blogs .row {
    justify-content: center;
  }
  
  #blogs .col-xl-4.col-md-6 {
    max-width: 400px;
  }
}

/* Small Tablets and Large Phones (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  
  #recentUpdate {
    padding: 35px;
    margin-bottom: 50px;
  }
  
  #recentUpdate h2 {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 1.2rem;
  }
  
  #recentUpdate .order2 {
    order: -1;
    margin-bottom: 25px;
  }
  
  #recentUpdate img {
    max-width: 350px;
    margin: 0 auto;
    display: block;
  }
  
  .flip {
    height: 310px;
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .redDiv {
    padding: 22px 18px;
  }
  
  .redDiv h5 {
    font-size: 1.15rem;
    line-height: 1.3;
  }
  
  .dateAndName {
    font-size: 0.85rem;
  }
  
  .newsBox {
    padding: 35px 25px;
  }
  
  .newsLeft h3 {
    font-size: 1.7rem;
    margin-bottom: 25px;
    text-align: center;
  }
}

/* Mobile Phones (up to 575px) */
@media (max-width: 575px) {
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  #recentUpdate {
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 30px;
  }
  
  #recentUpdate h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.1;
  }
  
  #recentUpdate .order2 {
    order: -1;
    margin-bottom: 20px;
  }
  
  #recentUpdate img {
    border-radius: 15px;
  }
  
  #blogs {
    padding: 0 0 60px;
  }
  
  .flip {
    height: 310px;
    margin-bottom: 20px;
  }
  
  .flip-inner {
    border-radius: 15px;
  }
  
  .thisDiv {
    border-radius: 15px;
  }
  
  .redDiv {
    padding: 20px 15px;
    border-radius: 15px;
    margin-top: 8px;
  }
  
  .redDiv h5 {
    font-size: 1.05rem;
    line-height: 1.25;
  }
  
  .dateAndName {
    font-size: 0.8rem;
    margin-bottom: 15px;
  }
  
  .newsBox {
    padding: 25px 15px;
    border-radius: 15px;
  }
  
  .newsLeft h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
  }
  
  .newsRight .input-group {
    margin-top: 15px;
  }
  
  .newsRight input {
    padding: 15px 18px;
    font-size: 0.9rem;
  }
}

/* Extra Small Phones (up to 380px) */
@media (max-width: 380px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  #recentUpdate {
    padding: 25px;
    margin-bottom: 35px;
    border-radius: 25px;
  }
  
  #recentUpdate h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
  }
  
  .flip {
    height: 260px;
    margin-bottom: 18px;
  }
  
  .redDiv {
    padding: 18px 12px;
  }
  
  .redDiv h5 {
    font-size: 1rem;
    line-height: 1.2;
  }
  
  .dateAndName {
    font-size: 0.75rem;
    margin-bottom: 12px;
  }
  
  .newsBox {
    padding: 20px 12px;
  }
  
  .newsLeft h3 {
    font-size: 1.25rem;
  }
}

/* Landscape Phone Orientation */
@media (max-height: 500px) and (orientation: landscape) {
  #recentUpdate {
    padding: 20px;
    margin-bottom: 30px;
  }
  
  #recentUpdate h2 {
    font-size: 2.2rem;
  }
  
  .flip {
    height: 250px;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .thisDiv img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .flip:hover .flip-inner {
    transform: none;
  }
  
  .flip:active .flip-inner {
    transform: rotateY(180deg);
  }
  
  .flip:hover .thisDiv {
    box-shadow: 0 10px 30px var(--card-shadow);
  }
  
  .flip:active .thisDiv {
    box-shadow: 0 20px 40px var(--hover-shadow);
  }
  
  .flip:hover .redDiv {
    transform: none;
  }
  
  .flip:active .redDiv {
    transform: translateY(-5px);
  }
}

/* Smooth Animations */
* {
  transition: all 0.3s ease;
}

/* Focus States for Accessibility */
.flip:focus-within {
  outline: 2px solid var(--secondary-color);
  outline-offset: 4px;
  border-radius: 20px;
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flip {
  animation: fadeInUp 0.6s ease forwards;
}

.flip:nth-child(2) { animation-delay: 0.1s; }
.flip:nth-child(3) { animation-delay: 0.2s; }
.flip:nth-child(4) { animation-delay: 0.3s; }
.flip:nth-child(5) { animation-delay: 0.4s; }
.flip:nth-child(6) { animation-delay: 0.5s; }