/**
 * Posts styles
 *
 * @package    Onix template
 * @author     Alejandro Caballero - lava.caballero@gmail.com
 */

/* Slider, for the home page */

#quick_post_form_container {
    margin-bottom: 20px; background-color: #F4F4F4; padding: 10px;
}

/* Space added when the slider has only one item */
#quick_post_form_container.spaced { margin-top: 20px; }

/* Common meta areas */

.meta_box                       { padding: 10px 10px 5px 10px; }
.meta_box .user_avatar          { float: left; margin-right: 10px; width: 42px; height: 42px; }
.meta_box .meta_field           { display: inline-block; padding: 2px 4px; }
.meta_box .meta_field.dimmed    { color: dimgrey; }
.meta_box .meta_field.important { color: blue; }
.meta_box .meta_field.critical  { color: #FF0080; text-shadow: none; }
.meta_box .meta_section         { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; line-height: 16px; padding: 1px; }
.meta_box .meta_section.upper   { font-size: 11pt; }

/* Posts */

#posts_pagination             { font-family: var(--body-font), Arial, Helvetica, sans-serif;
                                font-size: 14pt; line-height: 1em; }
#posts_pagination a           { text-decoration: none; }
#posts_pagination a[disabled] { cursor: default; color:  grey; }

.posts_index article                          { position: relative; margin-bottom: 20px;
                                                color: white;
                                                /*
                                                color: white; border-radius: 20px;
                                                background: linear-gradient(black, black) padding-box, var(--ref-border-gradient) border-box;
                                                border: 2px solid transparent;
                                                */
                                                display: flex; flex-wrap: nowrap; width: 100%;
                                                align-content: flex-start; align-items: stretch; }
.posts_index article h1                       { margin: 0; padding: 5px 10px; color: white; font-weight: bold; }
.posts_index article h1:after                 { display: none; }
.posts_index article .post_featured_image     { display: none;
                                                /*
                                                background: transparent center center no-repeat;
                                                background-size: cover; width: 40%;
                                                border-top-left-radius: 18px; border-bottom-left-radius: 18px;
                                                */ }
.posts_index article .content_area            { padding-top: 20px; padding-bottom: 25px; }
.posts_index article .post_contents           { padding: 5px 10px 10px 10px; }
.posts_index article .post_contents *         { margin-top: 1px; margin-bottom: 1px; }
.posts_index article .post_excerpt img        { max-width: 100%; }
.posts_index article .view_link               { font-weight: bold; text-align: right; }

/* region v2 additions */
/* =================== */

.meta_section { margin-left: -8px; }

.posts_index article .view_link .buttonized       { color: black;             background-color: var(--ref-color2); }
.posts_index article .view_link .buttonized:hover { color: var(--ref-color2); background-color: white; }

