/**
 * @file
 * File icons using SVG data URIs
 * Applied globally to all file links.
 */

/* ========================================
   BASE FILE ICON STYLES
   ======================================== */

.file a::before,
.field--type-file a::before {
  content: '';
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Default file icon (gray) */
.file a::before,
.field--type-file a::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%2364748b'%3E%3Cpath d='M320 464c8.8 0 16-7.2 16-16V160H256c-17.7 0-32-14.3-32-32V48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16H320zM0 64C0 28.7 28.7 0 64 0H229.5c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64z'/%3E%3C/svg%3E");
}

/* ========================================
   PDF FILES (red)
   ======================================== */

.file a[href$=".pdf"]::before,
.field--type-file a[href$=".pdf"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23dc2626'%3E%3Cpath d='M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V304H176c-35.3 0-64 28.7-64 64V512H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128zM176 352h32c30.9 0 56 25.1 56 56s-25.1 56-56 56H192v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V448 368c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H192v48h16zm96-80h32c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H304c-8.8 0-16-7.2-16-16V368c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H320v96h16zm80-112c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H448v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V432 368z'/%3E%3C/svg%3E");
}

/* ========================================
   WORD DOCUMENTS (blue)
   ======================================== */

.file a[href$=".doc"]::before,
.file a[href$=".docx"]::before,
.field--type-file a[href$=".doc"]::before,
.field--type-file a[href$=".docx"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%232563eb'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM111 257.1l26.8 89.2 31.6-90.3c3.4-9.6 12.5-16.1 22.7-16.1s19.3 6.4 22.7 16.1l31.6 90.3L273 257.1c3.8-12.7 17.2-19.9 29.9-16.1s19.9 17.2 16.1 29.9l-48 160c-3 10-12 16.9-22.4 17.1s-19.8-6.2-23.2-16.1L192 336.6l-33.3 95.3c-3.4 9.8-12.8 16.3-23.2 16.1s-19.5-7.1-22.4-17.1l-48-160c-3.8-12.7 3.4-26.1 16.1-29.9s26.1 3.4 29.9 16.1z'/%3E%3C/svg%3E");
}

/* ========================================
   EXCEL SPREADSHEETS (green)
   ======================================== */

.file a[href$=".xls"]::before,
.file a[href$=".xlsx"]::before,
.file a[href$=".csv"]::before,
.field--type-file a[href$=".xls"]::before,
.field--type-file a[href$=".xlsx"]::before,
.field--type-file a[href$=".csv"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%2316a34a'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM155.7 250.2L192 302.1l36.3-51.9c7.6-10.9 22.6-13.5 33.4-5.9s13.5 22.6 5.9 33.4L221.3 344l46.4 66.2c7.6 10.9 5 25.8-5.9 33.4s-25.8 5-33.4-5.9L192 385.8l-36.3 51.9c-7.6 10.9-22.6 13.5-33.4 5.9s-13.5-22.6-5.9-33.4L162.7 344l-46.4-66.2c-7.6-10.9-5-25.8 5.9-33.4s25.8-5 33.4 5.9z'/%3E%3C/svg%3E");
}

/* ========================================
   POWERPOINT PRESENTATIONS (orange)
   ======================================== */

.file a[href$=".ppt"]::before,
.file a[href$=".pptx"]::before,
.field--type-file a[href$=".ppt"]::before,
.field--type-file a[href$=".pptx"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%23ea580c'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM136 240h68c42 0 76 34 76 76s-34 76-76 76H160v56c0 13.3-10.7 24-24 24s-24-10.7-24-24V264c0-13.3 10.7-24 24-24zm68 104c15.5 0 28-12.5 28-28s-12.5-28-28-28H160v56h44z'/%3E%3C/svg%3E");
}

/* ========================================
   IMAGE FILES (purple)
   ======================================== */

