/* ========================================
   Contact Page Styles
   ======================================== */

/* Page Layout */
.contact-page {
  --header-height: 120px;
  --header-height-mobile: 110px;
  overflow-x: hidden;
  width: 100%;
}

.contact-main {
  width: 100%;
  padding: 0;
  margin: 0;
}

/* ========================================
   Hero Section with Background Image
   ======================================== */

.contact-hero {
  position: relative;
  width: 100%;
  height: 40vh;
  min-height: 280px;
  max-height: 400px;
  --contact-hero-padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--contact-hero-padding);
  padding-top: calc(var(--contact-hero-padding) + var(--header-height));
  text-align: center;
  overflow: hidden;
  background-color: #0a3d62;
  background-image: url("/images/contact-hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.contact-hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--hero-text-max-width);
  width: 100%;
  padding: clamp(1rem, 3vw, 1.75rem);
  color: var(--color-white);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hero-gap);
}

.contact-hero__title {
  font-size: var(--hero-title-size);
  font-weight: var(--hero-title-weight);
  letter-spacing: var(--hero-letter-spacing);
  margin-bottom: 0;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #ffffff;
  line-height: var(--hero-title-line-height);
  text-transform: uppercase;
}

.contact-hero__subtitle {
  font-size: var(--hero-subtitle-size);
  font-weight: var(--hero-subtitle-weight);
  line-height: var(--hero-subtitle-line-height);
  max-width: min(var(--hero-text-max-width), 900px);
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  text-align: center;
}

/* ========================================
   Ministry Cards Section
   ======================================== */

.ministry-section {
  padding: 2rem 0 3rem;
  background: #ffffff;
  opacity: 0;
  animation: ultraSoftFadeIn 3.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.2s forwards;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.ministry-cards,
.contact-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  align-items: stretch;
}

.contact-card-compact {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.75rem;
  border: 2px solid #e8ecf4;
  border-left: 4px solid #14497c;
  border-right: 4px solid #14497c;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(70px);
  width: 100%;
  min-width: 0;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.contact-card-compact:nth-child(1) {
  animation: ultraSoftFadeInUp 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
}

.contact-card-compact:nth-child(2) {
  animation: ultraSoftFadeInUp 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
}

.contact-card-compact:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: #d0d8e6;
  border-left-color: #14497c;
  border-right-color: #14497c;
}

.contact-card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.contact-icon {
  width: 64px;
  height: 64px;
  background: #14497c;
  background: #ffffff;  
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  color: #ffffff;
  position: relative;
}

