/* ==========================================================
   EASY THEME SETTINGS
   ========================================================== */

:root {
  --paper: #f8f7f3;
  --ink: #20201e;
  --muted: #77746d;
  --line: #ddd9d0;

  --button-bg: #20201e;
  --button-text: #ffffff;

  --max: 1180px;
}


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

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;

  background: var(--paper);
  color: var(--ink);

  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  -webkit-font-smoothing: antialiased;
}


/* ==========================================================
   HEADER / HERO
   ========================================================== */

.hero {
  min-height: 24vh;

  padding:
    24px
    24px
    24px;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  border-bottom:
    1px solid var(--line);
}


.wedding-logo {
  display: block;

  width:
    min(420px, 100vw);

  max-height: 180px;

  object-fit: contain;

  margin-bottom: 0px;
}


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

.upload-button input {
  display: none;
}


.upload-button {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-width: 184px;
  height: 50px;

  padding:
    0
    28px;

  border: 0;

  border-radius: 999px;

  background:
    var(--button-bg);

  color:
    var(--button-text);

  cursor: default;

  font-size: 14px;
  font-weight: 600;

  letter-spacing: .02em;

  text-align: center;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    opacity .18s ease;
}


.upload-button:hover {
  transform:
    translateY(-2px);

  box-shadow:
    0 8px 24px
    rgba(0, 0, 0, .10);
}


.upload-button:active {
  transform:
    translateY(0);

  opacity: .85;
}


.status {
  min-height: 20px;

  margin-top: 8px;

  color: var(--muted);

  font-size: 13px;
}


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

main {
  width:
    min(
      var(--max),
      calc(100% - 32px)
    );

  margin:
    0 auto;

  padding:
    46px 0
    90px;
}


.gallery-heading {
  display: flex;

  align-items: baseline;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 24px;
}


.gallery-heading h1 {
  margin: 0;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size:
    clamp(
      25px,
      4vw,
      36px
    );

  font-weight: 400;
}


.refresh-button {
  border: 0;

  padding: 6px 0;

  background: transparent;

  color: var(--muted);

  cursor: pointer;

  font: inherit;

  text-decoration: underline;
  text-underline-offset: 4px;
}


.refresh-button:hover {
  color: var(--ink);
}


.refresh-button:disabled {
  opacity: .45;

  cursor: default;
}


/* ==========================================================
   PHOTO GRID
   ========================================================== */

.gallery {
  columns:
    3 280px;

  column-gap: 12px;
}


.photo {
  position: relative;

  width: 100%;

  display: block;

  break-inside: avoid;

  margin:
    0 0
    12px;

  padding: 0;

  border: 0;

  background: #ece9e3;

  cursor: default;

  overflow: hidden;
}


.photo img {
  width: 100%;
  height: auto;

  display: block;

  transition:
    transform .25s ease,
    filter .25s ease;
}


.photo:hover img {
  transform:
    scale(1.018);
}


/* ==========================================================
   FULLSCREEN VIEWER
   ========================================================== */

dialog {
  width: 100vw;
  max-width: none;

  height: 100vh;
  max-height: none;

  margin: 0;

  padding:
    56px
    80px
    62px;

  border: 0;

  background:
    rgba(
      19,
      19,
      18,
      .97
    );

  color: white;

  overflow: hidden;

  overscroll-behavior:
    contain;
}


dialog::backdrop {
  background:
    rgba(
      19,
      19,
      18,
      .97
    );
}


#viewerImage {
  width: 100%;

  height:
    calc(
      100vh - 118px
    );

  display: block;

  object-fit: contain;

  user-select: none;

  -webkit-user-select:
    none;

  -webkit-user-drag:
    none;

  touch-action:
    pan-y;
}


/* ==========================================================
   VIEWER CLOSE BUTTON
   ========================================================== */

.close {
  position: fixed;

  top: 14px;
  right: 22px;

  z-index: 30;

  width: 48px;
  height: 48px;

  display: grid;

  place-items: center;

  padding: 0;

  border: 0;

  background: transparent;

  color: white;

  font-size: 38px;
  font-weight: 200;

  line-height: 1;

  cursor: pointer;

  opacity: .85;

  transition:
    opacity .15s ease,
    transform .15s ease;
}


