/* --------------------------------
   Form Container
-------------------------------- */
.obituary-form {
  max-width: 720px;
  margin: 40px auto;
  padding: 28px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.obituary-form h3 {
  margin-bottom: 26px;
  font-size: 24px;
  font-weight: 600;
  color: #1f2933;
  text-align: center;
}

/* --------------------------------
   Layout Helpers
-------------------------------- */
.form-group {
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* --------------------------------
   Labels
-------------------------------- */
.obituary-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* --------------------------------
   Inputs & Selects
-------------------------------- */
.obituary-form input[type="text"],
.obituary-form input[type="date"],
.obituary-form input[type="file"],
.obituary-form textarea,
.obituary-form select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.obituary-form textarea {
  resize: vertical;
}

/* Focus states */
.obituary-form input:focus,
.obituary-form textarea:focus,
.obituary-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Dropdown fix for WP categories */
.obituary-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  cursor: pointer;
}

/* --------------------------------
   WordPress Editor Styling
-------------------------------- */
.obituary-editor .wp-editor-container {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d1d5db;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.obituary-editor .wp-editor-area {
  font-size: 14px;
  line-height: 1.7;
  padding: 12px;
  min-height: 160px;
  background-color: #fff;
  transition: background-color 0.2s ease;
}

/* --------------------------------
   Image Preview
-------------------------------- */
.image-preview {
  margin-top: 12px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}

.image-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f9fafb;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Remove button */
.image-box button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.image-box button:hover {
  background: #dc2626;
}

/* --------------------------------
   Submit Button
-------------------------------- */
.form-actions {
  margin-top: 30px;
  text-align: center;
}

.obituary-form button[type="submit"] {
  padding: 14px 32px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 999px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.obituary-form button[type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.obituary-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --------------------------------
   Mobile Responsive
-------------------------------- */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .obituary-form {
    padding: 20px;
  }

  .image-box {
    aspect-ratio: 1 / 1;
  }
}

/* Spinner inside button */
.btn-spinner {
  margin-left: 8px;
  display: inline-block;
  animation: spin 1s linear infinite;
  font-size: 16px;
  line-height: 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* --------------------------------
   AJAX Message
-------------------------------- */

/* Smooth scroll behavior (optional) */
html {
  scroll-behavior: smooth;
}

/* Highlight invalid fields */
.obituary-form input.invalid,
.obituary-form textarea.invalid,
.obituary-form select.invalid {
  border-color: #dc2626 !important;
  background-color: #fee2e2 !important;
  animation: shake 0.3s ease;
  color: #b91c1c;
}

/* Shake animation */
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Messages */
.obituary-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 14px;
  line-height: 1.4;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.obituary-message.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}
.obituary-message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #a7f3d0;
}

/* TinyMCE editor highlight */
.obituary-editor.invalid .mce-tinymce,
.obituary-editor.invalid .wp-editor-area {
  border-color: #dc2626 !important;
  background-color: #fee2e2 !important;
  animation: shake 0.3s ease;
}

/* Inline error messages */
.field-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 4px;
  font-weight: 600;
}

/* Make sure error message below selects is spaced */
.form-group select + .field-error {
  margin-top: 6px;
  display: block;
}

/* Make sure error message below inputs and textarea is spaced */
.form-group input + .field-error,
.form-group textarea + .field-error {
  margin-top: 6px;
  display: block;
}

/* login restricted */
/* Container styling to center the box on the page */
.login-required-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh; /* Adjust height based on your layout */
  padding: 20px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The card itself */
.login-required-container {
  background: #ffffff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 450px;
  width: 100%;
}

/* Typography */
.login-required-container h1 {
  color: #333;
  font-size: 28px;
  margin-bottom: 15px;
}

.login-required-container p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 25px;
}

/* The Log In Button */
.login-button {
  display: inline-block;
  background-color: #0073aa; /* Standard WordPress Blue */
  color: #ffffff;
  padding: 12px 30px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease;
  margin-bottom: 20px;
}

.login-button:hover {
  background-color: #005177;
  color: #ffffff;
}

