/*
Theme Name: WW Portfolio
Description: Desktop sidebar + mobile hamburger off-canvas; mobile series details under image
Version: 10.15
Text Domain: ww
*/

/* -------------------- Fonts & Variables -------------------- */
@font-face {
  font-family: "bahnschrift";
  src: url("/wp-content/uploads/BAHNSCHRIFT 9.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --sidebar: 370px;
  --pad: 24px;
  --gutter: 24px;
  --muted: #666;
}

/* -------------------- Base -------------------- */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #eeeeec;
  color: #111;
  font:
    14px/1.6 bahnschrift,
    system-ui,
    Inconsolata;
  font-stretch: semi-condensed;
}

a {
  color: inherit;
  text-decoration: none !important;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

article.page.page-centered {
  letter-spacing: 2px;
  font-size: 18px;
  text-align: justify;
  text-indent: 1.5em;
}

/* -------------------- Layout -------------------- */
.site {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  border-right: 1px solid #eaeaea;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f7f7f7;
  background-color: #eeeeec;
  z-index: 30;
  width: 370px;
  -webkit-overflow-scrolling: touch;
}

.main {
  padding: 24px;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Fixed sidebar on wide screens (avoid 100vh rounding) */
@media (min-width: 901px) {
  .site {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar);
    height: auto;
    overflow-y: auto;
    transform: none;
    box-shadow: none;
  }
  .main {
    margin-left: var(--sidebar);
  }
}

/* WP admin bar offsets */
body.admin-bar .sidebar {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .sidebar {
    top: 55px;
  }
}

/* -------------------- Mobile off-canvas -------------------- */
.hamburger {
  display: none;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 40;
  background: #111;
  color: #fff;
  border: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 16px;
}
.sidebar-overlay {
  display: none;
}

@media (max-width: 900px) {
  .site {
    grid-template-columns: 1fr;
  }
  .hamburger {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    padding: 60px 16px 24px;
  }
}

/* -------------------- Navigation (left sidebar) -------------------- */
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-series ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav-pages {
  margin-top: 40px;
}
.nav-pages ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

nav.nav.nav-series {
  letter-spacing: 4px;
  font-size: 23px;
  font-stretch: condensed;
}

.sidebar .nav ul li a {
  color: rgb(94, 94, 94);
  text-decoration: none !important;
}
.sidebar .nav ul li.current-menu-item > a,
.sidebar .nav ul li.current_page_item > a,
.sidebar .nav ul li.current-menu-ancestor > a {
  color: #000000;
  text-decoration: none !important;
}

/* Pages menu colors (#02f default, #000 active) */
.sidebar .nav.nav-pages .menu a {
  text-decoration: none;
  font-size: 20px;
  letter-spacing: 4px;
}
.sidebar .nav.nav-pages .menu li.current-menu-item > a,
.sidebar .nav.nav-pages .menu li.current_page_item > a,
.sidebar .nav.nav-pages .menu li.current-menu-ancestor > a {
  color: #000000;
}
.sidebar .nav.nav-pages .menu a:hover,
.sidebar .nav.nav-pages .menu a:focus {
  color: #000000;
}

/* Series Menu dropdown */
.nav-series .menu,
.nav-series ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nav-series li a {
  color: rgb(94, 94, 94);
  text-decoration: none;
}
.nav-series li.current-cat > a,
.nav-series li.current-cat-parent > a,
.nav-series li.current-term > a,
.nav-series li.current-menu-item > a {
  text-decoration: none;
}
li.menu-item {
  list-style: none;
  text-decoration: none;
}

.sidebar .nav-series .menu .sub-menu {
  display: none;
  padding-left: 16px;
}
.sidebar .nav-series .menu li.open > .sub-menu {
  display: block;
}

.sidebar .nav-series .menu li.menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sidebar .nav-series .menu .submenu-toggle {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
}

/* -------------------- Sidebar footer & branding -------------------- */
.branddiv {
  margin-bottom: 30px;
}
.social {
  margin-top: auto;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* -------------------- Series meta / dots -------------------- */
.series-controls {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meta-title {
  font-weight: 700;
}
.meta-detail {
  color: #222;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thumb-toggle {
  cursor: pointer;
  text-decoration: underline;
}

/* Mobile meta/dots */
.series-controls-mobile {
  display: none;
  max-width: 1024px;
  margin: 16px auto 0;
  padding: 0 4px;
}
.series-controls-mobile .meta-title {
  font-weight: 700;
}
.series-controls-mobile .meta-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/*.series-controls-mobile .dotbar{ display:flex; gap:10px; margin:10px 0; }*/
@media (max-width: 900px) {
  .series-controls {
    display: none;
  }
  .series-controls-mobile {
    display: block;
  }
}

/* -------------------- Main image / viewer -------------------- */
.series-main {
  max-width: 1024px;
  margin: 0 auto;
}

/* Desktop main image size */
.series-main img,
.work-viewer img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 500px; /* cap width on large screens only */
  max-height: none;
  min-height: 0; /* ensure no legacy min-height applies */
}

/* Mobile main image */
@media (max-width: 900px) {
  .series-main img,
  .work-viewer img {
    max-width: 100%;
    height: auto;
    max-height: none;
    min-height: 0; /* IMPORTANT: cancel the old 500px min-height */
    object-fit: contain; /* safe guard: never crop or distort */
  }
  .work-viewer {
    max-width: 92vw;
  }
  .viewer-nav.prev {
    left: 8px;
  }
  .viewer-nav.next {
    right: 8px;
  }
}

/* Viewer wrapper + arrows + big click zones */
.work-viewer {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}
.work-viewer img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

/* Arrow buttons */
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  z-index: 3;
}
.viewer-nav:hover {
  background: rgba(0, 0, 0, 0.14);
}
.viewer-nav.prev {
  left: -54px;
}
.viewer-nav.next {
  right: -54px;
}
@media (max-width: 900px) {
  .viewer-nav.prev {
    left: 8px;
  }
  .viewer-nav.next {
    right: 8px;
  }
}

/* Full-height left/right hit areas (click anywhere to navigate) */
.viewer-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 2; /* above image, below arrows */
  cursor: pointer;
}
.viewer-hit.left {
  left: 0;
}
.viewer-hit.right {
  right: 0;
}

