﻿/* ===================================================================
   TOMB DETAIL DYNAMIC - WebForms implementation
   هدف: استفاده از معماری فعلی tomb-base/tomb-layout و تکمیل بخش جزئیات
   =================================================================== */

.tomb-detail-page {
  --tomb-detail-card-bg: var(--color-white-aqua);
  --tomb-detail-soft-bg: var(--color-white-soft);
  --tomb-detail-border: var(--color-gray-mid);
  min-height: calc(100vh - 180px);
  padding-bottom: 24px;
}

@media (min-width: 768px) {
  body.tomb-personal-page .tomb-detail-page {
    min-height: 0;
    padding-bottom: 0;
  }
}

.tomb-detail-grid {
  min-height: 640px;
}

.tomb-detail-sidebar .nav-link {
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  min-height: 54px;
}

.tomb-detail-sidebar .nav-link:focus-visible {
  outline: 2px solid var(--color-primary-hover);
  outline-offset: -2px;
}

.tomb-detail-main-wrapper {
  min-width: 0;
}

.tomb-detail-identity {
  margin-bottom: 20px;
}

.tomb-detail-section {
  display: none !important;
  background: transparent;
}

.tomb-detail-section.is-active {
  display: block !important;
}

.tomb-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary-hover);
  margin: 0 0 18px;
  text-align: right;
}

.tomb-empty-state {
  width: 100%;
  border: 1px solid var(--tomb-detail-border);
  border-radius: 12px;
  background: var(--tomb-detail-soft-bg);
  color: var(--color-gray-dark);
  text-align: center;
  padding: 28px 18px;
  line-height: 1.8;
}

.tomb-detail-notfound {
  padding-top: 40px;
  padding-bottom: 40px;
}

.tomb-detail-notfound .tomb-empty-state h1 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--color-primary-hover);
}

.tomb-achievements-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.tomb-achievements-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--tomb-detail-soft-bg);
  border: 1px solid var(--tomb-detail-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.tomb-achievements-list li span {
  color: var(--color-primary-hover);
  font-size: 1.3rem;
  line-height: 1;
}

.tomb-achievements-list li p {
  margin: 0;
  line-height: 1.8;
  text-align: justify;
}

.tomb-gallery-grid,
.tomb-announcement-grid,
.tomb-related-grid,
.tomb-interaction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.tomb-gallery-item {
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--tomb-detail-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--tomb-detail-soft-bg);
  cursor: pointer;
}

.tomb-gallery-item img,
.tomb-announcement-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.tomb-gallery-item:hover,
.tomb-gallery-item:focus-visible {
  border-color: var(--color-primary-hover);
  outline: 1px solid var(--color-primary-hover);
}

.tomb-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, .88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.tomb-gallery-lightbox.is-open {
  display: flex;
}

.tomb-gallery-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
}

.tomb-gallery-close {
  position: absolute;
  top: 18px;
  left: 18px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tomb-interaction-card {
  width: 100%;
  height: auto;
  min-height: 185px;
  padding: 18px 14px !important;
  margin: 0 !important;
  background: var(--color-white-aqua);
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tomb-interaction-card .window i {
  font-size: 1.7rem;
  color: var(--color-primary-hover);
}

.tomb-interaction-card .d-flex {
  width: 100%;
  max-width: 180px;
  margin-top: 8px;
}

.tomb-interaction-card .prayer-number-input {
  height: 34px;
  text-align: center;
  background: var(--color-white-soft);
}

.tomb-interaction-card .prayer-send-btn {
  min-width: 54px;
  height: 34px;
  border-radius: 6px !important;
  background: var(--color-primary) !important;
}

.tomb-interaction-card .prayer-send-btn:hover {
  background: var(--color-primary-hover) !important;
}

.tomb-share-card,
.tomb-announcement-card,
.tomb-related-card {
  background: var(--tomb-detail-soft-bg);
  border: 1px solid var(--tomb-detail-border);
  border-radius: 12px;
  padding: 18px;
}

.tomb-share-card {
  max-width: 650px;
}

.tomb-share-card p {
  margin-bottom: 14px;
  line-height: 1.8;
}

.tomb-share-input {
  direction: ltr;
  text-align: left;
}

.tomb-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tomb-share-actions .btn {
  min-width: 110px;
}

.tomb-form-feedback {
  min-height: 26px;
  margin-top: 10px;
  font-size: .85rem;
  color: var(--color-primary-hover);
}

.tomb-form-feedback.is-error {
  color: #b00020;
}

.routing-wrapper iframe.routing-map {
  width: 100%;
  border: 0;
  border-radius: 8px 8px 0 0;
}

.tomb-routing-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-dark);
  background: var(--tomb-detail-soft-bg);
  line-height: 1.8;
  padding: 16px;
}

.tomb-announcement-card {
  padding: 0;
  overflow: hidden;
}

.tomb-announcement-card img {
  aspect-ratio: 1 / 1;
  display: block;
}

.tomb-announcement-card h3 {
  font-size: 1rem;
  color: var(--color-primary-hover);
  margin: 12px 14px 6px;
}

