/* ==========================================================================
   Photo Gallery cards  (PhotogalleryNew.aspx / ShowAlbum.aspx)
   Prefix: pg-  |  Depends on FontAwesome 4 icons bundled in style3.1.css
   Square corners throughout - the site uses rectangular containers.
   ========================================================================== */

:root {
    /* Orange tuned so white text on it passes WCAG AA (5.3:1); the dark
       variant is used for orange text on the pale tint (5.4:1). */
    --pg-orange: #b54a13;
    --pg-orange-dark: #8f3a0e;
    --pg-orange-soft: #fdf1ea;
    --pg-ink: #1f2937;
    --pg-muted: #5b6270;
    --pg-line: #e6e8ec;
    --pg-card-bg: #ffffff;
    --pg-focus: #1d4ed8;
    --pg-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06);
    --pg-shadow-hover: 0 4px 10px rgba(16, 24, 40, .10), 0 18px 36px rgba(16, 24, 40, .12);
}

.pg-page {
    padding-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Album header (ShowAlbum.aspx)
   -------------------------------------------------------------------------- */
.pg-album-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    background: var(--pg-card-bg);
    border: 1px solid var(--pg-line);
    border-left: 6px solid var(--pg-orange);
    box-shadow: var(--pg-shadow);
    padding: 20px 24px;
    margin: 20px 0 26px;
}

.pg-album-head__text {
    flex: 1 1 480px;
    min-width: 0;
}

.pg-album-head__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pg-orange);
    margin-bottom: 6px;
}

.pg-album-head__title {
    font-size: 22px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--pg-ink);
    margin: 0 0 10px;
}

.pg-album-head .pg-card__meta {
    border: 0;
    padding: 0;
    margin: 0;
}

.pg-album-head__back {
    flex: 0 0 auto;
    align-self: center;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.pg-btn--primary {
    background: var(--pg-orange);
    color: #fff !important;
    border: 1px solid var(--pg-orange);
}

.pg-btn--primary:hover,
.pg-btn--primary:focus {
    background: var(--pg-orange-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(181, 74, 19, .35);
}

/* --------------------------------------------------------------------------
   Card grid
   -------------------------------------------------------------------------- */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 20px 0 0;
}

.pg-grid__full {
    grid-column: 1 / -1;
}

.pg-grid__full:empty {
    display: none;
}

.pg-empty {
    text-align: center;
    padding: 48px 20px;
    color: #b42318;
    font-weight: 700;
    font-size: 17px;
    background: var(--pg-card-bg);
    border: 1px dashed #f0b8a3;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.pg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--pg-card-bg);
    border: 1px solid var(--pg-line);
    box-shadow: var(--pg-shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.pg-card:hover,
.pg-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--pg-shadow-hover);
}

/* The photo is shown whole (object-fit: contain). The area around it is a
   blurred, darkened copy of the same photo (--pg-img is set inline on the
   element) so the letterbox matches the picture instead of a flat grey. */
.pg-card__media {
    position: relative;
    display: block;
    height: 250px;
    overflow: hidden;
    background: #23272e;
    isolation: isolate;
}

.pg-card__media::before {
    content: "";
    position: absolute;
    inset: -20px;
    z-index: 0;
    background-image: var(--pg-img);
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(.55) saturate(1.1);
    transform: scale(1.1);
}

.pg-card__media img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform .45s ease;
}

.pg-card:hover .pg-card__media img {
    transform: scale(1.03);
}

/* Badges on the image */
.pg-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 28px);
    padding: 7px 13px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: rgba(17, 24, 39, .82); /* keeps white text >= 7:1 over any photo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-badge--date {
    top: 14px;
    left: 14px;
}

.pg-badge--ministry {
    left: 14px;
    bottom: 14px;
}

.pg-badge .fa {
    font-size: 13px;
    flex: 0 0 auto;
}

.pg-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 22px 22px 22px;
}

.pg-card__title {
    margin: 0 0 16px;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 700;
    color: var(--pg-ink);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(17px * 1.55 * 3);
}

.pg-card__meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    margin: auto 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--pg-line);
    font-size: 15px;
    color: var(--pg-muted);
}

.pg-card__meta li {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: 100%;
    min-width: 0;
}

.pg-card__meta li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-card__meta .fa {
    font-size: 16px;
    color: #9ca3af;
    flex: 0 0 auto;
}

.pg-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.pg-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--pg-orange-dark) !important;
    background: var(--pg-orange-soft);
    border: 1px solid transparent;
    text-decoration: none !important;
    transition: background-color .15s ease, color .15s ease;
}

.pg-card__cta .fa {
    transition: transform .15s ease;
}

.pg-card__cta:hover,
.pg-card__cta:focus {
    background: var(--pg-orange);
    color: #fff !important;
}

.pg-card__cta:hover .fa-arrow-right,
.pg-card__cta:focus .fa-arrow-right {
    transform: translateX(3px);
}

/* Photo (album) card variant: no caption - the album head carries it. */
.pg-card--photo .pg-card__media {
    cursor: zoom-in;
}