.posts_index article {
    color: white;
    margin: 20px 0;
    background-color: black;
    padding: 100px;
    min-height: 500px;
    
    background-image:
        url('v2/lighted_frame/top_left.jpg'),           /* top_left        */
        url('v2/lighted_frame/top_right.jpg'),          /* top_right       */
        url('v2/lighted_frame/top_center_2.jpg'),       /* top_center_2    */
        url('v2/lighted_frame/top_center_1.jpg'),       /* top_center_1    */
        url('v2/lighted_frame/top_center_3.jpg'),       /* top_center_3    */
        url('v2/lighted_frame/bottom_left.jpg'),        /* bottom_left     */
        url('v2/lighted_frame/bottom_right.jpg'),       /* bottom_right    */
        url('v2/lighted_frame/bottom_center_2.jpg'),    /* bottom_center_2 */
        url('v2/lighted_frame/bottom_center_1.jpg'),    /* bottom_center_1 */
        url('v2/lighted_frame/bottom_center_3.jpg'),    /* bottom_center_3 */
        url('v2/lighted_frame/left_middle_2.jpg'),      /* left_middle_2   */
        url('v2/lighted_frame/left_middle_1.jpg'),      /* left_middle_1   */
        url('v2/lighted_frame/left_middle_3.jpg'),      /* left_middle_3   */
        url('v2/lighted_frame/right_middle_2.jpg'),     /* right_middle_2  */
        url('v2/lighted_frame/right_middle_1.jpg'),     /* right_middle_1  */
        url('v2/lighted_frame/right_middle_3.jpg'),     /* right_middle_3  */
        url('v2/lighted_frame/center.jpg'),             /* center          */
        none
    ;
    
    background-position:
        left                top,                        /* top_left        */
        right               top,                        /* top_right       */
        center              top,                        /* top_center_2    */
        100px               top,                        /* top_center_1    */
        calc(100% - 90px)   top,                        /* top_center_3    */
        left                bottom,                     /* bottom_left     */
        right               bottom,                     /* bottom_right    */
        center              bottom,                     /* bottom_center_2 */
        100px               bottom,                     /* bottom_center_1 */
        calc(100% - 92px)   bottom,                     /* bottom_center_3 */
        left                center,                     /* left_middle_2   */
        left                90px,                       /* left_middle_1   */
        left                calc(100% - 90px),          /* left_middle_3   */
        right               center,                     /* right_middle_2  */
        right               90px,                       /* right_middle_1  */
        right               calc(100% - 90px),          /* right_middle_3  */
        100px               90px,                       /* center          */
        center              center;
    ;
    
    background-size:
        100px               90px,                       /* top_left        */
        98px                90px,                       /* top_right       */
        calc(100% - 182px)  90px,                       /* top_center_2    */
        50%                 90px,                       /* top_center_1    */
        50%                 90px,                       /* top_center_3    */
        100px               92px,                       /* bottom_left     */
        98px                92px,                       /* bottom_right    */
        calc(100% - 182px)  92px,                       /* bottom_center_2 */
        50%                 92px,                       /* bottom_center_1 */
        50%                 92px,                       /* bottom_center_3 */
        100px               auto,                       /* left_middle_2   */
        100px               calc(50%  - 90px),          /* left_middle_1   */
        100px               calc(50%  - 90px),          /* left_middle_3   */
        98px                auto,                       /* right_middle_2  */
        98px                calc(50%  - 90px),          /* right_middle_1  */
        98px                calc(50%  - 90px),          /* right_middle_3  */
        calc(100% - 182px)  calc(100% - 180px),         /* center          */
        0                   0
    ;
    
    background-repeat:
        no-repeat,                                      /* top_left        */
        no-repeat,                                      /* top_right       */
        no-repeat,                                      /* top_center_2    */
        no-repeat,                                      /* top_center_1    */
        no-repeat,                                      /* top_center_3    */
        no-repeat,                                      /* bottom_left     */
        no-repeat,                                      /* bottom_right    */
        no-repeat,                                      /* bottom_center_2 */
        no-repeat,                                      /* bottom_center_1 */
        no-repeat,                                      /* bottom_center_3 */
        no-repeat,                                      /* left_middle_2   */
        no-repeat,                                      /* left_middle_1   */
        no-repeat,                                      /* left_middle_3   */
        no-repeat,                                      /* right_middle_2  */
        no-repeat,                                      /* right_middle_1  */
        no-repeat,                                      /* right_middle_3  */
        no-repeat,                                      /* center          */
        no-repeat;
    ;
}

.posts_index article .view_link { position: absolute; left: 80px; bottom: 80px; right: 80px; }

@media all and (max-width: 1024px)
{
    /* Note: smaller lighted frame is enforced upon the standard size. */
    .posts_index article {
        
        padding: 50px 50px 80px 50px;
        min-height: 400px;
        
        background-position:
            left                top,                        /* top_left        */
            right               top,                        /* top_right       */
            center              top,                        /* top_center_2    */
            50px                top,                        /* top_center_1    */
            calc(100% - 45px)   top,                        /* top_center_3    */
            left                bottom,                     /* bottom_left     */
            right               bottom,                     /* bottom_right    */
            center              bottom,                     /* bottom_center_2 */
            50px                bottom,                     /* bottom_center_1 */
            calc(100% - 46px)   bottom,                     /* bottom_center_3 */
            left                center,                     /* left_middle_2   */
            left                45px,                       /* left_middle_1   */
            left                calc(100% - 45px),          /* left_middle_3   */
            right               center,                     /* right_middle_2  */
            right               45px,                       /* right_middle_1  */
            right               calc(100% - 45px),          /* right_middle_3  */
            50px                45px,                       /* center          */
            center              center;
        ;
        
        background-size:
            50px                45px,                       /* top_left        */
            49px                45px,                       /* top_right       */
            calc(100% - 91px)   45px,                       /* top_center_2    */
            50%                 45px,                       /* top_center_1    */
            50%                 45px,                       /* top_center_3    */
            50px                46px,                       /* bottom_left     */
            49px                46px,                       /* bottom_right    */
            calc(100% - 91px)   46px,                       /* bottom_center_2 */
            50%                 46px,                       /* bottom_center_1 */
            50%                 46px,                       /* bottom_center_3 */
            50px                auto,                       /* left_middle_2   */
            50px                calc(50%  - 45px),          /* left_middle_1   */
            50px                calc(50%  - 45px),          /* left_middle_3   */
            49px                auto,                       /* right_middle_2  */
            49px                calc(50%  - 45px),          /* right_middle_1  */
            49px                calc(50%  - 45px),          /* right_middle_3  */
            calc(100% - 91px)   calc(100% - 90px),          /* center          */
            0                   0
        ;
    }
    
    .posts_index article .view_link { position: absolute; left: 40px; bottom: 40px; right: 40px; text-align: center; }
}


