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 = "Bannering";
layerinfo author_name = "branchandroot";
layerinfo redist_uniq = "bannering/layout";
layerinfo lang = "en";

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

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

propgroup presentation_child {
property string header_border_position {
    des = "Position of header border";
    values = "none|None|bottom|Bottom|topbottom|Top and Bottom|all|On All Sides";
    }
property string header_border_width {
    des = "Width of header border";
    size = 5;
    }
property string header_border_style {
    des = "Style of header border";
    values = "solid|Solid|double|Double|dotted|Dotted|dashed|Dashed";
    }
property string header_margin_size {
    des = "Size of header margin";
    }
property string header_title_position {
    des = "Position of journal and page titles";
    values = "left|Left|right|Right|center|Center";
    }
property string header_title_spacing_top {
    des = "Spacing above journal and page titles";
    }
property string header_title_spacing_side {
    des = "Spacing on the side of journal and page titles";
    }
}

set layout_type = "two-columns-left";
set sidebar_width = "13em";
set sidebar_width_doubled = "26em";
set userpics_position = "left";
set entry_management_links = "text";
set comment_management_links = "text";
set header_border_position = "none";
set header_border_width = "1px";
set header_border_style = "solid";
set header_margin_size = "0em";
set header_title_position = "left";
set header_title_spacing_top = "0em";
set header_title_spacing_side = "0em";

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

propgroup colors_child {
    property Color color_navlinks_link_current { des = "Navigation module current link color"; }
    property Color color_header_inner_background { des = "Page header inner background color"; }
    # Used instead of color_header_link:
    property Color color_navlinks_link { des = "Page header link color"; }
    property Color color_navlinks_link_active { des = "Page header active link color"; }
    property Color color_navlinks_link_hover { des = "Page header hover link color"; }
    property Color color_navlinks_link_visited { des = "Page header visited link color"; }
    property Color color_header_border { des = "Header border color"; }
}

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

propgroup images_child {
    property string[] image_header_background_inner_group {
        des = "Second header background image";
        grouptype = "image";
    }
    set image_header_background_inner_group = [ "image_background_header_inner_url", "image_background_header_inner_repeat", "image_background_header_inner_position" ];
    property string image_background_header_inner_url {
        grouped = 1;
    }
    property string image_background_header_inner_repeat {
        values = "repeat|tile image|no-repeat|don't tile|repeat-x|tile horizontally|repeat-y|tile vertically";
         grouped = 1;
    }
    property string image_background_header_inner_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;
    }
    property int image_background_header_inner_height {
        des = "The height of your second header image, in pixels.  Use 0 for default."; }
}

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

property string module_navlinks_section_override {
       values = "none|(none)|header|Header|one|Main Module Section|two|Secondary Module Section";
       grouped = 1;
       }

set grouped_property_override = { "module_navlinks_section" => "module_navlinks_section_override" };
set module_navlinks_section = "header";

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

set text_entry_prev = "Previous";
set text_entry_next = "Next";
set text_tell_friend = "Share";
set text_mem_add = "Memory";
set text_watch_comments = "Track";
set text_unwatch_comments = "Untrack";
set text_post_comment = "Reply";
set text_post_comment_friends = "Reply";

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


# Give a title to the navlinks module
function print_module_navlinks() {
    var Page p = get_page();
    var string title = "Navigation";
    open_module("navlinks", "$title", "");
    var string[] links = [];
    foreach var string k ($p.views_order) {
        var string css = """ class="$k" """;
        if ($p.view == $k) { $css = """ class="current $k" """; }
        $links[size $links] = """<a href="$p.view_url{$k}"$css>""" + lang_viewname($k) + """</a>""";
    }
    print_module_list($links);
    close_module();
}

