<?php

$author_writer_tp_theme_css = '';

//theme-color
$author_writer_tp_color_option = get_theme_mod('author_writer_tp_color_option');

// 1st color
$author_writer_tp_color_option = get_theme_mod('author_writer_tp_color_option', '#eb6237');
if ($author_writer_tp_color_option) {
    $author_writer_tp_theme_css .= ':root {';
    $author_writer_tp_theme_css .= '--color-primary1: ' . esc_attr($author_writer_tp_color_option) . ';';
    $author_writer_tp_theme_css .= '}';
}

//hover color
$author_writer_tp_color_option_link = get_theme_mod('author_writer_tp_color_option_link');

if($author_writer_tp_color_option_link != false){
$author_writer_tp_theme_css .='.prev.page-numbers:focus, .prev.page-numbers:hover, .next.page-numbers:focus, .next.page-numbers:hover,#slider .carousel-control-prev-icon:hover, #slider .carousel-control-next-icon:hover,span.meta-nav:hover, #comments input[type="submit"]:hover,.woocommerce #respond input#submit:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, #footer button[type="submit"]:hover, #theme-sidebar button[type="submit"]:hover,.book-tkt-btn a.register-btn:hover,.more-btn a:hover,.book-tkt-btn a.bar-btn i:hover, .woocommerce a.remove:hover,.wc-block-cart__submit-container a:hover  {';
	$author_writer_tp_theme_css .='background: '.esc_attr($author_writer_tp_color_option_link).';';
$author_writer_tp_theme_css .='}';
}
if($author_writer_tp_color_option_link != false){
$author_writer_tp_theme_css .='a:hover,#theme-sidebar a:hover,#footer a:hover,.media-links i:hover, .readmore-btn a:hover{';
	$author_writer_tp_theme_css .='color: '.esc_attr($author_writer_tp_color_option_link).';';
$author_writer_tp_theme_css .='}';
}
if($author_writer_tp_color_option_link != false){
$author_writer_tp_theme_css .='.readmore-btn a:hover{';
	$author_writer_tp_theme_css .='border-color: '.esc_attr($author_writer_tp_color_option_link).';';
$author_writer_tp_theme_css .='}';
}

//Font Weight
$author_writer_menu_font_weight = get_theme_mod( 'author_writer_menu_font_weight','600');
if($author_writer_menu_font_weight == '100'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 100;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '200'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 200;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '300'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 300;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '400'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 400;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '500'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 500;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '600'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 600;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '700'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 700;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '800'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 800;';
$author_writer_tp_theme_css .='}';
}else if($author_writer_menu_font_weight == '900'){
$author_writer_tp_theme_css .='.main-navigation a{';
    $author_writer_tp_theme_css .='font-weight: 900;';
$author_writer_tp_theme_css .='}';
}

// menu color
$author_writer_menu_color = get_theme_mod('author_writer_menu_color');
if($author_writer_menu_color != false){
$author_writer_tp_theme_css .='.main-navigation a{';
$author_writer_tp_theme_css .='color: '.esc_attr($author_writer_menu_color).';';
$author_writer_tp_theme_css .='}';
}


    /*------------------ Slider CSS -------------------*/
    $author_writer_slider_opacity_setting = get_theme_mod('stationary_bookstore_slider_opacity_setting', true);
    $author_writer_image_opacity_color    = get_theme_mod('stationary_bookstore_image_opacity_color', '');
    $author_writer_slider_opacity         = get_theme_mod('stationary_bookstore_slider_opacity', '0.5');

    if ($author_writer_slider_opacity_setting) {
        // Apply opacity value to slider image
        if ($author_writer_slider_opacity !== '') {
            $author_writer_tp_theme_css .= '.cat-inner-box img {';
            $author_writer_tp_theme_css .= 'opacity: ' . esc_attr($author_writer_slider_opacity) . ';';
            $author_writer_tp_theme_css .= '}';
        }

        // Apply background color to slider if defined
        if ($author_writer_image_opacity_color !== '') {
            $author_writer_tp_theme_css .= '.cat-inner-box {';
            $author_writer_tp_theme_css .= 'background-color: ' . esc_attr($author_writer_image_opacity_color) . ';';
            $author_writer_tp_theme_css .= '}';
        }
    } else {
        // If setting is disabled, force full opacity
        $author_writer_tp_theme_css .= '.cat-inner-box img {';
        $author_writer_tp_theme_css .= 'opacity: 0.5;';
        $author_writer_tp_theme_css .= '}';
    }

    // Slider Height
    $author_writer_slider_img_height      = get_theme_mod('stationary_bookstore_slider_img_height');
    $author_writer_slider_img_height_resp = get_theme_mod('author_writer_slider_img_height_responsive');

    // Desktop height
    $author_writer_tp_theme_css .= '@media screen and (min-width: 768px) {';
    $author_writer_tp_theme_css .= '.cat-inner-box img {';
    if ( $author_writer_slider_img_height ) {
        $author_writer_tp_theme_css .= 'height: ' . esc_attr( $author_writer_slider_img_height ) . ';';
    }
    $author_writer_tp_theme_css .= 'width: 100%; object-fit: cover;';
    $author_writer_tp_theme_css .= '}';
    $author_writer_tp_theme_css .= '}';

    // Mobile height
    $author_writer_tp_theme_css .= '@media screen and (max-width: 767px) {';
    $author_writer_tp_theme_css .= '.cat-inner-box img {';
    if ( $author_writer_slider_img_height_resp ) {
        $author_writer_tp_theme_css .= 'height: ' . esc_attr( $author_writer_slider_img_height_resp ) . ' !important;';
    }
    $author_writer_tp_theme_css .= 'width: 100%; object-fit: cover;';
    $author_writer_tp_theme_css .= '}';
    $author_writer_tp_theme_css .= '}';
