.draggy-boxy-thing-hover (@color: #ffa500) {
    border-color: @color;
    @darker: darken(@color, 11%);
    box-shadow: 0 0 4px @darker;
    -moz-box-shadow: 0 0 4px @darker;
    -ms-box-shadow: 0 0 4px @darker;
    -o-box-shadow: 0 0 4px @darker;
    -webkit-box-shadow: 0 0 4px @darker;
}

.draggy-boxy-thing {
    .draggable-box,
    .cards-area {
        background: #eee;
        border: 1px solid #ccc;
        border-bottom: 1px solid #aaa;

        box-shadow: 0 1px 2px #ccc;
        -moz-box-shadow: 0 1px 2px #ccc;
        -webkit-box-shadow: 0 1px 2px #ccc;
    }

    // TODO(jack): Make this work for the orderer too.
    // Right now don't do this for the orderer because it uses
    // more complicated positioning that this would break
    .cards-area {
        .above-scratchpad;
    }

    .card {
        .perseus-interactive;

        background-color: #fff;
        border: 1px solid #b9b9b9;
        border-bottom-color: #939393;
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -o-user-select: none;
        cursor: pointer;

        &.placeholder {
            background:#ddd;
            border: 1px solid #ccc;
        }

        &.drag-hint {
            background: none;
            border: 1px dashed #aaa;
            cursor: auto;

            &:hover {
                border-color: #aaa;
                box-shadow: none;
            }
        }

        &.dragging {
            background-color: #ffedcd;
            opacity: 0.8;
            filter: opacity(0.8);
        }

        &.stack {
            z-index: auto;
            &:after {
                content: " ";
                background-color: #fff;
                border: 1px solid #b9b9b9;
                border-bottom-color: #939393;
                border-radius: 4px;
                -moz-border-radius: 4px;
                -webkit-border-radius: 4px;
                height: 100%;
                width: 100%;
                z-index: -1;
                top: 1px;
                left: 1px;
                position: absolute;
            }
        }

        &:hover {
            .draggy-boxy-thing-hover();
        }
    }
}

.perseus-sortable {
    // This should really be applied to individual items, but applying
    // it here makes positioning simple
    .perseus-interactive;

    box-sizing: border-box;
    -moz-box-sizing: border-box;
    float: left;

    .perseus-sortable-card {
        background-color: #fff;
        border: 1px solid #ddd;

        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;

        box-sizing: border-box;
        -moz-box-sizing: border-box;

        cursor: pointer;

        min-width: 25px;
        min-height: 44px;
        padding: 10px;

        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -o-user-select: none;
    }

    .perseus-sortable-placeholder {
        background: #ddd;
        border: 1px solid #ccc;
    }

    .perseus-sortable-draggable {
        font-size: 0;
        text-align: center;

        &:before {
            // Vertical-align, part 1
            content: "";
            display: inline-block;
            height: 100%;
            vertical-align: middle;
        }

        & > div {
            // Vertical-align, part 2
            display: inline-block;
            font-size: 14px;
            max-width: 100%;
            vertical-align: middle;
        }

        div.paragraph {
            margin: 0;
        }

        &.perseus-sortable-static {
            cursor: pointer;
        }

        &.perseus-sortable-static:hover {
            .draggy-boxy-thing-hover();
        }

        &.perseus-sortable-dragging {
            background-color: #ffedcd;
            filter: opacity(0.8);
            opacity: 0.8;
        }

        &.perseus-sortable-disabled {
            background-color: inherit;
            border: 1px solid transparent;
            cursor: default;
        }
    }

    &.layout-horizontal {
        .perseus-sortable-card {
            float: left;
        }

        .perseus-sortable-dragging {
            cursor: ew-resize;
        }
    }

    &.layout-vertical {
        &, .perseus-sortable-card {
            max-width: 100%;
        }

        .perseus-sortable-dragging {
            cursor: ns-resize;
        }
    }

    &.unpadded {
        .perseus-sortable-card {
            padding: 0;
            img {
                vertical-align: bottom;
            }
        }
    }
}
