/**
 * Paws & Prayers - public CSS
 *
 * Carries the Bark Events visual language: native system font stack, brand
 * blue (#2271b1), brand green (#1a7f1a), rounded meta block, pill-ish buttons,
 * mobile-first card layout. Differences vs. Bark Events: the "hug" button
 * replaces "interested" (always shows its count from 1), and there is a
 * submission-form block at the bottom.
 *
 * All classes prefixed with .bbpp-
 */

/* ── Layout container ─────────────────────────────────────── */
.bbpp-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.55;
}
@media (min-width: 768px) {
    .bbpp-container { padding: 24px; }
}

/* ── Single case page ─────────────────────────────────────── */
.bbpp-single-case .bbpp-case-photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

/* ── Title row ────────────────────────────────────────────── */
.bbpp-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 8px;
    flex-wrap: wrap;
}
.bbpp-single-case h1.bbpp-case-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #111;
    flex: 1 1 auto;
    min-width: 0;
}
.bbpp-single-case h2.bbpp-case-summary {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    color: #444;
    margin: 0 0 20px;
}
@media (min-width: 768px) {
    .bbpp-single-case h1.bbpp-case-title { font-size: 36px; }
    .bbpp-single-case h2.bbpp-case-summary { font-size: 20px; }
}

/* Title-row right side (desktop hug button). Hidden on mobile. */
.bbpp-title-row-buttons {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 4px;
}
.bbpp-btn-hug-desktop { display: none; flex-shrink: 0; }
.bbpp-mobile-hug { display: flex; width: 100%; margin: 12px 0 20px; }
.bbpp-mobile-hug .bbpp-btn { flex: 1 1 0; min-width: 0; justify-content: center; }

@media (min-width: 768px) {
    .bbpp-title-row-buttons { display: flex; }
    .bbpp-btn-hug-desktop { display: inline-flex; }
    .bbpp-mobile-hug { display: none; }
}

