/* Portrait and small-width specific styles to improve usability
   and appearance on phones held in portrait orientation */

@media (orientation: portrait), (max-width: 900px) {
  /* Give pages comfortable padding on small screens */
  .container, .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Header spacing more compact */
  header.py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Make main heading readable on narrow screens */
  .display-3 {
    font-size: 2rem !important;
    line-height: 1.05 !important;
    margin-bottom: 1.25rem !important;
  }

  .fs-3 {
    font-size: 1.05rem !important;
  }

  /* Profile block — smaller and centered */
  .profile {
    width: 220px !important;
    height: 220px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(30,48,243,0.12) !important;
  }
  .profile-img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Hide decorative SVG dots to reduce visual clutter */
  .dots-1, .dots-2, .dots-3, .dots-4 {
    display: none !important;
  }

  /* Make action buttons easy to tap: full width on very small screens */
  .d-grid.gap-3.d-sm-flex .btn {
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .d-grid.gap-3.d-sm-flex .btn + .btn {
    margin-top: 0.75rem !important;
    margin-left: 0 !important;
  }

  /* Increase navbar tap area and make brand more compact */
  .navbar .nav-link {
    padding: 0.55rem 0.5rem !important;
    font-size: 1rem !important;
  }
  .navbar-brand {
    font-size: 1.05rem !important;
  }

  /* Improve readability of summary text */
  .lead {
    font-size: 1.02rem !important;
  }
  .text-muted {
    font-size: 0.98rem !important;
    line-height: 1.5 !important;
  }

  /* Make social icons larger and easier to tap */
  .d-flex.justify-content-center.fs-2.gap-4 a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    font-size: 1.25rem !important;
    background: rgba(30,48,243,0.06) !important;
  }

  /* Footer centered */
  footer .small {
    text-align: center !important;
  }

  /* Ensure text blocks center on small screens */
  .text-xxl-start {
    text-align: center !important;
  }
}

/* Extra small screens (phones) */
@media (max-width: 420px) {
  .display-3 {
    font-size: 1.6rem !important;
  }
  .profile {
    width: 180px !important;
    height: 180px !important;
  }
  .badge {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.78rem !important;
  }
  .btn-lg {
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
    font-size: 0.95rem !important;
  }
}

/* Make certain action buttons full width and easy to tap on small devices */
@media (orientation: portrait), (max-width: 900px) {
  .download-resume {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .card .btn {
    width: 100% !important;
  }
}

/* Visible focus styles for keyboard users */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 3px solid rgba(30,48,243,0.18);
  outline-offset: 3px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Lightbox styles */
#lightbox.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  z-index: 1050;
}
#lightbox.lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox-content {
  max-width: 95%;
  max-height: 85%;
  text-align: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  padding: 0.4rem 0.6rem;
}
.lightbox-close { top: 12px; right: 18px; font-size: 2.4rem; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-caption {
  margin-top: 0.6rem;
  color: #eee;
  font-size: 0.95rem;
}

.lightbox-counter {
  display: inline-block;
  margin-left: 0.6rem;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

/* Animations: fade the overlay and zoom the image */
#lightbox {
  transition: opacity 240ms ease;
  opacity: 0;
}
#lightbox[aria-hidden="false"] {
  opacity: 1;
}
.lightbox-content img {
  transform: scale(0.98);
  opacity: 0;
  transition: transform 260ms cubic-bezier(.2,.9,.3,1), opacity 260ms ease;
}
.lightbox-content img.fade-in {
  transform: scale(1);
  opacity: 1;
}
.lightbox-content img.fade-out {
  transform: scale(0.96);
  opacity: 0;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  #lightbox, .lightbox-content img, .lightbox-content img.fade-in, .lightbox-content img.fade-out {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 420px) {
  .lightbox-prev, .lightbox-next { font-size: 1.6rem; }
  .lightbox-close { font-size: 1.8rem; }
}
