/* Fonts */
@font-face {
  font-family: "Comfortaa";
  src: url("../fonts/Comfortaa/Comfortaa-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Reset and base */
*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: "Comfortaa", Georgia, "Times New Roman", serif;
  line-height: 1.5;
  color: #333;
  background: #2c70b7;
}

html {
  scrollbar-width: none;
}
html::-webkit-scrollbar {
  display: none;
}

/* Hero: background.png (bottom), logo (middle), background2.png (top) */
.hero {
  position: relative;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 400px;
  min-height: -webkit-fill-available;
  background-color: #2c70b7;
  background-image: url("../img/background.png");
  background-repeat: no-repeat;
  background-position: 50% center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.hero__bg-top {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: url("../img/background2.png");
  background-repeat: no-repeat;
  background-position: 50% center;
  background-size: cover;
  pointer-events: none;
}

@media (min-width: 641px) {
  .hero {
    background-size: 120%;
    background-position: 50% 0%;
  }
  .hero__bg-top {
    background-size: 120%;
    background-position: 50% 0%;
  }
}

.hero__logo {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 280px;
  width: 60%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

.hero__cloud {
  display: none; /* cloud animation removed; hero bg slide + logo dissolve only */
  position: absolute;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  transition: none;
}

.hero__cloud--1 {
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  height: 120vh;
  height: 120dvh;
  width: auto;
  max-width: none;
  object-fit: contain;
}

/* Scroll hint: mobile only, circular button with jumping arrow */
.hero__scroll-hint {
  display: none;
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #2d2d2d;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.hero__scroll-hint-arrow {
  display: block;
  font-size: 1.25rem;
  line-height: 1;
  animation: hero-scroll-hint-jump 2.5s ease-in-out infinite;
}

@keyframes hero-scroll-hint-jump {
  0%, 85% { transform: translateY(0); }
  92% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@media (max-width: 640px) {
  .hero {
    min-height: 300px;
    background-size: 250%;
    background-position: 50% 0%;
  }
  .hero__bg-top {
    background-size: 250%;
    background-position: 50% 0%;
  }
  .hero__cloud--1 {
    height: 100dvh;
    max-height: 400vw;
    min-width: 380vw;
    width: auto;
  }
  .hero__logo {
    max-width: 140px;
    width: 42%;
  }
  .hero__obituary-preview {
    padding: 1rem;
  }
  .hero__obituary-preview-name {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  .hero__obituary-preview-info,
  .hero__obituary-preview-verse {
    font-size: 0.875rem;
  }
  .hero__scroll-hint {
    display: flex;
  }
}

.hero__fade {
  position: absolute;
  inset: 0;
  background: #e8e4df url("../img/lino.png") center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.hero__obituary-preview {
  --hero-preview-gap-slight: 0.5rem;
  --hero-preview-gap-small: 0.5rem;
  --hero-preview-gap-medium: 1.25rem;
  --hero-preview-gap-large: 1.5rem;
  --hero-preview-gap-larger: 2rem;
  --hero-preview-padding-block: 2.5rem;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  padding: var(--hero-preview-padding-block) 1.5rem;
}

.hero__obituary-preview-inner {
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
  scrollbar-width: none;
}
.hero__obituary-preview-inner::-webkit-scrollbar {
  display: none;
}

.hero__obituary-preview-cruz {
  display: block;
  width: auto;
  height: 9rem;
  margin: 0 auto var(--hero-preview-gap-medium);
  object-fit: contain;
}

.hero__obituary-preview-prayer {
  font-size: 0.9375rem;
  color: #5c5c5c;
  margin: 0 0 var(--hero-preview-gap-larger);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  text-align: center;
}

.hero__obituary-preview-prayer[hidden] {
  display: none;
}

.hero__obituary-preview-name {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 var(--hero-preview-gap-small);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-align: center;
}

.hero__obituary-preview-dates {
  font-size: 1rem;
  color: #6b6b6b;
  margin: 0 0 var(--hero-preview-gap-medium);
  text-align: center;
}

.hero__obituary-preview-dates[hidden] {
  display: none;
}

.hero__obituary-preview-photo-box {
  margin: 0 auto var(--hero-preview-gap-larger);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__obituary-preview-photo-placeholder {
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: #f2f0ed;
  border: 2px dashed #c9c4bd;
  border-radius: 50%;
  color: #9a958e;
  margin: 0 auto;
}

.hero__obituary-preview-photo-placeholder[hidden] {
  display: none;
}

.hero__obituary-preview-photo-icon {
  font-size: 1.25rem;
  opacity: 0.7;
}

.hero__obituary-preview-photo-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero__obituary-preview-photo {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto;
}

.hero__obituary-preview-photo[hidden] {
  display: none;
}

.hero__obituary-preview-info {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #2d2d2d;
  text-align: center;
  white-space: pre-wrap;
  margin: 0 auto var(--hero-preview-gap-larger);
  max-width: 350px;
}

.hero__obituary-preview-verse {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #2d2d2d;
  text-align: center;
  white-space: pre-wrap;
  margin: 0 auto;
  max-width: 420px;
}

/* FAQ section */
.faq-section {
  width: 100%;
  min-height: 100vh;
  background: #f4f4f2;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-section__inner {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.faq-section__intro {
  font-size: 1rem;
  line-height: 1.6;
  color: #2d2d2d;
  margin: 0 0 2rem;
}

.faq-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-item {
  margin-bottom: 1rem;
  padding: 1.25rem 1.25rem 1.125rem;
  background: rgba(120, 118, 115, 0.06);
  border: 1px solid rgba(120, 118, 115, 0.14);
  border-radius: 16px;
  box-sizing: border-box;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item__question {
  margin: 0;
}

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.faq-item__question-text {
  flex: 1;
}

.faq-item__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.25rem;
  line-height: 1;
  color: #5a524a;
  transition: transform 0.2s ease;
}

.faq-item.is-open .faq-item__icon {
  transform: rotate(45deg);
}

.faq-item__answer {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #2d2d2d;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(120, 118, 115, 0.1);
  display: none;
}

.faq-item.is-open .faq-item__answer {
  display: block;
}

/* Artículos section (items families can buy) — same height as ceremony/horarios */
.articulos-section {
  width: 100%;
  min-height: 100vh;
  background: #f4f4f2;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.articulos-section__inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.articulos-section__title {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.articulos-section__intro {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin: 0 0 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.articulos-section__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.articulos-section__item {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 calc((100% - 2 * 1.25rem) / 3);
  max-width: calc((100% - 2 * 1.25rem) / 3);
}

@media (max-width: 720px) {
  .articulos-section__item {
    flex: 0 0 calc((100% - 1.25rem) / 2);
    max-width: calc((100% - 1.25rem) / 2);
  }
}

@media (max-width: 480px) {
  .articulos-section__item {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.articulos-section__card {
  display: block;
  height: 100%;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(120, 118, 115, 0.18);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.articulos-section__card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(120, 118, 115, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.articulos-section__card--no-link {
  cursor: default;
  pointer-events: none;
}

.articulos-section__item-image {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  max-height: 140px;
  background: rgba(0, 0, 0, 0.06);
}

.articulos-section__item-img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.articulos-section__item-title {
  display: block;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

/* Obituary section: full viewport, white (same height as hero) */
.obituary-section {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.obituary-section__inner {
  max-width: 560px;
  width: 100%;
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prayer / symbol line */
.obituary-section__prayer {
  font-size: 0.9375rem;
  color: #5c5c5c;
  margin: 0 0 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.obituary-section__prayer[hidden] {
  display: none;
}

/* Full name – main heading */
.obituary-section__name {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Dates under name */
.obituary-section__dates {
  font-size: 1rem;
  color: #6b6b6b;
  margin: 0 0 1.75rem;
  font-weight: 400;
}

.obituary-section__dates[hidden] {
  display: none;
}

/* Photo box: placeholder or image */
.obituary-section__photo-box {
  margin: 0 auto 1.75rem;
  position: relative;
}

.obituary-section__photo-placeholder {
  width: 160px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f2f0ed;
  border: 2px dashed #c9c4bd;
  border-radius: 10px;
  color: #9a958e;
}

.obituary-section__photo-placeholder[hidden] {
  display: none;
}

.obituary-section__photo-placeholder-icon {
  font-size: 2rem;
  line-height: 1;
  opacity: 0.7;
}

.obituary-section__photo-placeholder-text {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.obituary-section__photo {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.obituary-section__photo[hidden] {
  display: none;
}

/* Main paragraph – body text */
.obituary-section__message {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #2d2d2d;
  text-align: left;
  white-space: pre-wrap;
  margin: 0;
}

.obituary-section__message p {
  margin: 0 0 1em;
}

.obituary-section__message p:last-child {
  margin-bottom: 0;
}

/* Ceremony section: same structure as hero nombre block – centered single column */
.ceremony-section {
  --ceremony-gap-slight: 0.5rem;
  --ceremony-gap-small: 0.5rem;
  --ceremony-gap-medium: 1.25rem;
  --ceremony-gap-large: 1.5rem;
  --ceremony-gap-larger: 2rem;
  --ceremony-padding-block: 2.5rem;
  width: 100%;
  min-height: 100vh;
  background: #fafaf7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--ceremony-padding-block) 1.5rem;
  scroll-snap-align: start;
}

.ceremony-section__inner {
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
}

.ceremony-section__heading {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 600;
  color: #3d3935;
  margin: 0 0 var(--ceremony-gap-larger);
  line-height: 1.35;
  text-align: center;
}

.ceremony-section__block {
  margin-bottom: var(--ceremony-gap-larger);
  text-align: center;
  width: 100%;
}

.ceremony-section__block:last-of-type {
  margin-bottom: var(--ceremony-gap-large);
}

.ceremony-section__block-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b6560;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--ceremony-gap-small);
  text-align: center;
}

.ceremony-section__block-subtitle {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #2d2d2d;
  margin: 0 0 var(--ceremony-gap-small);
  text-align: center;
}

.ceremony-section__block-subtitle[hidden] {
  display: none;
}

.ceremony-section__block-line {
  font-size: 1rem;
  color: #444;
  margin: 0 0 var(--ceremony-gap-slight);
  line-height: 1.5;
  text-align: center;
}

.ceremony-section__block-address {
  font-size: 1rem;
  color: #444;
  margin: 0 0 var(--ceremony-gap-small);
  line-height: 1.55;
  white-space: pre-wrap;
  text-align: center;
}

.ceremony-section__map-link {
  font-size: 0.9375rem;
  color: #2c70b7;
  text-decoration: none;
  display: inline-block;
  margin-top: var(--ceremony-gap-slight);
}

.ceremony-section__map-link:hover {
  text-decoration: underline;
}

.ceremony-section__map-link[hidden] {
  display: none;
}

.ceremony-section__closing {
  font-size: 1rem;
  color: #5a554e;
  font-style: italic;
  margin: var(--ceremony-gap-larger) 0 0;
  text-align: center;
  line-height: 1.5;
}

.ceremony-section__closing[hidden] {
  display: none;
}

/* Person block (shown when preview link loads data) */
.ceremony-section__person {
  text-align: center;
  margin-bottom: var(--ceremony-gap-larger, 2rem);
}
.ceremony-section__person[hidden] { display: none; }
.ceremony-section__person-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  display: block;
  border: 3px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.ceremony-section__person-photo[hidden] { display: none; }
.ceremony-section__person-name {
  font-size: clamp(1.125rem, 3vw, 1.375rem);
  font-weight: 700;
  color: #3d3935;
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
}
.ceremony-section__person-dates {
  font-size: 1rem;
  color: #6b6560;
  margin: 0;
}
.ceremony-section__person-dates[hidden] { display: none; }

/* Preview error state */
.ceremony-section__error {
  text-align: center;
  padding: 2rem 1rem;
  color: #6b6560;
  font-size: 1rem;
  line-height: 1.5;
}

/* Announcement page error */
.announcement-error {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2rem;
  background: #fff8f8;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  color: #b33;
}

.announcement-error[hidden] {
  display: none;
}

#announcement-content[hidden] {
  display: none;
}

/* Section spacing */
section {
  padding: 1rem;
}

@media (min-width: 640px) {
  .faq-section {
    padding: 4rem 2rem;
  }
  .faq-section__intro {
    font-size: 1.0625rem;
  }
  .faq-item__question {
    font-size: 1.0625rem;
  }
  .faq-item__answer {
    font-size: 1rem;
  }
}
