// General block styles.
.block {
    .well;
    padding: 8px 0;

    .header {
        h2 {
            .nav-header;
            font-size: 1.1em;
            word-wrap: break-word;
            margin: 0;
        }
        .block_action {
            padding: 3px 15px;
            float: right;
            > * {
                margin-left:3px;
            }
            .block-hider-show,
            .block-hider-hide {
                cursor: pointer;
            }
            .block-hider-show {
                display: none;
            }
        }
        .commands {
            clear: both;
            text-align: right;
            display: block;
            padding: 3px 15px;

            > a {
                margin: 0 3px;
            }
            .icon img {
                width: 12px;
                height: 12px;
            }
            img.actionmenu {
                width:auto;
            }
        }
    }
    .content {
        padding: 4px 14px;
        word-wrap: break-word;

        h3 {
            .nav-header;
            font-size: 1.1em;
        }
        hr {
            margin: 5px 0;
        }
        .userpicture {
            width: 16px;
            height: 16px;
            margin-right: 6px;
        }
        .list {
            li.listentry {
                clear: both;
            }
            .c0 {
                display: inline;
            }
            .c1 {
                margin-left: 5px;
                display: inline;
            }
        }
    }
    .footer {
        margin-bottom: 4px;
        display: block;
        padding: 3px 5px;
    }
    &.beingmoved {
        border-width: 2px;
        border-style: dashed;
    }
    &.invisible {
        .opacity(50);
    }

    &.hidden .header .block_action {
        .block-hider-hide {
            display: none;
        }
        .block-hider-show {
            display: inline;
        }
    }
    &.list_block .unlist > li > .column {
        display: inline-block;
        .ie7-inline-block();
    }
}

// Hide the block content when the block has been minimised.
.jsenabled .block.hidden .content {
    display: none;
}

// Style the div used as a move target for non-drag+drop block moves.
.blockmovetarget {
    border-width: 2px;
    border-style: dashed;
    display: block;
    height: 1em;
    margin-bottom: 20px;
}

// Style the div that contains the cancel link for moving a block with JS disabled.
.blockannotation {
    // Blocks have a bottom margin of 20px, to associate this link with the block being moved
    // we move it up 10px, and then give it a bottom margin of 10px giving it a better visual association
    position: relative;
    top: -10px;
    margin-bottom: 10px;
}

// Styles for the blog menu block.
.block_blog_menu #blogsearchquery {
    max-width: 92%;
}

// Styles for the admin block.
.block_settings {
    #adminsearchquery {
        max-width: 92%;
    }
}

// Styles for the search forums block.
.block_search_forums {
    #searchform_search {
        width: auto;
        max-width: 92%;
    }
}

// Styles for the Calendar Upcoming block.
.block_calendar_upcoming {
    .content {
        .date {
            padding-left: 22px;
        }
        .footer {
            margin-top: .5em;
            padding-top: 10px;
            padding-left: 0px;
        }
    }
}

// Styles for the RSS client block.
.block_rss_client {
    .content li {
        margin-bottom: 10px;
        padding: 5px;
        border: 1px solid #ddd;
        .border-radius(@baseBorderRadius);
        .link {
            font-weight: inherit;
        }
    }
    .list li:first-child {
        border-top-width: 1px; // undo the style provided by the block's styles.css
    }
}

// Styles for the news items block.
.block_news_items .content {
    .newlink {
        padding-bottom: 10px;
    }
    ul li {
        border-top: 1px rgba(0,0,0,0.05) solid;
        padding: 2px;
        display: table;
        width: 100%;
        .info {
            display: table-header-group;
        }
        .date {
            font-size: @fontSizeSmall;
            display: inline;
        }
        .name {
            font-size: @fontSizeSmall;
            padding-left: 1ex;
            display: inline;
        }
    }
    .footer {
        padding-top: 10px;
        padding-left: 0px;
    }
}

// Overide for login block.
.block_login {
    input#login_username,
    input#login_password {
        width: 95%;
    }
    .content {
        margin-left: auto;
        margin-right: auto;
        max-width: 280px;
    }
    input[type="submit"] {
        margin: 10px 0;
    }
}

// Styles for the special "Add block" block shown while editing.
.block_adminblock {
    .content {
        display: block;
        padding: 3px 5px;
    }
    select {
        max-width: 92%;
    }
}

// RTL styles for blocks.
.dir-rtl {

    // RTL styles for blocks in general.
    .block {
        .header {
            text-align:right;
            h2 {
                text-align:right;
            }
            .commands {
                text-align: left;
                > * {
                    margin-left:0;
                    margin-right:3px;
                }
            }
            .block_action {
                float: left;
            }
        }
    }

    // LTR styles for the calendar upcoming block.
    .block_calendar_upcoming {
        .content {
            .date {
                padding-right: 22px;
            }
            .footer {
                padding-right: 0px;
            }
        }
    }

    // RTL styles for the news items block.
    .block_news_items .content {
        ul li {
            .name {
                padding-right: 1ex;
            }
        }
        .footer {
            padding-left: 0px;
        }
    }
}