/* The registration note */
.note {
  font-size: 14px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.note a {
  color: #0073aa;
  text-decoration: none;
  font-weight: bold;
}

.note a:hover {
  text-decoration: underline;
}

/* End of Login Required Page Styles */

/* obituary list styles */

/* Obituary Dashboard */
.obituary-dashboard {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.obituary-dashboard__title {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}

/* Table */
.obituary-table {
  width: 100%;
}

.obituary-table__header,
.obituary-table__row {
  display: grid;
  grid-template-columns: 2.5fr 1.2fr 1.5fr 1.3fr;
  align-items: center;
  padding: 12px 16px;
}

.obituary-table__header {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.obituary-table__row {
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.obituary-table__row:last-child {
  border-bottom: none;
}

/* Title */
.obituary-title {
  font-weight: 500;
  color: #111827;
}

/* Status Pills */
.obituary-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  width: fit-content;
}

/* Actions */
.obituary-actions a {
  margin-right: 12px;
  font-weight: 500;
  text-decoration: none;
  color: #2563eb;
}

.obituary-actions a:hover {
  text-decoration: underline;
}

/* Empty state */
.obituary-empty {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-size: 15px;
}
/* Update grid to include photo */
.obituary-table__header,
.obituary-table__row {
  grid-template-columns: 70px 2.5fr 1.2fr 1.5fr 1.3fr;
}

/* Thumbnail */
.obituary-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
}

.obituary-thumb__img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fff;
}

/* Placeholder (no image) */
.obituary-thumb__placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  color: #6b7280;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Obituary end List Styles */

/* Obituary Dates Styling */

.obituary-dates {
  font-family: "Roboto Slab", serif;
  font-size: 18px;
  color: #777;
  font-weight: 400;
  text-align: center;
}

.meta-data {
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  display: block;
  font-weight: 400;
  text-transform: uppercase;
}

/* End of obituary date styles */

/* condolence list styles */
.condolence-avatar {
  width: 60px;
  height: 60px;
}

.condolence-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #eee;
  border-radius: 50%;
  font-size: 24px;
  color: #999;
}

.post-type-obituary .comment-list {
  list-style: none;
  padding: 0;
}

.condolence-item {
  display: flex;
  gap: 20px;
  padding: 25px 0;
  border-bottom: 1px solid #eee;
}

.condolence-avatar img {
  border-radius: 50%;
}

.condolence-author {
  font-weight: 600;
}

.condolence-date {
  font-size: 13px;
  color: #999;
  margin-top: 4px;
}

.condolence-text {
  margin-top: 10px;
  line-height: 1.6;
}

.reply {
  display: none; /* matches your no-reply rule */
}

.condolence-submit-btn {
  background-color: #ffc107; /* warm yellow */
  color: #333; /* text color */
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.condolence-submit-btn:hover {
  background-color: #e0a800; /* slightly darker on hover */
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.condolence-submit-btn:disabled {
  background-color: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
  box-shadow: none;
}

.comment-form-comment textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.comment-form-comment textarea:focus {
  border-color: #ffc107;
  outline: none;
}
/* Container styling (optional) */
#commentform {
  background-color: #fffdf0;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #ffeeba;
  max-width: 700px;
  margin-bottom: 40px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Input fields: author & email */
.comment-form-author,
.comment-form-email {
  display: block;
  width: 100%;
  margin-bottom: 15px;
}

.comment-form-author input,
.comment-form-email input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
  transition: all 0.3s ease;
}

.comment-form-author input:focus,
.comment-form-email input:focus {
  border-color: #ffc107;
  outline: none;
}

/* Comment textarea */
.comment-form-comment textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.3s ease;
}

.comment-form-comment textarea:focus {
  border-color: #ffc107;
  outline: none;
}

/* Cookies consent */
.comment-form-cookies-consent {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  font-size: 13px;
}

.comment-form-cookies-consent input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #ffc107;
}

