/* Grønbekk Bibliography. Values copied from groenbekk.com's Elementor styles:
   "Latest news" (post-556: headings Roboto Slab 200, cover shadow 14px 11px, 20% divider, 22px column padding),
   "Latest books" (Elementor Pro portfolio: 1.54 ratio, 30/20 gaps, #C90000B8 overlay, Roboto Slab 600 titles),
   the contact form button (Roboto 20px bold uppercase, 3.5px tracking, #FF0202), Elementor's fadeIn (1.25s). */

.gbib, .gbib-lb { --gbib-overlay: #C90000B8; --gbib-text: #7A7A7A; --gbib-secondary: #54595F; --gbib-red: #FF0202; }
.gbib *, .gbib-lb * { box-sizing: border-box; }
.gbib [hidden], .gbib-lb [hidden] { display: none !important; }
.gbib a, .gbib a:hover, .gbib a:active, .gbib-lb a, .gbib-lb a:hover { color: inherit; text-decoration: none; }
.gbib a:after, .gbib-lb a:after { content: none !important; }
.gbib img, .gbib-lb img { border: 0; max-width: 100%; height: auto; }

/* Section heading, like the "Latest news" heading + divider widgets */
.gbib-head { text-align: center; margin-bottom: 20px; }
.gbib .gbib-head__title { font-family: "Roboto Slab", Sans-serif; font-size: 36px; font-weight: 200; line-height: 1.3em; color: #000; margin: 0; padding: 0; }
.gbib-head .gbib-divider { margin-top: 20px; }
.gbib-divider { display: flex; padding-block: 2px; }
.gbib-divider span { display: block; width: 20%; border-top: 1px solid #000; }
.gbib-divider--center { padding-block: 15px; }
.gbib-divider--center span { width: 10%; margin: 0 auto; }

/* ---------------------------------------------------------------- Latest (3-up row) */
.gbib-latest__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-inline: -10px; align-items: start; }
.gbib-latest__item { padding: 22px; min-width: 0; }
.gbib-latest__cover { margin: 0 0 35px; }
.gbib-latest__cover > a, .gbib-latest__cover > img, .gbib-latest__cover > .gbib-ph { display: block; box-shadow: 14px 11px 0 0 rgba(0, 0, 0, .5); }
.gbib-latest__cover img { display: block; width: 100%; }
.gbib-latest__cover .gbib-ph { aspect-ratio: 2 / 3; }
.gbib .gbib-latest__title { font-family: "Roboto Slab", Sans-serif; font-size: 28px; font-weight: 200; line-height: 1.3em; color: #000; margin: 0 0 20px; padding: 0; }
.gbib .gbib-latest__title b { font-weight: bolder; }
.gbib .gbib-latest__meta { font-family: "Roboto", Sans-serif; font-size: 15px; line-height: 1.5; color: var(--gbib-text); margin: -8px 0 20px; }
@media (max-width: 767px) {
  .gbib-latest__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gbib .gbib-latest__title { font-size: 20px; }
}

/* ---------------------------------------------------------------- Books (portfolio grid) */
.gbib-filterbar { margin: 0 0 10px; }
.gbib-filters { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; padding: 0; margin: 0; }
.gbib button.gbib-filter.is-empty { opacity: .4; }
.gbib-filters li { margin: 0 5px; list-style: none; }
.gbib-filters li:first-child { margin-left: 0; }
.gbib-filters li:last-child { margin-right: 0; }
.gbib button.gbib-filter, .gbib button.gbib-filter:hover, .gbib button.gbib-filter:focus {
  font-family: "Roboto Slab", Sans-serif; font-weight: 600; font-size: 1rem; line-height: 1.5; color: var(--gbib-text);
  background: none; border: 0; border-radius: 0; padding: 8px; margin: 0; cursor: pointer; white-space: nowrap; text-transform: none; letter-spacing: normal;
}
.gbib button.gbib-filter.is-active { color: #000; }
.gbib button.gbib-filter:focus-visible { outline: 1px auto -webkit-focus-ring-color; }

.gbib-grid { --gbib-cols: 5; --gbib-row-gap: 30px; --gbib-col-gap: 20px; --gbib-ratio: 1.54;
  position: relative; display: grid; grid-template-columns: repeat(var(--gbib-cols), minmax(0, 1fr)); gap: var(--gbib-row-gap) var(--gbib-col-gap); align-items: start; }
.gbib-item { margin: 0; min-width: 0; overflow: hidden; transform-style: preserve-3d; }
.gbib-item__link { position: relative; display: block; width: 100%; padding-bottom: calc(var(--gbib-ratio) * 100%); }
.gbib-item__img { position: absolute; inset: 0; overflow: hidden; background-color: rgba(0, 0, 0, .1); }
.gbib-item__img img { display: block; position: absolute; top: calc(50% + 1px); left: calc(50% + 1px); width: 100%; height: auto; max-width: none; transform: scale(1.01) translate(-50%, -50%); }
.gbib-item__img .gbib-ph { position: absolute; inset: 0; }
.gbib-item__overlay { position: absolute; inset: 0; padding: 15px; display: flex; flex-direction: column; justify-content: center; text-align: center; overflow: hidden;
  background-color: var(--gbib-overlay); opacity: 0; transition: opacity 1s; }
.gbib-item:hover .gbib-item__overlay, .gbib-item:focus-within .gbib-item__overlay { opacity: 1; transition: opacity .5s; }
.gbib .gbib-item__title { font-family: "Roboto Slab", Sans-serif; font-weight: 600; font-size: 18px; line-height: 1; color: #fff; margin: 0; padding: 0; }
.gbib-item__link:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
@media (max-width: 1024px) { .gbib-grid { --gbib-cols: 2; } }
@media (max-width: 767px) { .gbib-grid { --gbib-cols: 1; } }

/* Filter animation (recreates the portfolio widget's scale/fade and reflow) */
.gbib-ghost { pointer-events: none; z-index: 0; }
.gbib-moving { transition: transform .5s ease-in-out, opacity .5s ease-in-out; }
.gbib-grid.gbib-resizing { transition: height .5s; }

/* Placeholder for books without a cover image */
.gbib-ph { display: flex; align-items: center; justify-content: center; padding: 12%; background: #f2f2f2; color: #000;
  font-family: "Roboto Slab", Sans-serif; font-weight: 200; font-size: 18px; line-height: 1.3; text-align: center; }

/* Show more: the site's form button */
.gbib-more { text-align: center; padding: 22px 0 0; }
.gbib button.gbib-button, .gbib button.gbib-button:focus {
  display: inline-block; font-family: "Roboto", Sans-serif; font-size: 20px; font-weight: bold; text-transform: uppercase; line-height: 2em; letter-spacing: 3.5px;
  background-color: var(--gbib-red); color: #000; border: 0; border-radius: 0; padding: 12px 24px; margin: 0; cursor: pointer; transition: all .3s; white-space: nowrap;
}
.gbib button.gbib-button:hover { background-color: var(--gbib-red); color: #fff; }
.gbib button.gbib-button:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* Entrance animation: Elementor's fadeIn */
@keyframes gbibFadeIn { from { opacity: 0; } to { opacity: 1; } }
.gbib-invisible { visibility: hidden; }
.gbib-fade { animation: gbibFadeIn 1.25s both; }

.gbib-notice { padding: 16px; border: 1px dashed #c00; font: 14px/1.4 sans-serif; color: #900; background: #fff6f6; }

/* ---------------------------------------------------------------- Lightbox */
.gbib-lb { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #000; overflow: hidden; }
.gbib-lb::backdrop { background: rgba(0, 0, 0, .85); }
.gbib-lb[open] { display: flex; align-items: center; justify-content: center; animation: gbibFadeIn .5s both; }
.gbib-lb[open]::backdrop { animation: gbibFadeIn .5s both; }
.gbib-lb__panel { position: relative; width: min(1080px, calc(100% - 160px)); max-height: calc(100% - 48px); overflow: auto; background: #fff; padding: 48px; overscroll-behavior: contain; }
.gbib-lb__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
.gbib-lb__body.gbib-fade { animation-duration: .4s; }
.gbib-lb__figure { margin: 0; }
.gbib-lb__img { display: block; box-shadow: 14px 11px 0 0 rgba(0, 0, 0, .5); background: #f2f2f2; }
.gbib-lb__img img { display: block; width: 100%; }
.gbib-lb__img .gbib-ph { aspect-ratio: 2 / 3; }
.gbib-lb__cap { margin: 22px 0 0; font-family: "Roboto", Sans-serif; font-size: 14px; color: var(--gbib-text); }
.gbib-lb .gbib-lb__title { font-family: "Roboto Slab", Sans-serif; font-size: 28px; font-weight: 200; line-height: 1.3em; color: #000; margin: 0 0 20px; padding: 0; }
.gbib-lb .gbib-lb__title b { font-weight: bolder; }
.gbib-lb .gbib-divider { margin-bottom: 20px; }
.gbib-lb__meta { font-family: "Roboto", Sans-serif; font-size: 15px; line-height: 1.6; color: var(--gbib-text); margin: 0 0 24px; }
.gbib-lb__sec { font-family: "Roboto Slab", Sans-serif; font-weight: 200; font-size: 20px; line-height: 1.3; margin: 24px 0 12px; color: #000; }
.gbib-lb__credits { margin: 0 0 8px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-family: "Roboto", Sans-serif; font-size: 15px; line-height: 1.5; }
.gbib-lb__credits dt { font-family: "Roboto Slab", Sans-serif; font-weight: 600; color: #000; margin: 0; }
.gbib-lb__credits dd { margin: 0; color: var(--gbib-secondary); }
.gbib-lb__credits .me { color: #000; font-weight: 500; }
.gbib-lb .gbib-lb__credits a { border-bottom: 1px solid rgba(0, 0, 0, .25); }
.gbib-lb .gbib-lb__credits a:hover, .gbib-lb .gbib-lb__credits a:focus-visible { color: #C90000; border-color: #C90000; }
.gbib-lb__credits small { color: var(--gbib-text); font-size: 13px; }
.gbib-lb__covers { margin-top: 28px; }
.gbib-lb__covers-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 236px; overflow: auto; padding: 2px; }
.gbib-lb button.gbib-lb__thumb, .gbib-lb button.gbib-lb__thumb:hover, .gbib-lb button.gbib-lb__thumb:focus {
  width: 64px; padding: 0; margin: 0; border: 0; border-radius: 0; background: #f2f2f2; cursor: pointer; line-height: 0; opacity: .6; transition: opacity .3s; }
.gbib-lb button.gbib-lb__thumb[aria-current="true"], .gbib-lb button.gbib-lb__thumb:hover { opacity: 1; box-shadow: 4px 3px 0 0 rgba(0, 0, 0, .5); }
.gbib-lb button.gbib-lb__thumb:focus-visible { outline: 2px solid #000; outline-offset: 2px; opacity: 1; }
.gbib-lb__thumb img { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; }
.gbib-lb__links { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: "Roboto Slab", Sans-serif; font-size: 16px; }
.gbib-lb__links a { border-bottom: 1px solid #000; }
.gbib-lb__links a:hover { color: #C90000; border-color: #C90000; }
.gbib-lb__status { font-family: "Roboto", Sans-serif; color: var(--gbib-text); }

/* Layout rules carry no :hover/:focus, so a focused button never moves. Only colour and background
   need the :hover/:focus variants, to beat the theme's button:hover/:focus colours. */
.gbib-lb .gbib-lb__btn { position: absolute; margin: 0; }
.gbib-lb button.gbib-lb__btn { display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0;
  cursor: pointer; line-height: 1; transition: opacity .3s; opacity: .8; }
.gbib-lb button.gbib-lb__btn, .gbib-lb button.gbib-lb__btn:hover, .gbib-lb button.gbib-lb__btn:focus { background: none; color: #fff; }
.gbib-lb button.gbib-lb__btn:hover, .gbib-lb button.gbib-lb__btn:focus-visible { opacity: 1; }
.gbib-lb button.gbib-lb__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gbib-lb__btn svg { display: block; }
.gbib-lb button.gbib-lb__prev, .gbib-lb button.gbib-lb__next { top: calc(50% - 48px); width: 64px; height: 96px; }
.gbib-lb button.gbib-lb__prev { left: 8px; }
.gbib-lb button.gbib-lb__next { right: 8px; }
.gbib-lb button.gbib-lb__close { top: 12px; right: 12px; width: 48px; height: 48px; }
.gbib-lb__count { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-family: "Roboto", Sans-serif; font-size: 14px; letter-spacing: 1px; color: rgba(255, 255, 255, .8); pointer-events: none; }

@media (max-width: 1024px) {
  .gbib-lb__panel { width: calc(100% - 120px); padding: 36px; }
  .gbib-lb__body { gap: 32px; }
}
@media (max-width: 767px) {
  .gbib-lb { align-items: stretch !important; }
  .gbib-lb__panel { width: 100%; max-height: none; height: 100%; padding: 64px 22px 96px; }
  .gbib-lb__body { grid-template-columns: 1fr; gap: 28px; }
  .gbib-lb__figure { max-width: 420px; margin-right: 14px; }
  .gbib-lb .gbib-lb__title { font-size: 20px; }
  .gbib-lb button.gbib-lb__btn, .gbib-lb button.gbib-lb__btn:hover, .gbib-lb button.gbib-lb__btn:focus { color: #000; background: #fff; }
  .gbib-lb button.gbib-lb__btn { opacity: 1; }
  .gbib-lb button.gbib-lb__prev, .gbib-lb button.gbib-lb__next { position: fixed; top: auto; bottom: 0; height: 64px; width: 50%; border-top: 1px solid #000; }
  .gbib-lb button.gbib-lb__prev { left: 0; border-right: 1px solid #000; }
  .gbib-lb button.gbib-lb__next { right: 0; }
  .gbib-lb button.gbib-lb__close { position: fixed; top: 8px; right: 8px; }
  .gbib-lb button.gbib-lb__btn:focus-visible { outline-color: #000; outline-offset: -4px; }
  .gbib-lb__count { position: fixed; top: 22px; bottom: auto; left: 22px; right: auto; color: var(--gbib-text); }
}

@media (prefers-reduced-motion: reduce) {
  .gbib-fade, .gbib-lb[open], .gbib-lb[open]::backdrop { animation: none !important; }
  .gbib-moving, .gbib-grid.gbib-resizing, .gbib-item__overlay { transition: none !important; }
}
