/* ==========================================================================
   Eamonn McCabe — style.css
   Rebuilt from the original BA Studio (2016) design. The desktop layout
   (>= 768px) reproduces the legacy fixed-width design pixel-for-pixel; the
   base (< 768px) rules are the net-new mobile-responsive layer. See
   ../../aio-refactor-spec.md.
   ========================================================================== */

:root {
  --color-text: #666;
  --color-heading: #000;
  --color-link: #000;
  --color-lighter: #767676; /* AA-darkened from legacy #999 (4.5:1 on white) */
  --color-nav-link: #003366;
  --color-order-link: #b85c00; /* AA-darkened from legacy #cc6600 (4.5:1 on white) */
  --color-contact-info: #330066;
  --color-bg: #fff;
  --color-container-bg: #666;
  --font-body: Arial, Helvetica, sans-serif;
  --content-width: 980px;
  --focus-ring: 3px solid #1a73e8;
}

/* ----- Reset (modern equivalent of reset.css) ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body, div, span, h1, h2, h3, h4, h5, h6, p, blockquote,
a, img, ul, li, form, label, figure, figcaption, nav, header, footer, main {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
/* Legacy leaves links at the browser default (underlined); only nav/footer/
   thumbnail links explicitly suppress it below. */
button { font: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1; /* legacy reset.css default; prose areas opt into 1.5/1.6 below */
}

h1, h2, h3, h4, h5, h6 {
  font-size: 22px;
  color: var(--color-heading);
  font-weight: bold;
  text-align: left;
  line-height: 1.3;
}

a { color: var(--color-link); }
strong { font-weight: bold; color: var(--color-heading); }
em { font-style: italic; }
ul.plain, .generic-text ul { padding: 0 0 0 20px; margin-bottom: 20px; }
.generic-text li { list-style: disc outside; }

.lighter { color: var(--color-lighter); }
.smaller { font-size: 14px; font-weight: normal; }
/* "Clean mode" (recommendllm.ai referral): toggled in main.js. Hidden by
   default so both crawlers and JS-disabled visitors see the site exactly
   as the estate left it. */
.rllm-clean-only { display: none; }
.rllm-clean-only.is-visible { display: block; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 8px; top: -48px;
  background: #000; color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* ==========================================================================
   Page frame
   ========================================================================== */

#container {
  background-color: var(--color-container-bg);
  background-image: linear-gradient(#666, #666), url(../img/em-background.jpg);
  background-position: center top;
  background-repeat: no-repeat;
}

#middle-container {
  background-image: url(../img/em-masthead-background.gif);
  background-repeat: repeat-x;
}

#inner-container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  position: relative;
  background: #fff;
}

/* ----- Masthead ----- */

#masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

#logo img, #photograher img { display: block; height: auto; }
#logo { max-width: 200px; }
#photograher { max-width: 170px; }

/* ----- Navigation (mobile-first: hamburger + drawer) ----- */

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}
.nav-toggle .bar {
  width: 22px;
  height: 2px;
  background: #000;
  display: block;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#navigation { padding: 0 16px 16px; }

/* Every page's content sits inside <main>; give it consistent edge
   breathing room on mobile (desktop gets its own box model further
   down, matching the legacy #contents column). */
main { padding: 0 16px 16px; }

ul.top-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
}
ul.top-nav.is-open { display: flex; }

ul.top-nav li { list-style: none; }
ul.top-nav li > a {
  display: block;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: #000;
  font-weight: bold;
  text-decoration: none;
}
ul.top-nav li > a:hover,
ul.top-nav li > a:focus-visible { background-color: #eee; }

ul.top-nav li.nav-03 ul, ul.top-nav li.nav-04 ul {
  display: flex;
  flex-direction: column;
  background: #fff;
}
ul.top-nav li.nav-03 ul li a, ul.top-nav li.nav-04 ul li a {
  min-height: 40px;
  padding: 8px 14px 8px 28px;
  font-size: 14px;
  font-weight: normal;
  color: #444;
}

/* ==========================================================================
   Home mosaic
   ========================================================================== */

#home-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}
.home-box { background: #333; overflow: hidden; }
.home-box img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1; }

/* ==========================================================================
   Generic content (biography / contact)
   ========================================================================== */

#lc { text-align: center; margin-bottom: 16px; }
#lc img { margin: 0 auto; border-radius: 4px; }

.generic-text { line-height: 1.6; }
.generic-text h1 { margin-bottom: 20px; line-height: inherit; }
/* Semantically a real heading (for document structure/AIO), styled to
   read as the plain text label the legacy design uses for it. */
.generic-text h2.section-label {
  font-size: inherit;
  font-weight: normal;
  color: inherit;
  line-height: inherit;
  margin: 0 0 20px;
}
.generic-text p { margin: 0 0 20px; }
.generic-text p:empty,
.generic-text p:has(> br:only-child) { display: none; }

#contact-section { margin-top: 16px; }
.contact-info { font-size: 15px; color: var(--color-contact-info); font-weight: bold; }
.generic-text p.contact-fact { margin-bottom: 0; }
.contact-fact a { text-decoration: underline; }

/* ==========================================================================
   Gallery index
   ========================================================================== */

#content-gal { line-height: 1.5; }

#title { padding: 0 0 12px; }
#title h1 { font-size: 20px; }
#title .smaller { display: block; margin-top: 4px; }
#title .smaller a { color: #000; font-weight: bold; text-decoration: underline; }

.gallery-count {
  font-weight: bold;
  font-size: 15px;
  padding: 6px 0 14px;
}
.gallery-count.gallery-count-bottom { text-align: center; }
.thumbnext { margin: 0 6px; }

#gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 10px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gallery-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 auto;
}
.gallery-item .thumb-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.gallery-item img { width: 100%; height: auto; }
.thumbtext {
  font-size: 13px;
  text-align: center;
  font-weight: bold;
  margin-top: 6px;
  color: var(--color-heading);
}

