<?php
$file = '/var/www/n7w-dev/wp-content/plugins/n7w-voting/includes/class-n7w-vote-assets.php';
$content = file_get_contents($file);

$old = "wp_enqueue_style( 'wfc-fonts',    \$css . 'fonts.css',    [], \$ver );
                wp_enqueue_style( 'wfc-fonts-ar', \$css . 'fonts-ar.css', [ 'wfc-fonts' ], \$ver );
                wp_enqueue_style( 'wfc-vote',     \$css . 'vote.css',     [ 'wfc-fonts-ar' ], \$ver );";
$count = substr_count($content, $old);
if ($count !== 1) { die("ABORT: expected 1 match, found $count\n"); }

$new = "wp_enqueue_style( 'wfc-fonts',    \$css . 'fonts.css',    [], \$ver );
                wp_enqueue_style( 'wfc-fonts-ar', \$css . 'fonts-ar.css', [ 'wfc-fonts' ], \$ver );
                // Shared header/nav/counter CSS — single source, also loaded
                // by information-news.php on every non-vote page. Loaded
                // before vote.css so vote.css's own remaining (vote-specific)
                // rules can still override anything if ever needed.
                wp_enqueue_style( 'wfc-shared-header', \$css . 'shared-header.css', [ 'wfc-fonts-ar' ], \$ver );
                wp_enqueue_style( 'wfc-vote',     \$css . 'vote.css',     [ 'wfc-shared-header' ], \$ver );";

$content = str_replace($old, $new, $content);
file_put_contents($file, $content);
echo "OK — shared-header.css enqueued ahead of vote.css\n";