.file a[href$=".jpg"]::before,
.file a[href$=".jpeg"]::before,
.file a[href$=".png"]::before,
.file a[href$=".gif"]::before,
.file a[href$=".webp"]::before,
.file a[href$=".svg"]::before,
.field--type-file a[href$=".jpg"]::before,
.field--type-file a[href$=".jpeg"]::before,
.field--type-file a[href$=".png"]::before,
.field--type-file a[href$=".gif"]::before,
.field--type-file a[href$=".webp"]::before,
.field--type-file a[href$=".svg"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%238b5cf6'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm152 32c5.3 0 10.2 2.6 13.2 6.9l88 128c3.4 4.9 3.7 11.3 1 16.5s-8.2 8.6-14.2 8.6H80c-5.8 0-11.1-3.1-13.9-8.1s-2.8-11.2 .2-16.1l48-80c2.9-4.8 8.1-7.8 13.7-7.8s10.8 2.9 13.7 7.8l12.8 21.4 48.3-70.2c3-4.3 7.9-6.9 13.2-6.9z'/%3E%3C/svg%3E");
}

/* ========================================
   ARCHIVE FILES (amber)
   ======================================== */

.file a[href$=".zip"]::before,
.file a[href$=".rar"]::before,
.file a[href$=".7z"]::before,
.file a[href$=".tar"]::before,
.file a[href$=".gz"]::before,
.field--type-file a[href$=".zip"]::before,
.field--type-file a[href$=".rar"]::before,
.field--type-file a[href$=".7z"]::before,
.field--type-file a[href$=".tar"]::before,
.field--type-file a[href$=".gz"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%23f59e0b'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM96 48c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm0 64c0-8.8 7.2-16 16-16h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16zm-6.3 71.8L137.1 296H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V289.6l-51.4-42.8c-4.6-3.8-11.3-.5-11.3 5.6 0 4.4 2.3 8.5 6.1 10.8z'/%3E%3C/svg%3E");
}

/* ========================================
   AUDIO FILES (pink)
   ======================================== */

.file a[href$=".mp3"]::before,
.file a[href$=".wav"]::before,
.file a[href$=".ogg"]::before,
.file a[href$=".m4a"]::before,
.field--type-file a[href$=".mp3"]::before,
.field--type-file a[href$=".wav"]::before,
.field--type-file a[href$=".ogg"]::before,
.field--type-file a[href$=".m4a"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%23ec4899'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM192 272V464c0 8.8-7.2 16-16 16s-16-7.2-16-16V288h-8c-22.1 0-40-17.9-40-40s17.9-40 40-40h8 24c13.3 0 24 10.7 24 24v8c0 4.4-3.6 8-8 8h-8z'/%3E%3C/svg%3E");
}

/* ========================================
   VIDEO FILES (cyan)
   ======================================== */

.file a[href$=".mp4"]::before,
.file a[href$=".avi"]::before,
.file a[href$=".mov"]::before,
.file a[href$=".wmv"]::before,
.file a[href$=".webm"]::before,
.field--type-file a[href$=".mp4"]::before,
.field--type-file a[href$=".avi"]::before,
.field--type-file a[href$=".mov"]::before,
.field--type-file a[href$=".wmv"]::before,
.field--type-file a[href$=".webm"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%2306b6d4'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 288c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V288zM300.9 397.9L256 368V304l44.9-29.9c2-1.3 4.4-2.1 6.8-2.1c6.8 0 12.3 5.5 12.3 12.3V387.7c0 6.8-5.5 12.3-12.3 12.3c-2.4 0-4.8-.7-6.8-2.1z'/%3E%3C/svg%3E");
}

/* ========================================
   TEXT FILES (gray)
   ======================================== */

.file a[href$=".txt"]::before,
.file a[href$=".rtf"]::before,
.field--type-file a[href$=".txt"]::before,
.field--type-file a[href$=".rtf"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512' fill='%2364748b'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM112 256H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64H272c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z'/%3E%3C/svg%3E");
}

/* ========================================
   STYLED FILE LIST
   ======================================== */

/* Nice file list styling */
.field--type-file .field__items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field--type-file .field__item {
  display: block;
}

.field--type-file a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  text-decoration: none;
  color: #334155;
  transition: all 0.2s ease;
}

.field--type-file a:hover {
  background: #fff7ed;
  color: #f97316;
}

/* File size display */
.field--type-file .file-size {
  margin-left: auto;
  font-size: 0.8rem;
  color: #94a3b8;
}
