/* Scoped restyle for the client-branded public pages (ClientOfferController).
   Everything here is nested under .client-portal so the generic public
   OfferController pages (which reuse site.css classes like .offering-card,
   .icon-square, .offer-status) are never affected. */

.client-portal {
    --client-accent: #2f6fed;
    --client-accent-dark: #1f4fc0;
    --client-ink: #1f2430;
    --client-muted: #6b7280;
    --client-surface: #f7f8fb;
    background-color: var(--client-surface);
}

/* Layout: header is a fixed-height flex item that never scrolls; only
   #clientPortalScroll (main + footer) scrolls, so the header can't be dragged
   along with the page no matter what any child's CSS does. */
html {
    height: 100%;
}

body.client-portal {
    height: 100%;
    margin: 0;
}

body.client-portal {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.client-portal > header {
    flex: 0 0 auto;
}

.client-portal .client-portal-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .25) transparent;
}

.client-portal .client-portal-scroll::-webkit-scrollbar {
    width: 8px;
}

.client-portal .client-portal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.client-portal .client-portal-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .25);
    border-radius: 4px;
}

.client-portal .client-portal-scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, .4);
}

/* Footer nav links (Terms of Use, Privacy Policy, etc.) look like plain muted text otherwise */
.client-portal footer .nav-link {
    color: var(--client-accent);
    text-decoration: underline;
}

.client-portal footer .nav-link:hover {
    color: var(--client-accent-dark);
}

/* Header */
.client-portal .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030;
    padding-top: .25rem;
    padding-bottom: .25rem;
    backdrop-filter: saturate(180%) blur(6px);
}

.client-portal main {
    padding-top: 1rem;
}

.client-portal .navbar-brand img {
    transition: opacity .15s ease-in-out;
}

.client-portal .navbar-brand:hover img {
    opacity: .85;
}

.client-portal .navbar .nav-link {
    font-weight: 500;
}

.client-portal .navbar .btn-primary {
    background-color: var(--client-accent);
    border-color: var(--client-accent);
    border-radius: 999px;
    padding: .5rem 1.25rem;
    font-weight: 600;
}

.client-portal .navbar .btn-primary:hover {
    background-color: var(--client-accent-dark);
    border-color: var(--client-accent-dark);
}

/* Hero header on the offerings list page */
.client-portal .client-hero {
    padding: 0 0 1.5rem;
}

.client-portal .client-hero h3 {
    font-weight: 700;
    color: var(--client-ink);
    margin-bottom: .25rem;
}

.client-portal .client-hero p {
    color: var(--client-muted);
    margin-bottom: 0;
}

/* Offerings list grid. auto-fit collapses unused column tracks instead of
   leaving empty ones, so justify-content:center correctly centers a partial
   row (e.g. a single card) without affecting the gap between cards. */
.client-portal .client-offerings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: .75rem;
}

/* Offer cards (offerings list) */
.client-portal .offering-card {
    max-width: 320px;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 1rem;
    overflow: hidden;
}

.client-portal .offering-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(31, 36, 48, .12);
}

.client-portal .offering-card .card-img-top {
    object-fit: cover;
}

/* Offer summary card beside the carousel on the detail page: no max-width/centering,
   no rounded corners (unlike the offerings-list card it shares base styling with),
   and it's a showcase only — no hover zoom/shadow or clickable cursor. */
.client-portal .offer-summary-card {
    max-width: none;
    margin: 0;
    border-radius: 0 !important;
    cursor: default;
}

.client-portal .offer-summary-card:hover {
    transform: none;
    box-shadow: none;
}

.client-portal .offering-card .card-title {
    background: #fff;
}

/* Offer detail page */
.client-portal .client-offer-detail .card {
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 1rem;
}

.client-portal .client-offer-detail .icon-square {
    background-color: var(--client-surface);
    color: var(--client-accent);
}

.client-portal .client-offer-detail .nav-tabs .nav-link {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--client-muted);
    border: none;
    border-bottom: 2px solid transparent;
}

.client-portal .client-offer-detail .nav-tabs .nav-link.active {
    color: var(--client-accent);
    border-bottom-color: var(--client-accent);
    background: transparent;
}

/* Footer */
.client-portal footer {
    padding-top: 2rem;
}

.client-portal footer h6 {
    font-weight: 700;
    color: var(--client-ink);
}

.client-portal footer p {
    color: var(--client-muted);
}

.client-portal footer .nav-link {
    color: var(--client-muted);
}

.client-portal footer .nav-link:hover {
    color: var(--client-accent);
}

.client-portal footer p a {
    color: var(--client-accent);
}

.client-portal footer p a:hover {
    color: var(--client-accent-dark);
}

/* Offer detail page: reduced, more compact type scale */
.client-portal .client-offer-detail {
    font-size: .9rem;
}

.client-portal .client-offer-detail h4 {
    font-size: 1.9rem;
}

@media (max-width: 767.98px) {
    .client-portal .client-offer-detail {
        font-size: .85rem;
    }
}

