/* ── GYÁSZJELENTÉS KÉSZÍTŐ ──
   A /gyaszjelentes-keszito/ oldal stílusai.
   A gyászjelentés (gy-sheet) fix 720px széles, FEKVŐ A5 arányú lap
   (210:148 mm) - a PDF ebből készül html2canvas + jsPDF segítségével.
   A hagyományos magyar gyászjelentés elrendezését követi: keretes lap,
   felül középen a felekezeti jelkép, alatta a vers, majd középre zárt szöveg. */

.gy-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 1000px) {
  .gy-layout {
    grid-template-columns: 1fr;
  }
}

.gy-block {
  margin-bottom: 28px;
}
.gy-block .hint {
  margin: 6px 0 10px;
}
.gy-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* A többsoros mezők a .fg input stílusát követik, de nagyobbak, és
   gépelés közben automatikusan nőnek (JS), hogy a teljes szöveg látsszon */
.fg textarea {
  width: 100%;
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  padding: .78rem .95rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 96px;
  resize: vertical;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.fg textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(185, 151, 91, .16);
}

.gy-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .gy-row-2 {
    grid-template-columns: 1fr;
  }
}

/* ── STÍLUS ÉS BETŰTÍPUS VÁLASZTÓK ── */
.gy-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .gy-style-grid {
    grid-template-columns: 1fr;
  }
}
.gy-style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1.5px solid #D6D0C4;
  border-radius: var(--radius);
  background: var(--white);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gy-style-btn:hover {
  border-color: var(--gold);
}
.gy-style-btn.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(185, 151, 91, .25);
}
.gy-style-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
/* ── SZIMBÓLUMVÁLASZTÓ ── */
.gy-sym-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .gy-sym-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.gy-sym-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1.5px solid #D6D0C4;
  border-radius: var(--radius);
  background: var(--white);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gy-sym-btn svg {
  width: 26px;
  height: 26px;
  color: var(--navy);
}
.gy-sym-btn:hover {
  border-color: var(--gold);
}
.gy-sym-btn.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(185, 151, 91, .25);
}
.gy-sym-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.gy-sym-btn .gy-sym-none {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 18px;
}

.gy-style-thumb {
  width: 100%;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-size: 20px;
}
.gy-thumb-klasszikus {
  background: #fff;
  color: #111;
  border: 1px solid #111;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #111;
}
.gy-thumb-elegans {
  background: var(--navy);
  color: var(--gold);
}
.gy-thumb-termeszetes {
  background: #F6F1E7;
  color: var(--sage);
  border: 1px solid var(--sage);
}

.gy-font-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}
@media (max-width: 520px) {
  .gy-font-grid {
    grid-template-columns: 1fr;
  }
}
.gy-font-btn {
  padding: 10px 12px;
  border: 1.5px solid #D6D0C4;
  border-radius: var(--radius);
  background: var(--white);
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.gy-font-btn:hover {
  border-color: var(--gold);
}
.gy-font-btn.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(185, 151, 91, .25);
}
.gy-font-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gy-actions {
  margin-top: 8px;
}
.gy-actions .hint {
  margin-top: 8px;
  text-align: center;
}
#gyPdfBtn:disabled {
  opacity: .6;
  cursor: wait;
}

/* ── ELŐNÉZET ── */
.gy-preview-col {
  min-width: 0;
  /* A sticky elem csak a SZÜLŐJE magasságán belül tud "utazni". A grid
     align-items: start miatt ez az oszlop csak a saját tartalma magas volt,
     ezért a hosszabb űrlap mellett görgetve az előnézet elfogyott, és nagy
     üres folt maradt mellette (leginkább tableten volt feltűnő). */
  align-self: stretch;
}
.gy-preview-sticky {
  position: sticky;
  top: 20px;
}

