<?php

/*----------------------------------------------------------------------------------*/

$photography_album_common_inline_css = '';

$photography_album_scroll_top_alignment = get_theme_mod('photography_album_scroll_top_alignment', 'Right');

$photography_album_alignment_styles = [
    'Left' => 'left: 20px;',
    'Center' => 'right: 0; left: 0; margin: 0 auto;',
    'Right' => 'right: 20px;'
];

$alignment_style = $photography_album_alignment_styles[$photography_album_scroll_top_alignment] ?? $photography_album_alignment_styles['Right'];

$photography_album_common_inline_css .= "a.scrollup,button#scroll_2 { $alignment_style }";

/*----------------------------------------------------------------------------------*/

$photography_album_footer_background_color = get_theme_mod('photography_album_footer_background_color', '#000');

if (!empty($photography_album_footer_background_color)) {
    $photography_album_common_inline_css .= ".footer-widgets { background: " . esc_attr($photography_album_footer_background_color) . "}";
}

/*----------------------------------------------------------------------------------*/

$photography_album_footer_background_image = get_theme_mod('photography_album_footer_background_image', '');

if (!empty($photography_album_footer_background_image)) {
    $photography_album_common_inline_css .= ".footer-widgets { background-image: url('" . esc_url($photography_album_footer_background_image) . "') !important; background-size: cover; background-repeat: no-repeat; }";
}

/*----------------------------------------------------------------------------------*/

$photography_album_copyright_alignment = get_theme_mod('photography_album_copyright_alignment', 'Center');

$photography_album_copyright_alignment_styles = [
    'Left' => 'text-align: left;',
    'Center' => 'text-align: center;',
    'Right' => 'text-align: right;'
];

$alignment_style = $photography_album_copyright_alignment_styles[$photography_album_copyright_alignment] ?? $photography_album_copyright_alignment_styles['Center'];

$photography_album_common_inline_css .= "#footer-copyright p { $alignment_style }";

/*----------------------------------------------------------------------------------*/

$photography_album_container_width = get_theme_mod('photography_album_container_width');

if (!empty($photography_album_container_width)) {
    $photography_album_common_inline_css .= "@media (min-width: 1024px) { 
        body,.loading,.page-template-template-homepage #header { 
            width: " . esc_attr($photography_album_container_width) . "%; 
            margin: 0 auto; 
        } 
    }";
}

/*----------------------------------------------------------------------------------*/   

$photography_album_responsive_scroll_to_top_setting = get_theme_mod( 'photography_album_responsive_scroll_to_top_setting', true );

if ( $photography_album_responsive_scroll_to_top_setting == true && get_theme_mod( 'photography_album_scroll_to_top_setting', true ) != true ) {
    $photography_album_common_inline_css .= "a.scrollup,button#scroll_2 {
        display: none !important;
    }";
}

if ( $photography_album_responsive_scroll_to_top_setting == true ) {
    $photography_album_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: block !important;
        }
    }";
} elseif ( $photography_album_responsive_scroll_to_top_setting == false ) {
    $photography_album_common_inline_css .= "@media screen and (max-width: 768px) {
        a.scrollup,button#scroll_2 {
            display: none !important;
        }
    }";
}

/*----------------------------------------------------------------------------------*/ 

$photography_album_responsive_preloader_setting = get_theme_mod( 'photography_album_responsive_preloader_setting', false );

if ( $photography_album_responsive_preloader_setting == true && get_theme_mod( 'photography_album_preloader_setting', false ) == false ) {
    $photography_album_common_inline_css .= "@media screen and (min-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

if ( $photography_album_responsive_preloader_setting == false ) {
    $photography_album_common_inline_css .= "@media screen and (max-width: 768px) {
        .loading {
            display: none !important;
        }
    }";
}

/*---------------------------Global Color-------------------*/

$photography_album_theme_color_1 = get_theme_mod('photography_album_theme_color_1');

/*--- First Global Color ---*/

if ($photography_album_theme_color_1) {
  $photography_album_common_inline_css .= ':root {';
  $photography_album_common_inline_css .= '--first-color: ' . esc_attr($photography_album_theme_color_1) . ' !important;';
  $photography_album_common_inline_css .= '} ';
}