/* Edytor dyplomów – sam układ. Kolory, fonty, promienie i przyciski (.button) pochodzą ze strony:
   na teacherania.pl z motywu „redesign”, lokalnie z index.html, który podstawia te same zmienne.
   Wszystko jest pod .ta-dyplomy, żeby nie ruszać reszty strony. */

.ta-dyplomy {
  --ta-line: color-mix(in srgb, var(--color-ink) 16%, transparent);
  --ta-focus: color-mix(in srgb, var(--color-coral) 40%, transparent);
  /* Miejsce nad kartką zajęte przez przyklejony nagłówek strony i odstępy. */
  --ta-offset: 120px;
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  grid-template-areas: "panel side";
  gap: 32px;
  align-items: start;
  color: var(--color-ink);
  text-align: left;
}
/* Strona /generator/ we wtyczce WordPressa. */
.ta-dyplomy-main { padding: 48px 0 96px; }

/* Motyw ma duże nagłówki stron (h2 do 4rem) – w panelu to tylko podpisy sekcji. */
.ta-dyplomy h2 {
  margin: 0 0 12px;
  font-size: .78rem; line-height: 1.3; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--color-ink-soft);
}
.ta-dyplomy p { margin: 0; }

.ta-dyplomy__panel {
  grid-area: panel;
  background: var(--color-paper);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ta-dyplomy__panel > section { padding: 18px 22px; border-top: 1px solid var(--ta-line); }
.ta-dyplomy__panel > section:first-of-type { border-top: 0; }

.ta-dyplomy__side {
  grid-area: side;
  position: sticky;
  top: var(--ta-offset);
  display: grid;
  gap: 16px;
  justify-items: center;
}
.ta-dyplomy__preview { width: 100%; display: grid; place-items: center; }
.ta-dyplomy__paper {
  width: min(100%, calc((100vh - var(--ta-offset) - 110px) * var(--ratio, 0.707)));
  background: var(--color-white);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ta-dyplomy__paper svg { width: 100%; height: 100%; display: block; }
.ta-dyplomy__actions { width: min(100%, 420px); text-align: center; }
.ta-dyplomy__actions .button { width: 100%; }
.ta-dyplomy__actions .button:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }
.ta-dyplomy__status { min-height: 1.5em; margin-top: 8px; font-size: .85rem; color: var(--color-ink-soft); }

/* Pola */
.ta-dyplomy__field { display: block; margin-bottom: 12px; }
.ta-dyplomy__field > span { display: block; margin-bottom: 4px; font-weight: 700; font-size: .9rem; }
.ta-dyplomy__field > em { display: block; margin-top: 4px; font-style: normal; font-size: .8rem; color: var(--color-ink-soft); }
.ta-dyplomy input,
.ta-dyplomy textarea {
  width: 100%;
  padding: 9px 14px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-ink);
  outline: none;
  transition: box-shadow 150ms ease;
}
.ta-dyplomy textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.ta-dyplomy input:focus,
.ta-dyplomy textarea:focus { box-shadow: 0 0 0 4px var(--ta-focus); }
.ta-dyplomy details summary { cursor: pointer; margin: 4px 0 12px; font-weight: 700; font-size: .9rem; color: var(--color-ink-soft); }
.ta-dyplomy__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ta-dyplomy__note { font-size: .82rem; color: var(--color-ink-soft); }
.ta-dyplomy__count { display: block; margin-top: 4px; font-size: .8rem; color: var(--color-ink-soft); }
.ta-dyplomy__count[hidden] { display: none; }
.ta-dyplomy__privacy { display: flex; align-items: flex-start; gap: 7px; margin-top: 7px; font-size: .8rem; line-height: 1.45; color: var(--color-ink-soft); }
.ta-dyplomy__privacy svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.ta-dyplomy__warn {
  margin: 14px 22px 0;
  padding: 10px 14px;
  border: 1.5px solid var(--color-coral);
  border-radius: var(--radius-sm);
  background: var(--color-pink-light);
  font-size: .85rem;
}
.ta-dyplomy section .ta-dyplomy__warn { margin: 4px 0 0; }