function Page::print() {
    """<!DOCTYPE html>\n<html lang="en">\n<head profile="http://www.w3.org/2006/03/hcard http://purl.org/uF/hAtom/0.1/ http://gmpg.org/xfn/11">\n""";
    $this->print_meta_tags();
    $this->print_head();
    $this->print_stylesheets();
    $this->print_head_title();
    """</head>""";
    $this->print_wrapper_start();
    $this->print_control_strip();
    """
    <div id="canvas">
        <div class="inner">
            <div id="header">
                <div class="inner">
                    """;
                    $this->print_module_section("header");
                    $this->print_header();
    """
                </div><!-- end header>inner -->
            </div><!-- end header -->
            <div id="content">
                <div class="inner">
    """;
                if ($*layout_type == "one-column-split") {
    """
                    <div id="secondary"><div class="inner">
    """;
                        $this->print_module_section("one");
    """
                    </div></div><!--  end secondary and secondary>inner -->
    """;
                }
    """
                    <div id="primary"><div class="inner">
                        """;
                        $this->print_body();
    """
                    </div></div><!-- end primary and primary>inner -->
    """;
                if ($*layout_type != "one-column-split") {
    """
                    <div id="secondary"><div class="inner">
    """;
                        $this->print_module_section("one");
    """
                    </div></div><!--  end secondary and secondary>inner -->
    """;
                }
    """
                    <div id="invisible-separator" style="float: left; width: 1px;"></div> <!-- this is a hack for IE7 + two-columns-right -->
                    <div id="tertiary"><div class="inner">
                        """;
                        $this->print_module_section("two");
    """
                    </div></div><!-- end tertiary and tertiary>inner -->
                    <div id="content-footer"></div>
                </div><!-- end content>inner -->
            </div> <!-- end content -->
        </div> <!-- end canvas>inner -->
    """;

    """
    <div id="footer">
        <div class="inner">
            """;
            print safe """
                <div class="page-top"><a href="#">$*text_page_top</a></div>
        </div><!-- end footer>inner -->
    </div><!-- end footer -->

    </div> <!-- end canvas -->
    """;
    $this->print_wrapper_end();
    """</html>""";
}

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

    var string header_inner_background = generate_background_css ($*image_background_header_inner_url, $*image_background_header_inner_repeat, $*image_background_header_inner_position, $*color_header_inner_background);
    if ($*image_background_header_inner_height > 0) {
        $header_inner_background = """
            $header_inner_background
            height: """ + $*image_background_header_inner_height + """px;""";
    }

var string userpic_css = "";
    if ($*userpics_position == "right") {
        $userpic_css = ".entry .userpic,
        .comment .userpic { float: right; }
        .entry .userpic img,
        .comment .userpic img { right: 0; }

        .has-userpic .entry .header,
        .has-userpic .comment .header { margin-right: 110px; }";
    }
    else {
        $userpic_css = ".entry .userpic,
        .comment .userpic { float: left;
            margin-left: 0 !important; }
        .entry .userpic img,
        .comment .userpic img { left: 0; }

        .has-userpic .entry .header,
        .has-userpic .comment .header { margin-left: 110px; }";
    }


var string header_border_css = "";
    if ($*header_border_position == "bottom") {
        $header_border_css = "#header { border-bottom: $*header_border_style $*header_border_width $*color_header_border; }";
    }
    if ($*header_border_position == "topbottom") {
        $header_border_css = "#header { border-bottom: $*header_border_style $*header_border_width $*color_header_border;
            border-top: $*header_border_style $*header_border_width $*color_header_border; }";
    }
    if ($*header_border_position == "all") {
        $header_border_css = "#header { border: $*header_border_style $*header_border_width $*color_header_border; }";
    }

var string header_spacing_css = "";
    if ($*header_title_position == "left") {
        $header_spacing_css = "#title { margin-top: $*header_title_spacing_top; }
             #header > .inner:first-child { padding-left: $*header_title_spacing_side; } ";
    }
    if ($*header_title_position == "right") {
        $header_spacing_css = "#title { margin-top: $*header_title_spacing_top; }
             #header > .inner:first-child { padding-right: $*header_title_spacing_side; } ";
    }
    if ($*header_title_position == "center") {
        $header_spacing_css = "#title { margin-top: $*header_title_spacing_top; }
             #header > .inner:first-child { padding-right: $*header_title_spacing_side;
                padding-left: $*header_title_spacing_side; } ";
    }


