/* Styles for photography.html only. Colours and fonts follow the home page theme. */

.photography-page { display: flex; flex-direction: column; min-height: 100vh; }
.photography-page > section { flex: 1; padding-top: 130px; }
.gallery-heading { font-size: 40px; margin-top: 0; }
.photography-page .section-subheading { font-style: normal; }

/* As many columns as fit: one on a phone, up to three or four on a wide screen. */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-gap: 30px;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gallery li { background: #fff; display: flex; flex-direction: column; min-width: 0; }

.photo-button { display: block; position: relative; width: 100%; padding: 66.67% 0 0; border: 0; background: #ddd; overflow: hidden; }
.photo-button img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photo-button:hover img, .photo-button:focus img { transform: scale(1.05); }
.photo-button:focus { outline: 3px solid #fed136; outline-offset: 2px; }
.photo-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(254, 209, 54, .85); color: #fff; opacity: 0; transition: opacity .3s;
}
.photo-button:hover .photo-overlay, .photo-button:focus .photo-overlay { opacity: 1; }

.photo-caption { text-align: center; padding: 20px; }
.photo-caption h4 { margin: 0; text-transform: none; }
.photo-caption p { margin: 8px 0 0; font-family: "Droid Serif", Georgia, serif; font-style: normal; }
.gallery-empty { grid-column: 1 / -1; text-align: center; }

/* Large view */
.viewer {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 20, 20, .96); color: #fff; padding: 60px 70px 20px;
}
.viewer[hidden], .viewer [hidden] { display: none; }
.viewer-figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; min-height: 0; }
.viewer-image { max-width: 100%; max-height: calc(100vh - 200px); min-height: 0; object-fit: contain; }
.viewer-caption { text-align: center; max-width: 700px; max-height: 110px; overflow-y: auto; }
.viewer-title { color: #fed136; text-transform: none; margin: 15px 0 5px; }
.viewer-description { margin: 5px 0 0; }
.viewer-button { position: absolute; width: 46px; height: 46px; border: 0; border-radius: 50%; background: #fed136; color: #222; font-size: 18px; }
.viewer-button:hover, .viewer-button:focus { background: #fec503; outline: 2px solid #fff; }
.viewer-close { top: 12px; right: 12px; }
.viewer-previous { left: 12px; top: 50%; margin-top: -23px; }
.viewer-next { right: 12px; top: 50%; margin-top: -23px; }
body.viewer-open { overflow: hidden; }

/* Phones: arrows move to the bottom corners so the photo can use the full width. */
@media (max-width: 767px) {
  .photography-page > section { padding-top: 100px; }
  .viewer { padding: 66px 10px 70px; }
  .viewer-previous, .viewer-next { top: auto; bottom: 12px; margin-top: 0; }
  .viewer-image { max-height: calc(100vh - 260px); }
}

/* Phones held sideways: very little height, so the photo gets the whole screen. The buttons and
   any caption sit on top of it. Must stay after the narrow-screen rules, which it overrides. */
@media (orientation: landscape) and (max-height: 600px) {
  .viewer { padding: 0; }
  .viewer-figure { position: relative; width: 100%; height: 100%; }
  .viewer-image { width: 100%; height: 100%; max-height: none; }
  .viewer-caption { position: absolute; left: 0; right: 0; bottom: 0; max-width: none; max-height: 35%; background: rgba(0, 0, 0, .65); }
  .viewer-title { margin: 6px 10px; }
  .viewer-description { margin: 6px 10px; }
  .viewer-button { z-index: 1; width: 40px; height: 40px; font-size: 16px; opacity: .85; }
  .viewer-close { top: 8px; right: 8px; }
  .viewer-previous, .viewer-next { top: 50%; bottom: auto; margin-top: -20px; }
  .viewer-previous { left: 8px; }
  .viewer-next { right: 8px; }
}
