/*
Theme Name: Pierian
Theme URI: https://themeshaper.com/pierian/
Author: Automattic
Author URI: https://automattic.com
Description: Pierian is a minimalist typography-focused theme that embraces a low-key styling approach. With equivalent headings, paragraphs, links, and navigation, it features columns that elegantly divide navigation, blog posts, and a profile block.
Requires at least: 
Tested up to: 6.6
Requires PHP: 
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pierian
Tags: blog, three-columns, left-sidebar, right-sidebar, block-styles, custom-colors, custom-header, full-site-editing, post-formats, style-variations, threaded-comments, translation-ready

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */

/*
 * Control the hover stylings of outline block style.
 * Unnecessary once block styles are configurable via theme.json
 * https://github.com/WordPress/gutenberg/issues/42794
 */

function my_bandcamp_reset_script() {
    // Register an empty script; the empty string '' means no external file.
    wp_register_script( 'my-bandcamp-reset', '', array(), null, true );
    wp_enqueue_script( 'my-bandcamp-reset' );
    
    // Inline JavaScript to reset other Bandcamp players.
    $custom_js = "
        function resetOtherPlayers(activePlayer) {
            var players = document.getElementsByClassName('bandcamp-player');
            for (var i = 0; i < players.length; i++) {
                if (players[i] !== activePlayer) {
                    var iframe = players[i].querySelector('iframe');
                    if (iframe) {
                        // Reset the iframe src to force the player to reload.
                        iframe.src = iframe.src;
                    }
                }
            }
        }
    ";
    
    // Add our inline script to the registered script.
    wp_add_inline_script( 'my-bandcamp-reset', $custom_js );
}
add_action( 'wp_enqueue_scripts', 'my_bandcamp_reset_script' );


/*
 * Link styles
 * https://github.com/WordPress/gutenberg/issues/42319
 */
a {
	text-decoration-thickness: .0625em !important;
	text-underline-offset: .15em;
}
