/* Center the whole project horizontally and make it responsive */
.portrait-switch {
  width: 360px;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  display: block;
}

/* 9:16 frame with squared bottom corners */
.frame {
  width: 100%;
  aspect-ratio: 9 / 16;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 6px 6px;
  background: #111;
}

/* images stacked and filling the frame */
.frame .portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* default: show A, hide B */
.frame .front {
  display: block;
}

.frame .back {
  display: none;
}

/* toggle images with checkbox */
#swap:checked~.frame .back {
  display: block;
}

#swap:checked~.frame .front {
  display: none;
}

/* button spans the same width as the frame and sits directly below it */
.swap-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  /* flush under frame */
  padding: 8px 0;
  text-align: center;
  background: white;
  color: black;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  border: none;
  user-select: none;
}

/* keep button appearance simple when toggled */
#swap:checked~.swap-btn {
  background: yellow;
  color: black;
}

.description {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* small screens: reduce default width */
@media (max-width: 420px) {
  .portrait-switch {
    width: 240px;
  }
}


/* Gallery / Cards*/
.oc_gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: 6px;
  padding: 6px;
}

.oc_card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: var(--radius);
  border-style: var(--oc-border-style);
  border-width: var(--oc-border-width);
  border-color: var(--oc-border-color);
  overflow: hidden;
  padding: 8px;
  margin: 2px;
  gap: 6px;
  max-width: fit-content;
}

.oc_image {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 6px;
}

.oc_image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}