.allagash-community-search-form-wrap.is-compact {
    background: var(--bbpress-row-alt);
    border: 1px solid var(--bbpress-panel-border);
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--bbpress-panel-shadow);
    margin-bottom: 28px;
    padding: 28px;
}

.widget .allagash-community-search-form-wrap.is-compact {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.allagash-community-search-title {
    border-bottom: 2px solid var(--bbpress-accent-border);
    color: var(--pine);
    font-family: 'Alegreya', serif;
	font-weight: 700;
    font-size: 1.55rem;
    margin: 0 0 22px;
    padding-bottom: 4px;
}

.allagash-community-search-form {
    display: flex;
    gap: 10px;
}

.allagash-community-search-form input[type="search"] {
    border: 1px solid var(--bbpress-input-border);
    border-radius: 4px;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
}

.allagash-community-search-form-wrap.is-compact .allagash-community-search-form {
    align-items: stretch;
    flex-direction: column;
}

.allagash-community-search .allagash-community-search-results {
    display: grid;
    gap: 20px;
    list-style: none;
    margin: 16px 0 32px;
    padding: 0;
}

.allagash-community-search-result {
    background: var(--bbpress-row-alt);
    border: 1px solid var(--bbpress-panel-border);
    border-radius: 8px;
    box-shadow: 0 3px 9px var(--bbpress-panel-shadow);
    padding: 12px 24px;
}

.allagash-community-search-result h3 {
    margin: 8px 0 10px;
}

.allagash-community-search-type {
    color: var(--dark-spruce);
    font-family: "Alegreya", serif;
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.allagash-community-search-meta {
    align-items: center;
    color: var(--stone-gray);
    display: flex;
    font-size: .9rem;
    gap: 9px;
}

.allagash-community-search-meta img {
    border-radius: 50%;
    height: 30px;
    width: 30px;
}

.allagash-community-search-excerpt {
    margin: 14px 0 0;
}

.allagash-community-search-details {
    border-top: 1px solid var(--bbpress-panel-border-light);
    margin-top: 14px;
    padding-top: 10px;
}

.allagash-community-search-details summary {
    color: var(--river-blue);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.allagash-community-search-details summary::-webkit-details-marker {
    display: none;
}

.allagash-community-search-details summary::before {
    content: '\25BE';
    display: inline-block;
    margin-right: 7px;
    transition: transform .15s ease;
}

.allagash-community-search-details[open] summary::before {
    transform: rotate(180deg);
}

.allagash-community-search-full {
    margin-top: 12px;
}


/* ----------------------------------------------------------
   Sidebar shortcode cleanup
   ---------------------------------------------------------- */

.widget p:empty:has(+ .allagash-community-search-form-wrap.is-compact),
.widget .allagash-community-search-form-wrap.is-compact + p:empty {
    display: none;
}


/* ----------------------------------------------------------
   Search-result links and metadata
   Match the Community Activity visual language.
   ---------------------------------------------------------- */

.allagash-community-search-result-title {
    color: var(--canoe-red);
    font-family: "Alegreya", serif;
    font-weight: 600;
    text-decoration-line: underline !important;
    text-decoration-thickness: 1px !important;
    text-decoration-color: color-mix(in srgb, var(--canoe-red) 55%, transparent) !important;
    text-underline-offset: 2px !important;
    text-decoration-skip-ink: auto !important;
}

.allagash-community-search-member {
    color: var(--dark-spruce);
    font-family: "Alegreya", serif;
    font-weight: 700;
    text-decoration: none !important;
    text-underline-offset: 2px !important;
    text-decoration-skip-ink: auto !important;
}

.allagash-community-search-context {
    color: var(--pine);
    font-family: "Alegreya", serif;
    font-weight: 600;
    text-decoration-line: underline !important;
    text-decoration-thickness: 1px !important;
    text-decoration-color: color-mix(in srgb, var(--pine) 55%, transparent) !important;
    text-underline-offset: 2px !important;
    text-decoration-skip-ink: auto !important;
}

.allagash-community-search-date {
    color: rgba(24, 50, 39, 0.72);
    font-family: "Alegreya", serif;
    font-weight: 400;
}

.allagash-community-search-result-title:hover,
.allagash-community-search-result-title:focus-visible,
.allagash-community-search-member:hover,
.allagash-community-search-member:focus-visible,
.allagash-community-search-context:hover,
.allagash-community-search-context:focus-visible {
    color: var(--river-blue) !important;
    text-decoration-line: underline !important;
    text-decoration-thickness: 2px !important;
    text-decoration-color: currentColor !important;
}


/* ----------------------------------------------------------
   Full search page layout and heading
   ---------------------------------------------------------- */

.allagash-community-search {
    box-sizing: border-box;
    margin-inline: auto;
    padding-inline: 0px;
    width: 100%;
}

.allagash-community-search > #allagash-community-search-heading {
    border-bottom: 2px solid rgba(34, 81, 58, 0.35);
    color: var(--pine);
    font-family: "Alegreya", serif;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.04;
    margin: 0 0 14px;
    padding: 25px 0 5px;
}

.allagash-community-search > .allagash-community-search-form-wrap {
    margin: 0;
}

.allagash-community-search > .allagash-community-search-count,
.allagash-community-search > .allagash-community-search-prompt {
    margin: 6px 0 0;
}

.allagash-community-search-result h3 {
    margin: 0 0 7px;
}

.allagash-community-search-result-heading {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
    line-height: 1.25;
}

.allagash-community-search-result-heading .allagash-community-search-result-title {
    font-size: 1.35rem;
}

.allagash-community-search-excerpt {
    line-height: 1.4;
    margin-top: 10px;
}

.allagash-community-search-full {
    line-height: 1.4;
}

.allagash-community-search-full p {
    line-height: inherit;
    margin-bottom: .7em;
}

@media (max-width: 600px) {
    .allagash-community-search-form {
        align-items: stretch;
        flex-direction: column;
    }

    .allagash-community-search-result {
        padding: 12px 20px;
    }

    .allagash-community-search-form-wrap.is-compact {
        padding: 20px;
    }
}

/* Search Community: campsite image strip */
.allagash-community-search-campsite-images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.allagash-community-search-campsite-image {
    width: auto;
}

.allagash-community-search-campsite-image figure {
    margin: 0;
}

.allagash-community-search-campsite-image img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* Search Community: compact native bbPress attachments */
.allagash-community-search-native-bbpress .bbp-attachments ol.d4p-bba-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.allagash-community-search-native-bbpress .bbp-attachments ol.d4p-bba-thumbnails > li {
    margin: 0;
    width: auto;
}

.allagash-community-search-native-bbpress .bbp-attachments .wp-caption {
    width: auto !important;
    margin: 0;
}

.allagash-community-search-native-bbpress .bbp-attachments img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.allagash-community-search-native-bbpress .bbp-attachments .wp-caption-text {
    display: none;
}

@media (max-width: 600px) {
    .allagash-community-search-native-bbpress .bbp-attachments ol.d4p-bba-thumbnails {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Search Community: compact campsite-comment image grid */
.allagash-community-search-campsite-comment .campsite-readonly-comment-images {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.allagash-community-search-campsite-comment .campsite-readonly-comment-image {
    width: auto;
    margin: 0;
}

.allagash-community-search-campsite-comment .campsite-readonly-comment-image a {
    display: block;
    width: 100%;
}

.allagash-community-search-campsite-comment .campsite-readonly-comment-image img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.allagash-community-search-summary-hide {
    display: none;
}

.allagash-community-search-details[open]
    .allagash-community-search-summary-show {
    display: none;
}

.allagash-community-search-details[open]
    .allagash-community-search-summary-hide {
    display: inline;
}

/* Search Community: unified thumbnail appearance */
.allagash-community-search-campsite-images img,
.allagash-community-search-native-bbpress .bbp-attachments img,
.allagash-community-search-campsite-comment .campsite-readonly-comment-image img {
    border: 1px solid rgba(39, 84, 66, .16);
    border-radius: 6px;
    box-shadow: var(--image-shadow);
    transition:
        transform .20s ease,
        box-shadow .20s ease;
}

/* Unified thumbnail hover */
.allagash-community-search-campsite-images a:hover img,
.allagash-community-search-campsite-images a:focus-visible img,
.allagash-community-search-native-bbpress .bbp-attachments a:hover img,
.allagash-community-search-native-bbpress .bbp-attachments a:focus-visible img,
.allagash-community-search-campsite-comment .campsite-readonly-comment-image a:hover img,
.allagash-community-search-campsite-comment .campsite-readonly-comment-image a:focus-visible img {
    transform: translateY(var(--image-hover-lift));
    box-shadow: var(--image-shadow-hover);
}

/* Search Community — bbPress attachment thumbnails */
.allagash-community-search-results
ol.d4p-bba-thumbnails img {
    border: 1px solid rgba(39, 84, 66, .16);
    border-radius: 6px;
    box-shadow: var(--image-shadow);
    transition:
        transform .20s ease,
        box-shadow .20s ease;
}

.allagash-community-search-results
ol.d4p-bba-thumbnails a:hover img,
.allagash-community-search-results
ol.d4p-bba-thumbnails a:focus-visible img {
    transform: translateY(var(--image-hover-lift));
    box-shadow: var(--image-shadow-hover);
}

/* Search Community — unified campsite + bbPress thumbnail appearance */
.allagash-community-search-campsite-image > figure.wp-block-image > a > img,
.allagash-community-search-results ol.d4p-bba-thumbnails .wp-caption > a > img {
    border: 1px solid rgba(39, 84, 66, .16) !important;
    border-radius: 6px !important;
    box-shadow: var(--image-shadow) !important;
    transition:
        transform .20s ease,
        box-shadow .20s ease !important;
}

.allagash-community-search-campsite-image > figure.wp-block-image > a:hover > img,
.allagash-community-search-campsite-image > figure.wp-block-image > a:focus-visible > img,
.allagash-community-search-results ol.d4p-bba-thumbnails .wp-caption > a:hover > img,
.allagash-community-search-results ol.d4p-bba-thumbnails .wp-caption > a:focus-visible > img {
    transform: translateY(var(--image-hover-lift));
    box-shadow: var(--image-shadow-hover) !important;
}

@media (max-width: 600px) {

    .allagash-community-search-campsite-images,
    .allagash-community-search-results ol.d4p-bba-thumbnails,
    .allagash-community-search-campsite-comment
    .campsite-readonly-comment-images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .allagash-community-search-results ol.d4p-bba-thumbnails > li,
    .allagash-community-search-results ol.d4p-bba-thumbnails .wp-caption {
        width: auto !important;
    }

    .allagash-community-search-results ol.d4p-bba-thumbnails img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    .allagash-community-search-campsite-comment
    .campsite-readonly-comment-images {
        display: grid !important;
    }

    .allagash-community-search-campsite-comment
    .campsite-readonly-comment-image {
        flex: none !important;
        width: auto !important;
        min-width: 0;
        margin: 0;
    }

    .allagash-community-search-campsite-comment
    .campsite-readonly-comment-image a {
        display: block;
        width: 100% !important;
    }

}
