/*
Theme Name: Joanne Bamber Photography
Description: Recreation of the original Joanne Bamber Photography Wix site. Slideshows, card grids and thumbnail grids are ordinary Gallery blocks with a style chosen in the block sidebar (Slideshow, Cards, Thumbnail grid).
Version: 1.2.1
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: jb-photography
*/

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(assets/fonts/EBGaramond-latin-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url(assets/fonts/EBGaramond-latin-italic.woff2) format('woff2');
}

:root {
  --jb-ink: rgb(48, 45, 45);
  --jb-grey: rgb(170, 170, 170);
  --jb-col: 980px;
  --jb-serif: 'EB Garamond', Georgia, serif;
  --jb-sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--jb-ink);
  font-family: var(--jb-sans);
  font-size: 15px;
  line-height: 1.35;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.screen-reader-text:focus {
  position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto;
  background: #fff; padding: 8px 12px; z-index: 1000;
}

/* Page background photo (the page's featured image), washed out as on the old site */
.jb-page-bg {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  opacity: 0.55;
}

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--jb-ink); }
.site-header .inner { max-width: var(--jb-col); margin: 0 auto; padding: 4px 12px 0; }
.site-branding { text-align: right; padding-right: 8px; }
.site-title {
  display: inline-block; margin: 0; text-align: center;
  font: italic 400 26px/34px var(--jb-serif);
}
.site-title a { text-decoration: none; }
.site-title span { display: block; }
.site-nav { margin-top: 20px; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0 0 10px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 30px;
}
.site-nav a {
  font: 700 16px/22px var(--jb-sans);
  color: var(--jb-grey); text-decoration: none; white-space: nowrap;
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--jb-ink); }

/* Main column */
.site-main { min-height: 60vh; }
.entry { max-width: var(--jb-col); margin: 0 auto; padding: 12px 12px 24px; }
.entry > * { margin-top: 0; }
.entry > .alignfull,
.entry > .jb-slideshow { max-width: none; }

/* Footer */
.site-footer {
  background: #fff; border-top: 1px solid var(--jb-ink);
  text-align: center; font-size: 12px; color: var(--jb-grey); padding: 6px 12px 10px;
}

/* Text styles used in page content */
.jb-tagline { margin: 0; text-align: center; font: 400 16px/21px var(--jb-serif); }
.jb-tagline strong { font-weight: 700; }
.jb-heading-spaced {
  margin: 8px 0 28px; text-align: center;
  font: 700 18px/23px var(--jb-sans); letter-spacing: 5.4px;
}
.jb-letter {
  margin: 0 20px 16px; text-align: justify; color: #000;
  font: 400 15px/18.7px var(--jb-sans); letter-spacing: 1.5px;
}
.jb-script-heading {
  margin: 24px 0 40px; text-align: center;
  font: italic 400 40px/1.2 var(--jb-serif);
}

/* ---------- Slideshow: Gallery block with class "jb-slideshow" ---------- */
.entry.has-slideshow { max-width: none; padding: 0 0 6px; }
.wp-block-gallery.has-nested-images.jb-slideshow {
  display: block !important; position: relative;
  width: 100%; margin: 3px auto 8px;
  height: clamp(300px, calc(100vh - 250px), 780px);
  cursor: pointer;
}
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image {
  display: none !important; position: absolute; inset: 0;
  width: 100% !important; height: 100%; margin: 0 !important;
  opacity: 0; transition: opacity 1s ease;
}
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image.is-ready,
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image.is-active { display: block !important; }
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image.is-active { opacity: 1; z-index: 1; }
/* Before the script runs, show the first slide */
.wp-block-gallery.has-nested-images.jb-slideshow:not(.is-running) figure.wp-block-image:first-child {
  display: block !important; opacity: 1;
}
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image img {
  display: block; width: 100% !important; height: 100% !important;
  object-fit: contain !important; border-radius: 0;
}
.wp-block-gallery.has-nested-images.jb-slideshow.has-captions figure.wp-block-image img { height: calc(100% - 34px) !important; }
.jb-slideshow-counter {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  font: 400 12px/1 var(--jb-sans); color: var(--jb-grey);
}

