/* =========================
   RESET / BASE
========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #243746;
  background: linear-gradient(180deg, #dff2ff 0%, #f7fcff 40%, #ffffff 100%);
}

/* =========================
   LAYOUT
========================= */

.wrap {
  max-width: 900px;
  margin: auto;
  padding: 20px 12px 40px;
}

/* =========================
   HERO / TITLE
========================= */

.hero {
  text-align: center;
  padding: 24px 10px 16px;
}

.names {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.1;
  font-weight: 600;
  color: #243746;
}

.amp {
  display: block;
  font-size: 0.9em;
  margin: 6px 0;
  color: #c8a64c;
}

.date {
  margin-top: 12px;
  font-size: clamp(1.05rem, 4vw, 1.4rem);
  color: #3f5c6b;
  font-family: Georgia, "Times New Roman", serif;
}

.subtitle {
  margin: 14px auto 0;
  max-width: 600px;
  font-size: 1rem;
  color: #5e6d78;
  line-height: 1.5;
}

/* =========================
   NAV CARDS
========================= */

.nav-card {
  display: block;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e1e8ef;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 16px rgba(40, 70, 100, 0.06);
}

.nav-title {
  font-weight: 700;
  color: #1d4e89;
  margin-bottom: 6px;
}

.nav-copy {
  font-size: 0.95rem;
  color: #5f6f7a;
}

/* =========================
   PANELS
========================= */

.panel {
  background: #ffffff;
  border: 1px solid #e1e8ef;
  border-radius: 18px;
  padding: 18px;
  margin-top: 18px;
  box-shadow: 0 10px 24px rgba(40, 70, 100, 0.08);
}

.panel-heading {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  color: #243746;
}

.panel-copy {
  margin: 0 0 14px;
  color: #5e6d78;
  line-height: 1.5;
  font-size: 0.96rem;
}

/* =========================
   FORM
========================= */

.fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #dbe3ea;
  font-size: 1rem;
  color: #243746;
  background: #ffffff;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* =========================
   BUTTON
========================= */

.button {
  display: inline-block;
  background: linear-gradient(180deg, #2ca6e0, #1d7fc3);
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================
   UPLOAD AREA
========================= */

input[type="file"] {
  display: none;
}

.dropzone {
  border: 2px dashed #e3c770;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  color: #42515d;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  background: #f9fcff;
  border-color: #c8a64c;
  transform: translateY(-1px);
}

.dropzone-title {
  font-weight: 700;
  color: #1d4e89;
  margin-bottom: 6px;
  font-size: 1rem;
}

.dropzone-copy {
  font-size: 0.95rem;
  color: #5f6f7a;
  line-height: 1.5;
}

.upload-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

#selection {
  color: #5e6d78;
  font-size: 0.95rem;
}

/* =========================
   PREVIEWS
========================= */

.previews {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e1e8ef;
  background: #fff;
}

.preview img,
.preview video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #eef6fb;
}

.preview-meta {
  padding: 8px 10px;
  font-size: 0.82rem;
  color: #5e6d78;
  line-height: 1.4;
}

/* =========================
   GALLERY
========================= */

.gallery-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gallery-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.gallery-select {
  padding: 10px 12px;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  background: #fff;
  font-size: 0.95rem;
  color: #243746;
}

.gallery-summary {
  font-size: 0.95rem;
  color: #5e6d78;
}

.featured-section {
  margin-bottom: 22px;
}

.section-heading {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  color: #243746;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.featured-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e1e8ef;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(40, 70, 100, 0.08);
  position: relative;
}

.featured-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(200, 166, 76, 0.95);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}

.featured-card img,
.featured-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eef6fb;
  cursor: pointer;
}

.featured-meta {
  padding: 12px;
  font-size: 0.92rem;
  color: #5e6d78;
}

.media-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e1e8ef;
  overflow: hidden;
  position: relative;
}

.media-card img,
.media-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #eef6fb;
  cursor: pointer;
}

.media-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(36, 55, 70, 0.85);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
}

.media-meta {
  padding: 10px;
  font-size: 0.9rem;
  color: #5e6d78;
  line-height: 1.4;
}

.media-meta strong {
  color: #1d4e89;
  display: block;
  margin-bottom: 4px;
}

