/*
Theme Name: Portfolio Index Lightbox
Description: Índice tipográfico de posts com lightbox de rolagem.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: portfolio-index
*/


/* ABC ORACLE TRIPLE */


@font-face {
  font-family: 'ABC Oracle Triple Book';
  src: url('fonts/ABCOracleTriple-Book.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ABC Oracle Triple Book Italic';
  src: url('fonts/ABCOracleTriple-BookItalic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}


:root { --type-size: clamp(18px, 2.65vw, 19px); }
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; padding: 1px 5px; background: #fff; color: #000; font-family: 'ABC Oracle Triple Book', sans-serif; font-size: var(--type-size); line-height: .96; }
button, input { font: inherit; }
a { color: inherit; }
.site-intro p { margin: 0 0 7px; }
.work-row { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .22em; margin: 0; }
.work-date { white-space: nowrap; }
.work-link { text-decoration: none; }
.work-link:hover, .work-link:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.work-tags { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 .55em; }
.work-tag { font-size: 13px; line-height: 1.1; white-space: nowrap; color: #555; }
.work-tag:nth-child(7n+1) { color: #cf1616; }
.work-tag:nth-child(7n+2) { color: #2054d1; }
.work-tag:nth-child(7n+3) { color: #008a49; }
.work-tag:nth-child(7n+4) { color: #aa159f; }
.work-tag:nth-child(7n+5) { color: #ba6900; }
.work-tag:nth-child(7n+6) { color: #008c9b; }
.work-tag:nth-child(7n) { color: #666; }
/* Optional semantic colors for common tag slugs */
.work-tag[data-slug='video'] { color: #cf1616; }
.work-tag[data-slug='photography'], .work-tag[data-slug='post-photography'] { color: #2054d1; }
.work-tag[data-slug='archive'] { color: #008a49; }
.work-tag[data-slug='collage'] { color: #aa159f; }
.work-tag[data-slug='publication'], .work-tag[data-slug='photobook'] { color: #ba6900; }
.work-tag[data-slug='website'] { color: #008c9b; }
[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; padding: 10px 5% 5px 4.5%;; background: rgba(255,255,255,.12); }
.lightbox-panel { width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: #fff; color: #fff; padding: 0 3px 45px; scrollbar-color: #777 #000; outline: none; }
.lightbox-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; background: transparent; font-size: 18px; line-height: 1.15; min-height: 0px; }
.lightbox-close { border: 0; padding: 0 12px; background: #fff; color: #000; font-size: 30px; line-height: 1; cursor: pointer; }
.lightbox-close:focus-visible { outline: 2px solid #fff; }
.lightbox-content { font-family: 'ABC Oracle Triple Book',  sans-serif; font-size: clamp(18px, 2.15vw, 14px); line-height: .98; text-align: justify; overflow-wrap: anywhere; }
.lightbox-content h1 { font-size: 1.2em; line-height: 1; font-weight: normal; margin: 8px 0 16px; }
.lightbox-content p { margin: 0 0 .7em; }
.lightbox-content img { display: block; max-width: 100%; height: auto; }
.lightbox-content figure { max-width: 100%; margin: 0 0 1em; }
.lightbox-content figcaption, .lightbox-content .wp-caption-text { font-size: 16px; line-height: 1.2; color: #aaa; margin-top: 6px; }
.lightbox-content .wp-caption { max-width: 100%; }
.lightbox-content iframe, .lightbox-content video { max-width: 100%; }
.lightbox-content .gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.lightbox-content .gallery-item { float: none; margin: 0; }
.lightbox-content a { color: #000; }
.lightbox-loading, .lightbox-error { font-size: 20px; padding: 10px 0; }
.single-content { max-width: 1200px; font-size: clamp(23px, 2.15vw, 35px); line-height: 1; }
.single-content img { max-width: 100%; height: auto; }
.single-content iframe { max-width: 100%; }
.single-back { display: block; margin-bottom: 20px; }
@media (max-width: 700px) { body { padding: 12px; --type-size: 27px; line-height: 1; } .work-tag { font-size: 11px; } .lightbox { padding: 10px; } .lightbox-header { font-size: 15px; } .lightbox-content { font-size: 25px; } }

/* DESKTOP: INTERACTIVE INDEX + LIGHTBOX */

@media (min-width: 769px) {

  /* Allow clicks to pass through the overlay */
  .lightbox {
    pointer-events: none;
  }

  /* Keep the black panel interactive */
  .lightbox-panel {
    pointer-events: auto;
  }

  /* Keep the index visible and interactive */
  #portfolio {
    position: relative;
  }

  /* Highlight the currently opened work */
  .work-link.is-active {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }

}

/* LIGHTBOX: HALF SCREEN ON DESKTOP */

@media (min-width: 769px) {

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    justify-content: flex-end;
    align-items: stretch;

    padding: 12px 12px 12px 0;
    background: transparent;
  }

  .lightbox-panel {
    width: 50vw;
    max-width: none;
    height: 100%;

    margin: 0;
    overflow-y: auto;
    background: #fff;
    color: #000;
  }

}


/* FEATURED IMAGE HOVER PREVIEW */

#work-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 900;

  width: 760px;
  max-width: 90vw;

  pointer-events: none;
  opacity: 0;
  visibility: hidden;

  transform: translate3d(0, 0, 0);
}

#work-preview.visible {
  opacity: 1;
  visibility: visible;
}

#work-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 95vh;
  object-fit: contain;
}

/* Disable hover previews on touch devices */

#lightbox-date {
  display: none;
}

.lightbox-header {
  justify-content: flex-end;
}

.lightbox-content {
  padding-top: 0;
}

.lightbox-content > div > :first-child {
  margin-top: 0;
}

.lightbox-content p:first-child {
  margin-top: 0;
}

@media (hover: none) {
  #work-preview {
    display: none !important;
  }
}

@media (min-width: 769px) {

  body.modal-open {
    overflow: auto;
  }

  .lightbox-panel {
    overscroll-behavior: contain;
  }

}


/* REMOVE SPACING BETWEEN POST IMAGES */

.lightbox-content p,
.lightbox-content figure,
.lightbox-content .wp-caption,
.lightbox-content .wp-block-image,
.lightbox-content .gallery,
.lightbox-content .gallery-item {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.lightbox-content img {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: bottom;
}

.lightbox-content p:has(> img),
.lightbox-content p:has(> a > img) {
  line-height: 0;
}

.lightbox-content .gallery {
  gap: 0 !important;
  row-gap: 0 !important;
}