@media (max-width: 1000px) {
  /* Egyoszlopos elrendezésben nincs mihez tapadnia - maradjon a folyamban. */
  .gy-preview-sticky {
    position: static;
  }
}
.gy-preview-label {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  text-align: center;
}
.gy-preview-frame {
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

/* A lap: fix 720x507 px = fekvő A5 (210:148 mm).
   Kis képernyőn arányosan kicsinyítjük transformmal - a PDF-hez mindig a
   teljes méretet fotózzuk. */
.gy-sheet {
  width: 720px;
  height: 507px;
  flex: 0 0 auto;
  box-shadow: var(--shadow);
  transform-origin: top center;
  padding: 16px;
  box-sizing: border-box;
}

/* A klasszikus gyászjelentés jellegzetes vastag kerete */
.gy-frame {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 26px 34px 22px;
  display: flex;
  flex-direction: column;
}

/* ── FELSŐ SÁV: szimbólum középen, alatta a vers ── */
.gy-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  margin-bottom: 6px;
}
.gy-symbol svg {
  height: 100%;
  width: auto;
}
/* Egyszerre csak a kiválasztott jelkép látszik.
   FONTOS: a szelektor legyen erősebb a fenti `.gy-symbol svg`-nél, különben
   az felülírná a display értékét és egyszerre mind a hat jelkép látszana. */
.gy-symbol .gy-sym {
  display: none;
}
.gy-symbol .gy-sym.on {
  display: block;
}
/* "Nincs szimbólum" esetén a sáv se foglaljon helyet */
.gy-symbol.is-empty {
  height: 0;
  margin-bottom: 0;
}

.gy-verse {
  font-style: italic;
  font-size: 13px;
  line-height: 1.95;
  white-space: pre-wrap;
  text-align: center;
  min-height: 44px;
}
.gy-verse:empty {
  display: none;
  min-height: 0;
}

/* ── TÖRZS: középre zárt ── */
.gy-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 9px;
}
.gy-lead {
  font-size: 14px;
  line-height: 1.5;
  max-width: 560px;
}
.gy-lead:empty {
  display: none;
}
.gy-name {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 500;
  margin: 2px 0;
  overflow-wrap: break-word;
  max-width: 100%;
}
.gy-life {
  font-size: 15px;
  line-height: 1.5;
}
.gy-life:empty {
  display: none;
}
.gy-ceremony {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-width: 600px;
  margin-top: 6px;
}
.gy-ceremony:empty {
  display: none;
}
.gy-request {
  font-size: 14px;
  line-height: 1.6;
  max-width: 600px;
}
.gy-request:empty {
  display: none;
}
.gy-closing {
  font-size: 15px;
  margin-top: 10px;
}
.gy-closing:empty {
  display: none;
}

/* ── 1. STÍLUS: KLASSZIKUS (a hagyományos fekete keretes) ── */
.style-klasszikus {
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: "EB Garamond", serif;
}
.style-klasszikus .gy-frame {
  border: 3px solid #111111;
}
.style-klasszikus .gy-name { color: #000000; }
.style-klasszikus .gy-symbol { color: #222222; }

/* ── 2. STÍLUS: ELEGÁNS ÉJKÉK ── */
.style-elegans {
  background: var(--navy);
  color: #EDE6D6;
  font-family: "Lora", serif;
}
.style-elegans .gy-frame {
  border: 1.5px solid var(--gold);
}
.style-elegans .gy-name { color: #FFFFFF; }
.style-elegans .gy-symbol { color: var(--gold); }

/* ── 3. STÍLUS: TERMÉSZETES KRÉM ── */
.style-termeszetes {
  background: #F6F1E7;
  color: #3D4438;
  font-family: "EB Garamond", serif;
}
.style-termeszetes .gy-frame {
  border: 1.5px solid var(--sage);
}
.style-termeszetes .gy-name { color: #2F3A2F; }
.style-termeszetes .gy-symbol { color: #5F7360; }

/* A kiválasztott betűtípust a JS ezekre az elemekre teszi */
.gy-sheet .gy-name,
.gy-sheet .gy-verse,
.gy-sheet .gy-closing {
  font-family: var(--gy-font, inherit);
}
