/*
Theme Name: Sentiment
Author: Sentiment
Version: 1.0
*/

/* =========================================================
   Fonts
========================================================= */

@font-face{
  font-family: "Edition International";
  src:
    url("assets/fonts/edition-international70-webfont.woff2") format("woff2"),
    url("assets/fonts/edition-international70-webfont.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face{
  font-family: "Edition International";
  src:
    url("assets/fonts/edition-internationalitalic70-webfont.woff2") format("woff2"),
    url("assets/fonts/edition-internationalitalic70-webfont.woff") format("woff");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face{
  font-family: "Edition Scriptual";
  src:
    url("assets/fonts/edition-scriptual70-webfont.woff2") format("woff2"),
    url("assets/fonts/edition-scriptual70-webfont.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   Variables + resets
========================================================= */

:root{
  --font-size: 24px;
  --line-height: 1.25;

  --sidebar-width: 200px;
  --page-padding: 28px;
  --column-gap: 168px;

  --hover-underline-offset: 0.18em;

  --content-max: 980px;
  --content-shift-left: 160px;
  --media-max: 760px;

  --fixed-left-extra: 0px;
  --fixed-right-extra: 0px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body{
  font-family: "Edition International", serif;
  font-size: var(--font-size);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure consistent line-height inheritance */
h1, h2, h3, p, li, a{ line-height: inherit; }

/* Global links */
a,
a:visited,
a:hover,
a:active{
  color: inherit;
  text-decoration: none;
}

/* Media safety */
img, video, iframe, embed, object{
  max-width: 100%;
  height: auto;
}

/* Prevent long words/URLs from breaking layout */
.content, .content *{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================================
   Layout
========================================================= */

.layout{
  display: flex;
  align-items: flex-start;
  gap: var(--column-gap);
  padding: var(--page-padding);
  min-height: calc(100dvh - (2 * var(--page-padding)));
}

.sidebar{
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
}

.content{
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(var(--content-max) - var(--content-shift-left));
}

/* =========================================================
   Typography rhythm
========================================================= */

p{ margin: 0 0 0.8em 0; }

h1, h2, h3{
  font-size: 1em;
  font-weight: normal;
  margin: 0 0 0.6em 0;
}

em, i{ font-style: italic; }

.script{
  font-family: "Edition Scriptual", "Edition International", serif;
}

/* =========================================================
   Site title (fixed, scroll-aware)
========================================================= */

.site-title,
.site-title a{
  font-family: "Edition International", serif !important;
  margin-bottom: 0;
  display: inline-block;
}

.site-title a:hover{ text-decoration: none !important; }

.site-title{
  position: fixed;
  top: calc(var(--page-padding) + var(--fixed-left-extra));
  left: calc(var(--page-padding) + var(--fixed-left-extra));
  z-index: 1000;
  transition: transform 220ms ease, opacity 220ms ease;
}

.site-title.is-hidden{
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
}


/* Admin bar compensation (logged-in WP) */
body.admin-bar .site-title,
body.admin-bar .menu-toggle{
  top: calc(var(--page-padding) + 32px);
}

body.admin-bar .site-menu{
  top: calc(var(--page-padding) + 32px + 1.25em);
}

/* =========================================================
   Exhibitions archive
========================================================= */

.exh-list{
  display: flex;
  flex-direction: column;
  gap: 1.4em;
}

.exh-item{ display: block; }

a.exh-item:hover .exh-script,
a.exh-item:hover .exh-normal{
  text-decoration: underline;
  text-underline-offset: var(--hover-underline-offset);
}

.exh-script{ margin: 0; }

.exh-normal{
  margin: 0.1em 0 0 0;
  max-width: 52ch;
}

.exh-item > .exh-normal:first-child,
.exh-header > .exh-normal:first-child{
  margin-top: 0;
}

.exh-dates{ margin: 0.2em 0 0 0; }

.exh-section + .exh-section{ margin-top: 1.2em; }

/* =========================================================
   Artists archive
========================================================= */

.artist-list{
  display: flex;
  flex-direction: column;
  gap: 0.05em;
}

.artist-item{
  text-decoration: none;
  text-underline-offset: 0.15em;
}

.artist-item:hover{ text-decoration: underline; }

.artists-header{
  display: inline-block;
  margin-bottom: 0.6em;
  text-decoration: none;
  text-underline-offset: 0.15em;
}

.artists-header:hover{ text-decoration: none; }

/* =========================================================
   Single Exhibition — header + media
========================================================= */

.exh-header{ margin-bottom: 1.2em; }

/* --- Gutenberg/editor images (still supported if you use the editor) --- */
/* Some WP wrappers center things; enforce left */
.exh-body .wp-block-image{ text-align: left !important; }

.exh-body figure.wp-block-image,
.exh-body figure.wp-block-image.wp-lightbox-container,
.exh-body .wp-block-image,
.exh-body .wp-block-gallery figure{
  margin: 0.25em 0;
  max-width: var(--media-max);
}

.exh-body figure.wp-block-image,
.exh-body figure.wp-block-image.wp-lightbox-container,
.exh-body .wp-block-gallery figure{
  display: inline-block;
  width: fit-content;
  margin-left: 0 !important;
  margin-right: auto !important;
}

.exh-body img{
  display: block;
  margin: 0 !important;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.exh-body figcaption,
.exh-body .wp-element-caption{
  margin: 0.12em 0 0 0 !important;
  font-size: 0.85em;
  line-height: 1.25;
  max-width: 100%;
}

.exh-body figcaption p,
.exh-body .wp-element-caption p{
  margin: 0 !important;
}

/* Hide WP lightbox triggers if they appear */
button.lightbox-trigger,
.wp-lightbox-container button,
.wp-block-image button.lightbox-trigger,
.wp-block-gallery button.lightbox-trigger{
  display: none !important;
}

/* --- ACF media stream (your new system) --- */
.exh-body .exh-media{
  margin: 0.5em 0;
  max-width: var(--media-max);
}

/* Best-effort left alignment across all parent layouts:
   make figure full row, align image to left */
.exhibition-single .exh-body .exh-media{
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.exh-body .exh-media img{
  display: block;
  max-height: 90vh;
  object-fit: contain;
}

.exhibition-single .exh-body .exh-media img{
  width: auto !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

.exh-body .exh-caption{
  margin: 0.12em 0 0 0;
  font-size: 0.85em;
  line-height: 1.25;
}
.exh-body .exh-caption p{ margin: 0; }

.exhibition-single a.exh-lightbox{ cursor: zoom-in; }

/* =========================================================
   About page (ID 21)
========================================================= */

body.page-id-21,
body.page-id-21 *{
  font-family: "Edition International", serif !important;
}

body.page-id-21 .content article > h1:first-child,
body.page-id-21 .content article > h2:first-child,
body.page-id-21 .content article > h3:first-child,
body.page-id-21 .content article > h4:first-child,
body.page-id-21 .content article > h5:first-child,
body.page-id-21 .content article > h6:first-child{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-id-21 main.content > div[style]{ padding: 0 !important; }

body.page-id-21 .content article > :first-child{ margin-top: 0 !important; }

body.page-id-21 a:hover{
  text-decoration: underline;
  text-underline-offset: var(--hover-underline-offset);
}

/* =========================================================
   Single artist sections + works grid
========================================================= */

.artist-section{ margin: 0 0 1.2em 0; }

.artist-section-title{ margin: 0 0 0.4em 0; }

.works-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6em;
  margin-top: 0.4em;
}

.work-link,
.artist-highlight-btn{
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-block;
}

.artist-highlight{
  max-width: 320px;
  margin: 0 0 1em 0;
}

.artist-highlight img,
.work-link img{
  display: block;
  width: 100%;
  height: auto;
  transition: none !important;
}

@media (max-width: 980px){
  .works-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px){
  .works-grid{ grid-template-columns: 1fr; }
}

/* =========================================================
   Lightbox — #sLightbox (global default)
   Default behaviour: image + caption, grid layout
========================================================= */

#sLightbox{
  position: fixed;
  inset: 0;
  z-index: 99999;
}

#sLightbox .s-lightbox__backdrop{
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.96);
}

#sLightbox .s-lightbox__panel{
  position: relative;
  z-index: 2;
  margin: var(--page-padding);
  width: calc(100% - (2 * var(--page-padding)));
  height: calc(100% - (2 * var(--page-padding)));
}

#sLightbox .s-lightbox__close{
  position: absolute;
  top: 0;
  right: 0;
  border: 0;
  background: transparent;
  color: #000;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

#sLightbox .s-lightbox__content{
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  padding-top: 18px;
  padding-left: 38px;
}

#sLightbox .s-lightbox__img{
  max-width: 68vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
}

#sLightbox .s-lightbox__cap{
  padding-left: 38px;
  padding-right: 100px;
  color: #000 !important;
  font-size: 0.85em;
  line-height: 1.25;
}

@media (max-width: 768px){
  #sLightbox .s-lightbox__content{
    grid-template-columns: 1fr;
    padding-left: 0;
  }
  #sLightbox .s-lightbox__img{
    max-width: 92vw;
  }
  #sLightbox .s-lightbox__cap{
    padding-left: 0;
    padding-right: 0;
    margin-top: 0.8em;
  }
}