/* Submit button */
#submit,
.form-submit button,
.comment-form-submit .submit {
  background-color: #ffc107;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#submit:hover,
.form-submit button:hover,
.comment-form-submit .submit:hover {
  background-color: #e0a800;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

#submit:disabled,
.form-submit button:disabled,
.comment-form-submit .submit:disabled {
  background-color: #f5f5f5;
  color: #aaa;
  cursor: not-allowed;
  box-shadow: none;
}
#commentform label {
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
  color: #555;
}
/* End of condolence list styles */

/* Light a Candle Styles */
.reaction-bar {
  display: flex;
  gap: 4px;
  padding: 2px;
  /* background: #fafafa;
  border: 1px solid #e6e6e6; */
  /* border-radius: 10px; */
  justify-content: left;
  /* margin-bottom: 14px; */
}

.reaction-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: visible;
}

.reaction-item:hover {
  background: #f0f0f0;
  border-radius: 8px;
}

.reaction-item:focus {
  background: #e6e6e6;
  border-radius: 8px;
}

.reaction-item img {
  width: 30px;
  height: 30px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.reaction-item:hover img {
  transform: scale(1.15);
  opacity: 0.85;
}

.reaction-item:active img {
  transform: scale(1.05);
}

.reaction-count {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  /* neutral gray */
  line-height: 1;
}

/* Optional active state (after click) */
.reaction-item.is-active img {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.15));
}

/* Styling for logged-out users */
.reaction-bar.is-guest .reaction-item {
  cursor: not-allowed;
}

.reaction-bar.is-guest .reaction-item:hover {
  background: transparent;
}

.reaction-bar.is-guest .reaction-item[data-reaction="message"],
.reaction-bar.is-guest .reaction-item[data-reaction="share"] {
  filter: none;
  opacity: 1;
  cursor: pointer;
}

/* The base state */

/* The Reacted / Active State */
.reaction-item.active {
  background-color: rgba(0, 115, 170, 0.1); /* Light blue tint */
  border-color: #0073aa; /* Solid border */
  cursor: default; /* Change cursor back to arrow */
  pointer-events: none; /* Prevent clicking again */
}

/* Make the icon slightly bigger when active */
.reaction-item.active img {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Change the text color of the count when active */
.reaction-item.active .reaction-count {
  color: #0073aa;
  font-weight: bold;
}

/* Optional: Subtle animation when the class is added */
@keyframes react-bounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1.15);
  }
}

.reaction-item.active img {
  animation: react-bounce 0.4s ease forwards;
}
/* Only hover if NOT active and NOT a guest */
.reaction-bar.is-user .reaction-item:not(.active):hover {
  background-color: #f8f9fa;
  transform: translateY(-3px);
}

.reaction-bar.is-user .reaction-item:not(.active):active {
  transform: scale(0.95);
}

/* modal  */
/* Modal Overlay */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Modal Box */
.reaction-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.reaction-modal h3 {
  margin-top: 0;
  color: #333;
}
.reaction-modal p {
  color: #666;
  font-size: 14px;
}

/* Buttons */
.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-login,
.btn-register {
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}
.btn-login {
  background: #0073aa;
  color: #fff;
}
.btn-register {
  background: #f0f0f0;
  color: #333;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}
/* end of modal  */

/* Social Grid */
.social-grid {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
}
.share-icon {
  width: 45px;
  height: 45px;
  line-height: 45px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}
.fb {
  background: #1877f2;
}
.tw {
  background: #000000;
}
.wa {
  background: #25d366;
}
.ln {
  background: #0077b5;
}

/* Copy Link Box */
.copy-link-wrapper {
  display: flex;
  background: #f1f1f1;
  border-radius: 8px;
  padding: 5px;
  margin-top: 15px;
}
#share-url-input {
  border: none;
  background: transparent;
  padding: 8px;
  flex-grow: 1;
  font-size: 13px;
  outline: none;
  color: #666;
}
#copy-link-btn {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#copy-link-btn:hover {
  background: #005177;
}
/* end social grid  */

/* End of Light a Candle Styles */

#buddypress {
  padding-top: 70px;
}
