layerinfo "type" = "layout";
layerinfo "name" = "Tabula Rasa";
layerinfo redist_uniq = "core2base/layout";

##===============================
## Presentation
##===============================

propgroup presentation {
    property use layout_type;
    property use num_items_recent;
    property use num_items_reading;
    property use use_custom_friend_colors;
    property use use_shared_pic;
    property use use_journalstyle_entry_page;
    property use margins_size;
    property use margins_unit;
    property use sidebar_width;
    property use sidebar_width_doubled;
    property use medium_breakpoint_width;
    property use large_breakpoint_width;
    property use custom_control_strip_colors;

    property use reverse_sortorder_group;
    property use reg_firstdayofweek;
    property use tags_page_type;
    property use num_items_icons;
    property use icons_page_sort;

    property use all_entrysubjects;
    property use all_commentsubjects;
    property use entry_datetime_format_group;
    property use comment_datetime_format_group;
    property use userpics_style_group;
    property use userpics_position;
    property use entry_metadata_position;
    property use userlite_interaction_links;
    property use entry_management_links;
    property use comment_management_links;

}

set layout_type = "one-column";
set sidebar_width = "15em";
set sidebar_width_doubled = "30em";
set userpics_position = "left";
set use_custom_friend_colors = false;
set custom_foreground_element = "userpic_border";
set custom_background_element = "userpic_background";

##===============================
## Colors
##===============================

propgroup colors {
    property use color_page_background;
    property use color_page_text;
    property use color_page_link;
    property use color_page_link_active;
    property use color_page_link_hover;
    property use color_page_link_visited;
    property use color_page_border;

    property use color_module_background;
    property use color_module_text;
    property use color_module_link;
    property use color_module_link_active;
    property use color_module_link_hover;
    property use color_module_link_visited;
    property use color_module_title_background;
    property use color_module_title;
    property use color_module_border;

    property use color_header_background;
    property use color_page_title;

    property use color_footer_background;
    property use color_footer_link;
    property use color_footer_link_active;
    property use color_footer_link_hover;
    property use color_footer_link_visited;

    property use color_entry_background;
    property use color_entry_text;
    property use color_entry_link;
    property use color_entry_link_active;
    property use color_entry_link_hover;
    property use color_entry_link_visited;
    property use color_entry_title_background;
    property use color_entry_title;
    property use color_entry_interaction_links;
    property use color_entry_interaction_links_active;
    property use color_entry_interaction_links_hover;
    property use color_entry_interaction_links_visited;
    property use color_entry_border;

    property use color_comment_title_background;
    property use color_comment_title;

    property use control_strip_bgcolor;
    property use control_strip_fgcolor;
    property use control_strip_bordercolor;
    property use control_strip_linkcolor;
}

##===============================
## Fonts
##===============================

propgroup fonts {
    property use font_base;
    property use font_fallback;
    property use font_base_size;
    property use font_base_units;
    property use font_module_heading;
    property use font_module_heading_size;
    property use font_module_heading_units;
    property use font_module_text;
    property use font_module_text_size;
    property use font_module_text_units;
    property use font_journal_title;
    property use font_journal_title_size;
    property use font_journal_title_units;
    property use font_journal_subtitle;
    property use font_journal_subtitle_size;
    property use font_journal_subtitle_units;
    property use font_entry_title;
    property use font_entry_title_size;
    property use font_entry_title_units;
    property use font_comment_title;
    property use font_comment_title_size;
    property use font_comment_title_units;
    property use font_sources;
}

set font_base = "";
set font_fallback = "";
set font_base_size = "100";
set font_base_units = "%";

##===============================
## Images
##===============================

propgroup images {
    property use image_background_page_group;
    property use image_background_module_group;
    property use image_background_header_group;
    property use image_background_header_height;
    property use image_background_entry_group;
}

##===============================
## Modules
##===============================

propgroup modules {
    property use module_userprofile_group;
    property use module_navlinks_group;
    property use module_calendar_group;
    property use module_links_group;
    property use module_syndicate_group;
    property use module_tags_group;
    property use module_pagesummary_group;
    property use module_active_group;
    property use module_time_group;
    property use module_poweredby_group;
    property use module_customtext_group;
    property use module_credit_group;
    property use module_search_group;
    property use module_cuttagcontrols_group;
    property use module_subscriptionfilters_group;
}

# Explicitly define what sections the layout has available
set module_layout_sections = "none|(none)|one|Main Module Section|two|Secondary Module Section";

##===============================
## Text
##===============================

propgroup text {

    property use text_module_userprofile;
    property use text_module_links;
    property use text_module_syndicate;
    property use text_module_tags;
    property use text_module_popular_tags;
    property use text_module_pagesummary;
    property use text_module_active_entries;
    property use text_module_customtext;
    property use text_module_customtext_url;
    property use text_module_customtext_content;
    property use text_module_credit;
    property use text_module_search;
    property use text_module_cuttagcontrols;
    property use text_module_subscriptionfilters;

    property use text_view_recent;
    property use text_view_archive;
    property use text_view_friends;
    property use text_view_friends_comm;
    property use text_view_network;
    property use text_view_tags;
    property use text_view_memories;
    property use text_view_userinfo;

    property use text_entry_prev;
    property use text_entry_next;
    property use text_edit_entry;
    property use text_edit_tags;
    property use text_mem_add;
    property use text_tell_friend;
    property use text_watch_comments;
    property use text_unwatch_comments;

    property use text_read_comments;
    property use text_read_comments_friends;
    property use text_read_comments_screened_visible;
    property use text_read_comments_screened;
    property use text_post_comment;
    property use text_post_comment_friends;
    property use text_permalink;

    property use text_meta_location;
    property use text_meta_mood;
    property use text_meta_music;
    property use text_meta_xpost;
    property use text_tags;

    property use text_stickyentry_subject;

    property use text_max_comments;
    property use text_skiplinks_back;
    property use text_skiplinks_forward;
}

##===============================
## Custom CSS
##===============================

propgroup customcss {
    property use external_stylesheet;
    property use include_default_stylesheet;
    property use linked_stylesheet;
    property use custom_css;
}