/* ── Meta block ───────────────────────────────────────────── */
.bbpp-case-meta {
    background: #f7f8fa;
    border-radius: 8px;
    margin: 16px 0;
    overflow: hidden; /* keep columns inside the rounded corners */
}
.bbpp-meta-col { padding: 8px 16px; }
.bbpp-case-meta .bbpp-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}
.bbpp-case-meta .bbpp-meta-label {
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}
.bbpp-case-meta .bbpp-meta-value { color: #1a1a1a; }

/* Two-column variant (Pet's Name + Submitted By). */
/* Mobile (default): stacked, thin horizontal divider between the two. */
.bbpp-meta-two .bbpp-meta-col-left {
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    /* Desktop: side by side on one line with a thin vertical divider. */
    .bbpp-meta-two {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .bbpp-meta-two .bbpp-meta-col-left {
        border-bottom: none;
        position: relative;
    }
    /* Vertical divider, inset from the rounded corners (matches event pages). */
    .bbpp-meta-two .bbpp-meta-col-left::after {
        content: '';
        position: absolute;
        right: 0;
        top: 10px;
        bottom: 10px;
        width: 1px;
        background: #e5e7eb;
    }
    /* Right-justify "Submitted By" on the same line as "Pet's Name". */
    .bbpp-meta-two .bbpp-meta-col-right .bbpp-meta-row {
        justify-content: flex-end;
    }
}

/* ── Buttons ──────────────────────────────────────────────── */
.bbpp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.bbpp-btn:hover,
.bbpp-btn:active {
    background: #f9fafb;
    color: #1a7f1a;
}
.bbpp-btn-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}
.bbpp-btn-primary:hover,
.bbpp-btn-primary:active {
    background: #1d5e96;
    color: #fff;
}

/* ── Actions / fundraiser CTA ─────────────────────────────── */
.bbpp-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0 8px;
}
.bbpp-btn-cta {
    font-size: 16px;
    padding: 12px 22px;
}
@media (max-width: 767px) {
    .bbpp-actions { flex-direction: column; gap: 8px; }
    .bbpp-actions .bbpp-btn { width: 100%; justify-content: center; }
}
.bbpp-cta-disclaimer {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ── Hug button ───────────────────────────────────────────── */
.bbpp-btn-hug { background: #fff; gap: 5px; }
.bbpp-hug-label,
.bbpp-hug-count { line-height: 1; }
.bbpp-hug-count { margin-left: 2px; font-weight: 600; color: inherit; }
/* Active state: visitor has hugged. Warm green affirmation, white bg. */
.bbpp-btn-hug.is-hugged {
    color: #1a7f1a;
    border-color: #1a7f1a;
}
.bbpp-btn-hug.is-hugged:hover,
.bbpp-btn-hug.is-hugged:active {
    background: #f0fdf4;
    color: #1a7f1a;
}

/* ── Status banners ───────────────────────────────────────── */
.bbpp-banner {
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 16px;
    font-size: 14px;
}
.bbpp-banner-pending {
    background: #fef7e0;
    color: #8a6500;
    border: 1px solid #fde68a;
}

/* ── Story / description ──────────────────────────────────── */
.bbpp-case-description { margin: 20px 0; }
.bbpp-case-description h2,
.bbpp-case-description h3,
.bbpp-case-description h4 { margin-top: 24px; }
.bbpp-case-description p { margin: 0 0 24px; }

/* ── Gallery ──────────────────────────────────────────────── */
.bbpp-gallery {
    margin: 30px 0 10px;
    padding-top: 22px;
    border-top: 1px solid #e5e7eb;
}
.bbpp-gallery-heading {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
}
.bbpp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 768px) {
    .bbpp-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
.bbpp-gallery-item {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    line-height: 0;
}
.bbpp-gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* ── Archive / board ──────────────────────────────────────── */
.bbpp-archive .bbpp-archive-header { margin-bottom: 24px; }
.bbpp-archive h1.bbpp-archive-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}
.bbpp-archive .bbpp-archive-tagline {
    color: #6b7280;
    font-size: 16px;
    margin: 0 0 8px;
}
@media (min-width: 768px) {
    .bbpp-archive h1.bbpp-archive-title { font-size: 32px; }
}

.bbpp-card-list { display: block; }

.bbpp-case-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: inherit;
    transition: box-shadow 0.15s;
}
.bbpp-case-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.bbpp-card-thumb-link { display: block; line-height: 0; }
.bbpp-card-thumb {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    background: #e5e7eb;
    display: block;
}
.bbpp-card-thumb-empty { aspect-ratio: 1200 / 630; }
.bbpp-card-body { flex: 1; min-width: 0; padding: 14px 16px 16px; }
.bbpp-card-title-link { text-decoration: none; color: inherit; }
.bbpp-card-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.bbpp-card-title-link:hover .bbpp-card-title { color: #2271b1; }
.bbpp-card-excerpt {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0 0 14px;
}
.bbpp-card-actions { display: flex; }

/* Submit call-to-action in the board header */
.bbpp-submit-cta {
    display: inline-block;
    margin-left: 6px;
    color: #2271b1;
    font-weight: 600;
    text-decoration: none;
}
.bbpp-submit-cta:hover { text-decoration: underline; }

/* Centered "Make a Submission" under the single-page footer */
.bbpp-single-submit { text-align: center; margin-top: 16px; }
.bbpp-single-submit .bbpp-submit-cta { margin-left: 0; font-size: 15px; }

/* Directory bottom footer: Make a Submission + small-print disclaimer */
.bbpp-archive-footer { text-align: center; margin-top: 30px; }
.bbpp-archive-footer .bbpp-submit-cta { margin-left: 0; font-size: 16px; }
.bbpp-archive-disclaimer {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
    max-width: 640px;
    margin: 16px auto 0;
}

/* Tablet+ : side-by-side card */
@media (min-width: 768px) {
    .bbpp-case-card {
        flex-direction: row;
        gap: 22px;
        padding: 18px;
        border-radius: 8px;
    }
    .bbpp-card-thumb-link { flex-shrink: 0; width: 320px; }
    .bbpp-card-thumb,
    .bbpp-card-thumb-empty {
        width: 320px;
        height: 168px;
        aspect-ratio: auto;
        border-radius: 6px;
    }
    .bbpp-card-body { padding: 0; display: flex; flex-direction: column; }
    .bbpp-card-title { font-size: 23px; }
    .bbpp-card-actions { margin-top: auto; }
}

/* ── Pagination ───────────────────────────────────────────── */
.bbpp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}
.bbpp-pagination a,
.bbpp-pagination span {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}
.bbpp-pagination span.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    font-weight: 600;
}

