/**
 * All of the CSS for the public-facing functionality of this plugin
 */

:root {
	--cs-background-color: #ffffff;
	--cs-primary-color: #3a76ca;
	--cs-text-color: #303030;
	--cs-text-on-primary-color: #ffffff;
	--cs-text-lighter-color: #555555;
	--cs-text-lightest-color: #808080;
	--cs-gliph-color: #999999;
	--cs-border-darker-color: #808080;
	--cs-border-color: #c0c0c0;
	--cs-border-lighter-color: #e0e0e0;
	--cs-light-grey-background-color: #f3f3f3;
	--cs-today-background-color: #ffffef;
	--cs-category-1-color: #3a76ca;
	--cs-category-2-color: #539127;
}

.cancelled {
	color: var(--cs-text-lightest-color);
}

.cancelled div.cs-event-name {
	text-decoration: line-through;
}

div.cs-row {
	/* A container to display the event 'cards' horizontally */
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: space-evenly;
}

div.cs-card {
	/* Add shadows to create the "card" effect */
	box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
	transition: 0.3s;
	background-color: var(--cs-background-color);
}

/* On mouse-over, add a deeper shadow */
div.cs-card:hover {
  box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}

div.cs-event-card,
div.cs-group {
	/* Default width provides the right card size ... height is dependent on content */
	width: 330px;
    /* Default margin ensures cards are not 'squeezed' together too much */
	margin: 0.5rem 0.5rem;
	border-radius: 10px;
	overflow: hidden;
}

div.cs-group {
	width: 350px;
	margin: 1rem 1rem;
}

div.cs-group-image-area,
div.cs-event-card-image-area {
	background-image: linear-gradient(to bottom right, var(--cs-primary-color), black);
	background-size: cover;
	height: 186px;
}

div.cs-group-image-area {
	height: 250px;
}

div.cs-group-image-area img {
	height: 250px;
	width: 350px;
	object-fit: cover;
}

div.cs-event-card-image-area img {
	height: 186px;
	width: 330px;
	object-fit: cover;
}

div.cs-group-details-area,
div.cs-event-card-details-area {
	/* Add some padding around the internal text */
	padding: 1rem 1rem;
}

div.cs-event-name,
div.cs-group-name { 
	font-size: 1.5rem;
	margin: 1rem 0;
}

div.cs-date { /* no formatting at present */ }

span.cs-date-gliph::before {
	content: "\e800";
	font-family: "glyphs";
	font-size: 0.9rem;
	padding-right: 0.5rem;
	color: var(--cs-gliph-color);
}

div.cs-time { /* no formatting at present */ }

span.cs-time-gliph::before {
	content: "\e802";
	font-family: "glyphs";
	font-size: 0.9rem;
	padding-right: 0.5rem;
	color: var(--cs-gliph-color);
}

div.cs-location { /* no formatting at present */ }

span.cs-location-gliph::before {
	content: "\e801";
	font-family: "glyphs";
	font-size: 0.9rem;
	padding-right: 0.7rem;
	color: var(--cs-gliph-color);
}

div.cs-address,
div.cs-description {
    font-size: 0.8rem;
    line-height: 1.25;
	color: var(--cs-text-lighter-color);
	margin: 1rem 0;
}

div.cs-event-list div.cs-event-row {
	display: flex;
    flex-direction: row;
}

div.cs-event-list div.cs-date-column {
    width: 5rem;
}

div.cs-event-list div.cs-event-column {
	width: 100%;
}

div.cs-event-list div.cs-date {
    background-color: var(--cs-primary-color);
    color: var(--cs-text-on-primary-color);
    padding: 5px 5px;
    max-width: 3.5rem;
    text-align: center;
    font-size: 0.8rem;
    border-radius: 5px;
    line-height: 1rem;
}

div.cs-event-list div.cs-date .cs-day,
div.cs-event-list div.cs-date .cs-date-number,
div.cs-event-list div.cs-date .cs-month,
div.cs-event-list div.cs-date .cs-year {
    display: block;
}

div.cs-event-list div.cs-date .cs-date-number {
    font-size: 1.4rem;
    line-height: 1.4rem;
}

div.cs-event-list div.cs-date .cs-year {
    display: none;
}

div.cs-event-list div.cs-compact-event {
    border: 1px solid var(--cs-border-lighter-color);
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: 1rem;
    width: 100%;
    padding: 10px;
    margin-bottom: 0.7rem;
}

div.cs-event-list div.cs-compact-event:hover {
	box-shadow: 0 2px 4px 0 rgba(0,0,0,0.2);
}

div.cs-event-list div.cs-compact-event div.cs-event-name,
div.cs-event-list div.cs-compact-event div.ce-event-name a {
    font-size: 1rem;
}

