/* Obituary Manager – Frontend Styles */

:root {
  --om-primary: #4a6741;
  --om-primary-dk: #354d2f;
  --om-primary-lt: #e8f0e7;
  --om-accent: #8b6914;
  --om-text: #2c2c2c;
  --om-text-muted: #666;
  --om-border: #ddd;
  --om-bg-card: #fff;
  --om-bg-subtle: #f8f8f6;
  --om-radius: 10px;
  --om-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  --om-danger: #c0392b;
}

/* ── Notices ─────────────────────────────── */
.om-notice {
  padding: 12px 16px;
  border-radius: var(--om-radius);
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.5;
}

.om-notice-success {
  background: #edf7ed;
  border-left: 4px solid #27ae60;
  color: #1e6b3a;
}

.om-notice-error {
  background: #fdecea;
  border-left: 4px solid #e74c3c;
  color: #8b1a1a;
}

.om-notice-warning {
  background: #fff8e1;
  border-left: 4px solid #f39c12;
  color: #7a5000;
}

.om-notice ul {
  margin: 8px 0 0 18px;
}

/* ── Buttons ──────────────────────────────── */
.om-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

.om-btn-primary {
  background: var(--om-primary);
  color: #fff;
  border-color: var(--om-primary);
}

.om-btn-primary:hover {
  background: var(--om-primary-dk);
  border-color: var(--om-primary-dk);
  color: #fff;
}

.om-btn-secondary {
  background: #fff;
  color: var(--om-primary);
  border-color: var(--om-primary);
}

.om-btn-secondary:hover {
  background: var(--om-primary-lt);
}

.om-btn-outline {
  background: transparent;
  color: var(--om-text-muted);
  border-color: var(--om-border);
}

.om-btn-outline:hover {
  border-color: #999;
  color: var(--om-text);
}

.om-btn-danger {
  background: var(--om-danger);
  color: #fff;
  border-color: var(--om-danger);
}

.om-btn-large {
  padding: 14px 32px;
  font-size: 17px;
}

.om-btn-sm,
.om-btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

/* ── Archive Grid ─────────────────────────── */
.om-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.om-card {
  background: var(--om-bg-card);
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius);
  box-shadow: var(--om-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}

.om-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, .13);
  transform: translateY(-2px);
}

.om-card-link {
  text-decoration: none;
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.om-card-photo {
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--om-bg-subtle);
}

.om-card-photo .om-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.om-card-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--om-primary-lt), #e0e8df);
}

.om-initials {
  font-size: 42px;
  font-weight: 600;
  color: var(--om-primary);
  opacity: .6;
  letter-spacing: -2px;
}

.om-card-body {
  padding: 16px;
  flex: 1;
}

.om-card-name {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--om-text);
}

.om-card-dates {
  font-size: 13px;
  color: var(--om-text-muted);
  margin: 0 0 8px;
}

.om-card-quote {
  font-size: 13px;
  font-style: italic;
  color: var(--om-text-muted);
  margin: 0 0 8px;
  border-left: 3px solid var(--om-border);
  padding-left: 10px;
}

.om-card-cemetery {
  font-size: 13px;
  color: var(--om-text-muted);
  margin: 0;
}

.om-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--om-border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--om-bg-subtle);
}

.om-pagination {
  margin-top: 32px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.om-pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--om-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--om-text);
  font-size: 14px;
}

.om-pagination .page-numbers.current {
  background: var(--om-primary);
  color: #fff;
  border-color: var(--om-primary);
}

.om-pagination .page-numbers:hover:not(.current) {
  background: var(--om-primary-lt);
}

.om-no-results {
  color: var(--om-text-muted);
  font-style: italic;
}

/* ── Single Obituary ──────────────────────── */
.om-single {
  max-width: 800px;
  margin: 0 auto;
  /* overflow:visible ist Pflicht damit der Full-Bleed-Breakout von .om-hero funktioniert */
  overflow: visible;
}

.om-hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--om-border);
}