.pg-card--photo .pg-card__meta {
    border-top: 0;
    padding-top: 0;
}

.pg-card__zoom {
    position: absolute;
    z-index: 2;
    right: 14px;
    top: 14px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    background: rgba(17, 24, 39, .7);
    opacity: 0;
    transform: scale(.85);
    transition: opacity .2s ease, transform .2s ease;
}

.pg-card--photo .pg-card__media:hover .pg-card__zoom,
.pg-card--photo .pg-card__media:focus .pg-card__zoom,
.pg-card--photo:focus-within .pg-card__zoom {
    opacity: 1;
    transform: scale(1);
}

/* Share row */
.pg-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pg-share__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pg-muted);
    margin-right: 4px;
}

.pg-share a {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 15px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.pg-share a img {
    width: 16px;
    height: 16px;
}

.pg-share a:hover,
.pg-share a:focus {
    background: var(--pg-orange);
    border-color: var(--pg-orange);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pg-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 28px;
    margin: 36px 0 0;
}

.pg-pagination__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.pg-pagination__list li {
    display: inline-flex;
}

.pg-pagination__list a,
.pg-pagination__list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--pg-ink);
    background: #fff;
    border: 1px solid #d8dbe0;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.pg-pagination__list a:hover,
.pg-pagination__list a:focus {
    background: var(--pg-orange-soft);
    border-color: var(--pg-orange);
    color: var(--pg-orange-dark);
    text-decoration: none;
}

.pg-pagination__list a.aspNetDisabled,
.pg-pagination__list a[aria-current="page"] {
    background: var(--pg-orange);
    border-color: var(--pg-orange);
    color: #fff;
    cursor: default;
    pointer-events: none;
}

/* First / Prev / Next / Last when unavailable */
.pg-pagination__list li.pg-pagination__nav a.aspNetDisabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
}

.pg-pagination__list span.pg-pagination__gap {
    border: 0;
    background: transparent;
    min-width: 28px;
    color: #9ca3af;
}

.pg-pagination__size {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: var(--pg-muted);
}

.pg-pagination__size label {
    margin: 0;
    font-weight: 600;
}