.close:hover {
  opacity: 1;

  transform:
    scale(1.08);
}


/* ==========================================================
   DESKTOP PREVIOUS / NEXT BUTTONS
   ========================================================== */

.viewer-nav {
  position: fixed;

  top: 50%;

  z-index: 30;

  width: 58px;
  height: 58px;

  display: grid;

  place-items: center;

  padding: 0;

  border:
    0px solid
    rgba(
      255,
      255,
      255,
      .0
    );

  border-radius: 50%;

  background:
    rgba(
      255,
      255,
      255,
      .0
    );

  color: white;

  font-family:
    Arial,
    sans-serif;

  font-size: 44px;

  font-weight: 200;

  line-height: 1;

  cursor: pointer;

  transform:
    translateY(-50%);

  backdrop-filter:
    blur(8px);

  -webkit-backdrop-filter:
    blur(8px);

  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}


.viewer-nav:hover {
  background:
    rgba(
      255,
      255,
      255,
      .0
    );

  border-color:
    rgba(
      255,
      255,
      255,
      .0
    );
}


.viewer-nav:active {
  transform:
    translateY(-50%)
    scale(.92);
}


.viewer-nav-left {
  left: 22px;
}


.viewer-nav-right {
  right: 22px;
}


/* ==========================================================
   DOWNLOAD
   ========================================================== */

.download-link {
  position: fixed;

  left: 50%;
  bottom: 20px;

  z-index: 30;

  transform:
    translateX(-50%);

  color: white;

  font-size: 18px;

  text-decoration: underline;

  text-underline-offset: 4px;

  cursor: pointer;
}


.download-link:hover {
  opacity: .8;
}


/* ==========================================================
   LOGIN PAGE
   ========================================================== */

.login-page {
  width: 100%;

  min-height: 100vh;

  margin: 0;

  display: flex;

  align-items: center;
  justify-content: center;

  padding:
    32px 20px;
}


.login-card {
  width:
    min(
      420px,
      100%
    );

  text-align: center;
}


.login-logo {
  display: block;

  width:
    min(
      340px,
      80vw
    );

  max-height: 160px;

  object-fit: contain;

  margin:
    0 auto
    32px;
}


.login-title {
  margin:
    0 0
    10px;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 32px;

  font-weight: 400;
}


.login-copy {
  margin:
    0 auto
    28px;

  color: var(--muted);

  line-height: 1.6;
}


.login-form {
  display: flex;

  flex-direction: column;

  gap: 12px;
}


.login-input {
  width: 100%;

  height: 52px;

  padding:
    0 18px;

  border:
    1px solid
    var(--line);

  border-radius: 999px;

  background: white;

  color: var(--ink);

  font: inherit;

  text-align: center;

  outline: none;
}


.login-input:focus {
  border-color:
    var(--ink);
}


.login-button {
  width: 100%;

  height: 52px;

  border: 0;

  border-radius: 999px;

  background:
    var(--button-bg);

  color:
    var(--button-text);

  font: inherit;

  font-weight: 600;

  cursor: pointer;

  transition:
    transform .15s ease,
    opacity .15s ease;
}


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


.login-button:active {
  opacity: .85;
}


.login-error {
  margin:
    14px 0 0;

  color: #9b3d37;

  font-size: 14px;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media
(max-width: 700px) {

  .hero {
    min-height: auto;

    padding:
      52px
      20px
      42px;
  }


  .wedding-logo {
    width:
      min(
        330px,
        82vw
      );

    max-height: 135px;
  }


  main {
    width:
      calc(
        100% - 20px
      );

    padding-top: 34px;
  }


  .gallery {
    columns: 2;

    column-gap: 6px;
  }


  .photo {
    margin-bottom: 6px;
  }


  /*
    Mobile uses swipe navigation,
    so hide desktop arrows.
  */

  .viewer-nav {
    display: none;
  }


  .photo-overlay {
    display: none;
  }


  dialog {
    padding:
      52px
      8px
      60px;
  }


  #viewerImage {
    height:
      calc(
        100vh - 112px
      );
  }


  .close {
    top: 8px;
    right: 8px;
  }
}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media
(prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition:
      none !important;

    animation:
      none !important;
  }

}
