:root {
  --wgp-ivory: #fffdf7;
  --wgp-butter: #f6e7a6;
  --wgp-sky: #bfddf2;
  --wgp-gold: #a67c28;
  --wgp-gold-dark: #765718;
  --wgp-blue: #24364b;
  --wgp-text: #343434;
  --wgp-line: rgba(166, 124, 40, 0.26);
  --wgp-serif: Georgia, "Times New Roman", serif;
  --wgp-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wedding-portal-page {
  margin: 0;
  background: linear-gradient(180deg, rgba(246, 231, 166, 0.58), var(--wgp-ivory) 48%, rgba(191, 221, 242, 0.62));
  color: var(--wgp-text);
  font-family: var(--wgp-sans);
}

.wgp-shell {
  width: min(100% - 32px, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) 0;
}

.wgp-panel,
.wgp-upload,
.wgp-section {
  border: 1px solid var(--wgp-line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.84);
  padding: clamp(22px, 5vw, 48px);
}

.wgp-kicker {
  color: var(--wgp-gold-dark);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wgp-panel h1,
.wgp-dashboard h1,
.wgp-upload h2,
.wgp-section h2 {
  margin: 10px 0 18px;
  color: var(--wgp-gold);
  font-family: var(--wgp-serif);
  font-size: clamp(38px, 8vw, 74px);
  font-weight: 400;
  line-height: 1.08;
}

.wgp-section h2,
.wgp-upload h2 {
  font-size: clamp(30px, 5vw, 48px);
}

.wgp-panel p,
.wgp-dashboard p {
  color: rgba(52, 52, 52, 0.72);
  font-size: 17px;
  line-height: 1.75;
}

.wgp-form,
.wgp-upload-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.wgp-form label,
.wgp-upload-form label {
  display: grid;
  gap: 8px;
  color: var(--wgp-blue);
  font-weight: 700;
}

.wgp-form input:not([type="checkbox"]),
.wgp-upload-form input:not([type="file"]) {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--wgp-line);
  border-radius: 8px;
  background: #fff;
  color: var(--wgp-text);
  font: inherit;
  padding: 12px 14px;
}

.wgp-check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  font-weight: 500;
}

.wgp-check input {
  margin-top: 8px;
}

.wgp-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wgp-gold);
  border-radius: 999px;
  background: var(--wgp-gold);
  color: var(--wgp-ivory);
  cursor: pointer;
  font: 750 14px/1 var(--wgp-sans);
  letter-spacing: 0.08em;
  padding: 15px 22px;
  text-decoration: none;
  text-transform: uppercase;
}

.wgp-button-soft {
  background: transparent;
  color: var(--wgp-gold-dark);
}

.wgp-link {
  border: 0;
  background: transparent;
  color: var(--wgp-gold-dark);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.wgp-dashboard {
  display: grid;
  gap: 28px;
}

.wgp-dashboard-head,
.wgp-section-title {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.wgp-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--wgp-line);
  border-radius: 50%;
  background: var(--wgp-sky);
  color: var(--wgp-gold-dark);
  font-family: var(--wgp-serif);
  object-fit: cover;
}

.wgp-avatar-large {
  width: 82px;
  height: 82px;
  font-size: 34px;
}

.wgp-drop {
  min-height: 142px;
  place-items: center;
  border: 1px dashed var(--wgp-gold);
  border-radius: 8px;
  background: rgba(191, 221, 242, 0.28);
  text-align: center;
}

.wgp-drop input {
  max-width: 90%;
}

.wgp-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.wgp-preview img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.wgp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.wgp-photo {
  overflow: hidden;
  border: 1px solid var(--wgp-line);
  border-radius: 8px;
  background: #fff;
}

.wgp-photo-button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.wgp-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.wgp-photo footer {
  display: flex;
  gap: 12px;
  padding: 14px;
}

.wgp-photo footer p {
  margin: 4px 0 0;
  font-size: 14px;
}

.wgp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background: rgba(36, 54, 75, 0.86);
  padding: 20px;
}