/* Przyciski wyboru: wybrany szablon, palety, orientacja, imiona */
.ta-dyplomy button:focus-visible { outline: 3px solid var(--color-coral); outline-offset: 3px; }
.ta-dyplomy .picked,
.ta-dyplomy .pal,
.ta-dyplomy__chip {
  border: 1.5px solid var(--ta-line);
  background: var(--color-white);
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.ta-dyplomy .picked:hover,
.ta-dyplomy .pal:hover,
.ta-dyplomy__chip:hover { border-color: var(--color-ink); }
.ta-dyplomy .pal[aria-pressed="true"],
.ta-dyplomy__chip[aria-pressed="true"] { border-color: var(--color-ink); box-shadow: 2px 3px 0 var(--color-ink); }

.ta-dyplomy .picked {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 16px 8px 8px; border-radius: var(--radius-sm); text-align: left;
}
.ta-dyplomy .picked .thumb { width: 52px; flex: none; aspect-ratio: 210 / 297; border-radius: 4px; overflow: hidden; display: grid; align-items: center; }
.ta-dyplomy .picked b { display: block; font-size: .95rem; line-height: 1.3; }
.ta-dyplomy .picked .change { margin-left: auto; font-weight: 700; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }

.ta-dyplomy__pills { display: flex; flex-wrap: wrap; gap: 10px; }
.ta-dyplomy .pal {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 68px; min-height: 44px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem;
}
.ta-dyplomy .pal i { display: flex; }
.ta-dyplomy .pal b { width: 18px; height: 18px; margin-right: -5px; border: 2px solid var(--color-white); border-radius: 50%; }
.ta-dyplomy .pal .page { width: 14px; height: 20px; margin: 0 2px; border: 2px solid currentColor; border-radius: 3px; }
.ta-dyplomy .pal .page.landscape { width: 20px; height: 14px; margin: 3px 0; }

.ta-dyplomy__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ta-dyplomy__chip { padding: 3px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.ta-dyplomy__chip[aria-pressed="true"] { background: var(--color-mint-light); }

/* Wybór szablonu */
.ta-dyplomy__picker {
  width: min(1180px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100vh - 48px);
  padding: 0;
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--color-cream);
  color: var(--color-ink);
  overflow: auto;
}
.ta-dyplomy__picker::backdrop { background: color-mix(in srgb, var(--color-ink) 45%, transparent); }
html:has(.ta-dyplomy__picker[open]) { overflow: hidden; }
.ta-dyplomy__picker-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--ta-line);
  background: var(--color-paper);
}
.ta-dyplomy__picker-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: 0; text-transform: none; color: var(--color-ink); }
.ta-dyplomy__picker-head p { margin-top: 4px; color: var(--color-ink-soft); }
.ta-dyplomy__picker-head .button { flex: none; }
.ta-dyplomy__choices { padding: 28px 32px 48px; }
.ta-dyplomy__choices h3 { margin: 0 0 18px; font-size: 1.25rem; }
.ta-dyplomy__choices h3:not(:first-child) { margin-top: 40px; }
.ta-dyplomy__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 20px; }
.ta-dyplomy .tpl {
  padding: 10px; border: 1.5px solid var(--ta-line); border-radius: var(--radius-sm);
  background: var(--color-white); color: inherit; text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.ta-dyplomy .tpl:hover { border-color: var(--color-ink); transform: translateY(-2px); box-shadow: 3px 4px 0 var(--color-ink); }
.ta-dyplomy .tpl[aria-pressed="true"] { border-color: var(--color-ink); background: var(--color-mint-light); }
.ta-dyplomy .tpl .thumb { aspect-ratio: 210 / 297; border-radius: 6px; overflow: hidden; display: grid; align-items: center; }
.ta-dyplomy .tpl img,
.ta-dyplomy .picked img { width: 100%; height: auto; display: block; }
.ta-dyplomy .tpl small { display: block; margin-top: 10px; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.ta-dyplomy .tpl .when { display: block; margin-top: 2px; font-size: .8rem; line-height: 1.3; color: var(--color-ink-soft); }

/* Telefon i wąskie okna: kartka na górze, pod nią pola, przycisk przyklejony na dole. */
@media (max-width: 900px) {
  .ta-dyplomy {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "preview" "panel" "actions";
    gap: 20px;
  }
  .ta-dyplomy__side { display: contents; }
  .ta-dyplomy__preview { grid-area: preview; }
  .ta-dyplomy__paper { width: min(100%, calc(60vh * var(--ratio, 0.707))); }
  .ta-dyplomy__actions {
    grid-area: actions;
    position: sticky; bottom: 0; z-index: 2;
    width: 100%; padding: 12px 0 14px;
    background: var(--color-cream);
  }
}
@media (max-width: 600px) {
  .ta-dyplomy__panel > section { padding: 16px; }
  .ta-dyplomy__picker { width: 100%; max-height: 100%; height: 100%; border: 0; border-radius: 0; }
  .ta-dyplomy__picker-head { padding: 16px; align-items: flex-start; }
  .ta-dyplomy__picker-head h2 { font-size: 1.25rem; }
  .ta-dyplomy__picker-head p { font-size: .85rem; }
  .ta-dyplomy__choices { padding: 20px 16px 40px; }
  .ta-dyplomy__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .ta-dyplomy .tpl { padding: 8px; }
}