/* ========= */
/* endregion */

body#tinymce blockquote,
article .post_contents blockquote,
#post_comments .comment_entry .content blockquote {
    margin-left: 20px;
    padding: 10px 10px 10px 20px;
    background-color: #efefef;
    border-left: 5px solid silver;
    color: grey;
}

article.single_post, .content_frame { margin-bottom: 20px; background-color: black; padding: 10px; }

article.single_post.reviewing { background-color: #3f3637; }
article.single_post.draft     { background-color: #3f3f3b; }
article.single_post.hidden    { background-color: #3f3f3f; }
article.single_post.trashed   { background-color: #3f372a; }

/* Single post overrides */

.single_post h1           { font-size: 22pt; line-height: 24pt; }
.single_post h1 .emojione { height: 20pt;  }
.single_post .meta_box    { margin-bottom: 20px; }

.single_post img   { max-width: 100%; }
.single_post video { max-width: 100%; max-height: 90vh; }
.single_post img[data-id-media] { height: auto; }

.single_item_actions { margin-top: 0; }

.single_item_actions .item  {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px 5px 0;
    border-radius: 5px;
    text-decoration: none;
    font-family: arial, helvetica, sans-serif;
    font-size: 10pt;
    line-height: normal;
    font-weight: bold;
}

.single_item_actions .item  {
    border:           1px solid #990d0d;
    color:            #990d0d;
    background-color: white;
}

.single_item_actions .action {
    cursor:           pointer;
    color:            white;
    background-color: #990d0d;
}

.single_item_actions .warning {
    color:            #990d0d;
    background-color: yellow;
    border-color:     #990d0d;
}

.single_item_actions .seamless_right {
    margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: none;
}

.single_item_actions .seamless_left {
    margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-left: none;
    color: yellow;
    background-color: orangered;
}

.single_item_actions .action:hover { background-color: red; }

.single_item_actions .action.admin {
    border-color:     #542a13;
    color:            white;
    background-color: #bf6000;
}

.single_item_actions .action.admin:hover {
    border-color:     saddlebrown;
    color:            white;
    background-color: darkorange;
}

/* ======= */
/* INDEXES */
/* ======= */

/* Featured posts, only on the home */

.featured_post                { display: block; text-decoration: none;
                                background-color: #F4F4F4; margin-bottom: 10px; }
.featured_post h3             { padding: 5px; margin: 0; font-size: 10pt; line-height: normal; }
.featured_post .thumbnail     { display: block; border: none; }
.featured_post .thumbnail img { width: 100%; border: none; }
.featured_post .critical      { color: #FF0080; }
.featured_post .admin_stuff   { font-family: Arial, Helvetica, sans-serif;
                                font-size: 11pt; line-height: 12pt; padding-bottom: 2pt;
                                border-top: 1px solid #FF0080; padding-top: 5px; margin-top: 5px; }

/* By default, they're above the contents (For portrait mobiles) */

#featured_posts_column { display: block; float: none; padding-left: 0; }

/* They're on from 720px wide and above */

/* Responsiveness */

#home_index_wrapper[data-with-featured-posts="true"] #posts_index_wrapper {
    float: left;
}

@media all and (min-width: 1367px) and (max-width: 99999px)
{
    #home_index_wrapper[data-with-featured-posts="true"] #posts_index_wrapper   { width: 70%; }
    #home_index_wrapper[data-with-featured-posts="true"] #featured_posts_column { width: 30%; display: block; float: right; padding-left: 10px; }
}

@media all and (min-width: 100px) and (max-width: 480px)
{
    /* Sidebar is hidden here. We must adjust the content width. */
    #content { width: 100%; }
}

/* Last resort for huge displays with featured posts (two cols index) */
@media all and (min-width: 1367px) and (max-width: 99999px)
{
    #home_index_wrapper[data-with-featured-posts="true"] #posts_index_wrapper   { width: 75%; }
    #home_index_wrapper[data-with-featured-posts="true"] #featured_posts_column { width: 25%; display: block; float: right; padding-left: 10px; }
}

/* Here goes two columns for small displays */
@media all and (min-width: 260px) and (max-width: 1366px)
{
    #featured_posts_column {
        -webkit-column-count: 2; -webkit-column-gap: 10px;
        -moz-column-count:    2; -moz-column-gap:    10px;
        column-count:         2; column-gap:         10px;
    }
    .featured_post { display: inline-block; width: 100%; }
}

/* Posts index on two columns for big displays */

@media all and (min-width: 769px) {
    .posts_index article                  { display: inline-block; vertical-align: top; width: calc(50% - 14px); }
    .posts_index article:nth-child(even)  { margin-left: 23px; }

    /*.posts_index article h1                                    { height: 3em; overflow: hidden; }*/
    /*.posts_index article .post_contents                        { height: 7em; overflow: hidden; }*/
    /*.posts_index article .content_area                         { padding-bottom: 10px; }*/
    /*.posts_index article .content_area .meta_box .meta_section { height: 6.5em; overflow: hidden; }*/
    
    .posts_index article                      { flex-wrap: wrap; }
    .posts_index article .post_featured_image { width: 100%; height: 300px; 
                                                border-top-right-radius: 18px; border-bottom-left-radius: 0; }
    .posts_index article .content_area        { width: 100%; }
}

/* Comments on single posts */

#post_comments .comment_entry                { margin-top: 10px; padding-top: 10px; border-top: 2px solid silver;
                                               font-family: Arial, Helvetica, sans-serif; line-height: normal; }
#post_comments .comment_entry.single_preview { margin-top: 0; padding-top: 0; 
                                               border-top: none; }
#post_comments .comment_entry:first-child    { margin-top: 0; }
#post_comments .comment_entry .content       { margin-left: 67px; }
#post_comments .comment_entry .comment_reply { margin-left: 67px; }

#post_comments .comment_entry .comment_reply .target  form { margin-top: 10px; }
#post_comments .comment_entry .comment_reply .trigger { margin-top: 10px; font-family: Arial, Helvetica, sans-serif; }

#post_comments .comment_entry .comment_reply .trigger a,
#post_comments .comment_entry .comment_reply .trigger span.pseudo_link {
    font-size: 10pt; line-height: 12pt;
    display: inline-block; margin-right: 5px; margin-bottom: 5px;
}

#post_comments .comment_entry[data-indent-level="2"] { margin-left:  66px; }
#post_comments .comment_entry[data-indent-level="3"] { margin-left: 132px; }
#post_comments .comment_entry[data-indent-level="4"] { margin-left: 198px; }
#post_comments .comment_entry[data-indent-level="5"] { margin-left: 264px; }

@media all and (max-width: 1024px) {

    #post_comments .comment_entry .content       { margin-left: 5px; }
    #post_comments .comment_entry .comment_reply { margin-left: 5px; }
    
    #post_comments .comment_entry[data-indent-level="2"] { margin-left: 0; }
    #post_comments .comment_entry[data-indent-level="3"] { margin-left: 0; }
    #post_comments .comment_entry[data-indent-level="4"] { margin-left: 0; }
    #post_comments .comment_entry[data-indent-level="5"] { margin-left: 0; }

    #post_comments .comment_entry[data-indent-level="2"] .content { margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="3"] .content { margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="4"] .content { margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="5"] .content { margin-left: 10px; }
    
    #post_comments .comment_entry[data-indent-level="2"] .comment_wrapper { padding-left:  5px; }
    #post_comments .comment_entry[data-indent-level="3"] .comment_wrapper { padding-left: 10px; }
    #post_comments .comment_entry[data-indent-level="4"] .comment_wrapper { padding-left: 15px; }
    #post_comments .comment_entry[data-indent-level="5"] .comment_wrapper { padding-left: 20px; }
    
    #post_comments .comment_entry[data-indent-level="2"] .comment_reply  { padding-left:  5px; margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="3"] .comment_reply  { padding-left: 10px; margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="4"] .comment_reply  { padding-left: 15px; margin-left: 10px; }
    #post_comments .comment_entry[data-indent-level="5"] .comment_reply  { padding-left: 20px; margin-left: 10px; }
    
    #post_comments .comment_entry[data-indent-level="2"] .comment_wrapper {
        background: -moz-linear-gradient(   left, silver 0, silver 1px, white 2px);
        background: -webkit-linear-gradient(left, silver 0, silver 1px, white 2px);
        background: -o-linear-gradient(     left, silver 0, silver 1px, white 2px);
        background: -ms-linear-gradient(    left, silver 0, silver 1px, white 2px);
        background: linear-gradient(    to right, silver 0, silver 1px, white 2px);
    }
    
    #post_comments .comment_entry[data-indent-level="3"] .comment_wrapper {
        background: -moz-linear-gradient(   left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px);
        background: -webkit-linear-gradient(left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px);
        background: -o-linear-gradient(     left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px);
        background: -ms-linear-gradient(    left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px);
        background: linear-gradient(    to right, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px);
    }
    
    #post_comments .comment_entry[data-indent-level="4"] .comment_wrapper {
        background: -moz-linear-gradient(   left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px);
        background: -webkit-linear-gradient(left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px);
        background: -o-linear-gradient(     left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px);
        background: -ms-linear-gradient(    left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px);
        background: linear-gradient(    to right, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px);
    }
    
    #post_comments .comment_entry[data-indent-level="5"] .comment_wrapper {
        background: -moz-linear-gradient(   left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px, white 14px, silver 15px, silver 16px, white 17px);
        background: -webkit-linear-gradient(left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px, white 14px, silver 15px, silver 16px, white 17px);
        background: -o-linear-gradient(     left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px, white 14px, silver 15px, silver 16px, white 17px);
        background: -ms-linear-gradient(    left, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px, white 14px, silver 15px, silver 16px, white 17px);
        background: linear-gradient(    to right, silver 0, silver 1px, white 3px, white 4px, silver 5px, silver 6px, white 7px, white 9px, silver 10px, silver 11px, white 12px, white 14px, silver 15px, silver 16px, white 17px);
    }

    #post_comments .comment_entry .comment_reply[data-is-reply-active="true"] {
        margin-left:0; padding-left: 0;
    }
}