.wgp-lightbox img {
  max-width: min(100%, 1120px);
  max-height: 86vh;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .wgp-dashboard-head,
  .wgp-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .wgp-gallery {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Functional upload controls. Wedding-specific presentation lives in the theme. */
.wedding-portal-page *, .wedding-portal-page *::before, .wedding-portal-page *::after { box-sizing: border-box; }
.wgp-shell [hidden] { display: none !important; }
.wgp-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wgp-picker { position: relative; min-width: 0; min-height: 150px; padding: 24px 16px; border: 1px solid var(--wgp-line); border-radius: 16px; text-align: center; align-content: center; justify-items: center; cursor: pointer; }
.wgp-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.wgp-picker svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.wgp-picker span { font-size: 13px; font-weight: 400; }
.wgp-picker:focus-within { outline: 3px solid var(--wgp-blue); outline-offset: 3px; }
.wgp-selection-head, .wgp-upload-heading, .wgp-portal-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wgp-selection-head { margin-bottom: 12px; }
.wgp-preview-item { position: relative; min-width: 0; min-height: 112px; overflow: hidden; background: #eee; border-radius: 12px; }
.wgp-preview-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.wgp-preview-item > span { display: block; padding: 10px; font-size: 12px; overflow-wrap: anywhere; }
.wgp-preview-item > button { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: #222; cursor: pointer; font-size: 26px; }
.wgp-preview-item[data-state="error"] { border: 2px solid #a93434; }
.wgp-upload-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.wgp-progress { width: 100%; height: 12px; accent-color: var(--wgp-blue); }
.wgp-status:empty { display: none; }
.wgp-status[data-kind="error"] { color: #972e2e; }
.wgp-status[data-kind="success"] { color: #256044; }
.wgp-button:disabled { opacity: .55; cursor: default; }
.wgp-caption input { min-width: 0; font-size: 16px; }
.wgp-lightbox > button { position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); width: 48px; height: 48px; border-radius: 50%; border: 0; font-size: 30px; cursor: pointer; }
.wgp-lightbox { box-sizing: border-box; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 12px; padding: calc(64px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overscroll-behavior: contain; }
.wgp-lightbox [hidden] { display: none !important; }
.wgp-lightbox figure { margin: 0; min-width: 0; min-height: 0; width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; touch-action: pan-y pinch-zoom; }
.wgp-lightbox img { display: block; width: 100%; height: 100%; min-height: 0; max-height: 100%; flex: 1; object-fit: contain; user-select: none; -webkit-user-select: none; }
.wgp-lightbox figcaption { flex: 0 0 auto; max-height: 20%; overflow-y: auto; overflow-wrap: anywhere; color: white; text-align: center; padding: 0 8px; line-height: 1.4; }
.wgp-lightbox figcaption:empty { display: none; }
.wgp-lightbox-controls { display: flex; align-items: center; justify-content: center; gap: 24px; flex-shrink: 0; color: white; }
.wgp-lightbox-controls button { width: 48px; height: 48px; padding: 0; border: 1px solid #ffffff70; border-radius: 50%; background: #ffffff18; color: white; font-size: 26px; cursor: pointer; touch-action: manipulation; }
.wgp-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.wgp-lightbox-controls span { min-width: 100px; text-align: center; font-size: 14px; }
.wgp-lightbox-hint { margin: 0; color: #ffffffb3; font-size: 12px; text-align: center; flex-shrink: 0; }
.wgp-lightbox video { display: block; width: 100%; min-height: 0; max-height: 100%; flex: 1; object-fit: contain; }
.wgp-video-help { color: #fff; font-size: 12px; text-align: center; flex: 0 0 auto; }
.wgp-preview-item video { width: 100%; aspect-ratio: 1; object-fit: contain; background: #172b36; }
.wgp-video-tile { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; aspect-ratio: 1; background: #263f4c; color: #fff; padding: 50px 12px 24px; box-sizing: border-box; }
.wgp-video-tile > span { font-size: 32px; }
@media (max-height: 450px) { .wgp-lightbox { gap: 6px; padding-top: calc(12px + env(safe-area-inset-top)); padding-left: max(70px, env(safe-area-inset-left)); padding-right: max(70px, env(safe-area-inset-right)); } .wgp-lightbox-hint { display: none; } }
.wgp-couple { text-decoration: none; }
.wgp-photo-button { position: relative; }
.wgp-photo-author { position: absolute; top: 8px; left: 8px; max-width: calc(100% - 16px); display: flex; align-items: center; gap: 7px; padding: 5px 9px 5px 5px; border-radius: 22px; background: #172b36e8; color: white; text-align: left; font-size: 12px; line-height: 1.3; box-sizing: border-box; pointer-events: none; }
.wgp-photo-author .wgp-avatar { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #edf5f7; color: #263f4c; font-size: 14px; }
.wgp-author-name { min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.wgp-lightbox-author { position: absolute; top: max(16px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); max-width: calc(100% - 90px); }
.wgp-lightbox-author .wgp-photo-author { position: static; max-width: 100%; }
.wgp-lightbox-author img.wgp-avatar { flex: 0 0 30px; width: 30px; height: 30px; min-height: 30px; }
@media (max-height: 450px) { .wgp-lightbox-author { max-width: 170px; } }
.wgp-couple span { display: block; font-size: 12px; }
@media (max-width: 480px) {
  .wgp-upload-heading { align-items: flex-start; flex-direction: column; }
  .wgp-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wgp-upload-actions > button { width: 100%; }
}