/* Captions: undo the core overlay styling for all three gallery styles */
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image::before,
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image::before,
.wp-block-gallery.has-nested-images.jb-grid figure.wp-block-image::before { display: none !important; }
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image figcaption,
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image figcaption {
  position: static !important; background: none !important; color: var(--jb-ink) !important;
  text-shadow: none !important; max-height: none !important; overflow: visible !important;
  width: auto !important; margin: 0 !important; scrollbar-width: none;
}
.wp-block-gallery.has-nested-images.jb-slideshow figure.wp-block-image figcaption {
  height: 34px; padding: 0 12px !important; text-align: center !important;
  font: 400 16px/34px var(--jb-serif) !important;
}

/* ---------- Cards: Gallery block with class "jb-cards" ---------- */
.wp-block-gallery.has-nested-images.jb-cards {
  display: flex !important; flex-wrap: nowrap !important; align-items: flex-start !important;
  gap: 14px !important; max-width: 970px; margin: 0 auto;
}
.jb-cards-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image {
  display: block !important; width: 100% !important; margin: 0 !important;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.wp-block-gallery.has-nested-images.jb-cards:not(.is-laid-out) {
  display: block !important; column-count: 2; column-gap: 14px;
}
.wp-block-gallery.has-nested-images.jb-cards:not(.is-laid-out) figure.wp-block-image {
  break-inside: avoid; margin-bottom: 14px !important;
}
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image img {
  display: block; width: 100% !important; height: auto !important; object-fit: fill !important; border-radius: 0;
}
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image figcaption {
  padding: 20px 20px 22px !important; text-align: left !important; color: #000 !important;
  font: 400 12px/16px var(--jb-sans) !important;
}
.wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image figcaption strong {
  display: block; margin-bottom: 10px; font: 400 18px/24px var(--jb-sans);
}

/* ---------- Thumbnail grid: Gallery block with class "jb-grid" ---------- */
.wp-block-gallery.has-nested-images.jb-grid {
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 300px));
  gap: 20px !important; justify-content: center; margin: 0 auto 60px;
}
.wp-block-gallery.has-nested-images.jb-grid figure.wp-block-image {
  width: auto !important; margin: 0 !important; aspect-ratio: 1 / 1; overflow: hidden;
}
.wp-block-gallery.has-nested-images.jb-grid figure.wp-block-image img {
  display: block; width: 100% !important; height: 100% !important; object-fit: cover !important; border-radius: 0;
}
.wp-block-gallery.has-nested-images.jb-grid figure.wp-block-image figcaption { display: none !important; }

/* ---------- Contact form ---------- */
.jb-contact { display: flex; justify-content: center; align-items: flex-end; gap: 44px; margin: 22px 0 40px; flex-wrap: wrap; }
.jb-contact form { width: 530px; max-width: 100%; }
.jb-contact input[type=text],
.jb-contact input[type=email],
.jb-contact textarea {
  display: block; width: 100%; margin: 0 0 5px; padding: 3px 5px;
  font: 400 15px/1.4 var(--jb-serif); color: var(--jb-ink);
  background: #fff; border: 1px solid var(--jb-ink); border-radius: 0;
}
.jb-contact input[type=text], .jb-contact input[type=email] { height: 33px; }
.jb-contact textarea { height: 130px; resize: vertical; }
.jb-contact .jb-hp { position: absolute; left: -9999px; }
.jb-contact button {
  float: right; padding: 6px 6px; border: 0; cursor: pointer;
  font: 400 15px/1.2 var(--jb-serif); color: #fff; background: var(--jb-ink);
}
.jb-contact button:hover { background: #000; }
.jb-contact-note { clear: both; margin: 8px 0 0; font: 400 15px/1.4 var(--jb-serif); }
.jb-social { display: flex; gap: 12px; padding-bottom: 36px; }
.jb-social img { display: block; width: 50px; height: 50px; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  .site-branding { text-align: center; padding-right: 0; }
  .site-nav ul { gap: 2px 18px; }
  .site-nav a { font-size: 14px; }
  .wp-block-gallery.has-nested-images.jb-slideshow { height: clamp(240px, 62vw, 780px); }
  .wp-block-gallery.has-nested-images.jb-cards,
  .wp-block-gallery.has-nested-images.jb-cards:not(.is-laid-out) { display: block !important; column-count: 1; }
  .jb-cards-col { display: contents; }
  .wp-block-gallery.has-nested-images.jb-cards figure.wp-block-image { margin-bottom: 14px !important; }
  .wp-block-gallery.has-nested-images.jb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px !important; }
  .jb-heading-spaced { letter-spacing: 2px; }
  .jb-letter { margin: 0 4px 16px; text-align: left; letter-spacing: 0.5px; }
  .jb-social { padding-bottom: 0; }
}
