/* r98: Car Delivery - the public feed ([car_delivery_feed]; the approved "Car Delivery_ Happy Owners Feed.png"), the same
   card in the Add Car Delivery editor's live preview, and the list's Published / Draft pill. The feed's classes are
   prefixed cdf- (the website theme never uses them); it takes the page's own font. */
/* r100: no font face is set anywhere here - the story (and the whole card) uses the website theme's typography. The story
   shows two lines with [Read more]; the gallery is a Swiper slider; the Office list's Post Preview shows the same card. */

.cdf {--cdf-text: #111827; --cdf-text-2: #4b5563; --cdf-muted: #6b7280; --cdf-border: #e8ecf2; --cdf-blue: #1d4ed8; --cdf-wa: #22c55e; box-sizing: border-box; color: var(--cdf-text);}
.cdf *, .cdf *::before, .cdf *::after {box-sizing: border-box;}
.cdf-list {display: flex; flex-direction: column; gap: 24px;}
.cdf-card {display: grid; grid-template-columns: 220px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--cdf-border); border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(15, 23, 42, .05); scroll-margin-top: 90px;}
.cdf-card.is-pinned {border-color: #bfd3fb; box-shadow: 0 0 0 3px rgba(29, 78, 216, .08), 0 6px 20px rgba(15, 23, 42, .05);}

/* The Sales Advisor. */
.cdf-advisor {display: flex; flex-direction: column; align-items: center; padding: 26px 18px; border-right: 1px solid var(--cdf-border); text-align: center;}
.cdf-avatar {display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; overflow: hidden; border-radius: 50%; background: #eef2f7; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--cdf-border);}
.cdf-avatar img {display: block; width: 100%; height: 100%; object-fit: cover;}
.cdf-initials {color: #475569; font-size: 1.5rem; font-weight: 700;}
.cdf-name {margin: 14px 0 0; color: var(--cdf-text); font-size: 1.12rem; font-weight: 700; line-height: 1.3;}
.cdf-role {margin: 2px 0 0; color: var(--cdf-muted); font-size: .86rem;}
.cdf-stat {display: flex; align-items: flex-start; gap: 10px; width: 100%; margin-top: 18px; padding: 14px 4px 0; border-top: 1px solid var(--cdf-border); text-align: left;}
.cdf-stat-icon {display: inline-flex; flex: 0 0 auto; margin-top: 2px; color: #eab308;}
.cdf-stat-text {display: flex; flex-direction: column; line-height: 1.25;}
.cdf-stat-text strong {color: var(--cdf-text); font-size: 1.05rem;}
.cdf-stat-text span {color: var(--cdf-muted); font-size: .8rem;}
.cdf-wa {display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 18px; padding: 10px 12px; border-radius: 8px; background: var(--cdf-wa); color: #fff; font-size: .86rem; font-weight: 600; line-height: 1.2; text-decoration: none;}
.cdf-wa:hover, .cdf-wa:focus-visible {background: #16a34a; color: #fff;}

/* The story. */
.cdf-story {min-width: 0; padding: 22px 24px 24px;}
.cdf-top {display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;}
.cdf-date {display: inline-flex; align-items: center; gap: 8px; color: var(--cdf-muted); font-size: .86rem;}
.cdf-share {display: inline-flex; align-items: center; gap: 8px;}
.cdf-share-label {margin-right: 2px; color: var(--cdf-muted); font-size: .84rem;}
.cdf-share-btn {position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; text-decoration: none;}
.cdf-share-btn.is-fb {background: #1877f2;}
.cdf-share-btn.is-wa {background: var(--cdf-wa);}
.cdf-share-btn.is-link {background: #eef2f7; color: #475569;}
.cdf-share-btn:hover {filter: brightness(.94);}
.cdf-share-btn:focus-visible, .cdf-photo:focus-visible, .cdf-wa:focus-visible, .cdf-retry:focus-visible {outline: 2px solid var(--cdf-blue); outline-offset: 2px;}
.cdf-copied {position: absolute; bottom: calc(100% + 6px); right: 0; padding: 4px 8px; border-radius: 6px; background: #111827; color: #fff; font-size: .75rem; white-space: nowrap; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none;}
.cdf-share-btn.is-copied .cdf-copied {opacity: 1; transform: none;}
.cdf-title {margin: 12px 0 0; color: var(--cdf-text); font-size: 1.4rem; font-weight: 700; line-height: 1.3;}
.cdf-content {margin-top: 8px; color: var(--cdf-text-2); font-size: .96rem; line-height: 1.65; overflow-wrap: anywhere;}
.cdf-content p {margin: 0 0 .7em;}
.cdf-content p:last-child {margin-bottom: 0;}
.cdf-content:focus {outline: none;}
/* r100: the collapsed story - two lines (an ellipsis where it is cut), then [Read more] (the whole story in place). */
.cdf-content.is-collapsed .cdf-excerpt {display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;}
.cdf-more-btn {display: inline-flex; margin: 6px 0 0; padding: 0; border: 0; background: none; color: var(--cdf-blue); font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.4; cursor: pointer;}
.cdf-more-btn:hover {text-decoration: underline;}
.cdf-more-btn:focus-visible {border-radius: 4px; outline: 2px solid var(--cdf-blue); outline-offset: 2px;}
.cdf-more-btn:disabled {color: var(--cdf-muted); cursor: progress; text-decoration: none;}
.cdf-more-btn[hidden] {display: none;}

/* The gallery - portrait friendly: one photo at its own proportions (never stretched); r100: two or more in a Swiper of
   3:4 tiles - three at a time (the editor's preview two), fewer centred, never repeated; [<] [>] move this post's photos
   only (cropped in the tile only - the viewer shows the whole photo). Until Swiper starts (or without it) the tiles
   scroll sideways. r101: the public card (and the Office Post Preview) always uses the Swiper - three slots from the
   left, never centred; one photo alone at its own proportions remains for the Add Car Delivery preview (.cdf-n-1). */
.cdf-gallery {display: grid; gap: 8px; margin-top: 18px;}
.cdf-n-1 {grid-template-columns: minmax(0, max-content);}
.cdf-slider {--cdf-per-view: 3; position: relative; display: block;}
.cdf-slider .cdf-swiper {overflow: hidden;}
.cdf-slider:not(.is-ready) .swiper-wrapper {display: flex; gap: 8px; overflow-x: auto;}
.cdf-slider:not(.is-ready) .cdf-slide {flex: 0 0 calc((100% - (var(--cdf-per-view) - 1) * 8px) / var(--cdf-per-view));}
.cdf-slide {height: auto;}
/* r101: every slot is the same 3:4 box from the first moment (the public feed: always three slots from the left - one or
   two photos leave the rest empty); the photo fills it (cropped in the slot only, never stretched). */
.cdf-slide .cdf-photo {width: 100%; aspect-ratio: 3 / 4;}
.cdf-slide .cdf-photo img {position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;}
/* r101: until a photo has loaded and decoded - a soft shimmer in its slot (car-delivery-feed.js; only while the script
   runs: html.cdf-js); a photo that fails - "Photo unavailable", still (a click tries again). */
.cdf-skel, .cdf-photo-fail {position: absolute; inset: 0; display: none; pointer-events: none;}
.cdf-skel {background: linear-gradient(100deg, #eef2f6 30%, #f8fafc 50%, #eef2f6 70%); background-size: 220% 100%; animation: cdf-shimmer 1.4s ease-in-out infinite;}
.cdf-js .cdf-photo.is-loading .cdf-skel {display: block;}
.cdf-js .cdf-photo.is-loading img, .cdf-photo.is-error img {opacity: 0;}
.cdf-js .cdf-slide .cdf-photo img {transition: opacity .3s ease, transform .25s ease;}
.cdf-photo-fail {align-items: center; justify-content: center; padding: 10px; color: var(--cdf-muted); font-size: .8rem; line-height: 1.3; text-align: center;}
.cdf-photo.is-error {background: #f1f5f9; cursor: pointer;}
.cdf-photo.is-error .cdf-photo-fail {display: flex;}
@keyframes cdf-shimmer {from {background-position: 120% 0;} to {background-position: -120% 0;}}
.cdf-nav {position: absolute; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 1px solid var(--cdf-border); border-radius: 50%; background: #fff; color: var(--cdf-text); box-shadow: 0 4px 14px rgba(15, 23, 42, .18); cursor: pointer; transform: translateY(-50%); transition: opacity .15s;}
.cdf-nav.is-prev {left: 10px;}
.cdf-nav.is-next {right: 10px;}
.cdf-nav:hover {background: #f8fafc;}
.cdf-nav:focus-visible {outline: 2px solid var(--cdf-blue); outline-offset: 2px;}
.cdf-nav.is-disabled {opacity: .35; cursor: default;}
.cdf-nav.is-locked, .cdf-slider:not(.is-ready) .cdf-nav {display: none;}
.cdf-photo {position: relative; display: block; overflow: hidden; margin: 0; padding: 0; border: 0; border-radius: 10px; background: #f1f5f9; cursor: zoom-in;}
.cdf-photo img {display: block; transition: transform .25s ease;}
.cdf-photo:hover img {transform: scale(1.02);}
.cdf-n-1 .cdf-photo img {width: auto; max-width: 100%; height: auto; max-height: 560px;}

/* Loading, end, failure. */
.cdf-status {display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 8px; padding: 6px 0;}
.cdf-spinner {display: inline-block; width: 30px; height: 30px; margin: 18px auto; border: 3px solid #dbe3ef; border-top-color: var(--cdf-blue); border-radius: 50%; animation: cdf-spin .8s linear infinite;}
.cdf-spinner[hidden], .cdf-error[hidden], .cdf-viewer[hidden] {display: none;}
@keyframes cdf-spin {to {transform: rotate(360deg);}}
.cdf-error {margin: 14px 0; color: #b42318; font-size: .92rem; text-align: center;}
.cdf-retry {margin-left: 6px; padding: 6px 12px; border: 1px solid #f3b4b4; border-radius: 8px; background: #fff; color: #b42318; font: inherit; font-weight: 600; cursor: pointer;}
.cdf-empty {margin: 0; padding: 32px 16px; border: 1px dashed var(--cdf-border); border-radius: 12px; color: var(--cdf-muted); text-align: center;}
.cdf-sentinel {height: 1px;}
.cdf-sr {position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;}

/* The photo viewer. */
.cdf-viewer {position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 48px 64px; background: rgba(2, 6, 23, .9);}
.cdf-viewer-figure {display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; margin: 0;}
.cdf-viewer-figure img {display: block; max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 8px;}
.cdf-viewer-count {color: #e2e8f0; font-size: .9rem;}
.cdf-viewer-close, .cdf-viewer-nav {position: absolute; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; line-height: 1;}
.cdf-viewer-close {top: 16px; right: 16px; width: 42px; height: 42px; font-size: 1.8rem;}
.cdf-viewer-nav {top: 50%; width: 46px; height: 46px; font-size: 2rem; transform: translateY(-50%);}
.cdf-viewer-nav.is-prev {left: 14px;}
.cdf-viewer-nav.is-next {right: 14px;}
.cdf-viewer-close:hover, .cdf-viewer-nav:hover {background: rgba(255, 255, 255, .24);}
.cdf-viewer-nav[hidden] {display: none;}
html.cdf-viewer-open {overflow: hidden;}

/* Office: Add / Edit Car Delivery - the Add New Listing editor (car-listings-css .om-ce-*) with the feed card as its
   live preview. */
.om-cde .om-ce-panel {display: flex; flex-direction: column; gap: 18px;}
.om-cde .om-field {margin: 0;}
.om-cde-gallery .om-ce-photos {margin-top: 10px;}
.om-cde-preview {pointer-events: none;}
.om-cde-preview .cdf-slider {pointer-events: auto;} /* r100: its [<] [>] (the mouse; the preview is not part of the form). */
.om-cde-preview .cdf-photo {cursor: default;}
.om-cde-preview .cdf-card {grid-template-columns: 170px minmax(0, 1fr);}
.om-cde-preview .cdf-advisor {padding: 20px 12px;}
.om-cde-preview .cdf-story {padding: 18px;}
.om-cde-preview .cdf-title {font-size: 1.2rem;}
.om-cde-preview .cdf-n-1 .cdf-photo img {max-height: 360px;}
.om-cde-preview .cdf-placeholder {color: #9ca3af;}
/* r99: the first field sits clear of the card's top edge (the Car Listing form has its tabs above; this one has none). */
.om-cde .om-ce-form {padding-top: 20px;}
/* r99: one grid - the photos, the placeholders of the photos being uploaded. r100 (the approved add-car-delivery.jpg):
   [Remove] (x) and [Stop] (a square) are round icon buttons - the Car Listing photo's x; a placeholder is a plain grey
   tile: spinner, "85%", "uploading..." (Waiting... / Processing...). The upload box first, then [Add more image]. */
.om-cde-tile .om-cde-tile-btn {position: absolute; top: 6px; right: 6px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(17, 24, 39, .72); color: #fff; cursor: pointer; box-shadow: 0 1px 3px rgba(15, 23, 42, .25);}
.om-cde-tile .om-cde-tile-btn.is-remove:hover {background: #b91c1c;}
.om-cde-tile .om-cde-tile-btn.is-stop:hover {background: #111827;}
.om-cde-tile .om-cde-tile-btn.is-retry {width: auto; padding: 0 10px; border-radius: 999px; font: inherit; font-size: .74rem; font-weight: 600;}
.om-cde-tile .om-cde-tile-btn.is-retry:hover {background: var(--om-primary);}
.om-cde-tile .om-cde-tile-btn:disabled {opacity: .55; cursor: default;}
.om-cde-tile .om-cde-tile-btn:focus-visible {outline: 2px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 4px var(--om-primary);}
.om-cde-tile.is-uploading {background: #f1f3f6;}
.om-cde-tile.is-uploading img {display: none;}
.om-cde-tile.is-error img {display: block; opacity: .3; filter: grayscale(.5);}
.om-cde-tile-state {position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 10px; text-align: center;}
.om-cde-tile-spin {width: 24px; height: 24px; margin-bottom: 6px;}
.om-cde-tile-pct {color: var(--om-text); font-size: .86rem; font-weight: 700; line-height: 1.2;}
.om-cde-tile-pct[hidden] {display: none;}
.om-cde-tile-label {color: var(--om-text-muted, #6b7280); font-size: .74rem; line-height: 1.25;}
.om-cde-tile-acts {position: absolute; top: 6px; right: 6px; z-index: 3; display: flex; gap: 4px;}
.om-cde-tile-acts .om-cde-tile-btn {position: static;}
.om-cde-tile.is-error {border-color: #fecdca; background: #fffbfa;}
.om-cde-tile.is-error .om-cde-tile-label {color: var(--om-danger, #b42318); font-weight: 500;}
.om-cde-tile.is-error .om-cde-tile-state {background: rgba(255, 251, 250, .78);}
.om-cde-tile.is-uploading .om-ce-photo-no {z-index: 3;}
.om-cde-drop {margin: 12px 0 0;}
.om-cde-drop[hidden] {display: none;}
.om-cde-more {display: flex; justify-content: center; margin-top: 14px;}
.om-cde-more[hidden] {display: none;}
.om-cde-add {display: inline-flex; align-items: center; gap: 6px;}
.om-cde-gallery-msg {margin: 8px 0 0;}
.om-cde-gallery-msg[hidden] {display: none;}

/* r100: the Car Delivery list's Post Preview - the feed card in a wide dialog; [Edit] [Delete] in its footer. */
.om-cdp-dialog {width: 1040px;}
.om-cdp-title-row {display: flex; align-items: center; gap: 10px;}
.om-cdp-title-row .om-pill[hidden] {display: none;}
.om-cdp-body {background: #f6f8fb;}
.om-cdp-loading {display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 160px; color: var(--om-text-muted, #6b7280);}
.om-cdp-loading[hidden], .om-cdp-card[hidden], .om-cdp-foot[hidden], .om-cdp-foot [hidden] {display: none;}
.om-cdp-card .cdf-card {box-shadow: none;}
.om-cdp-foot {justify-content: flex-start;}
.om-cdp-foot .om-btn {display: inline-flex; align-items: center; gap: 6px;}
/* R173: the photo viewer's round page buttons under the photo (the current one filled; 2-12 photos). */
.cdf-viewer-dots {display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 100%;}
.cdf-viewer-dots[hidden] {display: none;}
.cdf-viewer-dot {position: relative; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;}
.cdf-viewer-dot::before {content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 1.5px solid rgba(255, 255, 255, .75); border-radius: 50%; box-sizing: border-box;}
.cdf-viewer-dot.is-current::before {border-color: #fff; background: #fff;}
.cdf-viewer-dot:focus-visible {outline: 2px solid #fff; outline-offset: 1px;}
.cdf-viewer-figure img {max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px);}

/* ==========================================================================
   RESPONSIVE STYLES - Car Delivery
   r132: every width rule of this stylesheet is in this section - one block per breakpoint, widest first;
   then reduced motion. The list uses the shared table panel, filter sheet and Quick View.
   ========================================================================== */

/* 760px and below */
@media (max-width: 760px) {
	/* Post preview card */
	.cdf-card {grid-template-columns: minmax(0, 1fr);}
	.cdf-advisor {border-right: 0; border-bottom: 1px solid var(--cdf-border);}
	.cdf-viewer {padding: 48px 12px;}
	/* R168 Add / Edit Car Delivery preview: the profile, then the story and its photos. */
	.om-cde-preview .cdf-card {grid-template-columns: minmax(0, 1fr);}
}

/* 600px and below */
@media (max-width: 600px) {
	/* R168 Post Preview: a full-screen page - the header and footer stay, the post scrolls between them. */
	.om-modal.om-cdp {align-items: stretch; padding: 0;}
	.om-cdp .om-modal-dialog.om-cdp-dialog {width: 100%; height: 100vh; height: 100dvh; max-height: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border-radius: 0; box-shadow: none;}
	.om-cdp-body {flex: 1 1 auto; min-height: 0; padding: 12px; overscroll-behavior: contain;}
	.om-cdp-foot {border-radius: 0;}
}

@media (max-width: 480px) {
.om-cdp .cdf-advisor, .om-cde-preview .cdf-advisor {display: grid; grid-template-columns: minmax(0, 50fr) minmax(0, 50fr); grid-template-areas: "avatar stat" "name stat" "role stat"; align-content: center; align-items: center; justify-items: center; column-gap: 12px; padding: 16px 12px; text-align: center;}
.om-cdp .cdf-avatar, .om-cde-preview .cdf-avatar {grid-area: avatar; width: 64px; height: 64px;}
.om-cdp .cdf-name, .om-cde-preview .cdf-name {grid-area: name; max-width: 100%; margin-top: 8px; font-size: 1rem; overflow-wrap: anywhere;}
.om-cdp .cdf-role, .om-cde-preview .cdf-role {grid-area: role; max-width: 100%; overflow-wrap: anywhere;}
.om-cdp .cdf-stat, .om-cde-preview .cdf-stat {grid-area: stat; align-self: stretch; align-items: center; justify-content: center; width: 100%; min-width: 0; margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--cdf-border);}
.om-cdp .cdf-stat-text, .om-cde-preview .cdf-stat-text {min-width: 0; overflow-wrap: anywhere;}
.om-cdp .cdf-advisor, .om-cde-preview .cdf-advisor, .cdf-story {padding: 14px;}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	/* Spinner */
	.cdf-spinner {animation-duration: 2s;}
	.cdf-photo img, .cdf-copied, .cdf-nav, .cdf-js .cdf-slide .cdf-photo img {transition: none;}
	.cdf-skel {animation: none;}
	/* r101: a still placeholder. */
}