/* =========================================================
   Lightbox override — Single Exhibitions (image only, centered)
========================================================= */

.exhibition-single #sLightbox .s-lightbox__cap{
  display: none !important;
}

.exhibition-single #sLightbox .s-lightbox__content{
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.exhibition-single #sLightbox .s-lightbox__img{
  max-width: 90vw !important;
  max-height: 90vh !important;
  width: auto !important;
  height: auto !important;
}

/* =========================================================
   Mobile layout
========================================================= */

@media (max-width: 768px){
  :root{ --font-size: 20px; }

  .layout{
    flex-direction: column;
    gap: 0;
  }

  .sidebar{
    width: 100%;
    flex: 0 0 auto !important;
    height: auto !important;
  }

  .site-meta{ display: none; }

  .site-title{ z-index: 1000; }
  .menu-toggle{ z-index: 1002; }
  .site-menu{ z-index: 1001; }

  /* Mobile: let content use full width */
  .content{
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Reduce gaps for mobile */
  :root{
    --column-gap: 0px;
    --content-shift-left: 0px;
    --page-padding: 18px;
  }

  .layout{ gap: 50px; }
}

/* =========================================================
   Reduce “tiny scroll” on short pages
========================================================= */

.content > :last-child,
.content article > :last-child,
.content article > :last-child > :last-child{
  margin-bottom: 0 !important;
}

/* =========================================================
   Header hide/show (mobile, direct)
========================================================= */

.site-title,
.menu-toggle{
  transition: transform 220ms ease, opacity 220ms ease;
}

@media (max-width: 768px){
  body{ --header-hide: 0px; }

  body::before,
  .site-title,
  .menu-toggle{
    transform: translateY(var(--header-hide));
    transition: none;
    will-change: transform;
  }

  body::before,
  .site-title,
  .menu-toggle{
    opacity: calc(1 - (min(1, (abs(var(--header-hide)) / 56))));
  }
}


/* Single Exhibition lightbox: centered image, no caption */
body.single-exhibition #sLightbox .s-lightbox__cap{
  display: none !important;
}

