/* Held In Memory - Memorials. Scoped to .him- classes to avoid theme clashes. */

.him-memorial,
.him-account {
  --him-ink: #24302a;
  --him-coal: #3b3832;
  --him-muted: #746e66;
  --him-line: #d2c4b3;
  --him-paper: #f8f3ea;
  --him-paper-light: #fffdf7;
  --him-bone: #ede4d6;
  --him-gum: #647d68;
  --him-clay: #9e6752;
  --him-gold: #b49361;
  --him-shadow: 0 20px 44px rgba(36, 48, 42, 0.12);
  color: var(--him-ink);
}

.him-memorial {
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--him-paper);
}

.him-hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(40px, 8vw, 86px) 0;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
}

.him-hero-photo img,
.him-hero-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  box-shadow: var(--him-shadow);
}

.him-hero-photo-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid var(--him-line);
  background: linear-gradient(135deg, var(--him-bone), #dfeadd);
}

.him-hero-photo-placeholder span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--him-ink);
  color: var(--him-paper-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
}

.him-eyebrow {
  margin: 0 0 10px;
  color: var(--him-clay);
  font-size: 0.92rem;
  font-weight: 800;
}

.him-name {
  margin: 0 0 12px;
  color: var(--him-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1;
  font-weight: 500;
}

.him-years,
.him-location,
.him-tribute-line {
  margin: 0 0 6px;
  color: var(--him-muted);
  font-size: 1.08rem;
}

.him-tribute-line {
  max-width: 46rem;
  margin-top: 16px;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.him-hero-actions,
.him-form-actions,
.him-dashboard-actions,
.him-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.him-hero-actions {
  margin: 22px 0 0;
}

.him-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 clamp(54px, 8vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: clamp(28px, 5vw, 60px);
  align-items: start;
}

.him-content,
.him-panel,
.him-memory-card,
.comment-respond,
.him-account-panel,
.him-dashboard-head,
.him-empty-panel {
  border: 1px solid var(--him-line);
  border-radius: 8px;
  background: var(--him-paper-light);
}

.him-content,
.him-account-panel,
.him-dashboard-head,
.him-empty-panel {
  padding: clamp(22px, 5vw, 52px);
}

.him-section {
  margin: 0 0 clamp(32px, 5vw, 48px);
  padding: 0;
}

.him-section:last-child {
  margin-bottom: 0;
}

.him-section h2,
.him-panel h2,
.comment-reply-title,
.him-account-panel h2,
.him-dashboard-head h2 {
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--him-line);
  color: var(--him-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.1;
  font-weight: 500;
}

.him-side {
  display: grid;
  gap: 18px;
}

.him-panel {
  padding: 22px;
}

.him-share-url {
  color: var(--him-clay);
  font-weight: 800;
  word-break: break-word;
}

.him-small,
.him-small-link,
.him-form-note,
.him-empty {
  color: var(--him-muted);
}

.him-button,
.him-form button,
.comment-form input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--him-clay);
  color: var(--him-paper-light);
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
}

.him-button:hover,
.him-form button:hover,
.comment-form input[type="submit"]:hover {
  background: var(--him-ink);
  color: var(--him-paper-light);
}

.him-button--ghost,
.him-form .him-button--ghost {
  border-color: var(--him-line);
  background: var(--him-paper-light);
  color: var(--him-ink);
}

.him-danger {
  background: #7f3f35 !important;
}

.him-photo-gallery,
.him-existing-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.him-photo-gallery figure {
  margin: 0;
}

.him-photo-gallery img,
.him-existing-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.him-memory-list {
  display: grid;
  gap: 14px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.him-memory-card {
  padding: 18px 20px;
}

.him-memory-author {
  display: block;
  color: var(--him-ink);
  font-size: 1.08rem;
}

.him-memory-body {
  color: var(--him-coal);
}

.him-memory-meta {
  color: var(--him-muted);
}

.comment-respond {
  padding: clamp(20px, 4vw, 34px);
}

.comment-form p {
  margin: 0 0 16px;
}

.comment-form label,
.him-form label {
  display: block;
  margin: 0 0 6px;
  color: var(--him-ink);
  font-weight: 800;
}

.comment-form input:not([type="submit"]),
.comment-form textarea,
.comment-form-relationship input,
.him-form input:not([type="checkbox"]):not([type="file"]),
.him-form textarea,
.him-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--him-line);
  border-radius: 8px;
  background: var(--him-paper-light);
  color: var(--him-ink);
  padding: 12px 14px;
  font: inherit;
}