function Page::print_default_stylesheet() {
    var string medium_media_query = generate_medium_media_query();
    var string large_media_query = generate_large_media_query();

    var string page_background = generate_background_css ($*image_background_page_url, $*image_background_page_repeat, $*image_background_page_position, $*color_page_background);
    var string header_background = generate_background_css ($*image_background_header_url, $*image_background_header_repeat, $*image_background_header_position, $*color_header_background);
    if ($*image_background_header_height > 0) {
        $header_background = """
            $header_background
            height: """ + $*image_background_header_height + """px;""";
    }

    var string footer_background = generate_background_css( "", "", "", $*color_footer_background );
    var string footer_link_colors = generate_color_css( $*color_footer_link, new Color, new Color );
    var string footer_link_active_colors = generate_color_css( $*color_footer_link_active, new Color, new Color );
    var string footer_link_hover_colors = generate_color_css( $*color_footer_link_hover, new Color, new Color );
    var string footer_link_visited_colors = generate_color_css( $*color_footer_link_visited, new Color, new Color );

    var string entry_background = generate_background_css ($*image_background_entry_url, $*image_background_entry_repeat, $*image_background_entry_position, $*color_entry_background);
    var string module_background = generate_background_css ($*image_background_module_url, $*image_background_module_repeat, $*image_background_module_position, $*color_module_background);

    var string page_colors = generate_color_css($*color_page_text, $*color_page_background, $*color_page_border);
    var string entry_colors = generate_color_css($*color_entry_text, $*color_entry_background, $*color_entry_border);
    var string module_colors = generate_color_css($*color_module_text, $*color_module_background, $*color_module_border);

    var string page_title_colors = generate_color_css($*color_page_title, new Color, new Color);
    var string entry_title_colors = generate_color_css($*color_entry_title, $*color_entry_title_background, new Color);
    var string comment_title_colors = generate_color_css($*color_comment_title, $*color_comment_title_background, new Color);
    var string module_title_colors = generate_color_css($*color_module_title, $*color_module_title_background, new Color);

    var string page_link_colors = generate_color_css($*color_page_link, new Color, new Color);
    var string page_link_active_colors = generate_color_css($*color_page_link_active, new Color, new Color);
    var string page_link_hover_colors = generate_color_css($*color_page_link_hover, new Color, new Color);
    var string page_link_visited_colors = generate_color_css($*color_page_link_visited, new Color, new Color);

    var string entry_link_colors = generate_color_css($*color_entry_link, new Color, new Color);
    var string entry_link_active_colors = generate_color_css($*color_entry_link_active, new Color, new Color);
    var string entry_link_hover_colors = generate_color_css($*color_entry_link_hover, new Color, new Color);
    var string entry_link_visited_colors = generate_color_css($*color_entry_link_visited, new Color, new Color);
    var string entry_interaction_link_colors = generate_color_css($*color_entry_interaction_links, new Color, new Color);
    var string entry_interaction_link_active_colors = generate_color_css($*color_entry_interaction_links_active, new Color, new Color);
    var string entry_interaction_link_hover_colors = generate_color_css($*color_entry_interaction_links_hover, new Color, new Color);
    var string entry_interaction_link_visited_colors = generate_color_css($*color_entry_interaction_links_visited, new Color, new Color);

    var string module_link_colors = generate_color_css($*color_module_link, new Color, new Color);
    var string module_link_active_colors = generate_color_css($*color_module_link_active, new Color, new Color);
    var string module_link_hover_colors = generate_color_css($*color_module_link_hover, new Color, new Color);
    var string module_link_visited_colors = generate_color_css($*color_module_link_visited, new Color, new Color);

    var string page_font = generate_font_css("", $*font_base, $*font_fallback, $*font_base_size, $*font_base_units);
    var string page_title_font = generate_font_css($*font_journal_title, $*font_base, $*font_fallback, $*font_journal_title_size, $*font_journal_title_units);
    var string page_subtitle_font = generate_font_css($*font_journal_subtitle, $*font_base, $*font_fallback, $*font_journal_subtitle_size, $*font_journal_subtitle_units);
    var string entry_title_font = generate_font_css($*font_entry_title, $*font_base, $*font_fallback, $*font_entry_title_size, $*font_entry_title_units);
    var string comment_title_font = generate_font_css($*font_comment_title, $*font_base, $*font_fallback, $*font_comment_title_size, $*font_comment_title_units);
    var string module_font = generate_font_css($*font_module_text, $*font_base, $*font_fallback, $*font_module_text_size, $*font_module_text_units);
    var string module_title_font = generate_font_css($*font_module_heading, $*font_base, $*font_fallback, $*font_module_heading_size, $*font_module_heading_units);


     var string userpic_css = "";
         if ($*userpics_position == "right") {
             $userpic_css = """
             .entry .userpic,
             .comment .userpic {
                 text-align: right;
                 }
             """;
         }
    print_custom_control_strip_css();

    """
H1, H2, H3 {
    margin: .25em 0;
    padding: .25em 0;
}

img {
    border: none;
}

hr {
    display: none;
}
.entry-content hr,
.comment-content hr {
    display: block;
    margin: 1em 10%;
}

body {
    $page_font
    padding: 0;
    $page_background
    $page_colors
}

html body {
    margin-left: $*margins_size$*margins_unit;
    margin-right: $*margins_size$*margins_unit;
}

a { $page_link_colors }
a:visited { $page_link_visited_colors }
a:hover { $page_link_hover_colors }
a:active { $page_link_active_colors }

q { font-style: italic; }

/* #content layout */
#content { float: none; }
@media $medium_media_query {
    .two-columns-left #content,
    .three-columns-sides #content {
        border-left: $*sidebar_width solid transparent;
    }
    .two-columns-right #content,
    .three-columns-sides #content {
        border-right: $*sidebar_width solid transparent;
    }
    .three-columns-left #content {
        border-left: $*sidebar_width_doubled solid transparent;
    }
    .three-columns-right #content {
        border-right: $*sidebar_width_doubled solid transparent;
    }
    .column-right #content {
        min-width: $*sidebar_width; /* prevents sidebar overlap of entry, when entry becomes narrower than sidebar */
    }
}

#content-footer {
    height: 0;
    font-size: 0; /*to make IE happy*/
    clear: both;
}

#header, #footer {
    margin: 0;
    clear: both;
    padding: .5em;
}

#header {
    $header_background
    $page_title_colors
}

h1#title {
    $page_title_font
}

h2#subtitle,
h2#pagetitle {
    $page_subtitle_font
}

#footer {
    $footer_background
}

#footer a { $footer_link_colors }
#footer a:visited { $footer_link_visited_colors }
#footer a:hover { $footer_link_hover_colors }
#footer a:active { $footer_link_active_colors }

#primary {
    width:100%;
    margin-right:-100%;
    margin-left: 0;
}

#primary > .inner:first-child, #secondary > .inner:first-child, #tertiary > .inner:first-child {
    padding: 1em;
}

/* modules layout */
#primary { float: none; }
#secondary, #tertiary { width: 100%; }

@media $medium_media_query {
    .multiple-columns #primary {
        float: left;
    }

    .two-columns-left #secondary,
    .three-columns-sides #secondary {
        float: left;
        width: $*sidebar_width;
        margin-left: -$*sidebar_width;
    }
    .two-columns-right #secondary {
        float: right;
        width: $*sidebar_width;
        margin-right: -$*sidebar_width;
    }
    .three-columns-left #secondary {
        float: left;
        width: $*sidebar_width;
        margin-left: -$*sidebar_width_doubled;
    }
    .three-columns-right #secondary {
        float: right;
        width: $*sidebar_width;
        margin-right: -$*sidebar_width;
    }

    .two-columns #tertiary {
        clear: both;
        width: auto;
    }
    .two-columns-left #tertiary { margin-left: -$*sidebar_width; }
    .two-columns-right #tertiary { margin-right: -$*sidebar_width; }
    .two-columns #tertiary .module {
        float: left;
        width: $*sidebar_width;
    }
    .three-columns-left #tertiary {
        float: left;
        width: $*sidebar_width;
        margin-left: -$*sidebar_width;
    }
    .three-columns-right #tertiary {
        float: right;
        width: $*sidebar_width;
        margin-right: -$*sidebar_width_doubled;
        margin-left: $*sidebar_width; /* so that #tertiary won't overlay #secondary in IE7 */
    }
    .three-columns-sides #tertiary {
        float: right;
        width: $*sidebar_width;
        margin-right: -$*sidebar_width;
    }
}

.navigation ul {
    margin-left: 0;
    padding-left: 0;
}
.navigation li {
    display: inline;
    padding: 0 .5em;
}
.noentries {
    padding: 0 .5em;
}

/* entries */

.entry {
    $entry_background
    $entry_colors
}

.entry .entry-title {
    $entry_title_font
}

.entry .entry-title, .entry .entry-title a {
    $entry_title_colors
}

.no-subject .entry .entry-title {
    background: none;
    border: none;
}

.entry a { $entry_link_colors }
.entry a:visited { $entry_link_visited_colors }
.entry a:hover { $entry_link_hover_colors }
.entry a:active { $entry_link_active_colors }

/* ensure comment content stretches out horizontally so it's readable */
.comment-content:before {
    content: "";
    display: block;
    overflow: hidden;
    width: 10em;
}
.comment-content { border-top: 1px transparent solid; } /* for firefox */

/* To prevent overlapping when icon's on the left */
/* and list is the first thing in content */
.entry-content li,
.comment-content li {
    list-style-position: inside;
    }

/* To constrain the width and prevent layout breaking */
.entry-content img, .comment-content img {
    max-width: 100%;
    height: auto;
}

@media $large_media_query {
    .entry-content img, .comment-content img { max-width: none; }
}

.metadata ul {
    display: inline;
    list-style: none;
    margin-left: .5em;
    padding-left: 0;
}
.metadata li {
    margin-bottom: .5em;
}
.metadata.top-metadata ul {
    margin: 0;
}
.metadata.top-metadata {
    margin-bottom: 1em;
}

.tag ul {
    display: inline;
    margin-left: 0;
    padding-left: 0;
}

.tag ul li {
    display: inline;
} /* same for month view */

ul.entry-management-links {
    margin-left: 0;
    padding-left: 0;
}
ul.entry-management-links li {
    display: inline;
    padding: 0 .25em;
}

ul.entry-interaction-links {
    margin-left: 0;
    padding-left: 0;
    text-align: right;
}

.entry-interaction-links a, .entry-management-links a { $entry_interaction_link_colors }
.entry-interaction-links a:visited, .entry-management-links a:visited { $entry_interaction_link_visited_colors }
.entry-interaction-links a:hover, .entry-management-links a:hover { $entry_interaction_link_hover_colors }
.entry-interaction-links a:active, .entry-management-links a:active { $entry_interaction_link_active_colors }

ul.entry-interaction-links li {
    display: inline;
    padding: 0 .25em;
}

/* comments */

.comment-posted {font-weight:bold;}

.comment-wrapper {
    padding: .5em 0;
    min-width: 15em;
}

.comment .comment-title {
    $comment_title_font
    margin: 0;
}

.comment .comment-title, .comment .comment-title a {
    $comment_title_colors
}

.no-subject .comment .comment-title {
    background: none;
    border: none;
}

ul.comment-management-links {
    margin-left: 0;
    padding-left: 0;
    text-align: right;
}
ul.comment-management-links li {
    display: inline;
    padding: 0 .25em;
}

ul.comment-interaction-links {
    margin-left: 0;
    padding-left: 0;
}
ul.comment-interaction-links li {
    display: inline;
    padding: 0 .25em;
}

textarea#commenttext {
    width: 100%; /* fix for FF form width glitch */
}

/* archive */

table.month {
    margin: 0 auto;
    border-collapse: collapse;
}
table.month td {
    height: 3.25em;
}
table.month td,
table.month th {
    border: 1px solid; /* ? */
    padding: 3px;
}
table.month td p {
    margin: 0;
    padding: 3px;
}

.month dl dt {
    font-weight: bold;
}
.month dl .time {
    padding-right: .5em;
}
.month dl h3 {
    display: inline;
    font-size: medium;
}
.page-month .month .entry-poster {
    margin-right: .5em;
}
.month dl .tag ul {
    margin-top: 0;
}

/* icons */

.sorting-options ul {
    margin-left: 0;
}

.sorting-options ul li {
    display: inline;
}

.icon-keywords ul {
    display: inline;
    margin-left: 0;
    padding-left: 0;
}

.icon-keywords ul li {
    display: inline;
}

/* modules */

.module {
    $module_background
    $module_colors
}

.module a { $module_link_colors }
.module a:visited { $module_link_visited_colors }
.module a:hover { $module_link_hover_colors }
.module a:active { $module_link_active_colors }

.module h2 {
    $module_title_colors
    $module_title_font
}

.module-content {
    $module_font
}

.module-content ul {
    list-style: outside;
    margin-left: 1em;
    padding-left: 0;
}
.module-content li {
    margin: .5em 0;
}

ul.userlite-interaction-links.icon-links {
    margin-left: 0;
    padding-left: 0;
}

ul.userlite-interaction-links.icon-links li {
    display: inline;
    padding: 0 .20em;
}

ul.userlite-interaction-links.text-links {
    text-align: left;
}

.any-column .module-calendar table { margin: 0; }
.module-calendar .module-content { text-align: left; }
@media $medium_media_query {
    .multiple-columns .module-calendar .module-content {
        text-align: center;
    }

    .multiple-columns .module-calendar table {
        margin: 0 auto;
    }

    .multiple-columns .module-syndicate .module-content {
        text-align: center;
    }
}

.module-calendar td {
    padding: 1px;
}
.module-calendar td a {
    display: block;
    padding: 2px;
}

.search-box {
    margin: .2em auto;
    max-width: 100%;
}

.search-form .search-box-item, 
.search-form .search-button-item {
    display: block
}

.search-form .comment_search_checkbox_item {
    display: inline
}

/* wrap long content, particularly openid usernames */
.module-pagesummary .ljuser {
    white-space: normal !important;
}
.module-pagesummary .module-content {
    word-wrap: break-word;
}

.module-credit .category-title {
    font-weight: bold;
}

.tags_cloud li, .module-tags_cloud li { display: inline; }

$userpic_css
    """;
}
layerinfo type = "layout";
layerinfo name = "Funky Circles";
layerinfo redist_uniq = "funkycircles/layout";
layerinfo author_name = "ninetydegrees";
layerinfo lang = "en";