/* Remove the global grid + paddings and truly center */
body.single-exhibition #sLightbox .s-lightbox__content{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

body.single-exhibition #sLightbox .s-lightbox__panel{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.single-exhibition #sLightbox .s-lightbox__img{
  max-width: 90vw !important;
  max-height: 90vh !important;
  width: auto !important;
  height: auto !important;
  margin: 0 auto !important;
  display: block !important;
}

/*Artists Archive */

/* -------------------------------------------------------
   ARTISTS ARCHIVE: layout + show more
------------------------------------------------------- */

/* 2 cols default */
#artistList.artist-list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax(0,1fr) prevents weird clipping */
  column-gap: 60px;
  row-gap: 6px;
}

/* 1 col on small screens */
@media (max-width: 700px){
  #artistList.artist-list{
    grid-template-columns: 1fr;
  }
}

/* 3 cols only on very large screens */
@media (min-width: 1600px){
  #artistList.artist-list{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* IMPORTANT: allow the artists page to be wider so 3 cols aren't tiny
   (adjust number if you want even wider) */
.post-type-archive-artist main.content,
.post-type-archive-artist .content{
  max-width: 1400px; /* try 1400–1600 */
}

/* Only hide vertically (for the “collapsed” cropping),
   but keep horizontal tidy via ellipsis */
#artistListWrap.artist-list-wrap{
  overflow: visible;          /* was hidden */
  padding-bottom: 0.25em;     /* small breathing room so descenders don't get chopped */
}

/* tighter line rhythm + prevent ugly cut: use ellipsis instead */
.artist-item{
  line-height: 1.05;     /* keep your overlap */
  background: transparent;
  position: relative;
  z-index: 0;
}

/* show more button looks like an item */
.artist-showmore{
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

#artistShowMore.artist-showmore{
  margin-top: 10px;           /* visually separates it from last row */
}

