/* ──────────────────────────────────────────────────────
   IndiaFOSS 2026 — Speaker Poster Generator
   Card poster styles (pixel-perfect for 1080 × 1080 output)
   UI chrome uses Tailwind; these are poster-only + overrides.
   ────────────────────────────────────────────────────── */

/* ── Card poster (the 1080×1080 downloadable image) ── */

.card-poster {
  width: 1080px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'Inter', sans-serif;
}

/* ── Foreground container ── */

.card-fg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  padding: 43px 114px 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.card-fg > * {
  pointer-events: auto;
}

/* ── Header ── */

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-header-logo {
  display: flex;
}

.card-header-logo svg {
  height: 78px;
  width: auto;
}

.card-header-dates {
  text-align: right;
  margin-top: 12px;
}

.card-header-dates h4 {
  margin: 0 0 4px;
  font-size: 18.23px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.card-header-dates sup {
  font-size: 0.6em;
  font-weight: 700;
}

/* ── Pills & Title ── */

.card-title-wrap {
  position: relative;
  z-index: 2;
  margin-top: auto;
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 25px;
}

.card-pills {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: var(--pill-bg, transparent);
  padding: 6px;
  gap: 0;
  border-radius: 16px;
}

.card-pill {
  display: inline-block;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  /* line-height = font-size + top-pad + bottom-pad (10+10) = 44px
     html-to-image centres text correctly when line-height == box height */
  line-height: 44px;
  white-space: nowrap;
}

/* Segmented pill: 14px on the outer corners, 8px where the two meet */
.card-pill-devroom {
  background: transparent;
  padding: 0 20px;
  border-radius: 14px 8px 8px 14px;
}

.card-pill-type {
  background-color: #ffffff;
  padding: 0 20px;
  border-radius: 8px 14px 14px 8px;
}

/* ── Title ── */

.card-title {
  position: relative;
  z-index: 2; /* keep the title above the photo card if a long title reaches it */
  margin: 0;
  font-size: 50px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: #1a1a1a;
  max-width: 888px;
  word-break: break-word;
}

/* ── Speaker card (photo + info) ── */

.speaker-card {
  position: relative;
  margin-bottom: 215px;
  align-self: center;
  display: inline-flex;
  justify-content: center;
  align-items: flex-end;
  gap: 42px;
  z-index: 2;
  pointer-events: auto;
}

.speaker-photo-wrap {
  position: relative;
  width: 358px;
  height: 358px;
  transform: rotate(-3.75deg);
  flex-shrink: 0;
}

.inside {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 358px;
  height: 278px;
  transform-origin: bottom center;
  border-radius: 32px;
  z-index: 1;
}

.speaker-photo {
  position: relative;
  width: 358px;
  height: 358px;
  transform-origin: bottom center;
  border-radius: 24px;
  background-color: lightgray;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 2;
}

.front-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 358px;
  height: 104px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.70) 100%);
  z-index: 3;
  pointer-events: none;
}

.speaker-photo-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  opacity: 0.35;
  pointer-events: none;
}

.speaker-info {
  display: flex;
  height: fit-content;
  transform: rotate(3.75deg);
  padding: 35px 25px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  border-radius: 28.743px;
  box-sizing: border-box;
  flex-shrink: 0;
  min-width: 280px;
  max-width: 480px;
}

.speaker-name {
  font-size: 43px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  word-break: break-word;
}

.speaker-designation {
  font-size: 32px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.01em;
  line-height: 1.2;
  word-break: break-word;
}

/* ── Footer (full-bleed bottom bar) ── */

.card-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  box-sizing: border-box;
  padding: 17px 115px;
  z-index: 2;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer-url {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #1a1a1a;
}

.card-footer-logo {
  display: flex;
  align-items: center;
}

.card-footer-logo svg {
  height: 40px;
  width: auto;
}

/* ── Debug reference overlay (?debug) ── */

.card-debug-overlay {
  position: absolute;
  inset: 4px 0 0 3px;
  width: 1080px;
  height: 1080px;
  object-fit: fill;
  pointer-events: none;
  z-index: 99;
}

/* ── Preview wrapper (scaled view) ── */

.preview-wrapper {
  transform: scale(var(--preview-scale, 0.4));
  transform-origin: top left;
  width: calc(1080px * var(--preview-scale, 0.4));
  height: calc(1080px * var(--preview-scale, 0.4));
  flex-shrink: 0;
}

.preview-wrapper .card-poster {
  outline: 3px dashed #999999;
}

/* ── Form overrides ── */

.form-input {
  width: 100%;
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #666666;
  border-radius: 8px;
  border: 1px solid #dddddd;
  background-color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  background-color: #ffffff;
  border-color: #666666;
  color: #4b4b4b;
}

.form-input:hover {
  background-color: #ffffff;
  border-color: #666666;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.08);
  color: #4b4b4b;
}

/* ── Bulk speaker grid item ── */

.speaker-grid-item {
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.speaker-grid-item:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ── Download overlay ── */

.download-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .preview-wrapper {
    --preview-scale: 0.35;
  }
}

@media (max-width: 768px) {
  .preview-wrapper {
    --preview-scale: 0.3;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .preview-wrapper {
    --preview-scale: calc((100vw - 32px) / 1080);
  }
}

/* On mobile, the form stretches full width */
@media (max-width: 1023px) {
  .form-panel-single {
    width: 100% !important;
    max-width: none !important;
  }
}