div.cs-event-list div.cs-event-status-pending,
div.cs-calendar div.cs-event-status-pending {
	display: none;
}

div.cs-event-list div.cs-event-status-cancelled,
div.cs-calendar div.cs-event-status-cancelled {
	color: var(--cs-text-lightest-color);
}

div.cs-event-list div.cs-event-status-cancelled div.cs-event-name,
div.cs-calendar div.cs-event-status-cancelled div.cs-event-name {
	text-decoration: line-through;
}

div.cs-compact-event span.cs-start-time,
div.cs-calendar-event span.cs-start-time {
    font-weight: bold;
}

div.cs-compact-event div.cs-location,
div.cs-compact-event div.cs-address,
div.cs-compact-event div.cs-description {
	line-height: 1rem;
	margin: 0.3rem 0;
}

div.cs-compact-event div.cs-address,
div.cs-calendar-event div.cs-address {
	font-size: 0.7rem;
	margin: 0.3rem 0 0.3rem 1.1rem;
}

div.cs-calendar {
    background-color: white;
	border: none;
}

div.cs-calendar-month-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    font-size: 2rem;
	border: 1px solid var(--cs-border-lighter-color);
	border-top-left-radius: 15px;
	border-top-right-radius: 15px;
	border-bottom: none;
}

div.cs-calendar-month-nav {}

div.cs-calendar-month-nav button {
    border-radius: 0.5rem;
    border: 1px solid var(--cs-border-lighter-color);
	background-color: var(--cs-light-grey-background-color);
    padding: 0.25rem;
    align-items: center;
    overflow: visible;
    display: inline-flex;
}

div.cs-calendar-month-nav button svg {
    color: var(--cs-text-color);
    width: 1.5rem;
    height: 1.5rem;
}

div.cs-calendar-day-name-header,
div.cs-calendar-days {
    display: flex;
    flex-direction: row;
}

div.cs-calendar-days {
    flex-wrap: wrap;
}

div.cs-calendar-day-name-cell,
div.cs-calendar-date-cell {
    width: 14.285%;
    border: 1px solid var(--cs-border-lighter-color);
    border-right: 0px transparent;
    border-bottom: 0px transparent;
    padding: 0;
}

div.cs-calendar-date-cell div.cs-day-content {
    padding: 0.5rem 0.5rem;
}

div.cs-calendar-day-name-cell {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0.5rem 0rem;
    overflow: hidden;
}

div.cs-calendar-day-name-cell:nth-child(7),
div.cs-calendar-date-cell:nth-child(7n){
    border-right: 1px solid var(--cs-border-lighter-color);
}

div.cs-calendar-date-cell:nth-last-child(-n+7){
    border-bottom: 1px solid var(--cs-border-lighter-color);
}

div.cs-calendar-date-cell {
    min-height: 5rem;
}

div.cs-calendar-date-cell.cs-calendar-outside-month {
    background-color: var(--cs-light-grey-background-color);
}

div.cs-calendar-date-cell.cs-calendar-today {
    background-color: var(--cs-today-background-color);
}

div.cs-calendar div.cs-date span.cs-day,
div.cs-calendar div.cs-date span.cs-month,
div.cs-calendar div.cs-date span.cs-year {
    display: none;
}

div.cs-calendar div.cs-date.cs-first-day span.cs-month {
    display: inline;
    margin-left: 0.5rem;
}

div.cs-calendar-event {
    font-size: 0.9rem;
    margin: 1rem 0 1.5rem 0;
    position: relative;
}

div.cs-calendar-event .cs-time {
    font-size: 0.9rem;
    line-height: 1rem;
}

div.cs-calendar-event span.cs-time-gliph::before {
	display: none;
}

div.cs-calendar-event .cs-start-time {
    font-weight: bold;
}

div.cs-calendar-event div.cs-event-name {
    font-size: 0.9rem;
    line-height: 1rem;
    margin: 0.2rem 0 0 0;
}

div.cs-calendar-event.cs-calendar-category-1 a.cs-event-link,
div.cs-calendar-event.cs-public  a.cs-event-link {
    color: var(--cs-category-1-color);
}

div.cs-calendar-event.cs-calendar-category-2 a.cs-event-link,
div.cs-calendar-event.cs-churchwide a.cs-event-link {
    color: var(--cs-category-2-color);
}

div.cs-calendar-event .cs-event-hover-block {
	position: absolute;
	padding: 1rem;
	border: 1px solid var(--cs-border-darker-color);
	width: 280px;
    background-color: var(--cs-background-color);
    box-shadow: 0 3px 6px 0 rgba(0,0,0,0.2);
	overflow: hidden;
	display: none;
}