.tomb-announcement-card p {
  font-size: .85rem;
  color: var(--color-gray-dark);
  margin: 0 14px 14px;
}

.tomb-related-card h3 {
  font-size: 1.05rem;
  color: var(--color-primary-hover);
  margin: 0 0 8px;
}

.tomb-related-relation {
  color: var(--color-gray-dark);
  font-size: .9rem;
  margin-bottom: 8px;
}

.tomb-related-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
  color: var(--color-gray-dark);
  margin-bottom: 8px;
}

.tomb-related-card p {
  margin: 0;
  line-height: 1.8;
  text-align: justify;
}

.heartfelt-page .heartfelt-card {
  max-width: 650px;
}

.heartfelt-page .heartfelt-submit-btn {
  min-height: 42px;
}

.condolence-scroll-container .tomb-empty-state {
  margin: 12px;
  width: auto;
}

.tomb-condolences-fullwidth {
  display: none;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 0;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth {
  display: flex;
  flex-direction: column;
}

body.tomb-detail-condolences-expanded .tomb-detail-sidebar,
body.tomb-detail-condolences-expanded .tomb-detail-main-wrapper {
  display: none;
}

body.tomb-detail-condolences-expanded .tomb-detail-page > .container-xxl.h-100 {
  margin-top: 0;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth .space-condolence {
  display: none;
}

/* نوار بازگشت ثابت بالای ناحیه پیام‌ها؛ اسکرول فقط داخل لیست */
body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth .header-condolence {
  position: relative;
  top: auto;
  flex-shrink: 0;
  z-index: 2;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth {
  min-height: 0;
  overflow: hidden;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth .box-condolence {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth .box-condolence > .condolence-scroll-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth .box-condolence > .condolence-scroll-container::-webkit-scrollbar {
  display: none;
}

@media (min-width: 768px) {
  body.tomb-detail-condolences-expanded .tomb-detail-grid {
    height: calc(100vh - var(--sticky-top-offset, 130px));
    overflow: hidden;
  }

  body.tomb-detail-condolences-expanded .tomb-condolences-fullwidth {
    height: 100%;
  }
}

.deceased-name {
  line-height: 1.5;
}

.photo-deceased-wrapper .photo-deceased img {
  display: block;
}

@media (min-width: 1200px) {
  .tomb-gallery-grid,
  .tomb-announcement-grid,
  .tomb-related-grid,
  .tomb-interaction-grid {
    grid-template-columns: repeat(2, minmax(0, 300px));
    gap: 28px;
  }

  .tomb-detail-section {
    max-width: 700px;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .tomb-detail-section {
    max-width: 500px;
  }
}

@media (max-width: 991.98px) {
  .tomb-detail-page {
    padding-bottom: 80px;
  }

  .tomb-detail-grid {
    min-height: 0;
  }

  .tomb-section-title {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tomb-detail-section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tomb-condolence-aside {
    padding-right: 12px;
    padding-left: 12px;
  }
}

/* ===== افراد هم‌مزار (افقی) ===== */
.card-horizontal-mazar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--color-gray-mid);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  width: 100%;
}

.card-horizontal-mazar:hover {
  border-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
}

.card-mazar-img-wrap {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-gray-light, #f0f0f0);
}

.card-mazar-img-wrap .card-img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card-mazar-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.card-mazar-name {
  font-weight: 700;
  color: var(--color-navy-deep, #243a5e);
  font-size: 0.95rem;
}

.card-mazar-relation {
  font-size: 0.8rem;
  color: var(--color-gray-dark, #555);
}

/* ===== modal اپ‌های مسیریابی و اشتراک‌گذاری ===== */
.navigation-app,
.virtual-app {
  width: 100%;
}

.map-app-link,
.share-app-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 80px;
  min-height: 70px;
  padding: 8px;
  border-radius: 10px;
  background: var(--color-white-aqua, #f7f8fa);
  text-decoration: none;
  color: var(--color-navy-deep, #243a5e);
  font-size: 0.78rem;
  border: 1px solid var(--color-gray-mid);
  transition: all 0.2s ease;
}

.map-app-link:hover,
.share-app-link:hover {
  border-color: var(--color-primary-hover);
  color: var(--color-primary-hover);
}

.map-app-link i,
.share-app-link i {
  font-size: 1.6rem;
}

.map-app-link.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Splash flower emojis ===== */
.flower-emoji {
  font-size: 24px;
}

@media (max-width: 575.98px) {
  .tomb-detail-page {
    min-height: 0;
  }

  .tomb-gallery-grid,
  .tomb-announcement-grid,
  .tomb-related-grid,
  .tomb-interaction-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tomb-share-actions {
    flex-direction: column;
  }

  .tomb-share-actions .btn {
    width: 100%;
  }

  .tomb-detail-sidebar .nav-link {
    font-size: .62rem !important;
    min-height: 60px;
    padding: 0 4px !important;
  }

  .tomb-detail-sidebar .nav-link .custom-tomb-icon {
    margin-bottom: 3px;
  }

  .tomb-interaction-card {
    min-height: 160px;
  }

  .tomb-section-title {
    font-size: 1.15rem;
  }
}
