/* Gallery title overlay */
.photonic-flickr-stream figure.photonic-thumb > a {
    position: relative;
    display: block;
    overflow: hidden;
}

.photonic-tooltip {
    display: none !important;
}

.photonic-flickr-stream figure.photonic-thumb > a::after {
    content: attr(data-photo-title);
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    box-sizing: border-box;
    padding: 38px 16px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.48) 55%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    opacity: 0;
    transform: translateY(7px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.photonic-flickr-stream figure.photonic-thumb > a:hover::after,
.photonic-flickr-stream figure.photonic-thumb > a:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.photonic-flickr-stream figure.photonic-thumb > a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -5px;
}

/* Keep BaguetteBox's native centring. Only reserve room for our caption panel. */
#baguetteBox-overlay .full-image img {
    max-width: calc(100vw - 120px) !important;
    max-height: calc(100vh - 230px) !important;
    object-fit: contain;
}

/* Hide BaguetteBox/Photonic's original caption. */
#baguetteBox-overlay .full-image figcaption {
    display: none !important;
}

#baguetteBox-overlay .birley-lightbox-caption-panel {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 100005;
    box-sizing: border-box;
    width: min(1100px, calc(100vw - 150px));
    max-height: 180px;
    padding: 17px 22px 19px;
    overflow-y: auto;
    transform: translateX(-50%);
    background: rgba(16, 16, 16, 0.94);
    color: #fff;
    text-align: left;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
}

#baguetteBox-overlay .birley-lightbox-caption-panel[hidden] {
    display: none !important;
}

#baguetteBox-overlay .birley-photonic-title {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(20px, 2vw, 27px);
    font-weight: 600;
    line-height: 1.2;
}

#baguetteBox-overlay .birley-photonic-description {
    color: rgba(255, 255, 255, 0.84);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
}

@media (hover: none), (max-width: 767px) {
    .photonic-flickr-stream figure.photonic-thumb > a::after {
        padding: 30px 12px 11px;
        font-size: 14px;
        opacity: 1;
        transform: none;
    }

    #baguetteBox-overlay .full-image img {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 245px) !important;
    }

    #baguetteBox-overlay .birley-lightbox-caption-panel {
        bottom: 10px;
        width: calc(100vw - 24px);
        max-height: 195px;
        padding: 14px 16px 17px;
    }

    #baguetteBox-overlay .birley-photonic-title {
        font-size: 20px;
    }

    #baguetteBox-overlay .birley-photonic-description {
        font-size: 14px;
        line-height: 1.45;
    }
}

/* Responsive ACF-driven YouTube embed. */
.birley-youtube-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.birley-youtube-embed iframe,
.birley-youtube-embed object,
.birley-youtube-embed embed {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

/* Photonic album header is redundant inside a post and links away to Flickr. */
.birley-flickr-gallery .photonic-object-header.photonic-flickr-set,
.birley-flickr-gallery header.photonic-object-header {
    display: none !important;
}

/* Avoid a visible empty gap while the album count is being populated. */
.birley-photo-count:empty {
    display: none;
}


/* Make Flickr video tiles obvious before hover, even when Flickr supplies no poster image. */
.photonic-flickr-stream figure.birley-photonic-video-tile > a {
    min-height: 140px;
    background: #08111d;
}

.photonic-flickr-stream .birley-video-indicator {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.28) 100%);
}

.photonic-flickr-stream .birley-video-play {
    position: relative;
    display: block;
    width: 58px;
    height: 58px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    background: rgba(5, 14, 25, 0.72);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.38);
    transition: transform 180ms ease, background-color 180ms ease;
}

.photonic-flickr-stream .birley-video-play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 52%;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    transform: translate(-38%, -50%);
}