/* Center 40% zone shows an up-arrow cursor and is clickable */
.work-viewer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30%; /* center 40%: 30%..70% */
  width: 40%;
  z-index: 2;

  /* make it interactive & show an up arrow-like cursor */
  pointer-events: auto;
  cursor: n-resize; /* “north” arrow; works everywhere */

  /* If you want a custom arrow icon, uncomment the lines below and
     upload your cursor image, adjusting the URL & hotspot (16 0) */
  /* cursor: url('/wp-content/uploads/up-arrow.png') 16 0, n-resize; */
}

/* -------------------- Thumbnails grid -------------------- */
#thumbGrid {
  display: none; /* toggled by JS */
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  margin: 0 auto;
}
#thumbGrid .thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
}
#thumbGrid img {
  width: 100%;
  border: 1px solid #eaeaea;
  cursor: pointer;
}

/* Responsive column counts (optional fine-tuning) */
@media (max-width: 1200px) {
  #thumbGrid .thumbs-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 992px) {
  #thumbGrid .thumbs-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  #thumbGrid .thumbs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 560px) {
  #thumbGrid .thumbs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -------------------- Misc content -------------------- */
.post {
  margin: 0 auto;
}

/* Center page content */
.page-centered .entry {
  max-width: 1024px;
  margin: 0 auto;
}
.page-centered .entry img {
  display: block;
  margin: 0 auto;
  height: auto;
}

/* ===== Contact (CF7) – WW style ===== */

.ww-contact {
  max-width: 760px;
  margin: 0 auto;
  font-family: bahnschrift, system-ui, Inconsolata, monospace;
  letter-spacing: 0.06em;
}

.ww-contact .wpcf7-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}

.ww-contact .field.full,
.ww-contact .actions.full {
  grid-column: 1 / -1;
}

.ww-contact label {
  display: block;
  margin-bottom: 6px;
  color: #111;
  font-weight: 700;
  font-size: 18px;
}

