/* =============================================================================
   yimcore_desk_layout.css
   -----------------------------------------------------------------------------
   Overrides the stock desktop icon title styling so long module labels
   (especially in English) wrap to two lines and stay centered instead of
   being truncated with an ellipsis ("System Arc...").
   The icon container stays SQUARE (fixed height) — only the caption area
   is given enough room for two lines.
   No system source files are modified - loaded via app_include_css.
   ========================================================================== */

/* Keep the desktop icon square: use the platform's responsive --desktop-icon-container
   variable (127px desktop / 117px tablet / 100px small-mobile) so the layout
   stays centered at all viewport widths instead of forcing a fixed 127px that
   overflows on phones. */
.desktop-icon {
	width: var(--desktop-icon-container, 127px) !important;
	height: var(--desktop-icon-container, 126px) !important;
	flex-shrink: 0 !important;
}

/* Force the icon container to stay a perfect square regardless of
   the grid column width (which uses 1fr and grows with the window). */
.desktop-icon .icon-container {
	width: var(--desktop-icon-dimension, 54px) !important;
	height: var(--desktop-icon-dimension, 54px) !important;
	aspect-ratio: 1 / 1 !important;
	flex-shrink: 0 !important;
}

/* Prevent the app icon image from being stretched by object-fit:fill */
.desktop-icon .icon-container .app-icon,
.desktop-icon .icon-container img {
	width: var(--desktop-icon-dimension, 54px) !important;
	height: var(--desktop-icon-dimension, 54px) !important;
	object-fit: contain !important;
}

/* Icon caption: fixed height that fits exactly two lines, centered */
.desktop-icon .icon-caption {
	height: 36px !important;
	text-wrap: wrap !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
	align-items: center !important;
	width: 100%;
	overflow: hidden;
}

/* Icon title: 2-line clamp, centered, slightly smaller font so long words
   (e.g. "Transportation") fit without mid-word breaking */
.desktop-icon .icon-title {
	white-space: normal !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	text-align: center !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2 !important;
	-webkit-box-orient: vertical !important;
	line-height: 1.25 !important;
	font-size: 13px !important;
	word-break: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
}

/* ==========================================================================
   Hide framework-branded / copyright elements
   (combined with JS that hides by label text)
   ========================================================================== */

/* About dialog: hide social buttons and copyright (the whole dialog is
   replaced by our own branded About dialog from the desk layout bundle) */
.about-social-btns,
.about-footer {
	display: none !important;
}

/* Generic footer copyright / powered-by text */
.powered-by,
[class*="copyright"] {
	display: none !important;
}

/* Center the website footer powered-by text.
   The stock footer uses a 2-column row; when the left column
   (copyright / address) is empty, the powered-by text sits on
   the right.  Override to center it across the full width. */
.footer-info > .row {
	display: flex !important;
	justify-content: center !important;
	text-align: center !important;
}
.footer-info .footer-col-right.footer-powered {
	width: 100% !important;
	text-align: center !important;
	flex: 0 0 100% !important;
	max-width: 100% !important;
}
.footer-info .footer-col-right.footer-powered a {
	color: #8d99a6 !important;
}

/* ==========================================================================
   Fix Accounting module folder icon
   --------------------------------------------------------------------------
   The stock app ships "Accounting" as a Folder-type desktop icon.  Its
   template renders an EMPTY <div class="icon-container folder-icon"> for
   folders (the child-icon preview JS does not run in v15), so the card
   shows a blank grey square.  We inject the accounting.svg as a background
   image so it looks like every other module card.  YCO-owned asset copy,
   no upstream path and no source files changed.
   ========================================================================== */
.desktop-icon[data-id="Accounting"] .icon-container.folder-icon {
	background-color: transparent !important;
	background-image: url("/assets/yimcore_desktop_ui/icons/desktop_icons/solid/accounting.svg") !important;
	background-size: 70% !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
}

/* ==========================================================================
   Fix: list column header scrolls away with the data (all Desk modules)
   --------------------------------------------------------------------------
   Symptom: on a List page the column-header row (column titles + the
   "Nth item / total" paging line) scrolls away together with the data rows,
   while the breadcrumb title bar and the filter bar stay pinned.  Users
   perceive the "title" as scrolling out of view.

   Root cause: the stock list view sizes .result-container to a fixed pixel height and
   makes it the scroll box for the rows.  The header container already has
   "position: sticky; top: 0", but its parent .result carries
   "overflow-y: hidden".  Per the CSS overflow / sticky spec, an ancestor
   with a non-visible overflow becomes the sticky positioning scroll
   container; .result itself never scrolls (its height equals the content),
   so the sticky header is carried away with the content.

   Fix: release the clipping on .result for the standard desk List view, so
   the existing sticky header sticks to the real scroll box
   (.result-container).  The header already has an opaque background
   (--subtle-fg) and z-index:2 in the stock list stylesheet.  Horizontal
   scrolling stays on .result-container (overflow-x: auto).

   Scoped to the List view only (.list-view is added by list_view.js);
   forms, reports, dashboards, global-search and embedded lists with
   .disable-scrolling are untouched.  Pure CSS hook, no source modified.
   ========================================================================== */
.layout-main-section-wrapper.list-view:not(.disable-scrolling)
	.result-container
	> .result {
	overflow: visible !important;
}
