@import "compass";
@import "mixins";

.so-announcements-portlet {
	.back-link {
		float: right;
		font-weight: bold;
	}

	.alert-error {
		display: inline-block;
	}

	.admin-actions {
		margin-bottom: 1em;
	}

	.entry {
		margin-bottom: 1.2em;
		padding-bottom: 0.5em;
		position: relative;

		&.last {
			padding-bottom: 0;
		}
	}

	.user-portrait {
		float: left;
		left: 0;
		margin-bottom: .4em;
		max-height: 45px;
		position: absolute;
		top: 0;
		width: 45px;

		.avatar {
			display: block;
			max-height: 45px;
			overflow: hidden;

			img {
				max-width: 45px;
			}
		}
	}

	.entry-block, .entry-header {
		margin-left: 55px;
		overflow: hidden;
	}

	.entry-header {
		margin-bottom: .4em;

		a {
			font-weight: bold;
		}
	}

	.entry-time {
		color: #999;
		float: right;
		font-size: .9em;
		margin-left: 1em;
	}

	.entry-action {
		float: left;
	}

	.entry-scope {
		color: #555;
		display: block;
	}

	.entry-block {
		clear: both;
	}

	.entry-body {
		border: 1px solid #C8C9CA;
		border-bottom-width: 0;

		.icon {
			height: 16px;
			width: 16px;
		}

		.title {
			border-right-width: 0;
			display: block;
			font-weight: bold;
			overflow: hidden;
			padding: .4em .9em;

			.event-title {
				float: left;
				line-height: 1.5em;
			}

			.date {
				float: right;
				line-height: 1.5em;
				padding-right: 0;
			}
		}
	}

	.entry-content-container {
		max-height: 75px;
		overflow: hidden;
		padding: .5em .9em;
	}

	.entry-content {
		overflow: hidden;

		p:last-child {
			margin-bottom: 0;
		}
	}

	.entry-footer {
		border: 1px solid #C8C9CA;
		border-top-width: 0;
	}

	.entry-footer-toolbar {
		background: #EAEAEA;
		padding: 0 1em;

		.action {
			border-left: 1px solid #2571AD;
			display: inline-block;
			height: 16px;
			line-height: 16px;
			margin: .5em 0;
			padding: 0 .6em 0 .8em;
			vertical-align: middle;

			&:first-child {
				border-left-width: 0;
				padding-left: 0;
			}
		}

		a {
			font-size: .9em;
		}
	}

	.no-announcements {
		padding: 5px;
		text-align: center;
	}

	.read-entries-container .entries {
		margin-top: 1em;

		.header {
			border: 1px solid #C8C9CA;
			cursor: pointer;
			padding: .2em .5em;
		}

		.toggler-header-collapsed {
			background: url(@theme_image_path@/portlet/maximize.png) no-repeat 99% 50%;
		}

		.toggler-header-expanded {
			background: url(@theme_image_path@/portlet/minimize.png) no-repeat 99% 50%;
		}

		.toggler-content-collapsed {
			display: block;
			height: 0;
			overflow: hidden;
		}

		.entry {
			margin-top: 1.2em;

			&.last {
				margin-bottom: 0;
			}
		}
	}

	.announcement-collapsed .entry-footer-toolbar {
		border-top: 1px solid #EFEFEF;
	}

	.navigation {
		margin-top: 1em;
		text-align: center;

		span {
			margin: 0 1em;
		}

		.left-nav {
			float: left;
			margin-left: .5em;
		}

		.right-nav {
			float: right;
			margin-right: .5em;
		}
	}
}

.dialog-iframe-popup .so-announcements-portlet {
	select {
		margin: 0;
	}

	.control-group {
		display: inline-block;
		margin-right: 1em;
		position: relative;

		&:last-child {
			margin-right: 0;
		}

		&.field-wrapper {
			display: block;
			margin-right: 0;
		}

		.title, .url {
			width: 350px;
		}

		.form-validator-stack {
			position: absolute;
			right: 0;
			top: 0;
		}
	}

	.distribution-scope-container .control-group .form-validator-stack {
		position: relative;
	}

	.date-container .control-group {
		float: left;
		margin-bottom: 0;
	}

	#_1_WAR_soannouncementsportlet_ocerSearchContainerSearchContainer td.last {
		white-space: nowrap;
	}

	.entry {
		margin: 0;
		padding: 0;
	}
}

.portlet-configuration {
	.accordion-group .accordion-heading .accordion-toggle {
		display: inline-block;
	}

	.taglib-move-boxes .control-group {
		min-width: 200px;
	}
}

/* ---------- Internet explorer ---------- */

.ie6, .ie7 {
	.so-announcements-portlet .entry-content-container {
		height: 75px;
	}
}

/* ---------- Extras ---------- */

.so-announcements-portlet .announcement-collapsed .entry-footer-toolbar {
	@include box-shadow(0 -1px 15px -5px rgba(0, 0, 0, .8));
}

/* ---------- Responsive ---------- */

@include respond-to(phone) {
	.so-announcements-portlet {
		.user-portrait {
			position: relative;
		}

		.entry-time {
			margin: .2em 0 0;
			width: 100%;
		}

		.entry-block {
			float: left;
			margin-left: 0;
			width: 100%;
		}
	}
}