.ww-contact input[type="text"],
.ww-contact input[type="email"],
.ww-contact input[type="url"],
.ww-contact input[type="tel"],
.ww-contact textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #bfbfbf;
  background: #f7f7f7;
  color: #111;
  border-radius: 6px;
  outline: none;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
  font-size: 16px;
  line-height: 1.5;
  font-stretch: semi-condensed;
}

.ww-contact textarea {
  min-height: 200px;
  resize: vertical;
}

.ww-contact input:focus,
.ww-contact textarea:focus {
  border-color: #000;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* Validation state from CF7 */
.ww-contact .wpcf7-not-valid {
  border-color: #d63638 !important;
}
.ww-contact .wpcf7-not-valid-tip {
  margin-top: 6px;
  color: #d63638;
  font-size: 13px;
}

/* Submit button */
.ww-btn,
.ww-contact input[type="submit"].ww-btn {
  appearance: none;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.02s ease;
}
.ww-btn:hover {
  background: #000;
}
.ww-btn:active {
  transform: translateY(1px);
}

/* Response + spinner */
.ww-contact .wpcf7-messages {
  margin-top: 10px;
  display: none;
}
.ww-contact .wpcf7-response-output {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cfcfcf;
  background: #fafafa;
  color: #222;
  font-size: 14px;
}
.ww-contact .wpcf7 form.sent .wpcf7-response-output {
  border-color: #46b450;
  background: #eef8f0;
}
.ww-contact .wpcf7 form.invalid .wpcf7-response-output,
.ww-contact .wpcf7 form.failed .wpcf7-response-output {
  border-color: #d63638;
  background: #fdeeee;
}

/* Make reCAPTCHA badge not overlap button on small screens */
.grecaptcha-badge {
  z-index: 15;
}

/* Mobile layout */
@media (max-width: 900px) {
  .ww-contact .wpcf7-form-grid {
    grid-template-columns: 1fr;
  }
  .brand-desktop {
    display: none !important;
  }
  .brand {
    color: #5e5e5e;
    font-weight: 900;
    line-height: 1.4em !important;
    font-size: 14px !important;
    padding-left: 40px;
    display: block;
    margin-bottom: 15px !important;
    text-decoration: none !important;
    top: 13px;
    position: absolute;
  }
  nav.nav.nav-series {
    margin-top: 50px;
  }
}
@media (min-width: 901px) {
  .brand-mobile {
    display: none !important;
  }
  div#workText {
    min-height: 130px;
  }
}
.brand {
  color: #5e5e5e;
  font-weight: 900;
  line-height: 1.4em;
  font-size: 20px;
  letter-spacing: 4px;
  margin-bottom: 30px;
  text-decoration: none !important;
}

/* Match site links style inside form (e.g., policy links) */
.ww-contact a {
  color: #02f;
  text-decoration: none;
}
.ww-contact a:hover {
  color: #000;
}

p.field {
  margin-bottom: 0px;
  margin-top: 0px;
}

#dotbar,
#dotbarM,
.series-controls .dotbar,
.series-controls-mobile .dotbar {
  display: grid !important; /* override old display:flex */
  grid-template-columns: repeat(10, 12px); /* 10 per row */
  grid-auto-rows: 12px;
  gap: 10px 10px; /* row/column gap */
  width: max-content; /* keep grid as tight as needed */
  align-content: start;
}

.dotbar {
  display: grid;
  grid-template-columns: repeat(10, 12px); /* 10 per row */
  grid-auto-rows: 12px;
  gap: 10px 10px; /* row gap / column gap */
  margin: 10px 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfcfcf;
  display: inline-block;
  cursor: pointer;
}

.dot.active {
  background: #1463ff;
}

/* Optional: if you want slightly fewer per row on tiny screens, tweak here */
@media (max-width: 420px) {
  .dotbar {
    grid-template-columns: repeat(8, 12px); /* 8 per row on very small phones */
  }
}
div#workText {
  letter-spacing: 2px;
  font-size: 18px;
  text-align: justify;
  text-indent: 1.5em;
}

.menu-contact > a {
  color: #1463ff !important;
}