set layout_authors = [ { "name" => "ninetydegrees", "type" => "user" } ];

##===============================
## Presentation
##===============================

set layout_type = "two-columns-right";
set entry_management_links = "text";
set comment_management_links = "text";
set custom_colors_template = "%%new%% .entry .contents .userpic img {background-color: %%background%%;} %%new%% .entry-title a {color: %%foreground%%;}";

##===============================
## Colors
##===============================

propgroup colors_child {
    property Color color_page_title_background { des = "Page title background color"; }
    property Color color_page_subtitle_background { des = "Page subtitle background color"; }
    property Color color_page_subtitle { des = "Page subtitle color"; }
    property Color color_entry_userpic_border { des = "Entry userpic border color"; }
    property Color color_entry_link_hover_background { des = "Entry hover link background color"; }
    property Color color_entry_poster_border { des = "Entry poster border color"; }
    property Color color_entry_footer_background { des = "Entry footer background color"; }
    property Color color_entry_footer_text { des = "Entry footer text color"; }
    property Color color_entry_footer_link { des = "Entry footer link color"; }
    property Color color_entry_footer_link_active { des = "Entry footer active color"; }
    property Color color_entry_footer_link_hover { des = "Entry footer hover link color"; }
    property Color color_entry_footer_link_visited { des = "Entry footer visited link color"; }
    property Color color_entry_footer_border { des = "Entry footer border color"; }
    property Color color_specificmodule_background {
        des ="Calendar and Search modules background color";
        note= "Used when day has no entries and for the search button.";
        }
    property Color color_specificmodule_text { des ="Calendar and Search modules text color"; }
    property Color color_specificmodule_background_alt {
        des ="Calendar and Search modules alternative background color";
        note= "Used when day has entries and for the search text field.";
        }
    property Color color_specificmodule_text_alt { des ="Calendar and Search modules alternative text color"; }
    property Color color_specificmodule_background_hover { des ="Calendar and Search modules hover background color"; }
    property Color color_specificmodule_text_hover { des ="Calendar and Search modules hover text color"; }
    property Color color_specificmodule_background_visited { des ="Calendar and Search modules visited background color"; }
    property Color color_specificmodule_text_visited { des ="Calendar and Search modules visited text color"; }
    property Color color_shadow {
        des ="Shadow color";
        noui = 1;
        }
    property Color color_shadow_alt {
        des ="Shadow alternative color";
        noui = 1;
        }
}

