/* Book of Condolences — page-specific (extends site-theme.css) */

.page-condolences .hero .subtitle {
  margin-bottom: 1rem;
}

.page-condolences .hero-add-actions {
  margin-top: 1.15rem;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.page-condolences .hero-add-actions .btn-add {
  width: 100%;
}

body.condolence-modal-open {
  overflow: hidden;
}

.condolence-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.condolence-modal[hidden] {
  display: none !important;
}

.condolence-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 32, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.condolence-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: min(92vh, 46rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.condolence-modal__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(26, 47, 75, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(18, 35, 56, 0.12);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.condolence-modal__close:hover {
  background: #fff;
  border-color: var(--accent);
  transform: scale(1.06);
}

.condolence-modal__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.condolence-modal__card {
  margin-top: 0;
}

.condolence-modal__card h2 {
  padding-right: 2.75rem;
}

.page-condolences .setup-banner {
  background: linear-gradient(135deg, #fff8e6 0%, #fff3cd 100%);
  border: 1px solid rgba(200, 160, 60, 0.45);
  color: #6b4f1a;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: none;
  box-shadow: var(--shadow-card);
}

.page-condolences .setup-banner.visible {
  display: block;
}

.page-condolences .save-success {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 1px solid rgba(46, 125, 50, 0.45);
  color: #1b5e20;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-card);
}

.page-condolences .save-success[hidden] {
  display: none;
}

.page-condolences .setup-banner code {
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.page-condolences .messages-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.35rem 1.1rem 1.5rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page-condolences .list-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.page-condolences .add-actions {
  margin: 0.25rem 0 0;
}

.page-condolences .btn-add {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.07) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.25, 0.64, 1),
    box-shadow 0.22s ease,
    filter 0.22s ease;
}

.page-condolences .btn-add::before {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  opacity: 0.9;
}

.page-condolences .btn-add:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.12) 100%);
  border-color: rgba(255, 255, 255, 0.55);
  filter: brightness(1.08);
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(184, 149, 106, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.page-condolences .btn-add:active {
  transform: translateY(-1px) scale(0.98);
  filter: brightness(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition-duration: 0.08s;
}

.page-condolences .btn-add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.page-condolences .card {
  background: var(--card);
  background-image: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.4rem;
  margin-top: 1rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
}

.page-condolences .card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 1.15rem;
  letter-spacing: 0.02em;
}

.page-condolences label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-condolences .label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.page-condolences input,
.page-condolences textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 1rem;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.page-condolences input::placeholder,
.page-condolences textarea::placeholder {
  color: #9a9ea4;
}

.page-condolences input:focus,
.page-condolences textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.page-condolences textarea {
  min-height: 130px;
  resize: vertical;
}

.page-condolences button[type="submit"] {
  width: 100%;
  background: linear-gradient(180deg, var(--navy) 0%, #152d45 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.25, 0.64, 1),
    box-shadow 0.22s ease,
    filter 0.22s ease,
    border-color 0.22s ease;
  box-shadow: 0 5px 18px rgba(26, 47, 75, 0.42);
}

.page-condolences button[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    0 14px 36px rgba(18, 30, 48, 0.55),
    0 0 0 3px rgba(184, 149, 106, 0.45);
}

.page-condolences button[type="submit"]:active:not(:disabled) {
  transform: translateY(-1px) scale(0.985);
  filter: brightness(1.05);
  box-shadow: 0 4px 14px rgba(18, 30, 48, 0.5);
  transition-duration: 0.08s;
}

.page-condolences button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.page-condolences button[type="submit"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .page-condolences .btn-add,
  .page-condolences button[type="submit"] {
    transition-duration: 0.01ms;
  }

  .page-condolences .btn-add:hover,
  .page-condolences button[type="submit"]:hover:not(:disabled) {
    transform: none;
  }

  .page-condolences .btn-add:active,
  .page-condolences button[type="submit"]:active:not(:disabled) {
    transform: none;
  }

  .condolence-modal__close {
    transition-duration: 0.01ms;
  }

  .condolence-modal__close:hover {
    transform: none;
  }
}

.page-condolences .msg {
  font-size: 0.9rem;
  margin-top: 0.85rem;
  min-height: 1.25rem;
}

.page-condolences .msg.ok {
  color: #1b5e20;
}

.page-condolences .msg.err {
  color: #b71c1c;
}

.page-condolences .entry {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(18, 35, 56, 0.04);
  transition: box-shadow 0.2s;
}

.page-condolences .entry:hover {
  box-shadow: 0 4px 16px rgba(18, 35, 56, 0.07);
}

.page-condolences .entry:last-child {
  margin-bottom: 0;
}

.page-condolences .entry .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.page-condolences .entry .text {
  color: #3a4048;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.975rem;
  line-height: 1.6;
}

.page-condolences .entry .when {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b9199;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.page-condolences .empty {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.75rem 1rem;
  line-height: 1.55;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.page-condolences .loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  padding: 1.5rem 1rem;
}

.page-condolences .loading-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: condolences-spin 0.75s linear infinite;
}

@keyframes condolences-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-condolences .loading-spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.5);
  }
}
