/* ==========================================================
   WEDDING MEMORIES: STYLESHEET
   1. Variables   2. Base   3. Layout   4. Upload panel
   5. Filter tabs   6. Gallery   7. Lightbox   8. Utilities
   ========================================================== */


/* ---------- 1. VARIABLES ---------- */
:root {
  --bg: #fbf7f2;
  --card: #fff;
  --ink: #3a2f2a;
  --mute: #8a7b72;
  --accent: #b5838d;
  --accent2: #8c5a66;
  --line: #eadfd5;
  --shadow: 0 4px 18px rgba(80, 50, 40, .08);

  /* keep content clear of phone notches and system bars */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}



/* ...or forced manually with <html data-theme="dark"> */
:root[data-theme="dark"] {
  --bg: #1d1719;
  --card: #2a2124;
  --ink: #f3e9e4;
  --mute: #b3a29b;
  --accent: #d19aa6;
  --accent2: #e8b4bf;
  --line: #3d3135;
  --shadow: 0 4px 18px rgba(0, 0, 0, .4);
}


/* ---------- 2. BASE ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
  background-color: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(249, 223, 223, 0), rgba(240, 105, 105, 0.078)),
    url("images/Bg.png") center / cover no-repeat;
}

@media (max-width: 768px) {
  body::before {
    background:
      linear-gradient(rgba(249, 223, 223, 0), rgba(240, 105, 105, 0.078)),
      url("images/Bunga.png") center / cover no-repeat;
  }
}

button,
input {
  font: inherit;
}


/* ---------- 3. LAYOUT ---------- */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

header {
  text-align: center;
  padding: 100px 8px 10px;
}

header .rings {
  font-size: 2rem;
}

header p {
  max-width: 22em;
  margin: 10px auto;
  color: var(--mute);
}

h1 {
  margin: 0 auto 8px;
  font-family: "Satisfy", cursive;
  font-size: clamp(1.9rem, 9vw, 2.8rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: .5px;
  line-height: 1.4;
  color: black;

}

h2 {
  margin: 0 0px;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: .02em;
}

.panel {
  margin: 18px 0;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row > * {
  flex: 1 1 200px;
}


/* ---------- 4. UPLOAD PANEL ---------- */
label {
  display: block;
  margin-bottom: 4px;
  font-family: system-ui, sans-serif;
  font-size: .85rem;
  color: var(--mute);
}

input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* drag-and-drop area */
.drop {
  margin-top: 14px;
  padding: 28px 12px;
  text-align: center;
  font-family: system-ui, sans-serif;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  cursor: pointer;
  transition: .15s;
}

.drop.over {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.drop strong {
  display: block;
  font-size: 1.05rem;
  color: var(--accent2);
}

.drop small {
  color: var(--mute);
}

/* buttons */
.btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  min-height: 44px;
  padding: 11px 20px;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.btn.alt {
  color: var(--accent2);
  background: transparent;
  border: 1px solid var(--accent);
}

.btn:disabled {
  opacity: .5;
  cursor: default;
}

.btn.alt.recording {
  color: #fff;
  background: #c0392b;
  border-color: #c0392b;
}

/* upload progress list */
.queue {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-family: system-ui, sans-serif;
  font-size: .9rem;
}

.q {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--mute);
}

.bar {
  flex: 0 0 90px;
  height: 6px;
  overflow: hidden;
  background: var(--line);
  border-radius: 4px;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .2s;
}

.note {
  margin-top: 10px;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: .85rem;
  color: var(--mute);
}


/* ---------- 5. FILTER TABS ---------- */
.tabs {
  display: flex;
  gap: 8px;
  padding: 2px 0 10px;
  overflow-x: auto;
  font-family: system-ui, sans-serif;
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.tab[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}


/* ---------- 6. GALLERY ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.item img,
.item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item .aud {
  width: 100%;
  padding: 10px;
  text-align: center;
  font-family: system-ui, sans-serif;
}

.item .aud b {
  display: block;
  font-size: 2.2rem;
}

.item .tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 9px;
  font: 600 .72rem system-ui, sans-serif;
  color: #fff;
  background: rgba(0, 0, 0, .55);
  border-radius: 999px;
}

.item .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 8px;
  overflow: hidden;
  font: .78rem system-ui, sans-serif;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}

.empty {
  padding: 40px 10px;
  text-align: center;
  font-family: system-ui, sans-serif;
  color: var(--mute);
}


/* ---------- 7. LIGHTBOX (full-screen viewer) ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) 12px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: rgba(0, 0, 0, .92);
}

.lb.on {
  display: flex;
}

.lb .media {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
}

.lb img,
.lb video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.lb audio {
  width: min(480px, 92vw);
}

.lb .meta {
  margin-top: 10px;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: .9rem;
  color: #fff;
}

/* top-right buttons (download, delete, close) */
.lb .top {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  display: flex;
  gap: 8px;
}

.lb .top button,
.lb .top .dlbtn {
  min-height: 40px;
  padding: 9px 16px;
  color: #fff;
  background: rgba(255, 255, 255, .15);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.lb .top .dlbtn {
  display: inline-flex;
  align-items: center;
  font-size: .9rem;
  text-decoration: none;
}

/* previous / next arrows */
.lb .nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(255, 255, 255, .15);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
}

.lb .prev { left: 8px; }
.lb .next { right: 8px; }


/* ---------- 8. UTILITIES ---------- */
.hidden {
  display: none !important;
}