/* Carousel indicator dots default to white, invisible against the near-white carousel background */
.client-portal .client-offer-detail #myCarousel .carousel-indicators [data-bs-target] {
    background-color: var(--client-accent);
    opacity: .4;
}

.client-portal .client-offer-detail #myCarousel .carousel-indicators .active {
    opacity: 1;
}

/* Bootstrap disables the slide transition under prefers-reduced-motion; force it back on for this carousel */
@media (prefers-reduced-motion: reduce) {
    .client-portal .client-offer-detail #myCarousel .carousel-item {
        transition: transform .6s ease-in-out !important;
    }
}

/* Company logo box in the offer detail header */
.client-portal .client-offer-detail .offer-logo-icon {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.75rem;
}

/* Raised-amount / Buy Now block: compact text and spacing, right-aligned */
.client-portal .client-offer-detail .offer-cta {
    text-align: right;
}

/* Visit our website / Buy Now: below 576px (x-small) they stack into two full-width
   rows of equal width; at sm and up they sit side by side at natural content width. */
@media (max-width: 575.98px) {
    .client-portal .client-offer-detail .offer-final-cta {
        flex-direction: column;
    }

    .client-portal .client-offer-detail .offer-final-cta > .btn {
        width: 100%;
    }
}

/* Applied via JS only when this block has actually wrapped onto its own row
   (see syncOfferCtaLayout in ClientIndex.cshtml). offer-cta itself must grow
   first to actually claim the row's leftover width, then offer-progress-block
   grows within it, so the progress bar widens instead of staying pinned at
   its 260px min-width. Neither affects the side-by-side layout on wide screens. */
.client-portal .client-offer-detail .offer-cta.offer-cta-wrapped {
    flex-grow: 1;
}

.client-portal .client-offer-detail .offer-cta.offer-cta-wrapped .offer-progress-block {
    flex-grow: 1;
}

.client-portal .client-offer-detail .offer-cta .invested-amount {
    font-size: 1.1rem;
    line-height: 1.3;
}

.client-portal .client-offer-detail .offer-cta .total-raised {
    font-size: .75rem;
    font-weight: 700;
}

.client-portal .client-offer-detail .offer-cta .btn {
    padding: .375rem 1rem;
    font-size: .9rem;
    border-radius: 999px;
}

/* CKEditor5's own content stylesheet (ckeditor5-content.css, loaded in the layout)
   now handles .image/.image_resized/figcaption sizing and centering correctly --
   this is just a safety net for bare <img> tags pasted via Source Editing that
   aren't wrapped in CKEditor's own .image/figure structure, so they can't overflow
   the page width either. */
.client-portal .hmtlContent img {
    max-width: 100% !important;
    height: auto !important;
}

/* Rich-text content sometimes pastes in with white-space/no-wrap baked in, which
   can overflow the entire page width; force it to always wrap. */
.client-portal .hmtlContent {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

/* Client theme hooks: the variables are set by the inline theme <style> in _ClientLayout
   (defaults below apply when a client has no resolvable theme). */
.client-portal {
    --client-base-font: var(--bs-body-font-family);
    --client-heading-font: var(--client-base-font);
    font-family: var(--client-base-font);
}

.client-portal h1,
.client-portal h2,
.client-portal h3,
.client-portal h4,
.client-portal h5,
.client-portal h6 {
    font-family: var(--client-heading-font);
}

.client-portal .btn-primary {
    background-color: var(--client-accent);
    border-color: var(--client-accent);
    color: #fff;
}

.client-portal .btn-primary:hover,
.client-portal .btn-primary:focus,
.client-portal .btn-primary:active {
    background-color: var(--client-accent-dark);
    border-color: var(--client-accent-dark);
    color: #fff;
}

.client-portal .btn-primary:focus {
    box-shadow: 0 0 0 .2rem rgba(var(--client-accent-rgb, 47, 111, 237), .35);
}

.client-portal .btn-primary:disabled,
.client-portal .btn-primary.disabled {
    background-color: var(--client-accent);
    border-color: var(--client-accent);
}

.client-portal .text-primary {
    color: var(--client-accent) !important;
}

.client-portal .client-progress-bar {
    background-color: rgba(72, 199, 142, 0.85);
}

.client-portal #offerActionTabs.nav-tabs .nav-link:hover,
.client-portal #offerActionTabs.nav-tabs .nav-link.active {
    color: var(--client-accent);
}

.client-portal #offerActionTabs.nav-tabs .nav-link.active {
    border-bottom-color: var(--client-accent);
}

.client-portal .btn-outline-primary {
    color: var(--client-accent);
    border-color: var(--client-accent);
}

.client-portal .btn-outline-primary:hover,
.client-portal .btn-outline-primary:active {
    background-color: var(--client-accent);
    border-color: var(--client-accent);
    color: #fff;
}

.client-portal .form-control:focus,
.client-portal .form-select:focus {
    border-color: var(--client-accent);
    box-shadow: 0 0 0 .2rem rgba(var(--client-accent-rgb, 47, 111, 237), .25);
}