.gallery-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e1e8ef;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.meta {
  padding: 10px;
  font-size: 0.9rem;
  color: #5e6d78;
}

.load-more-wrap {
  text-align: center;
  margin-top: 18px;
}

.empty-state,
.hidden {
  display: none;
}

.empty-state.show {
  display: block;
  text-align: center;
  color: #6b7a86;
  padding: 24px 12px;
}

/* =========================
   LIGHTBOX
========================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.lightbox img.lightbox-media,
.lightbox video.lightbox-media {
  width: auto;
  height: auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #243746;
  width: 46px;
  height: 46px;
  font-size: 22px;
  font-weight: 700;
}

.lightbox-close {
  top: -56px;
  right: 0;
}

.lightbox-prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -64px;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* =========================
   MESSAGES
========================= */

.message-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e1e8ef;
  padding: 14px;
  margin-top: 12px;
}

.message-name {
  font-weight: 700;
  color: #1d4e89;
}

.message-date {
  font-size: 0.85rem;
  color: #7a8a95;
}

.message-text {
  margin-top: 6px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* =========================
   STATUS
========================= */

.status {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  display: none;
}

.status.success {
  display: block;
  background: #e9f9f0;
  color: #1f7a4c;
}

.status.error {
  display: block;
  background: #fff2f2;
  color: #9b2f2f;
}

/* =========================
   FOOTER
========================= */

.footer {
  text-align: center;
  margin-top: 24px;
  color: #6b7a86;
}

/* =========================
   UPLOAD MODAL
========================= */

body.modal-open {
  overflow: hidden;
}

.upload-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  background: rgba(27, 40, 52, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.upload-modal.open {
  display: flex;
}

.upload-dialog {
  width: min(460px, 100%);
  background:
    radial-gradient(circle at top left, rgba(223, 242, 255, 0.9), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e3ebf2;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(22, 34, 45, 0.18);
  padding: 26px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.upload-dialog::before {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 180px;
  height: 180px;
  border: 2px solid rgba(200, 166, 76, 0.18);
  border-radius: 50%;
  pointer-events: none;
}

.upload-dialog::after {
  content: "";
  position: absolute;
  inset: -90px auto auto -90px;
  width: 180px;
  height: 180px;
  border: 2px solid rgba(200, 166, 76, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.upload-flourish {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f7e7b0, #e8c96e);
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 10px 24px rgba(200, 166, 76, 0.28);
}

.upload-dialog h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  color: #243746;
  font-weight: 600;
}

.upload-dialog p {
  margin: 0 0 18px;
  color: #5e6d78;
  line-height: 1.55;
  font-size: 0.98rem;
}

.upload-progress-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #edf3f7;
  overflow: hidden;
  margin: 0 0 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e1c15f, #2ca6e0);
  transition: width 0.2s ease;
}

.upload-progress-text {
  font-size: 0.96rem;
  font-weight: 700;
  color: #1d4e89;
  margin-bottom: 8px;
}

.upload-subtle {
  font-size: 0.88rem;
  color: #7a8a95;
}

.upload-dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 10px;
}

.upload-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8e5ef;
  animation: pulseDot 1.2s infinite ease-in-out;
}

.upload-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.upload-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulseDot {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (min-width: 700px) {
  .grid,
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .previews {
    grid-template-columns: repeat(3, 1fr);
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .grid,
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.admin-toolbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-button {
  background: #6f8290;
}

.danger-button {
  background: linear-gradient(180deg, #d65b5b, #b93d3d);
}

.admin-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.admin-card {
  border: 1px solid #e1e8ef;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.admin-card-head {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.95rem;
}

.admin-meta {
  flex: 1;
  min-width: 220px;
  color: #5e6d78;
  line-height: 1.5;
}

.admin-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fbfd;
  border: 1px solid #e7eef4;
  white-space: pre-wrap;
  line-height: 1.5;
}

.admin-files {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-file {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 12px;
  background: #fbfdff;
  border: 1px solid #e9eff4;
}

.admin-file-info {
  flex: 1;
  min-width: 220px;
  color: #5e6d78;
  line-height: 1.45;
}

.admin-file-key {
  font-size: 0.8rem;
  word-break: break-all;
  color: #8a98a4;
}