/*
 * Top Fice — front-end styles
 *
 * Colors and typography mirror the Figma export:
 *   #1A1818 ink / #FAF8F4 cream / #FAF6E8 highlight / #E8E4DF border
 *   #6B6560 muted / #C8A951 gold / #E8D08A gold hover / #2E7D32 up / #C62828 down
 *   Fonts: Playfair Display (titles), Archivo (body), IBM Plex Mono (numbers).
 */

/* ===== STYLE ARMOR (conservador) =====
 * Defaults en el wrapper para que el contenido herede font/color/box-sizing
 * correctos. NO usamos !important ni selectores agresivos sobre hijos
 * (h1-h6, p, ul/ol, table) — eso pisaba las clases internas del plugin
 * tipo `.tf-fw-category` que sí están autorizadas a redefinir su propio
 * margin/padding/font. Si un tema pisa algún property específico, agregar
 * el property al armor con specificity puntual — NO meter resets globales
 * acá. */

.topfice,
.topfice *,
.topfice *::before,
.topfice *::after {
    box-sizing: border-box;
}

.topfice {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1A1818;
    line-height: 1.5;
    background: #ffffff;
    font-size: 16px;
}

/* Links — sin underline por default; cada componente decide su look. */
.topfice a {
    color: inherit;
    text-decoration: none;
    background: transparent;
}

/* Form elements: heredan font para que los <input>/<select> de los filtros
 * no se vean con la font default del tema. Sin tocar margin/padding/border. */
.topfice button,
.topfice input,
.topfice select,
.topfice textarea {
    font-family: inherit;
    color: inherit;
    line-height: inherit;
}

/* Imágenes responsive. */
.topfice img,
.topfice svg {
    max-width: 100%;
    height: auto;
    border: 0;
    vertical-align: middle;
}

/* Tablas: solo lo estructural mínimo. Los estilos visuales (padding/border/
 * background de th/td) los manejan las clases `.tf-table` y derivadas. */
.topfice table {
    border-collapse: collapse;
    border-spacing: 0;
}

.tf-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .tf-container { padding: 0 16px; }
}

