/* =========================================================
   File lists — [townsy_files], see inc/file-lists.php

   Loaded on the front end and inside TinyMCE, where the theme's
   variables are not defined; every var() carries a fallback so the
   Visual tab preview matches the published page.

   Badge colours match the CSS-only badges on plain inline links in
   style.css, so a file looks the same whichever way it was linked.
   ========================================================= */

.townsy-files {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.townsy-files__item {
    margin: 0 0 .6rem;
    padding: 0;
}

.townsy-files__item::before,
.townsy-files__item::marker {
    content: none;
}

.townsy-files__link {
    color: var(--townsy-primary, #1a3a5c);
    text-decoration: none;
}

.townsy-files__link:hover .townsy-files__title,
.townsy-files__link:focus .townsy-files__title {
    text-decoration: underline;
}

/* The badge is rendered by PHP from the file's type. Switch off the
   URL-based ::before badge style.css adds to links in .wp-content,
   or a PDF in a list would be badged twice. */
.townsy-files a.townsy-files__link[href]::before {
    content: none;
    display: none;
}

.townsy-files__badge {
    display: inline-block;
    min-width: 2.6em;
    margin-right: .45em;
    padding: .25em .45em;
    border-radius: .25rem;
    font-size: .62em;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1;
    text-align: center;
    vertical-align: .2em;
    color: #fff;
    background: #5a6268;
}

.townsy-files__badge--pdf { background: #c0392b; }
.townsy-files__badge--doc { background: #2b5fbd; }
.townsy-files__badge--xls { background: #1e7e45; }
.townsy-files__badge--csv { background: #0e7b7b; }
.townsy-files__badge--ppt { background: #c55a11; }

.townsy-files__size {
    font-size: .8em;
    color: var(--townsy-text-muted, #5a6268);
    white-space: nowrap;
}

.townsy-files__missing {
    font-size: .85em;
    font-style: italic;
    color: #8a4b00;
}

.townsy-files .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------------------------------------------------------
   Editor preview only — the hint never reaches the front end.
   --------------------------------------------------------- */

.townsy-files-preview {
    padding: .6rem .8rem .1rem;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    background: #fbfbfc;
}

.townsy-files__hint {
    margin: 0 0 .6rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    color: #50575e;
}

.townsy-files-preview .townsy-files {
    margin-bottom: .5rem;
}