.contact-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-ministry {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  color: #1a1a1a;
  text-align: center;
  margin: 0;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.contact-department {
  text-align: center;
  color: #666666;
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  margin: 0;
  font-weight: 400;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.contact-card-body {
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin-top: 1rem;
  border: none;
  position: relative;
  flex: 1 1 auto;
  width: 100%;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: clamp(0.85rem, 1.4vw, 0.9rem);
  line-height: 1.5;
  color: #4a4a4a;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  min-width: 0;
}

.contact-info-item:last-of-type {
  border-bottom: none;
}

.contact-info-item span {
  color: inherit;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.contact-info-item a {
  color: #14497c;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.25s ease;
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.contact-info-item a:hover {
  color: #0f3a64;
  text-decoration: underline;
}

.contact-info-item address,
address.contact-info-item {
  font-style: normal;
}

.contact-info-item i {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #14497c;
  margin-top: 2px;
  font-size: 1rem;
  text-align: center;
}

.contact-card-footer {
  padding-top: 1.25rem;
  border-top: 1px solid #e8ecf4;
  margin-top: auto;
  width: 100%;
}

.social-links-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.social-links-compact a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666666;
  background: #ffffff;
  transition: all 0.25s ease;
  flex: 0 0 38px;
}

.social-links-compact a:hover {
  color: #14497c;
  border-color: #14497c;
  background: #f8f9fb;
  transform: translateY(-2px);
}

.social-links-compact i {
  font-size: 1rem;
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softFadeIn {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

@keyframes ultraSoftFadeIn {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.1;
  }
  60% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

@keyframes ultraSoftFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(70px);
  }
  30% {
    opacity: 0.1;
    transform: translateY(50px);
  }
  60% {
    opacity: 0.4;
    transform: translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.animate-on-scroll.animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .contact-hero {
    height: 40vh;
    max-height: 450px;
  }
  
  .ministry-section {
    padding: 2.5rem 0 3.5rem;
    min-height: 60vh;
  }
  
  .contact-card-compact {
    padding: 1.75rem;
  }
}

/* Tablet Landscape (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
  .contact-hero {
    height: 38vh;
    min-height: 280px;
    max-height: 380px;
  }
  
  .ministry-section {
    padding: 2rem 0 2.5rem;
    min-height: 62vh;
  }
  
  .ministry-cards,
  .contact-card-grid {
    gap: 1.25rem;
    padding: 0 1.25rem;
  }
  
  .contact-card-compact {
    padding: 1.35rem;
  }
  
  .contact-icon {
    width: 56px;
    height: 56px;
  }
  
  .contact-icon i {
    font-size: 1.35rem;
  }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .contact-hero {
    height: 35vh;
    min-height: 260px;
    max-height: 350px;
  }
  
  .ministry-section {
    padding: 1.75rem 0 2.25rem;
    min-height: 65vh;
  }
  
  .ministry-cards,
  .contact-card-grid {
    gap: 1rem;
    padding: 0 1rem;
    max-width: 100%;
  }
  
  .contact-card-compact {
    padding: 1.15rem;
  }
  
  .contact-icon {
    width: 54px;
    height: 54px;
  }
  
  .contact-icon i {
    font-size: 1.25rem;
  }
}

/* Mobile (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .contact-hero {
    height: 32vh;
    min-height: 240px;
    max-height: 320px;
    padding-top: calc(var(--header-height-mobile) + var(--spacing-sm));
  }
  
  .ministry-section {
    padding: 1.5rem 0 2rem;
    min-height: 68vh;
  }
  
  .ministry-cards,
  .contact-card-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0 0.75rem;
    max-width: 100%;
  }
  
  .contact-card-compact {
    padding: 0.95rem;
    border-radius: 20px;
    max-width: 100%;
  }
  
  .contact-icon {
    width: 50px;
    height: 50px;
  }
  
  .contact-icon i {
    font-size: 1.15rem;
  }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
  .contact-hero {
    height: 30vh;
    min-height: 220px;
    max-height: 280px;
    padding: 1.5rem 0.5rem;
    padding-top: calc(var(--header-height-mobile) + var(--spacing-sm));
  }
  .contact-hero__content {
    padding: 0.5rem;
    padding-top: calc(var(--header-height-mobile) + var(--spacing-xs));
  }
  
  .contact-hero__title {
    font-size: var(--hero-title-size);
    margin-bottom: 0;
  }
  
  .contact-hero__subtitle {
    font-size: var(--hero-subtitle-size);
  }
  
  .ministry-section {
    padding: 1.25rem 0 1.75rem;
    min-height: 70vh;
  }
  
  .ministry-cards,
  .contact-card-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0 0.5rem;
    max-width: 100%;
  }
  
  .contact-card-compact {
    padding: 0.8rem;
    border-radius: 18px;
    max-width: 100%;
  }
  
  .contact-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 0.3rem;
  }
  
  .contact-icon i {
    font-size: 1.05rem;
  }
  
  .contact-ministry {
    font-size: clamp(0.88rem, 3vw, 0.98rem);
    line-height: 1.25;
  }
  
  .contact-department {
    font-size: clamp(0.72rem, 2.5vw, 0.82rem);
    line-height: 1.3;
  }
  
  .contact-card-body {
    margin-top: 0.6rem;
  }
  
  .contact-info-item {
    gap: 0.35rem;
    padding: 0.3rem 0;
    font-size: clamp(0.72rem, 2.5vw, 0.78rem);
  }
  
  .contact-info-item i {
    width: 15px;
    height: 15px;
    font-size: 0.8rem;
  }
  
  .contact-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
  }
  
  .social-links-compact {
    gap: 0.35rem;
  }
  
  .social-links-compact a {
    width: 30px;
    height: 30px;
  }
  
  .social-links-compact i {
    font-size: 0.8rem;
  }
}

/* Extra Small Mobile (max 360px) */
@media (max-width: 360px) {
  .contact-hero {
    height: 28vh;
    min-height: 200px;
    max-height: 250px;
    padding: 1.5rem 0.35rem;
  }
  .contact-hero__content {
    padding-top: calc(var(--header-height-mobile) + var(--spacing-sm));
  }
  
  .contact-hero__title {
    font-size: var(--hero-title-size);
  }
  
  .contact-hero__subtitle {
    font-size: var(--hero-subtitle-size);
  }
  
  .ministry-section {
    padding: 1rem 0 1.5rem;
    min-height: 72vh;
  }
  
  .ministry-cards,
  .contact-card-grid {
    padding: 0 0.35rem;
    gap: 0.65rem;
  }
  
  .contact-card-compact {
    padding: 0.65rem;
  }
  
  .contact-icon {
    width: 42px;
    height: 42px;
  }
  
  .contact-icon i {
    font-size: 0.95rem;
  }
  
  .contact-ministry {
    font-size: 0.82rem;
  }
  
  .contact-department {
    font-size: 0.68rem;
  }
  
  .contact-info-item {
    font-size: 0.68rem;
    gap: 0.3rem;
    padding: 0.25rem 0;
  }
  
  .contact-info-item i {
    width: 14px;
    height: 14px;
    font-size: 0.75rem;
  }
  
  .contact-card-footer {
    margin-top: 0.65rem;
    padding-top: 0.5rem;
  }
  
  .social-links-compact {
    gap: 0.3rem;
  }
  
  .social-links-compact a {
    width: 28px;
    height: 28px;
  }
  
  .social-links-compact i {
    font-size: 0.75rem;
  }
}

/* ========================================
   Performance Optimizations
   ======================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .contact-hero,
  .contact-hero__content,
  .ministry-section,
  .contact-card-compact,
  .contact-icon {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }

  .contact-card-compact:hover {
    transform: none;
  }

  .contact-card-compact:hover .contact-icon {
    transform: none;
  }
}

/* GPU Acceleration */
.contact-card-compact {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
