/* Additions on top of the original theme stylesheet (assets/theme/style.css). */

/* ---- WordPress [gallery] shortcode (was an inline <style> per page) ---- */
.gallery { margin: auto; }
.gallery .gallery-item { float: left; margin-top: 10px; text-align: center; }
.gallery-columns-4 .gallery-item { width: 25%; }
.gallery-columns-5 .gallery-item { width: 20%; }
.gallery img { border: 2px solid #cfcfcf; }
.gallery .gallery-caption { margin-left: 0; }

.wp-block-image { margin: 0 0 1em; }
.wp-block-image img { max-width: 100%; height: auto; }

/* ---- Image hover fade (was a jQuery animation) ---- */
a img { transition: opacity .3s; }
a:hover img { opacity: .85; }

/* ---- Home page slider (nav positions come from the theme; site.js builds the markup) ---- */
.nivo-slice, .nivo-box { background-repeat: no-repeat; }
.nivo-directionNav a, .nivo-controlNav a { border: 0; padding: 0; font-size: 0; }

/* ---- Lightbox (replaces prettyPhoto, same "light_rounded" look) ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(0, 0, 0, .8);
  opacity: 0; transition: opacity .3s;
}
.lightbox.visible { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox-box {
  position: relative; background: #fff; border-radius: 10px; padding: 10px 10px 0;
  max-width: calc(100vw - 40px); box-shadow: 0 0 20px rgba(0, 0, 0, .5);
}
.lightbox-img { display: block; max-width: calc(100vw - 60px); max-height: calc(100vh - 120px); width: auto; height: auto; }
.lightbox-bar {
  display: flex; align-items: center; gap: 10px; min-height: 36px; font: 11px/1.4 Verdana, Geneva, sans-serif; color: #000;
}
.lightbox-caption { flex: 1; font: italic 17px/1.35 "Times New Roman", "Droid Serif", Times, serif; padding: 4px 0; }
.lightbox-count { color: #777; white-space: nowrap; font-size: 12px; }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 10px; bottom: 36px; width: 50%; border: 0; cursor: pointer;
  background: transparent no-repeat; opacity: 0; transition: opacity .2s;
}
.lightbox-prev { left: 0; background-image: url(theme/images/prettyPhoto/light_rounded/btnPrevious.png); background-position: 10px center; }
.lightbox-next { right: 0; background-image: url(theme/images/prettyPhoto/light_rounded/btnNext.png); background-position: calc(100% - 10px) center; }
.lightbox-prev:hover, .lightbox-next:hover, .lightbox-prev:focus-visible, .lightbox-next:focus-visible { opacity: 1; }
.lightbox-close {
  border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: #555; padding: 4px;
}
.lightbox-close:hover { color: #000; }
.lightbox.single .lightbox-prev, .lightbox.single .lightbox-next, .lightbox.single .lightbox-count { display: none; }

/* ---- Zoom gallery (OpenSeadragon, replaces the Flash Zoomify viewer) ---- */
.zoom-viewer { position: relative; max-width: 100%; background: #f4f4f4; border: 1px solid #e8e7e7; }
.zoom-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.zoom-ready .zoom-preview { display: none; }

/* ---- Contact form (Netlify Forms) ---- */
.hidden-field { position: absolute; left: -9999px; }
input[type="email"] {
  width: 300px; height: 24px; border: 1px solid #e2e2e2; background-color: #fff; padding: 2px 0 2px 5px;
  border-radius: 3px; color: #777; font-size: 12px; line-height: 23px;
}
input[type="email"].invalid { border: 1px solid #ff9999; }
button.button { border-width: 0; font: 13px/100% Arial, Helvetica, sans-serif; }
.pexeto-contact-form.sending .contact-loader { visibility: visible; }
.pexeto-contact-form.error .error-message,
.pexeto-contact-form.sent .sent-message { display: block; }

/* ---- Work 2001-2010: cleaned-up old pages ---- */
.archive-content { text-align: center; display: flow-root; }
.archive-content p { margin: 0 auto 1em; max-width: 720px; }
.archive-content p.prose { text-align: left; }
.archive-after-grid { margin-top: 32px; }
.archive-content img { max-width: 100%; height: auto; vertical-align: middle; }
.archive-content table { margin: 0 auto; border-collapse: collapse; }
.archive-content td { padding: 4px; vertical-align: middle; }
.archive-content .art-title { font: italic 18px/1.4 "Times New Roman", "Droid Serif", Times, serif; color: #000; }
.archive-content p.art-title { margin-top: 10px; }
.archive-content .art-details { font-size: 13px; line-height: 1.5; font-style: normal; color: #555; }
.archive-content .gallery { text-align: left; margin-top: 10px; }
.archive-content img.cover { width: 150px; height: 150px; object-fit: cover; }

/* ---- Work pages show the menu and labels in the visitor's language (set in <head>, see site.js) ---- */
html[data-ui="fr"] [data-ui-lang="en"],
html[data-ui="en"] [data-ui-lang="fr"] { display: none !important; }

/* ---- Header: menu + FR | EN ---- */
#menu { display: flex; align-items: center; justify-content: flex-end; }
#menu ul.menu { margin-bottom: 0; }
.lang-switch { display: flex; gap: 12px; margin-left: 26px; padding-left: 22px; border-left: 1px solid #d0d0d0; line-height: 12px; }
.lang-switch a, .lang-switch button {
  font: 11px/12px "Helvetica Neue", "Droid Sans", Helvetica, sans-serif; letter-spacing: 2px; color: #6b6b6b;
  text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
}
.lang-switch a:hover, .lang-switch button:hover { color: #7a1800; }
.lang-switch [aria-current], .lang-switch [aria-pressed="true"] { color: #0042b3; }

#menu ul ul { width: 170px; }   /* theme default 135px is too narrow for "Crise climatique" */

/* Work drop-down: the series in two columns */
#menu li.menu-work > ul.work-menu { width: 580px; left: auto; right: -130px; padding: 6px 0 10px; }
#menu .work-col ul li a { white-space: nowrap; }
#menu .work-col { float: left; width: 50%; }
#menu ul.work-menu::after { content: ""; display: block; clear: both; }
#menu .work-col-title { display: block; padding: 8px 14px 2px; font-size: 10px; letter-spacing: 2px; color: #6b6b6b; }
#menu .work-col ul { position: static; display: block; width: auto; border: 0; padding: 0; top: auto; left: auto; background: none; }
#menu .work-col ul li a { padding: 0 14px; }

/* Climate crisis: its pages linked from a section menu under the header */
.section-nav {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 24px 0 -22px; padding: 12px 0;
  border-top: 1px solid #e2e2e2; border-bottom: 1px solid #e2e2e2;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
}
.section-nav a { color: #000; text-decoration: none; }
.section-nav a:hover { color: #7a1800; }
.section-nav a[aria-current] { color: #0042b3; }

/* ---- Work: series grids, artwork pages ---- */
.work-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; margin: -8px 0 16px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.work-crumb, .work-pager { margin: 0; }
.work-crumb a { color: #6b6b6b; text-decoration: none; }
.work-crumb a:hover, .work-pager a:hover { color: #7a1800; }
.work-pager { display: flex; gap: 18px; align-items: baseline; }
.work-pager a { color: #000; text-decoration: none; }
.work-count { color: #6b6b6b; }
.pager-label { display: none; }
.work-back { margin: 0 0 16px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.work-back a { text-decoration: none; }
.work-intro { max-width: 720px; color: #3d3d3d; margin: 0 0 6px; }
.work-group { font: 11px/1 "Helvetica Neue", "Droid Sans", Helvetica, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: #6b6b6b; margin: 34px 0 0; padding-top: 18px; border-top: 1px solid #e2e2e2; }
.work-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; margin-top: 20px; }
.work-card { display: flex; flex-direction: column; gap: 6px; color: #000; text-decoration: none; }
.work-card:hover { color: #7a1800; }
.work-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #f4f4f4; }
.work-card-sub { order: 1; font-size: 11px; letter-spacing: 2px; color: #6b6b6b; }
.work-card-label { order: 2; font: italic 18px/1.3 "Times New Roman", "Droid Serif", Times, serif; margin-top: -2px; }
.work-grid-items .work-card img { aspect-ratio: 1; object-fit: contain; background: #f6f5f2; padding: 10px; box-sizing: border-box; }
.work-grid-items .work-card-label { font-size: 16px; }

.artwork { display: flex; gap: 40px; align-items: flex-start; padding-top: 18px; border-top: 1px solid #e2e2e2; }
.artwork-image { flex: 1; min-width: 0; display: flex; justify-content: center; align-items: center; background: #f6f5f2; padding: 36px; }
.artwork-image img { display: block; max-width: 100%; height: auto; width: auto; max-height: 70vh; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.artwork-info { width: 250px; flex-shrink: 0; padding-top: 6px; }
.artwork-title { font: italic normal 26px/1.25 "Times New Roman", "Droid Serif", Times, serif; margin: 0 0 12px; color: #000; }
.artwork-detail { margin: 0 0 4px; font-size: 14px; line-height: 1.5; color: #3d3d3d; }
.artwork-links { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid #e2e2e2; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.artwork-links a { text-decoration: none; }

.work-more .work-group { margin-top: 30px; }
.work-strip { display: flex; gap: 10px; overflow-x: auto; padding: 14px 2px 8px; }
.work-strip a { flex: none; width: 96px; height: 96px; }
.work-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-strip a[aria-current] { outline: 2px solid #0042b3; outline-offset: 2px; }

/* ======================================================================
   Responsive layout. Desktop (1000px and up) is exactly the original theme;
   everything below only applies to tablets and phones.
   ====================================================================== */

.menu-toggle { display: none; }

@media (max-width: 999px) {
  #main-container { min-width: 0; }
  .center,
  #slider-container,
  #content-container,
  #full-width,
  #content,
  #full-width .columns-wrapper,
  #footer .columns-wrapper { width: auto; float: none; }
  .center { padding: 0 16px; }
  #slider-container.center { padding: 0; }
  #content-container { padding: 30px 0; overflow: hidden; }
  #content-container .center, #footer .center { padding: 0; }
  #sidebar { display: none; }   /* always empty */

  /* keep long links (climate resource lists) from widening the page */
  #content-container { overflow-wrap: anywhere; }
  #content-container img { max-width: 100%; height: auto; }

  /* header */
  #logo-container { margin-top: 28px; }
  #menu-container { margin-top: 44px; max-width: none; }
  #menu ul li a { padding-left: 18px; }
  #intro { margin-top: 28px; }

  /* slider: scale with the page instead of a fixed 950x350 */
  #nivo-slider, #nivo-slider img { width: 100%; height: auto; aspect-ratio: 950 / 350; background-size: 100% 100% !important; }
  .nivo-directionNav { display: none; }
  .nivo-controlNav { left: 50% !important; transform: translateX(-50%); }

  /* WordPress galleries: responsive grid instead of fixed 4/5 floated columns */
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); column-gap: 10px; }
  .gallery br { display: none; }
  .gallery .gallery-item { width: auto !important; float: none; }
  #content-container .gallery img { width: 100%; max-width: 160px; height: auto; box-sizing: border-box; }

  /* zoom viewer fills the width, keeps the original 650x700 proportions */
  .zoom-viewer { width: 100% !important; height: auto !important; aspect-ratio: 650 / 700; max-height: 80vh; }

  /* contact form */
  .contact-form-input, .contact-form-textarea { width: auto; max-width: 400px; }
  input[type="text"], input[type="email"], textarea { width: 100%; max-width: 400px; box-sizing: border-box; font-size: 16px; }

  /* work */
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .artwork { flex-direction: column; gap: 20px; }
  .artwork-image { width: 100%; box-sizing: border-box; padding: 20px; }
  .artwork-info { width: auto; }
  #copyrights { height: auto; padding-bottom: 16px; }
  #copyrights h5 { line-height: 1.5; }
}

@media (max-width: 767px) {
  body { font-size: 15px; }

  /* header: logo on the left, "Menu" button on the right, menu drops down below */
  #header { position: relative; }
  #logo-container { margin-top: 22px; max-width: calc(100% - 100px); }
  #logo-container a { max-width: 100%; background-size: contain; }
  #menu-container { float: none; margin-top: 0; clear: both; }
  .menu-toggle {
    display: flex; align-items: center; gap: 8px; position: absolute; top: 28px; right: 16px;
    padding: 8px 10px; border: 1px solid #e2e2e2; border-radius: 3px; background: #fff; cursor: pointer;
    font: 11px/1 "Helvetica Neue", "Droid Sans", Helvetica, sans-serif; letter-spacing: 2px; text-transform: uppercase; color: #000;
  }
  .menu-toggle-icon, .menu-toggle-icon::before, .menu-toggle-icon::after {
    display: block; width: 16px; height: 2px; background: currentColor; position: relative; transition: transform .2s;
  }
  .menu-toggle-icon::before, .menu-toggle-icon::after { content: ""; position: absolute; left: 0; }
  .menu-toggle-icon::before { top: -5px; }
  .menu-toggle-icon::after { top: 5px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon::before { transform: translateY(5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon::after { transform: translateY(-5px) rotate(-45deg); }

  #menu { display: none; padding-top: 20px; }
  #menu-container.menu-open #menu { display: block; }
  #menu ul { text-align: left; margin-bottom: 0; }
  #menu ul li { display: block; border-top: 1px solid #e2e2e2; }
  #menu ul li a { display: block; padding: 14px 0; line-height: 1.2; height: auto; font-size: 12px; }
  #menu ul li:last-child { border-bottom: 1px solid #e2e2e2; }

  /* language switch: two buttons at the bottom of the open menu */
  #menu-container.menu-open #menu { display: block; }
  .lang-switch { margin: 16px 0 20px; padding: 0; border: 0; gap: 10px; }
  .lang-switch a, .lang-switch button { flex: 1; text-align: center; padding: 13px 0; border: 1px solid #e2e2e2; font-size: 12px; }
  .lang-switch [aria-current], .lang-switch [aria-pressed="true"] { border-color: #0042b3; }

  /* the Work drop-down: every series in one list */
  #menu li.menu-work > ul.work-menu { width: auto; padding: 0; }
  #menu .work-col ul li a { white-space: normal; }
    #menu .work-col { float: none; width: auto; }
  #menu .work-col-title { padding: 10px 0 4px 16px; }
  #menu .work-col ul li a { padding: 10px 0 10px 16px; }

  .section-nav { margin: 16px 0 -14px; gap: 4px 16px; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .work-card-label { font-size: 16px; }
  .work-bar { flex-direction: column; gap: 10px; }
  .work-pager { width: 100%; justify-content: space-between; }
  .work-pager a { padding: 8px 0; }
  .pager-title { display: none; }
  .pager-label { display: inline; }
  #content-container .work-strip img { height: 100%; }

  /* sub-menus become indented, tap-to-open sections */
  #menu ul ul, #menu ul ul ul {
    position: static; width: auto; border: 0; border-left: 2px solid #0042b3; margin: 0 0 12px 4px; background: transparent;
  }
  #menu ul ul li { border-top: 0; }
  #menu ul ul li:last-child { border-bottom: 0; }
  #menu ul ul li a { padding: 10px 0 10px 16px; line-height: 1.2; font-size: 11px; }
  #menu ul ul li a:hover { background: transparent; }
  #menu ul ul ul li a { padding-left: 32px; }
  #menu ul ul .drop-arrow { float: none; top: -2px; margin-left: 6px; transform: rotate(90deg); }
  #menu li.open > a .drop-arrow { transform: rotate(180deg); }
  #menu ul ul li.open > a .drop-arrow { transform: rotate(270deg); }

  #intro { margin-top: 20px; }
  #intro h1 { font-size: 18px; line-height: 1.35; }
  #slider-container { margin-top: 24px; }
  .nivo-controlNav { bottom: -30px; }
  h1.page-heading { font-size: 20px; line-height: 1.3; margin-top: 0; }
  #content-container { padding-top: 24px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .gallery .gallery-caption { font-size: 11px; line-height: 1.3; }
  /* CV entries indented with inline padding-left: 60px */
  #content-container p[style*="padding-left"] { padding-left: 24px !important; }

  /* lightbox: use the whole screen */
  .lightbox-box { padding: 6px 6px 0; border-radius: 6px; }
  .lightbox-box { max-width: calc(100vw - 24px); }
  .lightbox-img { max-width: calc(100vw - 36px); max-height: calc(100vh - 100px); }
  /* no PREV/NEXT labels over the artwork: tap either half or swipe */
  .lightbox-prev, .lightbox-next { background-image: none; }
}