.pg-pagination__size select {
    height: 44px;
    padding: 0 36px 0 14px;
    font-size: 15px;
    color: var(--pg-ink);
    border: 1px solid #d8dbe0;
    background-color: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* --------------------------------------------------------------------------
   Keyboard focus (WCAG 2.4.7 / 2.4.11) - one visible ring for every control
   on these pages, including the original filter box and print button.
   -------------------------------------------------------------------------- */
.pg-page a:focus-visible,
.pg-page select:focus-visible,
.pg-page button:focus-visible,
.pg-page input:focus-visible,
.pg-page [tabindex]:focus-visible {
    outline: 3px solid var(--pg-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #fff;
}

/* Browsers without :focus-visible still get a ring. */
.pg-page a:focus,
.pg-page select:focus,
.pg-page input:focus {
    outline: 3px solid var(--pg-focus);
    outline-offset: 3px;
}

.pg-page a:focus:not(:focus-visible),
.pg-page select:focus:not(:focus-visible),
.pg-page input:focus:not(:focus-visible) {
    outline: none;
}

/* --------------------------------------------------------------------------
   Dark / High-contrast theme (accessibility bar -> html.pib-hc)
   Palette matches css/accessibility.css: page #171717, panels #1f1f1f /
   #2b2b2b, rules #4a4a4a, links #ffff00, accent #7fd4cc.
   -------------------------------------------------------------------------- */
html.pib-hc .pg-page {
    --pg-ink: #ffffff;
    --pg-muted: #d5d5d5;
    --pg-line: #4a4a4a;
    --pg-card-bg: #1f1f1f;
    --pg-focus: #ffff00;
    --pg-shadow: 0 0 0 1px #4a4a4a;
    --pg-shadow-hover: 0 0 0 1px #7fd4cc, 0 12px 28px rgba(0, 0, 0, .6);
    color: #ffffff;
}

html.pib-hc .pg-page a:focus-visible,
html.pib-hc .pg-page select:focus-visible,
html.pib-hc .pg-page button:focus-visible,
html.pib-hc .pg-page input:focus-visible,
html.pib-hc .pg-page a:focus,
html.pib-hc .pg-page select:focus,
html.pib-hc .pg-page input:focus {
    outline-color: #ffff00;
    box-shadow: 0 0 0 5px #171717;
}

/* The original filter box: the theme sheet leaves it light grey, which
   would put white labels on a pale ground. */
html.pib-hc .pg-page .search_box {
    background: #1f1f1f !important;
    border-color: #4a4a4a !important;
}

html.pib-hc .pg-page .search_box label {
    color: #ffffff !important;
}

html.pib-hc .pg-page .search_box .btn-primary {
    background: #7fd4cc !important;
    border-color: #7fd4cc !important;
    color: #111111 !important;
}

/* Album header, empty state */
html.pib-hc .pg-album-head,
html.pib-hc .pg-empty {
    background: #1f1f1f !important;
    border-color: #4a4a4a !important;
    box-shadow: none;
}

html.pib-hc .pg-album-head {
    border-left-color: #7fd4cc !important;
}

html.pib-hc .pg-album-head__title,
html.pib-hc .pg-pagination__size,
html.pib-hc .pg-pagination__size label {
    color: #ffffff !important;
}

html.pib-hc .pg-album-head__eyebrow {
    color: #f0a860 !important;
}

html.pib-hc .pg-empty {
    color: #f0a860 !important;
    border-style: dashed;
}

/* Selects: accessibility.css paints them #2b2b2b; only the chevron needs to
   change colour so it stays visible. */
html.pib-hc .pg-pagination__size select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border-color: #6a6a6a !important;
}

/* Primary button: teal fill with near-black text (12:1). The theme's
   blanket "links are yellow" rule is outranked here on purpose. */
html.pib-hc .pg-btn--primary {
    background: #7fd4cc !important;
    border-color: #7fd4cc !important;
    color: #111111 !important;
    box-shadow: none;
}

html.pib-hc .pg-btn--primary:hover,
html.pib-hc .pg-btn--primary:focus {
    background: #ffffff !important;
    border-color: #ffffff !important;
    color: #111111 !important;
}

/* Cards */
html.pib-hc .pg-card {
    background: #1f1f1f !important;
    border-color: #4a4a4a !important;
}

html.pib-hc .pg-card__media {
    background: #000000;
}

html.pib-hc .pg-card__title {
    color: #ffffff !important;
}

html.pib-hc .pg-card__meta {
    color: #d5d5d5 !important;
    border-top-color: #4a4a4a !important;
}

html.pib-hc .pg-card__meta .fa {
    color: #9a9a9a !important;
}

html.pib-hc .pg-badge {
    background: rgba(0, 0, 0, .65) !important;
    color: #ffffff !important;
    border: 1px solid #6a6a6a;
}

html.pib-hc .pg-card__cta {
    background: #2b2b2b !important;
    border-color: #7fd4cc !important;
    color: #7fd4cc !important;
}

html.pib-hc .pg-card__cta:hover,
html.pib-hc .pg-card__cta:focus {
    background: #7fd4cc !important;
    color: #111111 !important;
}

html.pib-hc .pg-card__zoom {
    background: rgba(0, 0, 0, .8);
    color: #ffffff;
}

/* Share row */
html.pib-hc .pg-share__label {
    color: #d5d5d5 !important;
}

html.pib-hc .pg-share a {
    background: #2b2b2b !important;
    border-color: #4a4a4a !important;
    color: #7fd4cc !important;
}

html.pib-hc .pg-share a:hover,
html.pib-hc .pg-share a:focus {
    background: #7fd4cc !important;
    border-color: #7fd4cc !important;
    color: #111111 !important;
}

/* The X logo is a black PNG; paint it white on the dark tile and flip it
   back when the tile turns teal. */
html.pib-hc .pg-share a img {
    filter: invert(1);
}

html.pib-hc .pg-share a:hover img,
html.pib-hc .pg-share a:focus img {
    filter: none;
}

/* Pagination */
html.pib-hc .pg-pagination__list a,
html.pib-hc .pg-pagination__list span {
    background: #2b2b2b !important;
    border-color: #6a6a6a !important;
    color: #ffffff !important;
}

html.pib-hc .pg-pagination__list a:hover,
html.pib-hc .pg-pagination__list a:focus {
    background: #24423f !important;
    border-color: #7fd4cc !important;
    color: #7fd4cc !important;
}

html.pib-hc .pg-pagination__list a.aspNetDisabled,
html.pib-hc .pg-pagination__list a[aria-current="page"] {
    background: #7fd4cc !important;
    border-color: #7fd4cc !important;
    color: #111111 !important;
}

html.pib-hc .pg-pagination__list li.pg-pagination__nav a.aspNetDisabled {
    background: #1f1f1f !important;
    border-color: #4a4a4a !important;
    color: #9a9a9a !important;
}

html.pib-hc .pg-pagination__list span.pg-pagination__gap {
    background: transparent !important;
    border: 0 !important;
    color: #9a9a9a !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
    .pg-grid {
        gap: 22px;
    }

    .pg-card__media {
        height: 220px;
    }
}

@media (max-width: 991px) {
    .pg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .pg-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .pg-card__media {
        height: 210px;
    }

    .pg-card__body {
        padding: 18px;
    }

    .pg-album-head {
        padding: 18px;
    }

    .pg-album-head__title {
        font-size: 19px;
    }

    .pg-pagination {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-card,
    .pg-card__media img,
    .pg-card__cta .fa,
    .pg-share a,
    .pg-card__zoom {
        transition: none;
    }

    .pg-card:hover,
    .pg-card:focus-within {
        transform: none;
    }

    .pg-card:hover .pg-card__media img {
        transform: none;
    }
}

@media print {
    .pg-card {
        box-shadow: none;
        break-inside: avoid;
    }

    .pg-card__media::before,
    .pg-card__zoom,
    .pg-pagination,
    .pg-share {
        display: none !important;
    }
}