set color_shadow = "#111";
set color_shadow_alt = "#8c8c8c";

##===============================
## Fonts
##===============================

set font_base = "'Trebuchet MS', 'DejaVu Sans'";
set font_fallback = "sans-serif";
set font_base_size = "1";
set font_base_units = "em";
set font_journal_title = "Impact, 'MgOpen Moderna'";
set font_journal_title_size = "2";
set font_journal_title_units ="em";
set font_journal_subtitle_size = "1.5";
set font_journal_subtitle_units = "em";
set font_entry_title_size = "1.2";
set font_entry_title_units ="em";
set font_comment_title_size = "1.2";
set font_comment_title_units ="em";
set font_module_heading_size = "1.2";
set font_module_heading_units = "em";

##===============================
## Images
##===============================

propgroup images_child {

    property string[] image_entry_list_background_group {
        des = "Entry footer links background image";
        grouptype = "image";
        }
    set image_entry_list_background_group = [ "image_entry_list_background_url", "image_entry_list_background_repeat", "image_entry_list_background_position" ];
        property string image_entry_list_background_url {
        grouped = 1;
        }
    property string image_entry_list_background_repeat {
        values = "repeat|tile image|no-repeat|don't tile|repeat-x|tile horizontally|repeat-y|tile vertically";
        grouped = 1;
    }
    property string image_entry_list_background_position {
    values = "top left|top left|top center|top center|top right|top right|center left|center left|center center|center|center right|center right|bottom left|bottom left|bottom center|bottom center|bottom right|bottom right";
        grouped = 1;
        allow_other = 1;
    }
    property string image_module_list { des = "Module list image"; }
    property string image_module_list_hover { des = "Module list hover image"; }
    property string image_module_list_active { des = "Module list active image"; }
}

set image_entry_list_background_position = "100% 8px";


##===============================
## Text
##===============================