.tf-gold   { color: #C8A951; }
.tf-muted  { color: #6B6560; }
.tf-up     { color: #2E7D32; }
.tf-down   { color: #C62828; }
.tf-mono   { font-family: 'IBM Plex Mono', monospace; }
.tf-right  { text-align: right; }
.tf-flag   { margin-right: 8px; }

/* ----- HERO (Ranking) ----- */
.tf-hero {
    background: #1A1818;
    padding: 64px 0;
    text-align: center;
}
.tf-hero-title {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0 0 16px;
    font-weight: 700;
}
.tf-hero-sub {
    color: #E8E4DF;
    font-size: 18px;
    max-width: 720px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .tf-hero { padding: 32px 0; }
    .tf-hero-title { font-size: 28px; }
    .tf-hero-sub { font-size: 14px; }
}

/* ----- FILTER BAR ----- */
.tf-filterbar {
    background: #fff;
    border-bottom: 1px solid #E8E4DF;
    padding: 24px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.tf-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}
@media (max-width: 540px) {
    .tf-filters { flex-direction: column; align-items: stretch; }
}

.tf-field { display: flex; flex-direction: column; flex: 1 1 0; min-width: 140px; }
/* El display:flex de arriba pisa el [hidden] del UA stylesheet (mismo caso
 * que .tf-loader[hidden]). Necesario para el filtro State del Ranking, que
 * solo se muestra cuando el country es United States. */
.tf-filters .tf-field[hidden] { display: none; }
/* Con el filtro State visible, Year se compacta: no necesita el min-width
 * genérico (el valor más largo es "All years" en Winners), y así toda la
 * línea de filtros sigue cabiendo sin wrap. */
.tf-filters.tf-has-state .tf-field-year { flex: 0 0 116px; min-width: 100px; }
@media (max-width: 540px) {
    /* En mobile los filtros se apilan en columna: flex-basis sería la ALTURA
     * del campo, así que Year vuelve al comportamiento normal (ancho full,
     * como el resto de los filtros apilados). */
    .tf-filters.tf-has-state .tf-field-year { flex: 1 1 auto; min-width: 0; }
}
.tf-field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6B6560;
    margin-bottom: 8px;
    font-weight: 400;
    font-family: inherit;
}
.tf-req { color: #C8A951; }
.tf-field select,
.tf-field input[type="text"] {
    background: #fff;
    border: 1px solid #E8E4DF;
    color: #1A1818;
    padding: 12px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    width: 100%;
}
/* Chevron propio en los <select>: el ícono nativo del browser depende del
   tema WP y muchas veces no se ve, lo que hace que el filtro parezca un input
   de texto. Sustituimos por un SVG inline y dejamos espacio a la derecha. */
.tf-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%231A1818' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    padding-right: 36px;
    cursor: pointer;
}
.tf-field select::-ms-expand { display: none; }
.tf-field select:focus,
.tf-field input[type="text"]:focus {
    outline: none;
    border-color: #C8A951;
    box-shadow: none;
}
.tf-field input[type="text"]::placeholder { color: #6B6560; }

.tf-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Especificidad alta para vencer estilos del theme WP que puedan pintar el botón. */
.topfice .tf-btn,
.topfice .tf-btn-gold,
button.tf-btn-gold,
input[type="submit"].tf-btn-gold {
    display: inline-block;
    background: #C8A951;
    color: #1A1818;
    border: 0;
    padding: 0 32px;
    height: 44px;
    line-height: 44px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: none;
}
.topfice .tf-btn-gold:hover,
button.tf-btn-gold:hover,
input[type="submit"].tf-btn-gold:hover { background: #E8D08A; color: #1A1818; }

.tf-btn-clear {
    color: #6B6560;
    text-decoration: none;
    font-size: 14px;
    transition: color .15s ease;
}
.tf-btn-clear:hover { color: #C8A951; }

/* ----- INFINITE SCROLL ----- */
.tf-infinite {
    position: relative;
    margin-top: 24px;
    min-height: 64px;
}
/* Sentinel: 1px invisible para el IntersectionObserver. No ocupa espacio
 * visual ni interrumpe el layout. */
.tf-sentinel {
    width: 100%;
    height: 1px;
    pointer-events: none;
}
.tf-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 0;
    color: #6B6560;
    font-size: 13px;
    letter-spacing: 0.04em;
}
.tf-loader[hidden] { display: none; }
.tf-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #E8E4DF;
    border-top-color: #C8A951;
    animation: tf-spin 0.8s linear infinite;
}
.tf-loader-text {
    color: #6B6560;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
@keyframes tf-spin {
    to { transform: rotate(360deg); }
}

/* ----- RESULTS / TABLE ----- */
.tf-results { padding: 48px 0 80px; }
.tf-table-wrap {
    background: #fff;
    border: 1px solid #E8E4DF;
    border-radius: 8px;
    /* En mobile la tabla tiene min-width para que las 7 columnas no se
     * aplasten — overflow-x: auto activa scroll horizontal si no entra. */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}
.tf-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}
@media (max-width: 768px) {
    /* Padding lateral más chico en celdas para aprovechar el ancho. */
    .tf-table th,
    .tf-table td { padding-left: 14px; padding-right: 14px; }
}
.tf-table thead { background: #FAF8F4; }
.tf-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6B6560;
    font-weight: 500;
    border-bottom: 1px solid #E8E4DF;
}
.tf-table th.tf-right { text-align: right; }
.tf-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #E8E4DF;
    font-size: 15px;
    color: #1A1818;
    vertical-align: middle;
}
.tf-table tr:last-child td { border-bottom: 0; }
.tf-table .tf-muted { color: #6B6560; }

/* Sticky header (pedido cliente 2026-06-21): la primera fila (thead) queda
 * fija al hacer scroll, tipo "inmovilizar fila" de Excel, para no perder qué
 * columna es cuál al bajar en Ranking/Winners.
 *
 * Solo en pantallas anchas (>=1000px): ahí la tabla entra completa y el
 * scroll vertical es el de la PÁGINA. position:sticky se resuelve contra el
 * contenedor de scroll más cercano, así que el wrap NO puede ser uno — por
 * eso le quitamos el overflow en este breakpoint (el infinite scroll no se
 * toca: su sentinel vive fuera del wrap, contra el viewport). En mobile
 * mantenemos overflow-x:auto para el scroll horizontal de la tabla; ahí el
 * header no se fija, que es aceptable.
 *
 * top usa --tf-table-sticky-top (default 0) por si el tema tiene un menú
 * fijo arriba: basta setear esa var en .topfice con la altura del header.
 * El box-shadow inset hace de divisor inferior: con border-collapse el
 * border-bottom de la celda se va con la fila al quedar sticky. */
@media (min-width: 1000px) {
    /* El tema (Chandelier) Y WPBakery ponen overflow:hidden en varios
     * wrappers (.eltd-wrapper-inner, .eltd-content, .vc_row, ...). CUALQUIER
     * ancestro con overflow != visible captura el position:sticky — se
     * resuelve contra ÉL (que no scrollea) en vez del viewport — y el thead
     * nunca se fija. Por eso en local (página sin esos wrappers) se ve bien y
     * en producción no. Liberamos el overflow SOLO en los wrappers que
     * realmente contienen el shortcode (:has), para no tocar otras filas o
     * secciones de la página. Solo >=1000px: el contenido entra en los 1200px
     * del container, así que no se genera scroll horizontal. */
    .eltd-wrapper-inner:has( .topfice ),
    .eltd-content:has( .topfice ),
    .eltd-content-inner:has( .topfice ),
    .eltd-container:has( .topfice ),
    .eltd-container-inner:has( .topfice ),
    .vc_row:has( .topfice ),
    .eltd-full-section-inner:has( .topfice ),
    .wpb_column:has( .topfice ),
    .vc_column-inner:has( .topfice ),
    .wpb_wrapper:has( .topfice ) { overflow: visible !important; }
    /* El <body> trae overflow-x:hidden (anti scroll horizontal del tema), y
     * eso lo vuelve scroll-container, rompiendo el sticky de TODO lo que tiene
     * dentro — confirmado en consola: era el único ancestro con overflow !=
     * visible. Usamos overflow-x:clip en vez de visible: clip recorta igual el
     * overflow horizontal (no aparece scrollbar) pero NO crea scroll-container,
     * así el thead sticky puede anclarse al viewport. */
    body:has( .topfice ) { overflow-x: clip !important; }
    .tf-table-wrap { overflow: visible; }
    .tf-table thead th {
        position: -webkit-sticky;
        position: sticky;
        top: var(--tf-table-sticky-top, 0px);
        z-index: 5;
        background: #FAF8F4;
        box-shadow: inset 0 -1px 0 #E8E4DF;
    }
}

/* La tabla del Ranking pasó a 8 columnas al sumar Holding Company
 * (2026-06-09). Con el padding genérico (24px por lado, 384px en total solo
 * de padding) la columna Points quedaba fuera de un vistazo en PC. Celdas
 * más compactas y tipografía un punto menor SOLO en ranking — Winners
 * sigue en 6 columnas con el estilo genérico. Hay nombres de agencia de
 * hasta ~54 chars: van a hacer wrap a dos líneas, es esperado. */
.topfice-ranking .tf-table { min-width: 900px; }
.topfice-ranking .tf-table th {
    padding: 14px 12px;
    letter-spacing: 0.08em;
}
.topfice-ranking .tf-table td {
    padding: 14px 12px;
    font-size: 14px;
}
.topfice-ranking .tf-table th:first-child,
.topfice-ranking .tf-table td:first-child { padding-left: 20px; }
.topfice-ranking .tf-table th:last-child,
.topfice-ranking .tf-table td:last-child { padding-right: 20px; }
/* Points no debe partirse nunca; el resto de celdas puede wrappear. */
.topfice-ranking .tf-table td.tf-right.tf-mono { white-space: nowrap; }

.tf-sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tf-sort-link:hover { color: #C8A951; }
.tf-sort-arrow {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    transition: opacity .15s ease;
}
.tf-sort-arrow.tf-sort-idle { opacity: 0.4; }
.tf-sort-link:hover .tf-sort-arrow.tf-sort-idle { opacity: 0.8; }

/* AJAX loading: fade sutil sobre la tabla mientras la fetch está en vuelo. */
.tf-table-wrap.tf-table-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity .12s ease;
}

.tf-row { transition: background-color .15s ease; }
.tf-row:hover { background: #FAF8F4; }
.tf-row-clickable { cursor: pointer; }
.tf-row-clickable:hover { background: #FAF6E8; }
.tf-row-top { border-left: 1px solid #C8A951; }
.tf-row-1 { background: #FAF6E8; border-left: 3px solid #C8A951; }

.tf-rank {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #1A1818;
}
.tf-rank-top { color: #C8A951; }
.tf-rank-cell { width: 80px; }

.tf-agency-cell { font-weight: 500; }
.tf-agency-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.tf-row-clickable:hover .tf-agency-link { border-bottom-color: #C8A951; }

.tf-arrow {
    color: #C8A951;
    opacity: 0;
    transition: opacity .15s ease;
    margin-left: 8px;
    display: inline-block;
}
.tf-row-clickable:hover .tf-arrow { opacity: 1; }
/* La celda de score (números + flechita de hover) no debe wrappear: si
 * el ancho de la columna se ajusta justo, "6.627 →" se rompía y la
 * flecha caía debajo del número. nowrap mantiene todo en línea. */
.tf-table td.tf-right.tf-mono { white-space: nowrap; }

.tf-badge {
    display: inline-block;
    background: #C8A951;
    color: #1A1818;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 10px;
}

/* "Agency of the Year YYYY" pill al lado del nombre en Winners. Mismo
 * gradient que .tf-agency-badge del detail page, en tamaño chico para que
 * conviva con la <tr> sin pisar las otras columnas. */
.tf-aoy-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(to right, #C8A951, #E8D08A);
    color: #1A1818;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-left: 10px;
    /* font-weight: 600; */
    white-space: nowrap;
    vertical-align: middle;
}

/* ----- EMPTY STATE ----- */
.tf-empty {
    text-align: center;
    padding: 96px 0;
}
.tf-empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-style: italic;
    color: #1A1818;
    margin-bottom: 8px;
}
.tf-empty-sub { color: #6B6560; font-size: 14px; margin: 0; }

/* ----- AGENCY PROFILE ----- */
.tf-agency-header {
    border-bottom: 1px solid #E8E4DF;
    padding: 48px 0;
}
.tf-agency-back { margin-bottom: 32px; }
.tf-agency-back a {
    color: #C8A951;
    text-decoration: none;
    font-size: 13px;
}
.tf-agency-back a:hover { color: #E8D08A; }

.tf-agency-top {
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
}
.tf-agency-logo-wrap {
    width: 160px;
    height: 80px;
    background: #fff;
    border: 1px solid #E8E4DF;
    border-radius: 4px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.tf-agency-logo-bg {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.tf-agency-letter {
    font-size: 48px;
    color: #1A1818;
    font-family: 'Playfair Display', serif;
}
.tf-agency-info { flex: 1; min-width: 240px; }
.tf-agency-name {
    font-family: 'Playfair Display', serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 16px;
    color: #1A1818;
    margin-block-end: calc(var(--has-theme-content-spacing, 1) * (.3em + 0px)) !important;
}
@media (max-width: 768px) {
    .tf-agency-name { font-size: 36px; }
}
.tf-agency-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(to right, #C8A951, #E8D08A);
    color: #1A1818;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
    font-weight: 500;
}
.tf-agency-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
    color: #6B6560;
}
.tf-year-tabs {
    background: #fff;
    border-bottom: 1px solid #E8E4DF;
}
.tf-year-tabs .tf-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.tf-year-tab {
    padding: 16px 24px;
    color: #6B6560;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.tf-year-tab:hover { color: #1A1818; }
.tf-year-active {
    color: #C8A951;
    border-bottom-color: #C8A951;
}

.tf-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}
@media (max-width: 768px) {
    .tf-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.tf-stat {
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
}
.tf-stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 48px;
    font-weight: 400;
    color: #1A1818;
    line-height: 1;
    margin-bottom: 8px;
}
.tf-stat-highlight .tf-stat-value { color: #C8A951; }
.tf-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6B6560;
}

.tf-score-block {
    background: #FAF8F4;
    border-radius: 8px;
    padding: 48px 0;
    text-align: center;
    margin-bottom: 48px;
}
.tf-score-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 64px;
    color: #C8A951;
    line-height: 1;
    margin-bottom: 8px;
    font-weight: 500;
}
.tf-score-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #6B6560;
}

.tf-awards-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 24px;
    color: #1A1818;
}

/* Award level pills */
.tf-pill {
    display: inline-block;
    padding: 0px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    background: #E8E4DF;
    color: #1A1818;
}

/* ----- MOBILE TABLE TWEAKS ----- */
@media (max-width: 768px) {
    .tf-table th, .tf-table td { padding: 12px 14px; font-size: 13px; }
    .tf-hero { padding: 32px 0; }
    .tf-results { padding: 24px 0 48px; }
    .tf-agency-header { padding: 24px 0; }
    .tf-stats-grid { gap: 12px; }
    .tf-stat { padding: 16px 8px; }
    .tf-stat-value { font-size: 28px; }
    .tf-score-value { font-size: 42px; }
    .tf-awards-title { font-size: 22px; }
}

/* ============================================================
 * [topfice_winners_circle] — home section, 5 top agencies del año.
 * Replica del componente WinnersCircle.tsx del proyecto frontend
 * (Figma model). bg cream + eyebrow dorado + cards blancas con
 * iniciales o logo y score en mono dorado.
 * ============================================================ */
.tf-winners-circle {
    background: #FAF8F4;
    padding: 64px 0;
}
.tf-wc-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}
.tf-wc-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}
.tf-wc-eyebrow-line {
    display: inline-block;
    width: 32px;
    height: 1.5px;
    background: #C8A951;
}
.tf-wc-eyebrow-text {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #C8A951;
    text-transform: uppercase;
    text-align: center;
}
/* Flex con wrap + justify-center: si hay 5 cards llenan la fila, si hay
 * menos quedan centradas en vez de pegadas a la izquierda como hacía
 * el grid de 5 columnas fijas. */
.tf-wc-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
}
.tf-wc-card {
    flex: 0 1 calc((100% - 4 * 32px) / 5);
    max-width: calc((100% - 4 * 32px) / 5);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease;
}
.tf-wc-card:hover {
    text-decoration: none;
    color: inherit;
}
.tf-wc-card-logo {
    background: #fff;
    border: 1px solid #E8E4DF;
    border-radius: 8px;
    padding: 24px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: border-color .15s ease;
}
.tf-wc-card:hover .tf-wc-card-logo {
    border-color: #C8A951;
}
.tf-wc-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.tf-wc-card-initials {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #C8A951;
    letter-spacing: 0.02em;
}
.tf-wc-card-meta { text-align: center; }
.tf-wc-card-name {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1A1818;
    margin: 0 0 4px;
    line-height: 1.3;
    transition: color .15s ease;
}
.tf-wc-card:hover .tf-wc-card-name { color: #C8A951; }
.tf-wc-card-country {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    color: #6B6560;
    margin: 0 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
/* Emoji bandera (🇺🇸, 🇫🇷, etc.) — sin font-family override, deja que
 * el OS use su font emoji nativo. macOS/iOS lo muestra ondulado,
 * Android usa Noto, Windows muestra letras "US/FR" (limitación del
 * sistema, mismo comportamiento que el mock React original).
 * Hereda font-size y line-height del padre (.tf-wc-card-country). */
.tf-wc-card-flag.tf-flag-emoji,
.tf-flag-emoji {
    flex-shrink: 0;
}
/* Imagen real (cuando el cliente sube assets a wp-content/plugins/
 * topfice/assets/flags/{iso}.{svg|png|jpg|jpeg|webp}). */
.tf-wc-card-flag.tf-flag-img,
.tf-wc-card-flag-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}
.tf-wc-card-score {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #C8A951;
    margin: 0;
    letter-spacing: 0.02em;
}

/* Responsive: 2 columnas en tablets, 1 columna en mobile (mantiene el
 * mismo layout vertical del frontend project). */
@media (max-width: 960px) {
    .tf-wc-grid { gap: 24px; }
    .tf-wc-card {
        flex: 0 1 calc((100% - 24px) / 2);
        max-width: calc((100% - 24px) / 2);
    }
}
@media (max-width: 520px) {
    .tf-winners-circle { padding: 48px 0; }
    .tf-wc-inner { padding: 0 20px; }
    .tf-wc-grid { gap: 20px; }
    .tf-wc-card {
        flex: 0 1 100%;
        max-width: 100%;
    }
    .tf-wc-card-logo { height: 112px; padding: 20px; }
    .tf-wc-eyebrow-text { font-size: 9px; letter-spacing: 0.12em; }
}

/* ============================================================
 * [topfice_featured_winners] — Carousel rotativo, home section.
 * Replica WinnersCarousel.tsx + WinnerSlide.tsx del proyecto React
 * modelo. bg blanco + card grande con borde, badge circular por
 * award level a la izq, info al centro, stat number a la der;
 * progress bar arriba + dots/nav buttons abajo.
 * ============================================================ */
.tf-featured-winners {
    background: #fff;
    padding: 80px 0 64px;
}
.tf-fw-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 80px;
}

/* Header */
.tf-fw-header { margin-bottom: 48px; }
.tf-fw-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.tf-fw-eyebrow-line {
    display: inline-block;
    width: 32px;
    height: 1.5px;
    background: #C8A951;
}
.tf-fw-eyebrow-text {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #C8A951;
    font-weight: 500;
}
.tf-fw-title {
    font-family: 'Playfair Display', serif;
    font-size: 38px;
    line-height: 1.2;
    margin: 0;
    color: #1A1818;
}
.tf-fw-title-plain { font-weight: 700; color: #1A1818; }
.tf-fw-title-em    { font-style: italic; color: #C8A951; font-weight: 400; margin: 0 4px; }

/* Stage / card */
.tf-fw-stage {
    background: #fff;
    border: 0.5px solid #E8E4DF;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
}
.tf-fw-progress {
    height: 3px;
    background: transparent;
}
.tf-fw-progress-bar {
    height: 100%;
    width: 0;
    background: #C8A951;
    transition: width .1s linear;
}

/* Slides */
.tf-fw-slides {
    position: relative;
    padding: 40px 40px 0;
}
.tf-fw-slide {
    display: none;
    grid-template-columns: 72px 1fr 1px 120px;
    column-gap: 32px;
    align-items: start;
}
.tf-fw-slide.is-active { display: grid; }

/* Badge circular por award level. El background viene del color
 * configurado en el CRUD de Award Levels (inline style), así nuevos
 * levels (Yellow Pencil, Glass, Titanium, etc.) aparecen con su color
 * propio sin tocar CSS. El text-shadow ayuda a la legibilidad cuando
 * el admin elige un color claro con el icon/label en blanco. */
.tf-fw-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    background: #6B6560;
    text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.18 );
}
.tf-fw-badge-icon { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.tf-fw-badge-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba( 255, 255, 255, 0.9 );
}
/* Variante "star": ya no usamos el award level. Estrella blanca centrada
 * sobre fondo oscuro neutro — visual fijo para todos los slides. */
.tf-fw-badge--star {
    background: #1A1818;
}
.tf-fw-badge-star {
    font-size: 36px;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.3 );
}

/* Variante compacta del pill "Agency of the Year" para el carrusel —
 * mismo gradient/uppercase que el de Winners pero más chico para que
 * no compita con el nombre de la agencia. */
.tf-aoy-pill--sm {
    font-size: 9px;
    padding: 2px 8px;
    margin-left: 0;
    letter-spacing: 0.08em;
}

/* Contenido central */
.tf-fw-content { min-width: 0; }
.tf-fw-festival {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.tf-fw-festival-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #C8A951;
    flex-shrink: 0;
}
.tf-fw-festival-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #6B6560;
}
.tf-fw-agency-name {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: #1A1818;
    margin: 0 0 8px;
    text-align: left;
    margin-block-end: calc(var(--has-theme-content-spacing, 1) * (.3em + 0px)) !important;
}
.tf-fw-agency-name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .15s ease;
}
.tf-fw-agency-name a:hover { border-bottom-color: #C8A951; }
.tf-fw-category {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #6B6560;
    margin: 0 0 16px;
    text-align: left;
}
.tf-fw-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    flex-wrap: wrap;
}
.tf-fw-meta-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6B6560;
}
.tf-fw-meta-network { color: #6B6560; }
.tf-fw-meta-points {
    color: #C8A951;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
}

/* Separador vertical */
.tf-fw-divider {
    width: 1px;
    background: #E8E4DF;
    align-self: stretch;
    margin-top: 40px;
}

/* Stat number a la derecha */
.tf-fw-stat {
    text-align: right;
    width: 120px;
    flex-shrink: 0;
}
.tf-fw-stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: #C8A951;
    margin-bottom: 4px;
}
.tf-fw-stat-label {
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1.35;
    color: #6B6560;
}

/* Controls */
.tf-fw-controls {
    padding: 32px 40px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tf-fw-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tf-fw-dot {
    background: #E8E4DF;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: background-color .15s ease, width .2s ease, border-radius .2s ease;
}
.tf-fw-dot:hover { background: #C8A951; }
.tf-fw-dot.is-active {
    background: #C8A951;
    width: 20px;
    border-radius: 3px;
}
.tf-fw-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tf-fw-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0.5px solid #E8E4DF;
    background: #fff;
    color: #6B6560;
    cursor: pointer;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    transition: border-color .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tf-fw-nav-btn:hover {
    border-color: #C8A951;
    color: #C8A951;
}

/* Footer */
.tf-fw-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tf-fw-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #6B6560;
}
.tf-fw-see-all {
    display: inline-block;
    padding: 10px 20px;
    border: 0.5px solid #C8A951;
    color: #C8A951;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color .15s ease, color .15s ease;
}
.tf-fw-see-all:hover {
    background: #C8A951;
    color: #1A1818;
    text-decoration: none;
}
.tf-fw-flag {
    font-style: normal;
    line-height: 1;
    /* En el mock React el flag hereda el color base (negro), no el gris
     * del nombre del país. En Windows/Brave los regional-indicators caen
     * a las letras "US" en negro, y el "United States" al lado queda
     * gris (color de .tf-fw-meta-country). */
    color: #1A1818;
}

/* Responsive */
@media ( max-width: 960px ) {
    .tf-fw-inner { padding: 0 40px; }
    .tf-fw-title { font-size: 30px; }
    .tf-fw-slides { padding: 32px 28px 0; }
    .tf-fw-controls { padding: 24px 28px 24px; }
    .tf-fw-slide {
        grid-template-columns: 60px 1fr;
        column-gap: 20px;
        row-gap: 16px;
    }
    .tf-fw-badge { width: 60px; height: 60px; }
    .tf-fw-badge-icon { font-size: 18px; }
    .tf-fw-divider { display: none; }
    .tf-fw-stat {
        grid-column: 1 / -1;
        text-align: left;
        width: auto;
        border-top: 1px solid #E8E4DF;
        padding-top: 16px;
    }
    .tf-fw-agency-name { font-size: 24px; }
}
@media ( max-width: 520px ) {
    .tf-featured-winners { padding: 56px 0 48px; }
    .tf-fw-inner { padding: 0 20px; }
    .tf-fw-title { font-size: 24px; }
    .tf-fw-slides { padding: 24px 20px 0; }
    .tf-fw-controls { padding: 20px 20px 20px; flex-wrap: wrap; gap: 16px; }
    .tf-fw-agency-name { font-size: 22px; }
    .tf-fw-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
    .tf-fw-see-all { width: 100%; text-align: center; }
}

/* ===== THEME OVERRIDES =====
 * Reglas con `.topfice` prefix para ganar contra temas agresivos.
 * Suben la specificity de (0,1,1) a (0,2,1) sin necesitar !important.
 * Agregar aquí cualquier property que un tema host esté pisando. */

/* Tabla: el tema "Chandelier" (y muchos otros) fuerza text-align: center
 * en th/td. Sobreescribimos manteniendo el left por defecto y respetando
 * la utility class `.tf-right` para columnas como Score/Points. */
.topfice .tf-table th,
.topfice .tf-table td {
    text-align: left;
}
.topfice .tf-table th.tf-right,
.topfice .tf-table td.tf-right {
    text-align: right;
}

/* Vertical-align: el tema puede meter `top` u otra cosa que arruina la
 * alineación del flag/texto en celdas de location. */
.topfice .tf-table td {
    vertical-align: middle;
}

/* Asegurar font de la tabla (algunos temas fuerzan sans-serif distinta
 * en `table td` con specificity alta). */
.topfice .tf-table,
.topfice .tf-table th,
.topfice .tf-table td {
    font-family: inherit;
}

/* Padding interno de la tabla: algunos temas inflan padding de `td/th`
 * con specificity alta, dejando filas demasiado altas. Forzamos el valor
 * del plugin con specificity (0,2,1) — gana sobre `body table td`. */
.topfice .tf-table th,
.topfice .tf-table td {
    padding: 16px 24px;
}
@media (max-width: 768px) {
    .topfice .tf-table th,
    .topfice .tf-table td {
        padding: 14px 14px;
    }
}

/* Headers: nowrap para que "TOPFICE CATEGORY", "LAST YEAR RANK", etc. no
 * salten a 2 líneas cuando la columna es angosta. */
.topfice .tf-table thead th {
    white-space: nowrap;
}

/* Pill "★ Agency of the Year YYYY": el tema puede inflar font-size por
 * heredar reglas globales tipo `body span`. Forzamos tamaño chico. */
.topfice .tf-aoy-pill {
    font-size: 10px;
    padding: 3px 10px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.topfice .tf-aoy-pill--sm {
    font-size: 9px;
    padding: 2px 8px;
    letter-spacing: 0.08em;
}