/* Sidebar should stack blocks normally */
.sidebar{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Add separation so menu starts below the address */
.site-meta{
  margin-top: 8px;
  line-height: 1.25;
}

.sidebar-nav{
  margin-top: 22px;  /* space between address and menu */
}

/* Menu formatting */
.sidebar-menu{
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li{
  margin: 0 0 8px 0;
}

.sidebar-menu a{
  display: block;
  text-decoration: none;
  font: inherit;
  line-height: 1.2;
}

.sidebar-menu a:hover{
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* --- Make sidebar stack normally (title + meta + nav) --- */
.site-title{
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

.sidebar{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sidebar-nav{
  margin-top: 22px;
}

/* =========================================================
   MOBILE NAV — CLEAN, WORKING (Menu button)
   Paste at END of style.css
========================================================= */

/* Desktop: hide mobile UI */
.mobile-topbar,
.site-nav-overlay{
  display: none !important;
}

/* Desktop: keep sidebar normal (your existing desktop rules remain) */
@media (min-width: 901px){
  .sidebar{
    position: static !important;
    transform: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    width: var(--sidebar-width) !important;
  }
}

/* Mobile */
@media (max-width: 900px){

  /* Show topbar + overlay */
  .mobile-topbar{ display: flex !important; }
  .site-nav-overlay{ display: block !important; }

  /* Topbar (full width, no side gap) */
  .mobile-topbar{
    position: fixed;
    top: 0; left: 0; right: 0;
    display:flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background:#fff;
    z-index: 9999;
  }

  /* Brand in Edition International */
  .mobile-brand{
    font-family: "Edition International", serif !important;
    font-style: normal !important;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
  }

  /* Menu button (text) */
  #menuToggle,
  .menu-toggle{
    display: inline-block !important;
    appearance:none;
    -webkit-appearance:none;
    background:none;
    border:0;
    padding:0;
    margin:0;
    font: inherit;
    color: inherit;
    cursor:pointer;
    line-height:1;
  }

  #menuToggle:hover,
  .menu-toggle:hover{
    text-decoration: underline;
    text-underline-offset: var(--hover-underline-offset);
  }

  /* Remove the duplicated "sentiment" INSIDE the drawer on mobile */


  /* Make room for fixed topbar */
  .layout{
    display:block !important;
    padding: 18px 20px !important;
    padding-top: 86px !important;
    gap: 0 !important;
  }

  /* Overlay */
  .site-nav-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  body.nav-open .site-nav-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* Menu panel drops DOWN full width (no right gap) */
  .sidebar{
    position: fixed !important;
    top: 0; left: 0; right: 0;
    width: 100% !important;

    background:#fff;
    z-index: 9500;

    /* space for topbar inside the drop-down */
    padding: 86px 20px 28px;

    max-height: 100svh;
    overflow:auto;
    -webkit-overflow-scrolling: touch;

    transform: translateY(-105%);
    transition: transform .22s ease;
    will-change: transform;
  }


  body.nav-open .sidebar{
    transform: translateY(0);
  }
}

/* =========================
   MOBILE TOPBAR: FORCE "Menu" TEXT BUTTON VISIBLE
   (paste at END of style.css)
========================= */

/* Desktop: hide mobile UI */
.mobile-topbar,
.site-nav-overlay,
#menuToggle{
  display: none !important;
}

/* Mobile: show + make "Menu" text button normal sized */
@media (max-width: 900px){
  .mobile-topbar{
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;

    position: fixed;
    top: 0; left: 0; right: 0;

    padding: 18px 20px;
    background: #fff;
    z-index: 2000;
  }

  /* IMPORTANT: undo hamburger sizing */
  #menuToggle.menu-toggle{
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;

    appearance: none;
    -webkit-appearance: none;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;

    font: inherit !important;
    font-size: inherit !important;
    line-height: 1 !important;
    color: inherit !important;

    cursor: pointer;
    z-index: 2001; /* above everything */
  }

  /* If you still have any old hamburger span rules, kill them */
  #menuToggle span{ display: none !important; }

  /* overlay + dropdown panel behaviour (kept) */
  .site-nav-overlay{
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    z-index: 1800;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  body.nav-open .site-nav-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* Make room for fixed topbar */
  .layout{
    display: block !important;
    padding-top: 86px !important;
  }

  /* Dropdown menu panel */
  .sidebar{
    position: fixed !important;
    top: 0; left: 0; right: 0;
    background: #fff;
    z-index: 1900;

    padding: 56px 20px 32px;
    max-height: 100svh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;

    transform: translateY(-105%);
    transition: transform .22s ease;
    will-change: transform;
  }
  body.nav-open .sidebar{
    transform: translateY(0);
  }

  /* Remove duplicate "sentiment" inside the dropdown */
  .sidebar .site-title > a{ display:none !important; }
}

@media (max-width: 700px){
  #artistShowMore,
  .artist-showmore{
    display: none !important;
  }
}
/* Lightbox: animate without relying on [hidden] display:none */
#sLightbox{
  position: fixed;
  inset: 0;
  z-index: 99999;

  /* closed state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

/* IMPORTANT: override the browser's default [hidden]{display:none} */
#sLightbox[hidden]{
  display: block !important;
}

#sLightbox .s-lightbox__backdrop{
  opacity: 0;
  transition: opacity 240ms ease;
}

#sLightbox .s-lightbox__panel{
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 240ms ease, transform 240ms ease;
}

/* open */
#sLightbox.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 240ms ease, visibility 0s;
}

#sLightbox.is-open .s-lightbox__backdrop{ opacity: 1; }
#sLightbox.is-open .s-lightbox__panel{
  opacity: 1;
  transform: translateY(0) scale(1);
}
