/* Villa Catalana Cellars. Builds on Bootswatch Spacelab 4.6, the theme the
   payments site uses, so the two sites look related. */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #555;
}

.skip-link:focus {
  position: absolute;
  z-index: 10;
  padding: .5rem 1rem;
  background: #fff;
}

/* Shown to logged-in staff. */
.staff-bar {
  padding: .35rem 0;
  font-size: .85rem;
  background: #333;
}

.staff-bar a,
.staff-bar .btn-link {
  margin-right: 1.25rem;
  color: #fff;
}

.staff-bar .btn-link {
  margin-right: 0;
  font-size: .85rem;
}

/* Header */
.site-header .site-logo {
  display: block;
  width: max-content;
  margin: 1rem auto;
}

.site-nav {
  padding-top: .25rem;
  padding-bottom: .25rem;
}

.site-nav .nav-link {
  padding-left: .9rem !important;
  padding-right: .9rem !important;
}

.site-nav .navbar-toggler {
  margin-left: auto;
}

/* Main content */
.site-main {
  flex: 1 0 auto;
  max-width: 960px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.page-title {
  margin-bottom: 1.5rem;
  color: #333;
  font-size: 2rem;
}

.page-content {
  font-size: 1rem;
  line-height: 1.65;
}

.page-content h2,
.page-content h3,
.page-content h4 {
  margin-top: 1.5rem;
  color: #333;
}

.page-content hr {
  margin: 2rem 0;
  border-top: 1px solid #ccc;
}

.page-content img {
  max-width: 100%;
  height: auto;
}

.page-content iframe {
  max-width: 100%;
}

.page-content table {
  max-width: 100%;
}

.page-content .btn-block + br,
.page-content .text-center > .btn-block {
  margin: 1rem 0;
}

.page-content a.btn-primary {
  color: #fff;
}

.page-content .btn-block {
  white-space: normal;
}

/* Collapsible sections (TinyMCE "Accordion"). */
.page-content details {
  margin-bottom: .5rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: .25rem;
}

.page-content details > summary {
  padding: .75rem 1rem;
  color: #333;
  font-weight: 700;
  cursor: pointer;
}

.page-content details > summary:hover {
  background: #eaeaea;
}

.page-content details[open] > summary {
  border-bottom: 1px solid #ddd;
}

.page-content details > :not(summary) {
  margin: .75rem 1rem;
}

/* Photo galleries in the travel pages. */
.lsb-gallery img {
  margin: 5px 10px 10px;
  border: 6px solid #848383;
  border-radius: 5px;
}

@media (max-width: 575.98px) {
  .page-content img[align],
  .page-content img[style*="float"] {
    float: none !important;
    display: block;
    margin: 1rem auto !important;
  }
}

/* Article layout with photos. Wrap content in <div class="article">.
   - figure.photo.photo-left / .photo-right: a photo floated beside the text
     (add .photo-small or .photo-wide to change its width)
   - div.photo-pair.photo-left / .photo-right: two portrait photos side by side
   - div.photo-row: landscape photos in a full-width row
   - div.photo-grid: a gallery of uniform thumbnails
   - div.callout: a shaded aside */
.article {
  font-size: 1.05rem;
  line-height: 1.7;
}

.article .lead {
  font-size: 1.2rem;
}

.article h3 {
  clear: both;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

.photo {
  margin: 0 0 1rem;
}

.photo img,
.photo-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.photo a:hover img,
.photo-grid a:hover img {
  opacity: .9;
}

.photo figcaption {
  margin-top: .35rem;
  color: #777;
  font-size: .85rem;
  font-style: italic;
  line-height: 1.3;
  text-align: center;
}

.photo-left,
.photo-right {
  width: 30%;
  max-width: 260px;
}

/* Start each floated photo below earlier ones so floats never squeeze text
   into a narrow column between them. */
.photo-left,
.photo-right {
  clear: both;
}

.photo-left {
  float: left;
  margin: .3rem 1.75rem 1rem 0;
}

.photo-right {
  float: right;
  margin: .3rem 0 1rem 1.75rem;
}

/* Floated portrait photos show a 3:4 crop; the lightbox shows the whole photo. */
.photo-left img,
.photo-right img,
.photo-pair img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.photo-wide img {
  aspect-ratio: auto;
}

.photo-small {
  width: 22%;
  max-width: 180px;
}

.photo-wide {
  width: 46%;
  max-width: 440px;
}

.photo-pair {
  display: flex;
  gap: .75rem;
  width: 44%;
  max-width: 400px;
}

.photo-pair .photo {
  flex: 1 1 0;
  min-width: 0;
}

.photo-row {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.photo-row .photo {
  margin: 0;
}

.photo-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}

.photo-grid img {
  aspect-ratio: 1;
  object-fit: cover;
}

.callout {
  display: flow-root;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem .5rem;
  background: #f5f5f5;
  border-left: 4px solid #446e9b;
  border-radius: .25rem;
}

.callout h4 {
  margin-top: 0;
  font-size: 1.15rem;
}

@media (max-width: 575.98px) {
  .photo-left,
  .photo-right,
  .photo-pair {
    float: none;
    width: auto;
    max-width: none;
    margin: 1rem auto;
  }

  .photo-left,
  .photo-right {
    width: 75%;
  }

  .photo-small {
    width: 50%;
  }

  .photo-wide {
    width: 100%;
  }
}

/* Home page slideshow: shows the first image without JavaScript. */
.slideshow {
  position: relative;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border-radius: .25rem;
  aspect-ratio: 2 / 1;
  background: #eee;
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slideshow img:first-child,
.slideshow.is-running img.is-current {
  opacity: 1;
}

.slideshow.is-running img:first-child:not(.is-current) {
  opacity: 0;
}

.slideshow-dots {
  position: absolute;
  right: 0;
  bottom: .5rem;
  left: 0;
  text-align: center;
}

.slideshow-dots button {
  width: 10px;
  height: 10px;
  margin: 0 3px;
  padding: 0;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(0, 0, 0, .4);
  border-radius: 50%;
}

.slideshow-dots button[aria-current="true"] {
  background: #fff;
}

/* Lightbox for gallery links. */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: rgba(0, 0, 0, .85);
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 20px rgba(0, 0, 0, .6);
}

.lightbox-overlay button {
  position: absolute;
  padding: .25rem .75rem;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: 0;
}

.lightbox-overlay .lightbox-close { top: .5rem; right: .5rem; }
.lightbox-overlay .lightbox-prev { left: .25rem; }
.lightbox-overlay .lightbox-next { right: .25rem; }

/* Footer */
.site-footer {
  flex-shrink: 0;
  padding: 2rem 0 1.5rem;
  font-size: .9rem;
  background: #eee;
  border-top: 1px solid #ddd;
}

.footer-links li {
  margin-bottom: .35rem;
}

/* Payments pages bring their own .container, so don't cap the width twice. */
.site-main--app {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

/* Receipts get printed; print the content only. */
@media print {
  .staff-bar,
  .site-header,
  .site-footer {
    display: none !important;
  }
}
