/* ============================================================
   OPAL ATELIER — webcam / photo library page
   Layout + behaviour modelled on iheartwebcam.com
   ============================================================ */

html, body { margin: 0; padding: 0; text-transform: lowercase; overflow-y: scroll; overflow-x: hidden; background: #fff; }
body.wc { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #000; -webkit-text-size-adjust: 100%; }
.wc a { text-decoration: none; color: #000; }
.wc a:hover { opacity: .56; transition: opacity .2s ease; }
.wc .hidden { display: none !important; }

/* ---------- shared page frame (gallery + photo) ---------- */
.wc-page { display: flex; flex-direction: column; padding-left: 20px; padding-right: 20px; min-height: 100dvh; box-sizing: border-box; }

.wc-head, .wc-foot { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 700; letter-spacing: -.06em; color: #000; }

/* header + footer float over the scrolling content, like the reference mockup */
.wc-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 20px 0 20px; pointer-events: none; font-size: 34px; line-height: 1.05;
}
.wc-head > * { pointer-events: auto; }
.wc-title { display: block; cursor: pointer; letter-spacing: -.06em; text-transform: none; max-width: calc(100vw - 340px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-title:hover { opacity: .56; transition: opacity .2s ease; }
.wc-title b { font-style: normal; font-weight: 800; }
.wc-title i { font-style: italic; }

/* launch camera + hand-drawn ring */
.camBtn { display: block; width: 270px; margin: 0 -6px 0 0; line-height: 0; }
.camBtn img { display: block; width: 100%; height: auto; }

.wc-nav { display: none; }

.wc-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 15px;
  padding: 0 20px 16px 20px; font-size: 34px; line-height: 1;
}
.wc-foot > * { pointer-events: auto; }
.searchbar { display: flex; align-items: center; flex: 1; gap: 15px; }
.search-button { cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.search-button:hover { opacity: .56; transition: opacity .2s ease; }
.search-form { max-width: 0; opacity: 0; transition: max-width .8s ease, opacity .3s ease; overflow: hidden; display: flex; height: 35px; border: 1px solid rgba(80,80,80,.4); box-shadow: inset 0 1px 3px #0000001a; background: #ffffff80; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 3px; min-width: 0; }
.search-form.expanded { max-width: 2000px; opacity: 1; flex: 1; }
.search-input { flex: 1; padding-left: 6px; font-size: 16px; border: none; outline: none; box-sizing: border-box; font-family: serif; color: #000; background: transparent; text-transform: lowercase; }
.help { flex: 0 0 auto; text-align: right; padding-left: 30px; }
.home-link { padding-left: 0; margin-left: auto; }

/* ---------- layout: scroll area + tag column ---------- */
.intro { display: flex; flex-direction: row; align-items: flex-start; }
.galleryspace { flex: 1; overflow: visible; width: 100%; min-width: 0; padding: 34px 1px 96px 0; order: 1; box-sizing: border-box; scrollbar-width: none; }
.galleryspace::-webkit-scrollbar { display: none; }
.tag-container { order: 2; flex: 0 0 170px; max-width: 170px; padding-left: 20px; padding-top: 122px; padding-bottom: 96px; display: flex; flex-direction: column; align-self: flex-start; position: relative; z-index: 1; box-sizing: content-box; }
.tag-list-container { display: flex; flex-direction: column; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px 3px; align-content: flex-start; justify-content: flex-end; padding: 0; }
.tag { font-family: serif; display: inline-block; padding: 3px 8px; background: #eee; color: #646464; border-radius: 23px; cursor: pointer; text-align: center; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-size: 16px; border: 1px solid transparent; transition: background-color .2s ease, color .2s ease, border-color .2s ease; text-transform: lowercase; }
.tag:hover { background: #e1e1e1; color: #646464; border-color: #b4b4b4; }
.tag.active { background: #fbf1f1; color: #b45f5f; border-color: #b45f5f; }
.tag.main { color: #000; }
.tag.main.active { color: #b45f5f; }
.tag-gap { flex-basis: 100%; height: 4px; }

/* ---------- gallery grid ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(243px, 1fr)); column-gap: 10px; row-gap: 17px; justify-content: flex-start; width: 100%; }
@media (min-width: 1013px) {
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 3-column pages keep the exact same tile size as the 4-column pages; the 4th column is left blank */
  .gallery.cols3 { grid-template-columns: repeat(3, calc((100% - 30px) / 4)); }
}
.gallery-item { position: relative; text-align: center; color: #878787; align-self: start; }
.gallery-item a { display: block; position: relative; }
.gallery-item img { display: block; aspect-ratio: 3 / 2; width: 100%; height: auto; object-fit: cover; object-position: 50% 30%; opacity: 0; transition: opacity .3s ease-in-out; background: #f3f3f3; }
.gallery-item img.loaded { opacity: 1; }
.vid-badge { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.vid-badge::after { content: ""; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.caption-container { display: flex; align-items: center; justify-content: space-between; width: 100%; box-sizing: border-box; gap: 5px; font-size: 16px; padding-top: 3px; }
.wc .tags { color: #000; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; text-transform: lowercase; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.gallery-msg { font-family: Arial, Helvetica, sans-serif; font-size: x-large; color: gray; padding-top: 30px; text-transform: lowercase; }

/* ---------- photo page ---------- */
.top-section { display: flex; gap: 30px; align-items: stretch; flex-wrap: nowrap; width: 100%; margin: 0 auto; }
.image-selected { flex: 1 1 auto; flex-shrink: 0; min-width: 61%; max-width: 740px; }
.image-selected-item { display: flex; flex-direction: column; gap: 10px; }
.image-selected-item img, .image-selected-item video { display: block; width: 100%; height: auto; max-height: calc(100dvh - 150px); object-fit: contain; object-position: left top; background: transparent; }
.image-selected-item .caption-container { padding-top: 3px; }
.selected-tags { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; color: #000; overflow-wrap: anywhere; }
.tag-label { font-family: sans-serif; font-size: 15px; font-style: normal; }
.tag-link { color: #2d81ff !important; text-decoration: underline !important; }
.right-section { flex: 1 1 auto; max-width: 37%; min-width: 340px; }
.related-tags { margin-bottom: 15px; font-size: x-large; font-weight: 700; letter-spacing: -.055em; font-family: Arial, Helvetica, sans-serif; color: #000; }
.small-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); column-gap: 10px; row-gap: 12px; }
.small-gallery .gallery-item img { min-width: 100px; max-width: 100%; }
.lower-section { margin-top: 20px; }
.small-gallery2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); column-gap: 10px; row-gap: 17px; }

/* ---------- alert box (shared) ---------- */
.alert-box { position: fixed; inset: 0; justify-content: center; align-items: center; z-index: 100; display: flex; opacity: 0; pointer-events: none; transition: opacity .1s, backdrop-filter .2s; }
.alert-box.active { opacity: 1; pointer-events: auto; background: rgba(255,255,255,.15); }
.alert-content { -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); background: rgba(255,255,255,.7); border: 1px solid rgba(80,80,80,.4); box-shadow: inset 0 0 4px rgba(255,255,255,.2); padding: 25px 45px; border-radius: 10px; text-align: center; width: 390px; max-width: calc(100vw - 40px); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; font-size: small; color: #323232; font-weight: 400; letter-spacing: 0; text-transform: lowercase; }
.alert-content p { margin: 0; line-height: 19px; font-family: serif; font-size: 14px; }
.pill-btn { display: flex; align-items: center; justify-content: center; font-size: small; min-width: 90px; height: 26px; cursor: pointer; padding: 0 14px 1px; border-radius: 25px; background: #eee; color: #646464; border: .5px solid #b4b4b4; font-family: Arial, Helvetica, sans-serif; text-transform: lowercase; transition: background-color .2s, color .2s, border-color .2s; }
.pill-btn:hover { background: #e1e1e1; }
.pill-btn:disabled { opacity: .5; cursor: default; }
.alert-content .pill-btn { margin-top: 19px; background: rgba(255,255,255,.4); border: none; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: #505050; }

/* ---------- mobile (matches the reference's phone layout) ---------- */
.search-overlay, .nav-overlay { display: none; }
.mobile-footer { display: none; }

@media (max-width: 1012px) {
  .wc-page { padding-left: 10px; padding-right: 10px; }
  .wc-head { padding: 16px 10px 14px 10px; font-size: 22px; background: linear-gradient(#fff 60%, #fff0); }
  .tag-container, .galleryspace { order: 0; }
  .wc-title { max-width: calc(100vw - 90px); }
  .camBtn { display: none; }
  .wc-nav { display: block; }
  .wc-foot { display: none; }
  .intro { flex-direction: column-reverse; gap: 0; }
  .galleryspace { overflow-y: visible; padding: 8px 0 90px; }
  .gallery, .small-gallery2 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); row-gap: 15px; column-gap: 5px; }
  .small-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); row-gap: 15px; column-gap: 6px; }
  .wc-page { height: auto; min-height: 100dvh; }
  .intro { display: block; }
  .tag-container { display: block; max-width: 100%; max-height: 40px; padding: 0 0 10px 1px; flex: none; overflow-x: auto; overflow-y: hidden; margin-top: 62px; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%); mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%); }
  .tag-list-container { flex-direction: row; }
  .tag-list { flex-wrap: nowrap; align-items: center; justify-content: flex-start; font-size: medium; }
  .tag-gap { display: none; }
  .tag { font-size: small; flex: 0 0 auto; }
  .wc .tags { font-size: small; }
  .top-section { flex-direction: column; gap: 30px; align-items: flex-start; }
  .image-selected { width: 100%; max-width: 100%; min-width: 0; }
  .right-section { width: 100%; max-width: 100%; min-width: 0; }
  .image-selected-item img, .image-selected-item video { max-height: 72dvh; }
  .mobile-footer { position: fixed; bottom: 0; left: 0; width: 100%; height: 70px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 20px 15px; z-index: 40; box-sizing: border-box; overflow: hidden; font-family: Arial, Helvetica, sans-serif; font-weight: 700; letter-spacing: -.055em; font-size: 22px; }
  .mobile-footer:before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, #fffffff5, #ffffffeb, #ffffffc7 30%, #ffffff85, #ffffff38, #ffffff0f 90%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); -webkit-mask-image: linear-gradient(to top, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(to top, #000 0%, #000 55%, transparent 100%); }
  .footer-item { position: relative; z-index: 10; cursor: pointer; text-decoration: none; color: #000; }
  .search-overlay { position: fixed; inset: 0; z-index: 1000; display: none; flex-direction: column; justify-content: flex-start; background: #ffffff80; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding-top: 12px; }
  .search-overlay.active { display: flex; }
  .overlay-search-form { display: flex; padding-left: 15px; }
  .overlay-search-form .search-input { flex: 1; font-size: x-large; border: none; color: #000; }
  .overlay-search-form ::placeholder { color: #000; }
  .search-form { display: none; }
  .nav-overlay { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; justify-content: flex-start; background: #ffffff80; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .nav-overlay.active { display: flex; }
  .nav-menu { position: fixed; inset: 0; padding: 18px 20px; display: flex; align-items: flex-end; flex-direction: column; font-family: Arial, Helvetica, sans-serif; font-weight: 700; letter-spacing: -.055em; font-size: 22px; }
  .nav-menu a { display: block; text-align: right; margin-bottom: 10px; }
  .alert-content { padding: 22px 28px; }
}

/* ============================================================
   CAMERA PAGE
   ============================================================ */
body.wc-cam { overflow: hidden; }
.webcam-page, .webcam-page * { margin: 0; padding: 0; box-sizing: border-box; }
.webcam-page { position: fixed; inset: 0; width: 100%; min-height: 100%; overflow: hidden; display: flex; justify-content: center; align-items: center; background: #fff; font-family: Arial, Helvetica, sans-serif; }
.webcam-page .video-container { position: relative; width: 100vw; height: 100dvh; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.webcam-page button { font-size: x-large; background: transparent; border: none; cursor: pointer; font-weight: 700; letter-spacing: -.055em; color: #000; font-family: Arial, Helvetica, sans-serif; text-transform: lowercase; }
.webcam-page .header { position: absolute; top: 18px; left: 0; right: 0; padding: 0 30px; z-index: 10; display: flex; justify-content: space-between; align-items: center; }
.webcam-page .header > * { flex: 1; }
.webcam-page .header button { text-align: left; }
.webcam-page .header #pick { text-align: center; font-size: large; }
.webcam-page .header #counter { flex: 1; text-align: right; visibility: hidden; font-size: x-large; font-weight: 700; letter-spacing: -.055em; }
.webcam-page .header #counter.blinking { visibility: visible; animation: wcblink 1s step-start infinite; }
.webcam-page .header button:hover { text-decoration: underline; }
.webcam-page video { transform: scaleX(-1); }
.webcam-page video, .webcam-page #capturedImage { width: 100%; height: 100%; object-fit: contain; }
.webcam-page .interface { display: flex; justify-content: space-between; align-items: center; width: 100%; position: fixed; bottom: 64px; padding: 0 30px; }
.webcam-page .interface-side { flex: 1; display: flex; }
.webcam-page .interface-side:last-child { justify-content: flex-end; }
.webcam-page .interface-button { display: flex; align-items: center; }
.webcam-page .interface-button:hover { text-decoration: underline; }
.webcam-page .photo-button { width: 45px; height: 45px; border-radius: 50%; border: 3px solid #db0c0c; display: flex; justify-content: center; align-items: center; cursor: pointer; background: transparent; position: relative; opacity: 1; transition: opacity .2s ease-in-out; }
.webcam-page .photo-button.disabled { opacity: .5; }
.webcam-page .photo-inner { width: 30px; height: 30px; background: #db0c0c; border-radius: 50%; transition: transform .1s ease-in-out; }
.webcam-page .photo-inner.active { animation: expandContract 4s ease-in-out 1; }
@keyframes expandContract { 0% { transform: scale(1) } 12.5% { transform: scale(.7) } 25% { transform: scale(1) } 37.5% { transform: scale(.7) } 50% { transform: scale(1) } 62.5% { transform: scale(.7) } 75% { transform: scale(1) } 87.5% { transform: scale(.7) } to { transform: scale(1) } }
.cam-note { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-family: serif; font-size: 18px; color: #646464; padding: 0 30px; text-transform: lowercase; z-index: 5; }

/* ============================================================
   UPLOAD PAGE
   ============================================================ */
.upload-page, .upload-page * { margin: 0; padding: 0; box-sizing: border-box; }
.upload-page { overflow-x: clip; width: 100%; padding: 17px 19px 15px 20px; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: space-between; font-family: Arial, Helvetica, sans-serif; }
.upload-page header, .upload-page footer { font-weight: 700; letter-spacing: -.055em; display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: x-large; }
.upload-page footer { position: sticky; bottom: 60px; z-index: 10; }
.upload-page header a, .upload-page footer a { color: #000; text-decoration: none; }
.upload-page a:hover { text-decoration: underline; opacity: 1; }
.upload-container { display: flex; flex-direction: row; place-content: center; width: 100%; padding: 10px 0; gap: 5px; }
.upload-page .img-container { display: flex; flex: 2; width: 100%; place-content: center; }
.upload-page #uploadedImage { width: 100%; height: 100%; max-height: 70dvh; object-fit: cover; border: 1px solid rgba(80,80,80,.4); border-radius: 3px; }
.upload-page .user-form { flex: 1; display: flex; flex-direction: column; padding: 15px; border-radius: 3px; width: 100%; text-transform: lowercase; gap: 12px; font-size: small; color: gray; border: 1px solid rgba(80,80,80,.4); align-self: stretch; }
.upload-page .form-label { color: #000; text-decoration: underline; font-size: small; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px 4px; max-height: 38dvh; overflow-y: auto; padding: 2px 0; }
.chip { font-family: serif; display: inline-block; padding: 3px 9px; background: #eee; color: #646464; border-radius: 23px; cursor: pointer; font-size: 16px; border: 1px solid transparent; transition: background-color .2s, color .2s, border-color .2s; user-select: none; text-transform: lowercase; }
.chip:hover { background: #e1e1e1; border-color: #b4b4b4; }
.chip.on { background: #fbf1f1; color: #b45f5f; border-color: #b45f5f; }
.upload-page input[type=email] { font-family: serif; font-size: small; border: 1px solid rgba(80,80,80,.4); border-radius: 3px; padding: 4px; background: transparent; width: 100%; text-transform: none; }
.upload-page .note { color: gray; font-size: x-small; padding-top: 2px; line-height: 1.4; }
.upload-page .btn-row { display: flex; gap: 8px; margin-top: auto; }
.upload-page .pill-btn { width: 90px; padding: 0; }
@media (max-width: 760px) {
  .upload-container { flex-direction: column; }
  .upload-page #uploadedImage { max-height: 46dvh; }
  .upload-page header, .upload-page footer { font-size: 22px; }
}

/* ============================================================
   HELP PAGE
   ============================================================ */
/* ============================================================
   INFO PAGES  (new user / guidelines / privacy / about)
   ============================================================ */
body.wc-info { background: #fff; }
.info-page { font-family: Arial, Helvetica, sans-serif; text-transform: lowercase; padding: 0 30px; min-height: 100dvh; display: flex; flex-direction: column; box-sizing: border-box; color: #000; }
.info-page a { color: #000; }
.info-page a:hover { opacity: 1; }
.info-head, .info-foot { position: sticky; z-index: 5; display: flex; justify-content: space-between; align-items: baseline; font-size: 24px; font-weight: 700; letter-spacing: -.055em; line-height: 1.15; background: #fff; }
.info-head { top: 0; padding: 20px 0 10px; }
.info-foot { bottom: 0; padding: 14px 0 20px; margin-top: auto; }
.info-foot a { color: #b4b4b4; transition: color .2s; }
.info-foot a:hover { color: #000; opacity: 1; }
.info-foot a.selected-nav { color: #000; }
.info-container { padding: 24px 0 20px; }
.info-title { font-size: 24px; font-weight: 700; letter-spacing: -.055em; }
.info-content { font-size: 13px; line-height: 1.6; max-width: 340px; margin: 22px 0 40px; }
.info-content p { margin: 0 0 14px; }
.info-content em { font-style: italic; }
.info-content a { text-decoration: underline; }
/* guidelines + about: title and paragraph sit vertically centered, left-aligned */
.info-page main { flex: 1; display: flex; flex-direction: column; }
.info-center .info-container { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 0 20px; }
.info-center .info-content { margin: 22px 0 0; }
@media (max-width: 760px) {
  .info-page { padding: 0 20px; }
  .info-head { font-size: 22px; }
  .info-foot { font-size: 18px; }
  .info-content { max-width: none; }
}