var string navlinks_css = "";
    if ($*module_navlinks_section == "header") {
        $navlinks_css = """
            .module-navlinks {
                margin-bottom: -3em;
                padding-right: 2em;
                padding-top: 1em;
                text-align: right;
                background-color: transparent; }
            .module-navlinks li { display: inline;
                padding-left: .5em;
                border-left: 1px solid $*color_page_title; }
            .module-navlinks ul > li:first-child { border-left: none; }
            .module-navlinks .module-header { display: none; }
            .module-navlinks a { color: $*color_navlinks_link; }
            .module-navlinks a:visited { color: $*color_navlinks_link_visited; }
            .module-navlinks a:hover { color: $*color_navlinks_link_hover; }
            .module-navlinks a:active { color: $*color_navlinks_link_active; }
        """;
    }
    else {
        $navlinks_css = "";
    }


    """

/* Bannering  */

body { margin: 0; }

blockquote { padding: 1em 1em .5em 2em;
    font-style: italic;  }
blockquote > p:first-child { margin-top: 0; }
q { font-style: italic; }
dl dt { font-weight: bold; }

a:hover { text-decoration: none; }

.module-navlinks,
.datetime,
.entry .metadata,
.entry .footer,
.comment .footer,
.module { font-size: small; }

#canvas { position: relative;
    padding-top: 1px; }

#header {
    margin: $*header_margin_size;
    text-align: $*header_title_position;
    margin: 0;
    margin-bottom: 1em;
    padding: 0; }

#header > .inner:first-child {
    $header_inner_background
    margin: 0; padding: 0;
    padding-top: 1px; /*really freaking annoying workaround for margin stupidity */
    margin-top: -1px;
}

$header_border_css

$header_spacing_css

#footer { margin: 1em 0; }

#title,
#subtitle,
#pagetitle { padding-left: 1em;
    padding-right: 1em; }

#title { font-size: large; }
#title a { color: $*color_page_text;
    text-decoration: none; }
#subtitle { font-size: medium;
    font-style: italic; }
#pagetitle { font-weight: normal;
    font-size: small; }

#content {margin: 2em 5% 0 5%; }

.navigation { text-align: center;
    padding: 1px;
    margin: 0 0 2em 0; }

#primary > .inner:first-child { padding: 0 3em; }


/* Entry and Comments */

.entry-wrapper,
.comment-wrapper { border-bottom: 1px solid $*color_entry_border;
    margin-bottom: 2em;
    position: relative; }

.entry { border: none; }

.has-userpic .entry .userpic { margin: -4.5em 1em 1em; }
.has-userpic .comment .userpic { margin: -2.5em 1em 1em; }

$userpic_css

.entry .contents,
.comment .contents { margin: 1em 0; }

.entry-content,
.comment-content { margin-top: 1em; }

.entry .metadata { font-style: italic.
    margin-bottom: -1em; }

.entry .footer,
.comment .footer { clear: both;
    padding-bottom: .5em; }

.entry .footer { text-align: right; }

.entry .tag { margin-bottom: .5em;
    text-align: left; }

ul.entry-management-links,
.comment-management-links { display: inline;
	line-height: 2em; }
ul.entry-interaction-links,
.comment-interaction-links { display: inline;
	line-height: 2em; }

ul.entry-management-links li,
ul.entry-interaction-links li { border-left: 1px solid; padding-left: .5em; }
ul.entry-management-links li.first-item {border-left: none; padding-left: .25em; }

.bottomcomment { padding: 0 .25em .25em .25em;
    margin-top: 1em;
    text-align: right; }
.bottomcomment label { white-space: nowrap; }

.multiform-checkbox { clear: both;
    display: block; }

.partial .comment-title { display: inline; }

#qrformdiv table { padding: .5em; }

/* Archive */

.year .month,
#archive-month .month { margin-bottom: 2em; }

.month .contents { padding: 1em .5em 0 .5em; }
.month .footer {padding: 0 .5em 1em .5em;
    text-align: center; }

.month .header {  color: $*color_entry_title;
    font-family: $*font_entry_title;
    background: $*color_entry_title_background;
    padding: 1px .25em; }

table.month td,
table.month th { vertical-align: top;
    padding: .25em .5em; }

table.month caption { color: $*color_page_background; }

#archive-month .month { padding: 0 1em; }

#archive-month .entry-title { font-weight: bold; }

h3.day-date { text-align: center;
    margin-bottom: 2em; }

div.icons-container div.icon:nth-of-type(2n) {
    clear: both;
}

.icons-container .icon {
    float: left;
    margin-bottom: 15px;
    min-width: 350px;
    vertical-align: bottom;
    width: 50%;
    display:table;
}

.icon-image {
    display: inline;
    float: left;
    margin-right: 1em;
    min-width: 100px;
    margin-top: 0;
}

.icon-info {
    overflow: auto;
    vertical-align: bottom;
    word-wrap: break-word;
    display:table-cell;
    width:100%;
}

.icon-info .label,
.icon-info span {
    font-weight: bold;
}

.icons-container .inner .footer, .icon-pages {
    clear: both;
    text-align: center;
}


/* Sidebars */

#content .module {
    display: inline-block;
    vertical-align: top;
    width: $*sidebar_width;
    text-align:left;
    padding: 0 .25em;
    }

#content .module-wrapper {
    text-align:center;
    }

@media $medium_media_query {
    .two-columns-left #secondary, .three-columns-sides #secondary, .three-columns-left #secondary, .three-columns-left #tertiary { border-right: 1px solid $*color_module_border; }
    .two-columns-right #secondary, .three-columns-sides #tertiary, .three-columns-right #secondary, .three-columns-right #tertiary { border-left: 1px solid $*color_module_border; }

    body:not(.one-column) #content .module {
        display: block;
        vertical-align: baseline;
        width: auto;
        padding: 0;
    }
}

.module { margin-bottom: 1em;
    border: none; }

.module-content ul,
.module-list { list-style: none;
    margin: 0; padding: 0; }

.module-content ul ul { margin-left: 1em; }

.module-header { font-size: large; }
.module-header a { color: $*color_module_title; }

.module .userlite-interaction-links { margin-top: .5em; }

.any-column .module-calendar .module-content { text-align: left; }
.any-column .module-calendar table { margin: 0; }

$navlinks_css
.module-navlinks a.current { color: $*color_navlinks_link_current;
    text-decoration: none; }

.search-box {max-width: 100%;}

#footer { text-align: right;
    padding: .5em 2em; }

    """;
}