/*
#post_comments .comment_entry .content p     ,
body#tinymce .comment_quote p                { margin-top: 2px; margin-bottom: 2px; }
*/

#post_comments .comment_entry .content img { max-width: 100%; }

/* Generic elements */

.simple_entries_listing .date        { color: grey; }
.simple_entries_listing .date:before { content: '[' }
.simple_entries_listing .date:after  { content: ']:' }

/* Quick posts form */

#quick_post_form_container form .field                         { margin-bottom: 5px; }
#quick_post_form_container form .field:last-child              { margin-bottom: 0; }
#quick_post_form_container form .field.attachments             { margin-bottom: 0; }

#quick_post_form_container form .field[data-field="title"]     { margin-bottom: 0; line-height: 0; }
#quick_post_form_container form .rest                          { margin-top: 5px; }

#quick_post_form_container form .field.attachments .attachment {
    white-space: nowrap; margin: 0 5px 5px 0;
}

/* Pinned posts and special posts */

article.pinned,  .featured_post.pinned  { border: 2px solid var(--ref-color2); border-left: 6px solid var(--ref-color2); background-color: whitesmoke; }
article.special, .featured_post.special { border: 2px solid var(--ref-color2-lighter); border-left: 6px solid var(--ref-color2-lighter); background-color: #EFFFFF; }

/* Post comments on indexes */

ul.post_comments { padding-left: 22px; font-family: Arial, Helvetica, sans-serif;
                   font-size: 11pt; line-height: 1.1em; margin-top: 10px !important; }
ul.post_comments .emojione { height: 1em; }
ul.post_comments li img { max-width: 100%; }

/* Extras */

@media all and (max-width: 480px) {
    .posts_index article { margin-bottom: 10px; }
}