/* ==========================================================================
   Single image page
   ========================================================================== */

#content-single { line-height: 1.5; }

.gal-pagenav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  font-weight: bold;
}
.gal-pagenav a { color: #000; font-size: 15px; }
.gal-pagenav .is-disabled { color: #ccc; pointer-events: none; }

#single-lc { padding-bottom: 16px; line-height: 1.6; }
#single-lc .back-link { display: inline-block; margin-bottom: 10px; color: #000; }
.single-title { color: var(--color-heading); font-size: 18px; font-weight: bold; display: block; margin: 6px 0; }
.edition-line { font-size: 12px; margin-bottom: 6px; }
.print-size-label { font-size: 11px; }
.print-size-value { font-size: 12px; }
.price-order { margin-top: 10px; }
.price-order .price { font-size: 18px; font-weight: bold; color: #000; }
.price-order a { margin-left: 8px; color: #000; }

#single-content { text-align: center; }
#single-content img {
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
.image-caption {
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-lighter);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Footer
   ========================================================================== */

#footer { background-color: #fff; }
#inner-footer { max-width: var(--content-width); margin: 0 auto; padding: 20px 16px; }

#footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  font-size: 13px;
}
#footer-content a { font-weight: bold; text-decoration: none; }
#footer-content a:hover { text-decoration: underline; }
.footer-nav-group { }
.footer-nav-group > a {
  display: block;
  font-weight: bold;
  color: #000;
  margin-bottom: 8px;
}
.footer-nav-group ul li a {
  display: block;
  padding: 4px 0;
  color: var(--color-text);
}
#footer-left { font-size: 11px; }
.ba-studio { color: #000; font-size: 11px; }
.ba-studio a:hover { color: #5BAD9F; }
#footer-contact p { margin-bottom: 6px; }

/* ==========================================================================
   Desktop (>= 768px): reproduces the legacy fixed-width layout pixel-for-
   pixel. Do not "improve" these rules — see spec §4/§11.
   ========================================================================== */

@media (min-width: 768px) {
  body { font-size: 13px; }

  /* The legacy pixel values below (height/width + padding on the same
     element) were authored under the browser default of content-box.
     The site-wide border-box reset would silently shrink each box's
     content area, throwing off the masthead/nav/sidebar spacing —
     revert to content-box for this legacy-fidelity zone specifically. */
  #container, #container * {
    box-sizing: content-box;
  }

  #inner-container { width: var(--content-width); display: flow-root; }

  /* The legacy layout floats masthead/nav/content columns with no
     clearfix, which collapses their containing blocks to zero height.
     flow-root establishes a new block formatting context so each
     container correctly grows to contain its floated children. */
  header,
  #content-gal,
  #content-single,
  #footer-content {
    display: flow-root;
  }

  #masthead {
    display: block;
    width: 940px;
    height: 74px;
    padding: 10px;
  }
  #logo {
    float: left;
    width: 318px;
    height: 57px;
    padding-top: 23px;
    padding-left: 182px;
    max-width: none;
  }
  #photograher {
    float: left;
    width: 277px;
    height: 57px;
    padding-top: 23px;
    max-width: none;
  }

  .nav-toggle { display: none; }

  #navigation {
    float: left;
    width: 960px;
    height: 80px;
    padding: 0 0 0 10px;
    clear: left;
  }

  ul.top-nav {
    display: flex !important;
    flex-direction: row;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    gap: 0;
    overflow: visible;
  }
  ul.top-nav li { float: left; list-style: none; position: relative; }
  ul.top-nav li > a {
    display: block;
    height: 80px;
    min-height: 0;
    background-image: url(../img/em-nav.jpg);
    background-repeat: no-repeat;
    text-indent: -9999px;
    padding: 0;
    font-size: inherit;
  }

  ul.top-nav li.nav-01 > a { width: 158px; background-position: 0 0; }
  ul.top-nav li.nav-01 > a:hover { background-position: 0 -80px; }

  ul.top-nav li.nav-02 > a { width: 205px; background-position: -158px 0; }
  ul.top-nav li.nav-02 > a:hover { background-position: -158px -80px; }

  ul.top-nav li.nav-03 > a { width: 193px; background-position: -363px 0; }
  ul.top-nav li.nav-03 > a:hover { background-position: -363px -80px; }

  ul.top-nav li.nav-04 > a { width: 247px; background-position: -556px 0; }
  ul.top-nav li.nav-04 > a:hover { background-position: -556px -80px; }

  ul.top-nav li.nav-05 > a { width: 157px; background-position: -803px 0; }
  ul.top-nav li.nav-05 > a:hover { background-position: -803px -80px; }

  @media (min-resolution: 1.5dppx) {
    ul.top-nav li > a {
      background-image: url(../img/em-nav-hr.jpg);
      background-size: 960px 160px;
    }
  }

  ul.top-nav li.nav-03 ul, ul.top-nav li.nav-04 ul {
    display: none;
    flex-direction: column;
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
    background: none;
  }
  ul.top-nav li.nav-03:hover ul, ul.top-nav li.nav-03:focus-within ul,
  ul.top-nav li.nav-04:hover ul, ul.top-nav li.nav-04:focus-within ul {
    display: flex;
  }
  ul.top-nav li.nav-03 ul li, ul.top-nav li.nav-04 ul li {
    float: none;
    padding-top: 2px;
  }
  ul.top-nav li.nav-03 ul li a, ul.top-nav li.nav-04 ul li a {
    display: block;
    white-space: nowrap;
    height: auto;
    min-height: 0;
    text-indent: 0;
    color: #fff;
    text-align: center;
    padding: 9px 14px;
    font-weight: bold;
    font-size: 13px;
    background: #666;
    text-decoration: none;
  }
  ul.top-nav li.nav-03:hover > a, ul.top-nav li.nav-04:hover > a { text-decoration: underline; }
  ul.top-nav li.nav-03 ul li a:hover, ul.top-nav li.nav-04 ul li a:hover { background: #333; }

  /* Legacy wraps every page's content in #contents; the rebuild's
     equivalent element is <main> (present on every template), so the
     legacy box model is applied there instead of adding a redundant
     wrapper div. */
  main {
    display: flow-root;
    float: left;
    width: 960px;
    background-color: #fff;
    min-height: 600px;
    padding: 10px;
    padding-top: 30px;
  }

  h1, h2, h3, h4, h5, h6 { font-size: 28px; }
  #title h1 { font-size: 28px; }
  .smaller { font-size: 15px; }
  #title .smaller { display: inline; margin-top: 0; }

  /* Home mosaic: 4 across x 240px boxes, exactly as legacy */
  #home-content { display: block; padding: 0; }
  .home-box { float: left; width: 240px; height: 240px; }
  .home-box img { aspect-ratio: auto; }

  #lc { float: left; width: 200px; min-height: 200px; text-align: center; margin-bottom: 0; }
  #generic-text, .generic-text { float: left; width: 740px; line-height: 1.6; text-align: justify; }

  #content-gal { float: left; width: 960px; }
  #content-single { float: left; width: 960px; padding: 0; }

  #title { float: left; width: 600px; padding-left: 20px; }

  .gal-pagenav { float: right; text-align: right; padding: 10px 15px 0 0; min-height: 50px; min-width: 200px; display: block; }
  .gal-pagenav div { float: left; min-height: 50px; text-align: right; padding-left: 10px; min-width: 100px; }

  .gallery-count {
    float: right;
    width: auto;
    text-align: right;
    padding: 10px 15px 0 0;
    min-height: 50px;
    min-width: 200px;
    font-size: 18px;
  }
  .gallery-count.gallery-count-bottom {
    float: none;
    clear: both;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    min-height: 0;
    min-width: 0;
  }

  #gallery {
    display: grid;
    clear: both;
    grid-template-columns: repeat(4, 240px);
    column-gap: 0;
    row-gap: 26px;
    width: 960px;
    padding-top: 10px;
  }
  .gallery-item { width: 240px; text-align: center; }
  .gallery-item a { flex: 1 1 auto; }
  .gallery-item .thumb-frame {
    width: 100%;
  }
  .gallery-item img { width: auto; max-width: 215px; height: auto; max-height: 100%; object-fit: contain; margin: 0 auto; }
  .thumbtext { width: 240px; font-size: 14px; }

  #single-lc { float: left; clear: left; width: 180px; padding-top: 35px; padding-left: 10px; }
  #single-content { float: right; }
  #single-content img { max-width: 760px; }
  .image-caption { width: 760px; }

  #footer { height: 100px; }
  #inner-footer { width: 960px; padding-top: 15px; }
  #footer-content {
    display: flow-root;
    width: 960px;
    font-size: 14px;
    padding-bottom: 50px;
  }
  #footer-left { float: left; width: 205px; font-size: 10px; text-align: right; padding-right: 15px; }
  .footer-nav-group { float: left; padding-left: 10px; }
  .footer-nav-group > a { display: inline-block; margin-bottom: 0; text-transform: uppercase; }
  .footer-nav-group ul { padding-top: 7px; }
  .footer-nav-group ul li a { padding: 5px 0; text-align: left; }
  #footer-contact { float: right; min-width: 210px; }
}

@media (min-width: 980px) {
  #container {
    background-image: url(../img/em-background.jpg);
  }
}