@media (max-width: 600px) {
  .om-hero {
    flex-direction: column;
  }
}

.om-hero-photo {
  flex-shrink: 0;
  width: 180px;
}

.om-hero-img {
  width: 180px;
  height: 220px;
  object-fit: cover;
  border-radius: var(--om-radius);
  box-shadow: var(--om-shadow);
}

.om-hero-placeholder {
  width: 180px;
  height: 220px;
  border-radius: var(--om-radius);
  background: linear-gradient(135deg, var(--om-primary-lt), #dce8db);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 600;
  color: var(--om-primary);
  opacity: .5;
}

.om-hero-info {
  flex: 1;
}

.om-name {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--om-text);
}

.om-lifespan {
  font-size: 16px;
  color: var(--om-text-muted);
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.om-separator {
  color: var(--om-border);
}

.om-age {
  background: var(--om-bg-subtle);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 13px;
}

.om-birthplace {
  font-size: 14px;
  color: var(--om-text-muted);
  margin: 4px 0;
}

.om-hero-quote {
  font-size: 16px;
  font-style: italic;
  color: var(--om-accent);
  margin: 16px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--om-accent);
}

.om-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.om-body h2 {
  font-size: 20px;
  color: var(--om-text);
  margin-bottom: 12px;
}

.om-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--om-text);
  margin-bottom: 32px;
}

.om-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.om-detail-card {
  background: var(--om-bg-subtle);
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius);
  padding: 18px;
}

.om-detail-card h3 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--om-primary-dk);
}

.om-detail-card p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--om-text);
}

/* ── Map ──────────────────────────────────── */
.om-map-section {
  margin-bottom: 32px;
}

.om-map-section h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.om-map {
  width: 100%;
  height: 380px;
  border-radius: var(--om-radius);
  border: 1px solid var(--om-border);
  box-shadow: var(--om-shadow);
  overflow: hidden;
}

.om-map-fallback {
  background: var(--om-bg-subtle);
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius);
  padding: 24px;
  text-align: center;
}

.om-map-coords {
  font-size: 12px;
  color: var(--om-text-muted);
  margin-top: 8px;
}

.om-map-dir-link {
  color: var(--om-primary);
  text-decoration: underline;
}

/* ── Contact ──────────────────────────────── */
.om-contact {
  border-top: 1px solid var(--om-border);
  padding-top: 20px;
  margin-bottom: 24px;
}

.om-contact h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.om-contact a {
  color: var(--om-primary);
}

.om-edit-link {
  margin-top: 16px;
}

/* ── Frontend Form ────────────────────────── */
.om-submit-wrap {
  max-width: 760px;
}

.om-form-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--om-primary-dk);
  padding: 18px 0 10px;
  border-bottom: 2px solid var(--om-primary-lt);
  margin-bottom: 20px;
}

.om-form-section-title:first-of-type {
  padding-top: 0;
}

.om-form-row {
  margin-bottom: 16px;
}

.om-form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.om-form-row--3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.om-form-row--geo {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

@media (max-width: 600px) {

  .om-form-row--2col,
  .om-form-row--3col,
  .om-form-row--geo {
    grid-template-columns: 1fr;
  }
}

.om-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.om-form-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--om-text);
}

.om-required label::after {
  content: ' *';
  color: var(--om-danger);
}

.om-form-field input[type="text"],
.om-form-field input[type="email"],
.om-form-field input[type="url"],
.om-form-field input[type="date"],
.om-form-field input[type="datetime-local"],
.om-form-field input[type="number"],
.om-form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--om-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: var(--om-text);
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
}

.om-form-field input:focus,
.om-form-field textarea:focus {
  border-color: var(--om-primary);
  outline: 2px solid var(--om-primary-lt);
}

.om-form-field textarea {
  resize: vertical;
}

.om-form-hint {
  font-size: 13px;
  color: var(--om-text-muted);
  margin-top: 8px;
}