/* ── No results ───────────────────────────────────────────── */
.bbpp-no-results { text-align: center; padding: 50px 20px; color: #6b7280; }
.bbpp-no-results h2 { font-size: 20px; color: #1a1a1a; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════════
   Submission form
   ═══════════════════════════════════════════════════════════ */
.bbpp-submit-form { margin: 0 auto; max-width: 680px; }

.bbpp-form-header { text-align: center; margin-bottom: 24px; }
.bbpp-form-title {
    font-size: 26px;
    font-weight: 700;
    color: #1f3a5f;
    margin: 0 0 6px;
}
.bbpp-form-sub { color: #6b7280; font-size: 15px; margin: 0; }

/* Section headers with underline (matches the clean grouped look) */
.bbpp-section-head {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f3a5f;
    padding-bottom: 6px;
    margin: 24px 0 14px;
    border-bottom: 2px solid #e5e7eb;
}

.bbpp-field { margin-bottom: 12px; }

/* Visually-hidden labels: keep the clean placeholder look but stay accessible. */
.bbpp-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.bbpp-req { color: #b91c1c; }
.bbpp-file-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.bbpp-field input[type="text"],
.bbpp-field input[type="url"],
.bbpp-field input[type="email"],
.bbpp-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px; /* 16px min prevents iOS autozoom */
    box-sizing: border-box;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
}
.bbpp-field input::placeholder,
.bbpp-field textarea::placeholder { color: #9098a3; }
.bbpp-field textarea { resize: vertical; line-height: 1.5; }
.bbpp-field input:focus,
.bbpp-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}
.bbpp-field input[type="file"] {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
    border: 1px dashed #cbd2da;
    border-radius: 8px;
    background: #fafbfc;
    box-sizing: border-box;
}
.bbpp-help { font-size: 12px; color: #6b7280; margin: 6px 0 0; }

/* Two-up rows on desktop, stacked on mobile */
.bbpp-field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.bbpp-field-row .bbpp-field { flex: 1 1 240px; margin-bottom: 12px; }

/* Honeypot: visually + programmatically hidden. */
.bbpp-hp-wrap {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0;
    overflow: hidden;
}

.bbpp-submit-status {
    min-height: 18px;
    font-size: 14px;
    margin: 10px 0 12px;
}
.bbpp-submit-status.is-error { color: #b91c1c; font-weight: 600; }

.bbpp-submit-actions { margin-top: 12px; }
.bbpp-submit-actions .bbpp-btn { font-size: 16px; padding: 13px 28px; }
@media (max-width: 767px) {
    .bbpp-submit-actions .bbpp-btn { width: 100%; justify-content: center; }
}

.bbpp-submit-done {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: 8px;
    padding: 18px 20px;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

/* ── Single-page footer (All Paws & Prayers · Report Listing) ───────────── */
.bbpp-single-footer {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 15px;
}
.bbpp-single-footer a { color: #2271b1; text-decoration: none; }
.bbpp-single-footer a:hover { text-decoration: underline; }
.bbpp-foot-sep { color: #cbd2da; margin: 0 12px; }
.bbpp-report-link { color: #6b7280; }
.bbpp-report-link:hover { color: #b91c1c; }

/* ── Report modal ───────────────────────────────────────────────────────── */
.bbpp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100000;
}
.bbpp-modal-overlay[hidden] { display: none; }
.bbpp-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    padding: 24px 22px 20px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}
.bbpp-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #9098a3;
    cursor: pointer;
    padding: 4px 8px;
}
.bbpp-modal-close:hover { color: #1a1a1a; }
.bbpp-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f3a5f;
    margin: 0 0 4px;
}
.bbpp-modal-sub { font-size: 14px; color: #6b7280; margin: 0 0 16px; }
.bbpp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}
.bbpp-report-status { min-height: 16px; font-size: 14px; margin: 4px 0; }
.bbpp-report-status.is-error { color: #b91c1c; font-weight: 600; }
.bbpp-report-done {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
}
@media (max-width: 767px) {
    .bbpp-modal-actions { flex-direction: column-reverse; }
    .bbpp-modal-actions .bbpp-btn { width: 100%; justify-content: center; }
}
