:root {
  --nby-orange: #fb6000;
  --nby-orange-soft: rgba(251, 96, 0, 0.12);
  --nby-teal: #008f86;
  --nby-teal-soft: rgba(0, 143, 134, 0.12);
  --nby-ink: #062b3f;
  --nby-muted: #5d6770;
  --nby-border: rgba(6, 43, 63, 0.12);
  --nby-card: #ffffff;
  --nby-soft-bg: #f7f8f9;
}

.nby-anniversary-section {
  padding: 56px 0;
  background:
    radial-gradient(circle at top left, rgba(251, 96, 0, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7f8f9 100%);
}

.nby-section-head {
  max-width: 780px;
  margin-bottom: 28px;
}

.nby-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--nby-orange);
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(6, 43, 63, 0.08);
}

.nby-section-head h2 {
  margin: 18px 0 10px;
  color: var(--nby-ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.nby-section-head p {
  margin: 0;
  color: var(--nby-muted);
  font-size: 18px;
  line-height: 1.55;
}

.nby-anniversary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.nby-person-card {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border: 1px solid var(--nby-border);
  border-radius: 26px;
  background: var(--nby-card);
  box-shadow: 0 18px 44px rgba(6, 43, 63, 0.08);
}

.nby-person-card::before {
  content: "";
  display: block;
  height: 108px;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(135deg, rgba(251, 96, 0, 0.18), rgba(0, 143, 134, 0.12));
}

.nby-person-card-inner {
  position: relative;
  margin-top: -84px;
  padding: 22px;
}

.nby-person-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.nby-person-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 78px);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--nby-orange);
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(6, 43, 63, 0.08);
  white-space: nowrap;
}

.nby-person-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--nby-orange);
    font-size: 23px;
    box-shadow: 0 12px 30px rgba(6, 43, 63, 0.1);
    border: 1px solid rgba(251, 96, 0, 0.16);
}

.nby-person-card h3 {
  margin: 0 0 8px;
  color: var(--nby-ink);
  font-size: 28px;
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.nby-person-subtitle {
  margin: 0 0 16px;
  color: var(--nby-muted);
  font-size: 16px;
  line-height: 1.48;
}

.nby-person-dates {
  display: grid;
  gap: 8px;
  margin: 16px 0 20px;
}

.nby-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--nby-ink);
  font-size: 15px;
  font-weight: 700;
}

.nby-date-row i {
  color: var(--nby-orange);
}

.nby-date-row span {
  color: var(--nby-muted);
  font-weight: 600;
}

.nby-person-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.nby-memory-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 18px;
  padding: 14px 15px;
  background: var(--nby-orange-soft);
  color: var(--nby-orange);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nby-memory-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(251, 96, 0, 0.16);
  background: rgba(251, 96, 0, 0.16);
}

.nby-memory-btn[data-anniversary-action="death"] {
  background: var(--nby-teal-soft);
  color: var(--nby-teal);
}

.nby-memory-btn[data-anniversary-action="death"]:hover {
  box-shadow: 0 12px 28px rgba(0, 143, 134, 0.16);
  background: rgba(0, 143, 134, 0.16);
}

.nby-memory-count {
  min-width: 36px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--nby-ink);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.nby-person-note {
  margin-top: 14px;
  color: var(--nby-muted);
  font-size: 13px;
  line-height: 1.4;
}

.nby-memory-btn.is-done {
  opacity: 0.72;
  cursor: default;
}

.nby-memory-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}


.nby-person-text {
  --nby-lines: 7;
  position: relative;
  overflow: hidden;
  line-height: 1.55;
  margin-bottom: 0.45rem;
}

.nby-person-text.is-collapsed {
  max-height: calc(var(--nby-lines) * 1.55em);
}

.nby-person-text.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.3em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
  pointer-events: none;
}

.nby-person-text.is-expanded {
  max-height: none;
}

.nby-person-text.is-expanded::after {
  display: none;
}

.nby-readmore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: #fb6000;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0;
  margin: 0.15rem 0 0.75rem;
  cursor: pointer;
}

.nby-readmore-btn:hover {
  text-decoration: underline;
}


/* Hlásenie pri nedostupnom Supabase */
.nby-database-message {
  position: fixed;
  left: 50%;
  bottom: 25px;
  z-index: 99999;

  display: flex;
  align-items: center;
  gap: 10px;

  width: max-content;
  max-width: calc(100% - 30px);
  padding: 13px 18px;

  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;

  background: #b42318;
  border-radius: 12px;

  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.22);

  opacity: 0;
  transform: translate(-50%, 20px);

  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.nby-database-message.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.nby-database-message i {
  flex-shrink: 0;
  font-size: 18px;
}

/* Koniec hlásenia pri nedostupnom Supabase */

@media (max-width: 576px) {
  .nby-database-message {
    width: calc(100% - 30px);
    bottom: 15px;
  }
}



@media (max-width: 1100px) {
  .nby-anniversary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .nby-anniversary-section {
    padding: 38px 0;
  }

  .nby-anniversary-grid {
    grid-template-columns: 1fr;
  }

  .nby-person-card {
    border-radius: 22px;
  }

  .nby-person-card h3 {
    font-size: 25px;
  }
}