set text_posting_in = " in ";
set text_comment_date = "on";
set text_comment_from = "Posted by";

##===============================
## Functions
##===============================

function print_module_navlinks() {
    # prints as   <li><a class="current view...">
    # styles may override and change to print_module_navlinks( false )
    # to print as <li class="current view...">
    print_module_navlinks( false );
}

##===============================
## Stylesheet
##===============================

function print_stylesheet () {
    var string medium_media_query = generate_medium_media_query();
    var string large_media_query = generate_large_media_query();

    var string header_background = generate_background_css ($*image_background_header_url, $*image_background_header_repeat, "", $*color_header_background);
    var string page_link_colors = generate_color_css($*color_page_link, new Color, new Color);
    var string page_link_active_colors = generate_color_css($*color_page_link_active, new Color, new Color);
    var string page_link_hover_colors = generate_color_css($*color_page_link_hover, new Color, new Color);
    var string page_link_visited_colors = generate_color_css($*color_page_link_visited, new Color, new Color);
    var string page_title_colors = generate_color_css($*color_page_title, $*color_page_title_background, new Color);
    var string page_subtitle_colors = generate_color_css($*color_page_subtitle, $*color_page_subtitle_background, new Color);
    var string module_title_colors = generate_color_css($*color_module_title, new Color, new Color);
    var string image_module_list_url = generate_image_url($*image_module_list);
    var string image_module_list_active_url = generate_image_url($*image_module_list_active);
    var string image_module_list_hover_url = generate_image_url($*image_module_list_hover);
    var string entry_colors = generate_color_css($*color_entry_text, $*color_entry_background, $*color_entry_border);
    var string entry_title_colors = generate_color_css($*color_entry_title, $*color_entry_title_background, new Color);
    var string entry_title_font = generate_font_css($*font_entry_title, $*font_base, $*font_fallback, $*font_entry_title_size, $*font_entry_title_units);
    var string entry_link_colors = generate_color_css($*color_entry_link, new Color, new Color);
    var string entry_link_hover_colors = generate_color_css($*color_entry_link_hover, $*color_entry_link_hover_background, new Color);
    var string entry_link_visited_colors = generate_color_css($*color_entry_link_visited, new Color, new Color);
    var string entry_footer_colors = generate_color_css($*color_entry_footer_text, $*color_entry_footer_background, new Color);
    var string entry_footer_link_colors = generate_color_css($*color_entry_footer_link, new Color, new Color);
    var string entry_footer_link_hover_colors = generate_color_css($*color_entry_footer_link_hover, new Color, new Color);
    var string entry_footer_link_visited_colors = generate_color_css($*color_entry_footer_link_visited, new Color, new Color);
    var string entry_list_background = generate_background_css ($*image_entry_list_background_url, $*image_entry_list_background_repeat, $*image_entry_list_background_position, new Color);

    var string entry_spacing = "";
    if ( $*entry_userpic_style == "" ) { $entry_spacing = "65px"; }
    elseif ( $*entry_userpic_style == "small" ) { $entry_spacing = "40px"; }
    elseif ( $*entry_userpic_style == "smaller" ) { $entry_spacing = "15px"; }

    var string comment_spacing = "";
    if ( $*comment_userpic_style == "" ) { $comment_spacing = "65px"; }
    elseif ( $*comment_userpic_style == "small" ) { $comment_spacing = "40px"; }
    elseif ( $*comment_userpic_style == "smaller" ) { $comment_spacing = "15px"; }

    var string userpic_css = "";
        if ($*userpics_position == "left") {
            $userpic_css = """
            .contents .userpic {
                left: -40px;
                }

            .entry .header,
            .comment .header {
                margin-left: 2em;
                }

            .entry .header {
                padding-left: $entry_spacing;
                }
            .comment .header {
                padding-left: $comment_spacing;
                }

            .has-userpic .entry .poster {
                margin-left: $entry_spacing;
                }
            .has-userpic .comment .poster {
                margin-left: $comment_spacing;
                }

            @media $medium_media_query {
                .two-columns-left #primary > .inner:first-child,
                .three-columns-left #primary > .inner:first-child {
                    padding: 1em 2em 1em 5em;
                    }

                .three-columns-sides #primary > .inner:first-child {
                    padding: 1em 3em 1em 4.5em;
                    }

                .two-columns-right #primary > .inner:first-child,
                .three-columns-right #primary > .inner:first-child {
                    padding: 1em 3.5em 1em;
                    }
            }
            """;
        }
        elseif ($*userpics_position == "right") {
            $userpic_css = """
            .contents .userpic {
                right: -40px;
                }

            .entry .header,
            .comment .header {
                margin-right: 2em;
                }

            .entry .header {
                padding-right: $entry_spacing;
                }
            .comment .header {
                padding-right: $comment_spacing;
                }

            .has-userpic .entry .poster {
                margin-right: $entry_spacing;
                }
            .has-userpic .comment .poster {
                margin-right: $comment_spacing;
                }

            @media $medium_media_query {
                .two-columns-left #primary > .inner:first-child,
                .three-columns-left #primary > .inner:first-child {
                    padding: 1em 3.5em 1em;
                    }

                .three-columns-sides #primary > .inner:first-child {
                    padding: 1em 4.5em 1em 3em;
                    }

                .two-columns-right #primary > .inner:first-child,
                .three-columns-right #primary > .inner:first-child {
                    padding: 1em 5em 1em 2em;
                    }
            }
            """;
        }

"""
/* Funky Circles */

/* Body
***************************************************************************/
body {
    line-height: 1.5em;
    margin: 0;
    }

#canvas {
    $header_background
    background-color: transparent;
    background-position: 100% 0%;
    }

a,
a:visited {
    text-decoration: none;
    }

a:hover {
    text-decoration: underline;
    }

/* Header
***************************************************************************/
#header {
    background-position: 100% 0%;
    padding: 0;
    padding-bottom: 1.65em;
    box-shadow: -.667em .067em .667em $*color_shadow;
    }

#header .inner {
    $header_background
    $page_subtitle_colors
    background-position: 100% 5px;
    }

h1#title {
    $header_background
    background-position: 100% 0%;
    $page_title_colors
    font-weight: normal;
    letter-spacing: -.034em;
    line-height: 1em;
    margin: 0;
    padding: 1.1em .5em;
    text-transform: uppercase;
    word-spacing: .167em;
    box-shadow: inset -.667em .067em .667em $*color_shadow;
    }

h1#title a {
    color: $*color_page_title;
    }

h2#subtitle,
h2#pagetitle {
    background: transparent;
    color: $*color_page_subtitle;
    font-weight: normal;
    font-variant: small-caps;
    letter-spacing: -.04em;
    line-height: 1em;
    margin: 0;
    padding: .25em .6em;
    text-transform: lowercase;
    }

/* Page Containers
***************************************************************************/
#primary {
    margin-top: 2em;
    }

    .page-tags #primary,
    .page-icons #primary {
        margin-top: 6.6em;
        }


.any-column #content {
    width: 80%;
    margin: 0 auto;
    }
.any-column #secondary { margin-top: 0; }
.any-column #secondary > .inner:first-child { padding: 1em 0 0 0; }
.any-column #tertiary > .inner:first-child { padding: 0; }
@media $medium_media_query {
    .multiple-columns #content {
        width: auto;
    }

    .multiple-columns #secondary,
    .three-columns #tertiary {
        margin-top: 7em;
        }

    .multiple-columns #secondary > .inner:first-child {
        padding: 0;
        }

        .two-columns #tertiary > .inner:first-child {
            padding-top: 1em;
            }

        .three-columns-left #secondary > .inner:first-child,
        .three-columns-right #secondary > .inner:first-child {
            padding-right: .5em;
            }

        .three-columns-left #tertiary > .inner:first-child,
        .three-columns-right #tertiary > .inner:first-child {
            padding-left: .5em;
            }
}

@media $large_media_query {
    .multiple-columns #content {
        margin: 0 4em;
    }
}

/* Navigation
***************************************************************************/
.navigation {
    color: $*color_page_text;
    text-align: right;
    text-transform: uppercase;
    }

    .page-month .navigation .inner {
        padding: 0;
        }

    .navigation li {
        margin: 0 0 0 1.5em;
        padding: 0; 
        }

        .navigation li a {
            border-bottom: 1px solid $*color_page_link;
            border-top: 1px solid $*color_page_link;
            padding: .2em .4em;
            }

            .navigation li a:visited {
                border-bottom: 1px solid $*color_page_link_visited;
                border-top: 1px solid $*color_page_link_visited;
                }

            .navigation li a:hover {
                border-bottom: 1px solid $*color_page_link_hover;
                border-top: 1px solid $*color_page_link_hover;
                text-decoration: none;
                }

    .page-month .navigation {
        color: $*color_page_link;
        }

        .page-month .navigation li a {
            border: none;
            padding-right: 0;
            }

            .page-month .navigation li a:hover,
            .page-month .navigation li a:visited {
                border: none;
                }

        .page-month .navigation li:hover {
            color: $*color_page_link_hover;
            }

.navigation .page-separator {
    display: none;
    }

/* Posts
***************************************************************************/
.entry-wrapper,
.comment-wrapper,
.month-wrapper {
    margin-bottom: 4em;
    }

    .page-entry .entry-wrapper,
    .page-reply .entry-wrapper {
        margin-top: 3.1em;
        }

    .comment-thread {
        margin-left: 2.5em;
        }

    .comment-thread.comment-depth-1 {
        margin-left: 0;
        }

    .comment-thread .partial {
        margin-left: -2em;
        margin-bottom: 2em !important; /* Needed */
        }

.entry,
.comment {
    background-color: transparent;
    border: none;
    position: relative;
    }

.partial .comment {
    padding: 0 .5em;
    }

.header {
    $entry_title_colors
    }

.entry .header,
.comment .header {
    padding-bottom: .5em;
    }

    .header a { $page_link_colors }
    .header a:visited { $page_link_visited_colors }
    .header a:hover { $page_link_hover_colors }

    .entry-title,
    .comment-title,
    .tags-container h2,
    .month h3,
    .icons-container h2 {
        text-transform: uppercase;
        }

    /* Give a min height to make sure the userpic always sits in the same place */
    /* Use default H3 size or custom size */
    .has-userpic.no-subject .entry-title,
    .has-userpic.no-subject .comment-title {
        min-height: 1.17em;
        min-height: $*font_entry_title_size$*font_entry_title_units;
        }

    /* Give H3 spacing to comment titles */
    .has-userpic .comment-title {
        margin: .25em 0;
        padding: .25em 0;
        }

    .entry-title a,
    .comment-title a {
        $entry_title_colors
        }

    .tags-container h2,
    .month h3,
    .icons-container h2 {
        $entry_title_font
        }

    .page-day h3.day-date {
        display: none;
        }

    .entry .date:before {
        content: "on ";
        }

    .time:before {
        content: "at ";
        }

.contents,
.comment-wrapper.partial,
.page-month .month .inner {
    $entry_colors
    border-width: 20px;
    border-left: none;
    border-right: none;
    margin-bottom: 1em;
    box-shadow: .067em .067em .667em $*color_shadow;
    }

.no-userpic .contents,
.month .contents,
.page-month .month .inner,
.tags-container .contents,
.icons-container .contents {
    padding: 2em;
    }

    .has-userpic .contents {
        padding: 10px 2em 2em;
        }

        .page-recent .entry-wrapper.has-userpic.journal-type-P .entry .contents,
        .page-day .entry-wrapper.has-userpic.journal-type-P .entry .contents {
            padding: 50px 2em 2em;
            }

    .tags-container ul.ljtaglist {
        margin: 0;
        padding-left: 5em;
        }

    .tags-container .tags_cloud {
        margin: 0;
        }

    .tags-container .tags_multilevel li {
        font-weight: bold;
        }

        .tags-container .tags_multilevel ul {
            list-style: disc;
            margin: 1em 0;
            padding: 0 0 0 2em;
            }

            .tags-container .tags_multilevel ul li {
                font-weight: normal;
                margin-top: 0;
                }

                .tags-container .tags_multilevel ul ul {
                    list-style: circle;
                    }

.icons-container ul {
    margin: 0;
    padding: 0;
    }

.icons-container ul li {
    display: inline;
    padding: 0;
    }

.sorting-options {
    text-align: center;
    }

.icon-pages {
    text-align: right;
    }

.icons-container .icon {
    border-bottom: 1px dashed $*color_entry_poster_border;
    margin: 2em 0;
    padding-bottom: 2em;
    }

.icons-container .icon:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    }

.icon-image {
    float: left;
    clear: left;
    margin-bottom: .25em;
    min-width: 100px;
    padding-right: 1em;
    }

.icon-info {
    min-height: 100px;
    }

.icon-info .default {
    font-weight: bold;
    }

.icon-info .keywords-label,
.icon-info .comment-text,
.icon-info .description-text {
    font-style: italic;
    }

.contents a,
.partial .comment a,
.page-month .month a,
.tags-container a,
.icons-container a {
    $entry_link_colors
    }

    .contents a:visited,
    .partial .comment a:visited,
    .page-month .month a:visited,
    .tags-container a:visited,
    .icons-container a:visited {
        $entry_link_visited_colors
        text-decoration: none;
        }

    .contents a:hover,
    .partial .comment a:hover,
    .page-month .month a:hover,
    .tags-container a:hover,
    .icons-container a:hover {
        $entry_link_hover_colors
        text-decoration: none;
        }

    .entry-content a,
    .comment-content a {
        text-decoration: underline;
        }

    .entry-content a:hover,
    .comment-content a:hover,
    .entry-content a:visited,
    .comment-content a:visited {
        text-decoration: none;
        }

    .partial .comment-title {
        display: inline;
        padding-right: .2em;
        }

        .partial .comment-title a,
        .partial .comment-title a:hover {
            $entry_colors
            border: none;
            }

            .partial .comment-title a:hover {
                background-color: transparent;
                text-decoration: underline;
                }

.contents .userpic {
    position: absolute;
    text-align: center;
    top: -5px;
    }

    .no-userpic .userpic {
        display: none;
        }

    .contents .userpic img {
        background-color: $*color_entry_userpic_border;
        padding: 10px;
        box-shadow: .067em .067em .2em $*color_shadow;
        }


.contents .poster {
    border-bottom: 1px dashed $*color_entry_poster_border;
    display: block;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: .5em;
    }

    .entry .poster:before {
        content: 'Posted by ';
        }

    .no-userpic .poster {
        margin-left: 0;
        }

    .poster a {
        text-decoration: none;
        }

.poster-ip:before {
    content: "- ";
    }

$userpic_css

/* Must be after userpic_css */

.no-userpic .header {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    }

.poster.empty {
    display: none;
    }

#archive-year table * {
    border: none;
    text-align: center;
    vertical-align: top;
    }

    #archive-year table caption {
        font-weight: bold;
        margin-bottom: .5em;
        }

    #archive-year table thead {
        border-bottom: 1px solid $*color_entry_text;
        border-top: 1px solid $*color_entry_text;
        margin: .5em 0;
        padding: .5em 0;
        }

    #archive-year td {
        width: 14.285%;
        }

        #archive-year table td.day-has-entries {
            font-weight: bold;
            }

            #archive-year table td.day-has-entries p {
                $entry_link_hover_colors
                padding: .2em;
                }

            #archive-year table td.day-has-entries a {
                $entry_link_hover_colors
                }

                #archive-year table td.day-has-entries p:hover,
                #archive-year table td.day-has-entries p:hover > a,
                #archive-year table td.day-has-entries a:hover {
                    $page_title_colors
                    }

.entry-content {
    text-align: justify;
    }

.entry .metadata ul li {
    list-style: url() inside disc;
    }

    .entry .metadata .metadata-label {
        font-style: italic;
        }

.entry .metadata.top-metadata ul {
    margin: 0;
    }

.footer,
.bottomcomment, .comments-message {
    $entry_footer_colors
    padding: 0 .5em;
    text-align: right;
    box-shadow: .067em .067em .667em $*color_shadow;
    }

    .tags-container .manage-tags-link,
    .icons-container .manage-link {
        margin-top: 1em;
        padding: .5em;
        }

    .footer a,
    .bottomcomment a {
        $entry_footer_link_colors
        }

    .footer a:visited,
    .bottomcomment a:visited {
        $entry_footer_link_visited_colors
        }

    .footer a:hover,
    .bottomcomment a:hover {
        $entry_footer_link_hover_colors
        background-color: transparent;
        text-decoration: underline;
        }

    .comment .footer {
        padding: 0 .5em;
        text-align: left;
        }

    .month .footer .inner {
        padding: .5em 0;
        }

.entry .footer ul,
.entry .footer ul li,
.comment .footer ul,
.comment .footer ul li,
.page-month .tag ul,
.page-month .tag ul li,
.page-entry ul.entry-management-links,
.page-entry ul.entry-interaction-links {
    margin: 0;
    padding: 0;
}

.entry .tag {
    border-bottom: 1px dashed $*color_entry_footer_border;
    padding: .5em 0;
    text-align: left;
    }

    .page-month .tag {
        margin: .5em 0;
        }

    .page-month .tag-text {
        font-weight: bold;
        }

.entry ul.entry-management-links,
.entry ul.entry-interaction-links,
.comment ul.comment-management-links,
.comment ul.comment-interaction-links,
.bottomcomment ul.entry-interaction-links,
.bottomcomment ul.entry-management-links {
    display: inline-block;
    padding: .5em 0;
    }

.comment .multiform-checkbox {
    padding-right: 1em;
    }

.comment ul.comment-interaction-links,
.bottomcomment label {
    border-top: 1px dashed $*color_entry_footer_border;
    display: block;
    text-align: right;
    }

.bottomcomment select,
.bottomcomment input {
    margin-bottom: .5em;
    }

    .entry ul.entry-management-links li,
    .entry ul.entry-interaction-links li,
    .comment ul.comment-management-links li,
    .comment ul.comment-interaction-links li,
    .bottomcomment ul.entry-management-links li,
    .bottomcomment ul.entry-interaction-links li {
        $entry_list_background
        padding-right: 14px;
        }

        .entry ul.entry-interaction-links li:last-child,
        .comment ul.comment-management-links li:last-child,
        .comment ul.comment-interaction-links li:last-child,
        .bottomcomment ul.entry-interaction-links li:last-child {
            background: none;
            padding-right: 0;
            }

.entry ul.entry-interaction-links {
    padding-left: .35em;
    }

.bottomcomment ul li {
    padding-left: 0;
    }

.bottomcomment ul.entry-interaction-links li:first-child {
    padding-left: .35em;
    }

.comment-pages {
    color: $*color_page_text;
    margin: 1em 0;
    text-align: right;
    }

#qrformdiv {
    padding: 1.5em 1em;
    }

    #qrformdiv label {
        border-top: none;
        display: inline;
        padding-top: 0;
        text-align: left;
        }

    #qrformdiv table {
        border: none !important; /* Needed */
        margin: 0 auto;
        }

        #qrformdiv table td[align='center'] {
            text-align: right;
            }

    #qrformdiv #subject {
        width: 99%;
        }

    #qrformdiv .de {
        $entry_footer_link_visited_colors
        }

#postform {
    $entry_footer_colors
    padding: .5em;
    box-shadow: .067em .067em .667em $*color_shadow;
    }

    #postform a {
        $entry_footer_link_colors
        }

        #postform a:visited {
            $entry_footer_link_visited_colors
            }

        #postform a:hover {
            $entry_footer_link_hover_colors
            }

/* Modules
***************************************************************************/

.module {
    padding: 0 .5em;
    }

#secondary .module,
#tertiary .module {
    margin-bottom: 4em;
    }

.one-column-split #secondary,
.one-column-split #tertiary {
    text-align: center;
    }

.one-column-split .module {
    display: inline-block;
    text-align: left;
    vertical-align: top;
    width: $*sidebar_width;
    }

.one-column-split #secondary .module,
.one-column-split #tertiary .module {
    margin: 2em 1em;
    }

.module li {
    list-style: url($image_module_list_url) disc;
    margin: .5em;
    }


.module-navlinks li.current {
        list-style: url($image_module_list_active_url) disc;
        }

    .module-navlinks li.current a {
        $page_link_hover_colors
        text-decoration: underline;
        }

    .module-navlinks li:hover {
        list-style: url($image_module_list_hover_url) disc;
        }

.module-tags_multilevel ul li {
    font-weight: bold;
    margin-top: 1.5em;
    }

    .module-tags_multilevel ul ul li {
        font-weight: normal;
        list-style: url() disc;
        margin-top: 0;
        }

        .module-tags_multilevel ul li:first-child {
            margin-top: .5em;
            }

            .module-tags_multilevel ul ul ul li {
                font-weight: normal;
                list-style: url() circle;
                }


.any-column .module-userprofile,
.any-column .module h2, .any-column .module h2 a,
.any-column .module-search .search-form {
    text-align: left;
}
.any-column .module-search .search-button {
    margin-left: .3em;
    margin-top: 0;
    }

@media $medium_media_query {
    .multiple-columns .module-userprofile, .one-column-split .module-userprofile,
    .multiple-columns .module h2, .multiple-columns .module h2 a, .one-column-split .module h2, .one-column-split .module h2 a,
    .multiple-columns .module-search .search-form, .one-column-split .module-search .search-form {
        text-align: center;
    }

    .multiple-columns .module-search .search-box, .one-column-split .module-search .search-box {
        width: 90%;
    }

    .multiple-columns .module-search .search-button, .one-column-split .module-search .search-button {
        margin-left: 0;
        margin-top: .3em ;
        }
}

.module-userprofile {}

    .module-userprofile .userpic {
        margin-bottom: .5em;
        }

        .module-userprofile .userpic img {
            background-color: $*color_header_background;
            padding: .7em;
            box-shadow: .067em .067em .2em $*color_shadow;
            }

    .module-userprofile .userlite-interaction-links li {
        padding: 0;
        }

.module-calendar table {
    border-spacing: 4px;
    margin: 0 auto;
    }

    .module-calendar td {
        padding: .3em;
        width: 14.285%;
        border-radius: .2em;
        }

        .module-calendar td.empty-day {
            background-color: $*color_specificmodule_background;
            color: $*color_specificmodule_text;
            box-shadow: .067em .067em .134em $*color_shadow;
            }

        .module-calendar td.entry-day {
            background-color: $*color_specificmodule_background_alt;
            box-shadow: .067em .067em .134em $*color_shadow_alt;
            }

            .module-calendar td.entry-day a {
                color: $*color_specificmodule_text_alt;
                padding: 0;
                }

            .module-calendar td.entry-day:visited {
                background-color: $*color_specificmodule_background_visited;
                }

            .module-calendar td.entry-day:hover {
                background-color: $*color_specificmodule_background_hover;
                }

                .module-calendar td.entry-day:visited > a,
                .module-calendar td.entry-day a:visited {
                    color: $*color_specificmodule_text_visited;
                    text-decoration: none;
                    }

                .module-calendar td.entry-day:hover > a,
                .module-calendar td.entry-day a:hover {
                    color: $*color_specificmodule_text_hover;
                    text-decoration: none;
                    }

.module h2,
.module h2 a {
    text-transform: uppercase;
    $module_title_colors
    }

.module-search .search-form {
    margin: 0 auto;
    }

.module-search .search-box,
.module-search .search-button {
    border: 0;
    padding: .3em;
    border-radius: .2em;
    }

.module-search .search-box {
    background-color: $*color_specificmodule_background_alt;
    color: $*color_specificmodule_text_alt;
    box-shadow: .067em .067em .134em $*color_shadow_alt;
    }

.module-search .search-button {
    background-color: $*color_specificmodule_background;
    color: $*color_specificmodule_text;
    box-shadow: .067em .067em .134em $*color_shadow;
    }

.module-search .search-button:hover {
    background-color: $*color_specificmodule_background_hover;
    color: $*color_specificmodule_text_hover;
    }

/* Footer
***************************************************************************/

#footer {
    padding: 2em;
    text-align: center;
    text-transform: uppercase;
    }

    #footer a {
        border-bottom: 1px solid $*color_footer_link;
        border-top: 1px solid $*color_footer_link;
        padding: .2em .5em;
        }

        #footer a:visited {
            border-bottom: 1px solid $*color_footer_link_visited;
            border-top: 1px solid $*color_footer_link_visited;
            }

        #footer a:hover {
            border-bottom: 1px solid $*color_footer_link_hover;
            border-top: 1px solid $*color_footer_link_hover;
            text-decoration: none;
            }
""";
}