.om-form-map {
  width: 100%;
  height: 320px;
  border-radius: var(--om-radius);
  border: 1px solid var(--om-border);
  margin-top: 8px;
  overflow: hidden;
}

.om-current-photo {
  margin-bottom: 10px;
}

.om-current-photo img {
  border-radius: 6px;
  max-width: 100px;
  height: auto;
}

.om-form-submit {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--om-border);
}

/* ── My List table ────────────────────────── */
.om-my-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.om-my-table th,
.om-my-table td {
  padding: 10px 14px;
  border: 1px solid var(--om-border);
  text-align: left;
}

.om-my-table th {
  background: var(--om-bg-subtle);
  font-weight: 600;
}

.om-actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.om-status {
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
}

.om-status--pending {
  background: #fff3cd;
  color: #856404;
}

.om-status--approved {
  background: #d1e7dd;
  color: #0f5132;
}

.om-status--rejected {
  background: #f8d7da;
  color: #842029;
}

/* ============================================================
   OM Hero Section – 50/50 Layout mit Portrait-Frame + Kerze
   ============================================================ */

.om-hero {
  /* Full-bleed breakout auf volle Viewport-Breite */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;

  /* Hintergrund */
  background: #0D0D0D;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  /* Inhalt zentrieren über inneren Wrapper — kein Padding hier */
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
}

/* Innerer Wrapper: begrenzt den Inhalt auf max 1360px und zentriert ihn */
.om-hero-inner {
  width: 100%;
  max-width: 1360px;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 3rem 2rem;
  box-sizing: border-box;
}

/* ── LEFT 50% ─────────────────────────────────────────────── */
.om-hero-photo {
  flex: 0 0 50%;
  max-width: 50%;
  display: flex;
  align-items: flex-end;
  /* Kerze bündig unten */
  justify-content: center;
}

.om-hero-portrait-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  position: relative;
}

/* Portrait mit Bilderrahmen als Background */
.om-portrait-bg {
  position: relative;
  width: 320px;
  /* Breite anpassen */
  aspect-ratio: 3 / 4;
  background-image: url('https://memoria.webmanufaktura.com/wp-content/uploads/2026/05/bildrahmen-transparent.png');
  background-size: 100% 100%;
  /* Rahmen füllt den Container exakt */
  background-repeat: no-repeat;
  background-position: center;
  padding: 30px 28px 34px 28px;
  /* Innenabstand – Foto liegt innerhalb des Rahmens */
  box-sizing: border-box;
}

.om-portrait-bg .om-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder-Initialen (falls kein Foto) */
.om-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  color: #c9a96e;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Kerze neben dem Rahmen */
.om-hero-candle {
  flex-shrink: 0;
}

.om-candle-img {
  width: 80px;
  /* Größe der Kerze */
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(255, 200, 100, 0.25));
}

/* ── RIGHT 50% ─────────────────────────────────────────────── */
.om-hero-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #e0d5c5;
}

.om-hero-info .om-name {
  font-size: 2.4rem;
  font-weight: 700;
  color: #cd995c;
  /* Goldton wie im Mockup */
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.om-lifespan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cd995c
;
  margin: 0;
}

.om-born,
.om-separator,
.om-died {
  color: #c9a96e;
}

.om-age {
  background: #fff;
  color: #222;
  border-radius: 4px;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.om-birthplace {
  font-size: 0.95rem;
  color: #9a8878;
  margin: 0;
}

.om-hero-quote {
  border-left: 3px solid #cd995c
;
  margin: 0.5rem 0 0;
  padding-left: 1rem;
  font-style: italic;
  font-size: 0.95rem;
  color: #cd995c
;
  line-height: 1.7;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .om-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.25rem;
  }

  .om-hero-photo,
  .om-hero-info {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .om-hero-portrait-wrapper {
    justify-content: center;
  }

  .om-portrait-bg {
    width: 260px;
  }

  .om-lifespan {
    justify-content: center;
  }

  .om-hero-quote {
    text-align: left;
  }
}