div.cs-calendar-event button.cs-clickable-caret{
	float: right;
	background-color: transparent;
	border: none;
	font-size: 1rem;
	color: var(--cs-text-color);
	width: 16px; height: 16px;
	padding: 0;
	margin: 0 0 0 5px;
}

div.cs-calendar-event .cs-event-hover-block button.cs-clickable-caret {
	float: right;
	color: var(--cs-text-color);
	background-color: var(--cs-light-grey-background-color);
	border: 1px solid var(--cs-border-lighter-color);
	border-radius: 3px;
	width: 24px; height: 24px;
}

div.cs-calendar-event .cs-event-hover-block.cs-event-hover-reveal {
	display: block;
	z-index: 1;
	left: auto;
	right: 0rem;
}

div.cs-calendar-date-cell:nth-child(7n+1) div.cs-calendar-event .cs-event-hover-block,
div.cs-calendar-date-cell:nth-child(7n+2) div.cs-calendar-event .cs-event-hover-block,
div.cs-calendar-date-cell:nth-child(7n+3) div.cs-calendar-event .cs-event-hover-block {
	left: 1rem;
	right: auto;
}

div.cs-calendar-event .cs-event-hover-block .cs-location {
	margin: 0.7rem 0 0 0;
}

div.cs-calendar-event .cs-event-hover-block .cs-address {
	margin: 0.3rem 0 0.3rem 1.1rem;
}

div.cs-calendar-event .cs-event-hover-block .cs-description {
	margin: 0.7rem 0 0 0;
	word-wrap: break-word;
	overflow: scroll;
	font-size: 0.8rem;
	max-height: 150px;
}

div.cs-calendar-event .cs-event-hover-block .cs-description p {
	font-size: 0.8rem;
}


@media screen and (max-width: 700px) {  

    div.cs-calendar {
        border: 0px solid transparent;
        border-radius: 0px;
        background-color: transparent;
    }

	div.cs-calendar-month-header {
		border: none;
	}

    div.cs-calendar div.cs-calendar-day-name-cell {
	    visibility: hidden;
	    height: 0;
	    position: absolute;
    }
	
    div.cs-calendar div.cs-calendar-days {
        display: block;
    }

    div.cs-calendar div.cs-calendar-date-cell {
        border: 0px solid transparent;
        width: 100%;
    }

    div.cs-calendar div.cs-calendar-date-cell div.cs-day-content {
        display: flex;
        flex-direction: row;
	    width: 100%;
    }

    div.cs-calendar div.cs-calendar-date-cell.cs-calendar-before {
        display: none;
    }
	
    div.cs-calendar div.cs-calendar-date-cell div.cs-date {
        width: 5rem;
    }

    div.cs-calendar-date-cell div.cs-day-content {
        padding: 0;
    }

    div.cs-calendar div.cs-calendar-date-cell div.cs-date-cell-inner {
        width: 100%;
    }

    div.cs-calendar-event button.cs-clickable-caret {
        margin-right: 1rem;
    }

    div.cs-calendar-date-cell div.cs-event-hover-block.cs-event-hover-reveal,
    div.cs-calendar-date-cell:nth-child(7n+1) div.cs-calendar-event .cs-event-hover-block,
    div.cs-calendar-date-cell:nth-child(7n+2) div.cs-calendar-event .cs-event-hover-block,
    div.cs-calendar-date-cell:nth-child(7n+3) div.cs-calendar-event .cs-event-hover-block {
        left: auto;
        right: 0rem;
    }

    div.cs-calendar div.cs-calendar-date-cell div.cs-date span.cs-day,
    div.cs-calendar div.cs-calendar-date-cell div.cs-date span.cs-month {
        display: block;
    }

    div.cs-calendar div.cs-calendar-date-cell  div.cs-date {
        background-color: var(--cs-primary-color);
        color: var(--cs-text-on-primary-color);
        padding: 5px 5px;
        width: 3.5rem;
        max-width: 3.5rem;
        text-align: center;
        font-size: 0.7rem;
        font-weight: normal;
        border-radius: 5px;
        line-height: 1rem;
        height: 4.3rem;
        margin-right: 1rem;
    }
	
    div.cs-calendar div.cs-calendar-date-cell div.cs-date .cs-date-number {
        font-size: 1.4rem;
        font-weight: strong;
        line-height: 1.4rem;
    }

    div.cs-calendar div.cs-calendar-date-cell div.cs-date.cs-first-day span.cs-month {
        display: block;
        margin-left: 0;
    }

    div.cs-calendar div.cs-calendar-date-cell  div.cs-calendar-date-cell-inner {
        width: 100%;
    }

}