.photonic-flickr-stream .birley-video-label {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(5, 14, 25, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.photonic-flickr-stream a.birley-photonic-video:hover .birley-video-play,
.photonic-flickr-stream a.birley-photonic-video:focus-visible .birley-video-play {
    transform: scale(1.08);
    background: rgba(75, 174, 122, 0.9);
}

/* Keep the normal title gradient above the persistent video marker. */
.photonic-flickr-stream figure.photonic-thumb > a.birley-photonic-video::after {
    z-index: 5;
}

@media (max-width: 767px) {
    .photonic-flickr-stream .birley-video-play {
        width: 48px;
        height: 48px;
    }

    .photonic-flickr-stream .birley-video-play::after {
        border-top-width: 8px;
        border-bottom-width: 8px;
        border-left-width: 13px;
    }
}

/* ==========================================================
   CATEGORY-AWARE ARCHIVE CARDS
   ========================================================== */

.archive-card-type-module {
    margin: 0 !important;
    padding: 16px 18px 0 !important;
}

.archive-card-type-module .et_pb_text_inner,
.archive-card-type-module p {
    margin: 0 !important;
    padding: 0 !important;
}

.archive-card-type {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-family: "Lato", Helvetica, Arial, Lucida, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2em;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    text-transform: uppercase;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.archive-card-type--travel {
    color: #4BAE7A !important;
    background-color: rgba(75, 174, 122, 0.10);
}

.archive-card-type--travel:hover,
.archive-card-type--travel:focus-visible {
    color: #16253B !important;
    background-color: #4BAE7A;
}


.archive-card-type--monthly {
    color: #B8AA92 !important;
    background-color: rgba(184, 170, 146, 0.10);
}

.archive-card-type--monthly:hover,
.archive-card-type--monthly:focus-visible {
    color: #0E1A2B !important;
    background-color: #B8AA92;
}

.archive-card-type--species {
    color: #63A9C7 !important;
    background-color: rgba(99, 169, 199, 0.10);
}

.archive-card-type--species:hover,
.archive-card-type--species:focus-visible {
    color: #16253B !important;
    background-color: #63A9C7;
}

.archive-card-type-module + .archive-card-title {
    padding-top: 12px !important;
}

.archive-card.is-travel-card .archive-card-meta,
.archive-card.is-travel-card .archive-card-meta p,
.archive-card.is-travel-card .archive-card-meta .et_pb_text_inner {
    color: #4BAE7A !important;
}

.archive-card.is-species-card .archive-card-meta,
.archive-card.is-species-card .archive-card-meta p,
.archive-card.is-species-card .archive-card-meta .et_pb_text_inner {
    color: #63A9C7 !important;
}

.birley-card-button-module {
    margin: 0 !important;
    padding: 20px 18px 20px !important;
}

.birley-card-button-module .et_pb_text_inner,
.birley-card-button-module p {
    margin: 0 !important;
    padding: 0 !important;
}

.birley-card-button {
    display: inline-block;
    padding: 0.3em 1em;
    border: 2px solid currentColor;
    border-radius: 3px;
    font-family: "Lato", Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7em;
    text-align: center;
    text-decoration: none !important;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.birley-card-button--travel {
    color: #4BAE7A !important;
    background-color: rgba(75, 174, 122, 0.10);
}

.birley-card-button--travel:hover,
.birley-card-button--travel:focus-visible {
    color: #16253B !important;
    background-color: #4BAE7A;
}


.birley-card-button--monthly {
    color: #B8AA92 !important;
    background-color: rgba(184, 170, 146, 0.10);
}

.birley-card-button--monthly:hover,
.birley-card-button--monthly:focus-visible {
    color: #0E1A2B !important;
    background-color: #B8AA92;
}

.birley-card-button--species {
    color: #63A9C7 !important;
    background-color: rgba(99, 169, 199, 0.10);
}

.birley-card-button--species:hover,
.birley-card-button--species:focus-visible {
    color: #16253B !important;
    background-color: #63A9C7;
}

.category-species .not-found-title,
.category-species .entry > p {
    display: none !important;
}


/* ==========================================================
   SINGLE-POST SUMMARY
   ========================================================== */

.birley-summary,
.birley-summary-line {
    margin: 0;
    padding: 0;
}

.birley-summary-line + .birley-summary-line {
    margin-top: 8px;
}

.birley-summary-label {
    color: inherit;
    font-weight: 400;
}

.birley-summary-value {
    color: #FFFFFF;
    font-weight: 600;
}


/* ==========================================================
   SINGLE-POST PREVIOUS / NEXT NAVIGATION
   ========================================================== */

.birley-post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    width: 100%;
    margin: 0;
    padding: 28px 0;
    border-top: 1px solid #243347;
    border-bottom: 1px solid #243347;
}

.birley-post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    color: #E8ECEF !important;
    text-decoration: none !important;
}

.birley-post-nav__item--next {
    align-items: flex-end;
    text-align: right;
}

.birley-post-nav__label {
    font-family: "Lato", Helvetica, Arial, Lucida, sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.birley-post-nav__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(24px, 2.2vw, 34px);
    font-weight: 600;
    line-height: 1.12;
    color: #E8ECEF;
    transition: color 0.25s ease;
}

.birley-post-nav--travel .birley-post-nav__label {
    color: #4BAE7A;
}

.birley-post-nav--species .birley-post-nav__label {
    color: #63A9C7;
}

.birley-post-nav--travel .birley-post-nav__item:hover .birley-post-nav__title,
.birley-post-nav--travel .birley-post-nav__item:focus-visible .birley-post-nav__title {
    color: #4BAE7A;
}

.birley-post-nav--species .birley-post-nav__item:hover .birley-post-nav__title,
.birley-post-nav--species .birley-post-nav__item:focus-visible .birley-post-nav__title {
    color: #63A9C7;
}

.birley-post-nav__item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 6px;
}

@media (max-width: 767px) {
    .birley-post-nav {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 0;
    }

    .birley-post-nav__item--next {
        align-items: flex-start;
        text-align: left;
        padding-top: 24px;
        border-top: 1px solid #243347;
    }
}

/* ==========================================================
   SPECIES ARCHIVE FILTER + SEARCH
   ========================================================== */
.birley-species-filter {
    margin: 0 0 32px;
}

.birley-species-filter__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.birley-species-filter__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.birley-species-filter__button {
    appearance: none;
    border: 1px solid #63A9C7;
    border-radius: 3px;
    background: rgba(99, 169, 199, 0.08);
    color: #63A9C7;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    padding: 9px 14px;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.birley-species-filter__button:hover,
.birley-species-filter__button:focus-visible,
.birley-species-filter__button.is-active {
    background: #63A9C7;
    color: #0E1A2B;
    outline: none;
}

.birley-species-filter__search {
    flex: 0 1 280px;
    min-width: 220px;
}

.birley-species-filter__input {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #33445A;
    border-radius: 3px;
    background: #16253B;
    color: #E8ECEF;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    padding: 10px 12px;
}

.birley-species-filter__input::placeholder {
    color: #A9B4C3;
    opacity: 1;
}

.birley-species-filter__input:focus {
    border-color: #63A9C7;
    outline: 1px solid #63A9C7;
    outline-offset: 1px;
}

.birley-species-filter__status {
    min-height: 1.4em;
    margin-top: 10px;
    color: #A9B4C3;
    font-size: 13px;
}

/* Divi 5 can apply display:flex !important to loop columns with a more
   specific generated selector. Make the filtered state more specific so
   hidden loop cards really leave the layout and the remaining cards reflow. */
html body #page-container .et_pb_row .et_pb_column.birley-filter-card.birley-species-filter-hidden,
html body #page-container .birley-filter-card.birley-species-filter-hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .birley-species-filter__controls {
        align-items: stretch;
        flex-direction: column;
    }

    .birley-species-filter__search {
        flex-basis: auto;
        min-width: 0;
        width: 100%;
    }
}