.comment-form textarea,
.him-form textarea {
  min-height: 140px;
}

.him-account {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 40px);
}

.him-auth-grid,
.him-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.him-auth-grid {
  align-items: start;
}

.him-form {
  display: grid;
  gap: 16px;
}

.him-field {
  margin: 0;
}

.him-field--full {
  grid-column: 1 / -1;
}

.him-memorial-editor {
  padding-top: clamp(20px, 4vw, 36px);
}

.him-editor-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--him-line);
}

.him-editor-heading h2 {
  margin-bottom: 6px;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.him-editor-heading p {
  color: var(--him-muted);
}

.him-back-link {
  color: var(--him-clay);
  font-weight: 800;
  text-decoration: none;
}

.him-form-section {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid var(--him-line);
}

.him-form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.him-form-section legend {
  margin: 0 0 14px;
  padding: 0;
  color: var(--him-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 600;
}

.him-memorial-form .him-checkbox,
.him-memorial-form .him-form-actions {
  padding-top: 18px;
  border-top: 1px solid var(--him-line);
}

.him-checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
}

.him-checkbox input {
  margin-top: 0.35em;
}

.him-alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 800;
}

.him-alert--success {
  border: 1px solid #b7c8b8;
  background: #edf4ec;
  color: #284a31;
}

.him-alert--error {
  border: 1px solid #d8b7aa;
  background: #fff3ed;
  color: #7f3f35;
}

.him-verification-panel {
  max-width: 760px;
  margin: 0 auto;
}

.him-verification-panel > p {
  max-width: 58ch;
}

.him-verification-form {
  margin: 18px 0 12px;
  justify-items: start;
}

.him-dashboard-head {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.him-dashboard-head h2 {
  border-bottom: 0;
  padding-bottom: 0;
}

.him-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.him-panel-heading h2,
.him-panel-heading p {
  margin-bottom: 0;
}

.him-dashboard-list,
.him-memory-review-list {
  display: grid;
  gap: 14px;
}

.him-dashboard-card,
.him-memory-review {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--him-line);
  border-radius: 8px;
  background: var(--him-paper);
}

.him-dashboard-card h3 {
  margin: 8px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.him-status {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--him-bone);
  color: var(--him-ink);
  font-size: 0.85rem;
  font-weight: 900;
}

.him-status--publish {
  background: #dfeadd;
}

.him-status--pending {
  background: #f3dfc1;
}

.him-status--draft {
  background: var(--him-bone);
}

.him-existing-gallery {
  margin: 8px 0 4px;
  padding: 18px;
  border: 1px solid var(--him-line);
  border-radius: 8px;
  background: var(--him-paper);
}

.him-existing-gallery h3 {
  margin-top: 0;
}

.him-existing-gallery label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.him-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .him-cols-2,
  .him-cols-3,
  .him-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .him-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .him-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.him-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--him-line);
  border-radius: 8px;
  background: var(--him-paper-light);
  color: inherit;
  text-decoration: none;
}

.him-card:hover {
  box-shadow: var(--him-shadow);
}

.him-card-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.him-card-photo--empty {
  background: linear-gradient(135deg, #eef2ee, #dde7e0);
}

.him-card-name {
  display: block;
  padding: 14px 16px 2px;
  font-weight: 800;
}

.him-card-years {
  display: block;
  padding: 0 16px 16px;
  color: var(--him-muted);
  font-size: 0.92rem;
}

.him-empty-panel {
  text-align: center;
}

@media (max-width: 900px) {
  .him-hero,
  .him-layout,
  .him-auth-grid,
  .him-form-grid,
  .him-dashboard-card,
  .him-memory-review {
    grid-template-columns: 1fr;
  }

  .him-photo-gallery,
  .him-existing-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .him-dashboard-head,
  .him-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .him-hero,
  .him-layout {
    width: min(100% - 32px, 1180px);
  }

  .him-photo-gallery,
  .him-existing-gallery-grid {
    grid-template-columns: 1fr;
  }
}
