/**
 * Memorial Site Shared Styles
 * Elegant, respectful design for briavel.life
 */

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

html {
  height: 100%;
}

body {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
  background-attachment: fixed;
  color: #333;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.memorial-container {
  max-width: 70ch;
  margin: 0 auto;
}

.memorial-header {
  text-align: center;
  margin-bottom: 1rem;
  padding: 0rem 1rem;
  max-width: 100%;
}

.memorial-header h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.memorial-dates {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-style: italic;
  color: #7f8c8d;
  font-weight: 300;
  margin-top: 0.5rem;
}

.memorial-image-container {
  text-align: center;
  margin: 2rem auto 3rem;
  max-width: 70ch;
  position: relative;
  cursor: pointer;
}

.memorial-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.memorial-image-container:hover .memorial-image {
  transform: scale(1.02);
}

.slideshow-trigger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  border: 2px solid white;
  border-radius: 8px;
  font-size: 1.1rem;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.memorial-image-container:hover .slideshow-trigger {
  opacity: 1;
  pointer-events: auto;
}

.slideshow-trigger:hover {
  background: rgba(0, 0, 0, 0.9);
}

.memorial-obit {
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.5em;
}

p {
  font-size: 1.2em;
  padding-bottom: 20px;
  text-wrap: pretty;
}

.memorial-divider {
  width: 100px;
  height: 1px;
  background: linear-gradient(to right, transparent, #bdc3c7, transparent);
  margin: 3rem auto;
}

.memorial-footer {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem 1rem;
  border-top: 1px solid #e0e0e0;
  color: #7f8c8d;
}

.memorial-footer p {
  font-size: 0.95rem;
  padding-bottom: 0.25rem;
  line-height: 1.8;
}

.memorial-footer .footer-dates {
  font-style: italic;
  font-size: 0.9rem;
  color: #95a5a6;
}

/* Navigation Links */
.memorial-nav {
  text-align: center;
  margin: 2rem 0;
}

.memorial-nav-top {
  text-align: left;
  margin: 0 0 2rem 0;
  padding: 1rem 0 0.5rem 0;
}

/* Global link style: thin underline matching text color, with animated light-blue underline on hover */
a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px; /* sit just below the base underline */
  width: 100%;
  height: 2px;
  background: #76b5ff; /* light blue */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms ease;
}

a:hover::after,
a:focus-visible::after {
  transform: scaleX(1);
}

/* Navigation links use the same global link treatment, with spacing preserved */
.memorial-nav a {
  color: inherit;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid currentColor;
}

.memorial-nav a:hover {
  color: inherit; /* keep same color on hover */
}

/* Contact Form Styles */
.contact-section {
  max-width: 70ch;
  margin: 0 auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.contact-section h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 400;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  text-align: center;
}

.contact-section .subtitle {
  text-align: center;
  color: #7f8c8d;
  font-style: italic;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6b7c8e;
}

.form-group textarea {
  resize: vertical;
  min-height: 225px;
}

.form-submit {
  align-self: center;
  padding: 0.875rem 2.5rem;
  background: #6b7c8e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 0.5rem;
}

.form-submit:hover {
  background: #5a6a7a;
}

.form-submit:active {
  transform: translateY(1px);
}

.form-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Override comment widget styles for memorial theme */
.comment-widget h3 {
  color: #2c3e50;
  font-weight: 400;
  text-align: center;
}

/* Return button for success message */
.return-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: #6b7c8e;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

.return-btn:hover {
  background: #5a6a7a;
  transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .memorial-header {
    padding: 1rem 0.5rem;
    margin-bottom: 2rem;
  }

  .memorial-image-container {
    margin: 1.5rem auto 2rem;
  }

  .memorial-obit {
    padding: 0 1rem;
  }

  .contact-section {
    padding: 1.5rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Slideshow Modal */
.slideshow-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.slideshow-modal.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slideshow-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 500ms ease;
}
.slideshow-image.visible {
  opacity: 1;
}

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

.slideshow-close {
  position: fixed;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: white;
  font-size: 60px;
  font-weight: 300;
  cursor: pointer;
  z-index: 10000;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
  line-height: 1;
  padding: 0;
}

.slideshow-close:hover {
  transform: scale(1.1);
  color: #ddd;
}

.slideshow-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 40px;
  padding: 16px 20px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s ease;
  border-radius: 4px;
  user-select: none;
}

.slideshow-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.slideshow-prev {
  left: 20px;
}

.slideshow-next {
  right: 20px;
}

.slideshow-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 20px;
  z-index: 10000;
}

@media (max-width: 768px) {
  .slideshow-close {
    font-size: 50px;
    top: 10px;
    right: 15px;
    width: 50px;
    height: 50px;
  }

  .slideshow-nav {
    font-size: 30px;
    padding: 12px 16px;
  }

  .slideshow-prev {
    left: 10px;
  }

  .slideshow-next {
    right: 10px;
  }

  .slideshow-counter {
    font-size: 14px;
    bottom: 15px;
    padding: 8px 16px;
  }
}

