/**
* Download System - shared front-end stylesheet
*
* Consolidated from the inline <style> blocks that used to live in
* index_body.html and showcat_body.html. Both templates share most of
* these rules (grid/card/modal); the one real difference between them
* (icon size) is scoped via the grid's own #edsCatGrid / #edsFileGrid id
* rather than duplicating the whole block per template.
*/

.eds-toolbar { margin: 0 0 1em; }
.eds-search-input { width: 100%; max-width: 320px; padding: 6px 10px; border-radius: 6px; box-sizing: border-box; }
.eds-points-balance { margin: 0 0 1em; font-size: 13px; opacity: 0.85; }

.eds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 1em; }
.eds-card { display: flex; gap: 12px; padding: 14px; border: 1px solid rgba(127,127,127,0.35); border-radius: 10px; }
.eds-card-icon { flex-shrink: 0; display: block; }
.eds-card-icon img { width: 45px; height: 45px; border-radius: 6px; object-fit: cover; }
#edsCatGrid .eds-card-icon img { width: 40px; height: 40px; }
.eds-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.eds-card-title { font-weight: bold; font-size: 15px; display: block; margin-bottom: 4px; }

/* index_body.html - category cards */
.eds-card-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.eds-count-badge { font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 999px; background: rgba(127,127,127,0.15); white-space: nowrap; flex-shrink: 0; }
.eds-card-subcats { font-size: 12px; opacity: 0.8; margin-bottom: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.eds-latest-file { border-top: 1px solid rgba(127,127,127,0.25); padding-top: 8px; margin-top: auto; }
.eds-latest-file-label { display: flex; align-items: center; gap: 8px; font-size: 11px; opacity: 0.7; margin-bottom: 4px; }
.eds-latest-file-name { font-size: 13px; font-weight: bold; margin: 0 0 6px; }
.eds-latest-file-empty { font-weight: normal; opacity: 0.7; font-style: italic; }
.eds-latest-file-stats { display: flex; gap: 14px; font-size: 12px; opacity: 0.75; }

/* showcat_body.html - individual download cards */
.eds-card-badge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.eds-card-size { font-size: 12px; opacity: 0.75; }
.eds-badge-cost { background: rgba(212,160,23,0.22); }
.eds-card-meta { font-size: 12px; opacity: 0.7; margin-bottom: 8px; }
.eds-card-meta span { display: block; }
.eds-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.eds-card-clicks { font-size: 12px; opacity: 0.8; }

/* download icon + file-extension badge (downloadsystemcat.php builds this
   markup server-side: a Font Awesome fa-stack icon with a plain .eds-ext
   span for the extension nested inside it). Without explicit positioning
   here, .eds-ext isn't picked up by Font Awesome's own fa-stack-1x/2x
   absolute-positioning rules, so it just flows inline on top of the icon's
   2em-square box - hence the overlap. Pull it out to a small corner badge
   instead. */
.fa-stack { position: relative; }
.eds-ext {
	position: absolute;
	right: -8px;
	bottom: -2px;
	font-size: 9px;
	font-weight: bold;
	line-height: 1;
	text-transform: uppercase;
	background: rgba(80,80,80,0.92);
	color: #fff;
	padding: 2px 4px;
	border-radius: 4px;
	pointer-events: none;
}

/* shared: description clamp + read-more */
.eds-card-desc-wrap { margin-bottom: 8px; }
.eds-card-desc { font-size: 13px; opacity: 0.85; word-wrap: break-word; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
.eds-readmore { display: none; margin-top: 2px; border: none; background: none; padding: 0; font-size: 12px; color: inherit; text-decoration: underline; cursor: pointer; opacity: 0.8; }
.eds-badge { font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 999px; background: rgba(127,127,127,0.18); }
.eds-no-results { opacity: 0.7; font-style: italic; }

/* shared: description modal */
.eds-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.eds-modal-overlay[hidden] { display: none; }
.eds-modal { max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; }
.eds-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eds-modal-close { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.eds-modal-body { font-size: 14px; line-height: 1.6; }

@media (max-width: 900px) {
	.eds-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.eds-grid { grid-template-columns: 1fr; }
	.eds-card { flex-direction: column; }
}
