/*
 * Cinesist Comments Section Styles
 * This file contains styles for the custom comments section, including Deadpool integration.
 */

/* --- Main Comments Section Container --- */
.cinesist-comments-section {
background-color: var(--cinesist-dark-grey-lighter);
    border-radius: 15px;
    padding: 40px;
    margin: 40px auto;
    box-shadow: var(--cinesist-box-shadow);
    color: var(--cinesist-text-color);
    max-width: 1000px;
    position: relative;
    overflow: hidden;
    border-top-left-radius: 15;
    border-top-right-radius: 15;
    margin-top: -83px;
    padding-top: 50px;
}

/* --- Deadpool Overwatch Section (now a sibling to .cinesist-comments-section) --- */
.cinesist-deadpool-overwatch {
    display: flex; /* Use flexbox for robust centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically (if needed, though flex-direction: column makes it less relevant here) */
    flex-direction: column; /* Stack caption and image vertically */

    /* Negative margin to pull the comments section up. This value should match comments-section margin-top. */
    margin-bottom: -7px; /* User's perfect overlap value */
    z-index: 2; /* Ensure Deadpool is above the comments section */
    position: relative; /* Needed for z-index to work on this element */
    width: 100%; /* Take full width */
    max-width: 1000px; /* Match max-width of comments section for alignment */
    margin-left: auto; /* Center the flex container itself */
    margin-right: auto; /* Center the flex container itself */
}

.deadpool-comments-guardian {
    max-width: 250px; /* Increased size for more impact */
    height: auto;
    border-radius: 10px; /* Slightly rounded corners for the image */
}

/* --- Deadpool Commentary Caption (Speech Bubble) --- */
.deadpool-commentary-caption {
    font-family: var(--cinesist-body-font);
    font-size: 1.1em;
    color: var(--cinesist-dark-grey); /* Changed to dark grey for contrast on white bubble */
    line-height: 1.6;
    font-style: italic;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center; /* Ensure caption text is centered within its own box */

    /* Speech Bubble Styling */
    background-color: #FFFFFF; /* Comic book white */
    border-radius: 15px; /* Rounded corners for the bubble */
    padding: 15px 20px; /* Padding inside the bubble */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Subtle shadow for depth */
    position: relative; /* Needed for positioning the ::after pseudo-element */
    margin-bottom: 20px; /* Space between bubble and Deadpool image */
}

.deadpool-commentary-caption::after { /* Using ::after for the tail */
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid #FFFFFF; /* Tail color matches bubble, points DOWN */
    bottom: -20px; /* Position it below the bubble */
    left: 50%;
    transform: translateX(-50%); /* Center the triangle */
    z-index: 1; /* Ensure it's behind the main bubble content if needed */
}

.deadpool-commentary-caption .cinesist-caption-emoji {
    font-size: 1.2em;
    margin-right: 5px;
    color: var(--cinesist-accent-color); /* Keep emoji red for contrast */
}

/* --- Comment Form Styling (#respond) --- */
.comment-respond {
    background-color: var(--cinesist-dark-grey); /* Slightly darker background for the form */
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--cinesist-box-shadow);
    margin-top: 30px; /* Space from Deadpool section */
}

#reply-title {
    font-family: var(--cinesist-heading-font);
    font-size: 1.8em;
    color: var(--cinesist-heading-color);
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

#reply-title .cinesist-snark-emoji {
    font-size: 0.8em;
    margin-left: 8px;
    color: var(--cinesist-accent-color);
}

#reply-title small a {
    color: var(--cinesist-light-grey);
    font-size: 0.6em;
    font-weight: normal;
    text-decoration: none;
    transition: color 0.2s ease;
}

#reply-title small a:hover {
    color: var(--cinesist-accent-color);
    text-decoration: underline;
}

.logged-in-as {
    font-size: 0.9em;
    color: var(--cinesist-light-grey);
    margin-bottom: 20px;
    text-align: center;
}

.logged-in-as a {
    color: var(--cinesist-accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.logged-in-as a:hover {
    color: var(--cinesist-heading-color);
    text-decoration: underline;
}

/* --- Form Fields --- */
.comment-form p {
    margin-bottom: 20px;
    position: relative; /* For placeholder positioning */
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cinesist-text-color);
    font-size: 0.95em;
}

.comment-form .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background-color: var(--cinesist-dark-grey-lighter);
    color: var(--cinesist-text-color);
    font-size: 1em;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form textarea:focus,
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus {
    border-color: var(--cinesist-accent-color);
    box-shadow: 0 0 0 3px rgba(var(--cinesist-accent-color-rgb), 0.3);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* --- Submit Button --- */
.comment-form .form-submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    margin-top: 30px;
    margin-right: 40px;
}

.comment-form .submit {
    background-color: var(--cinesist-accent-color);
    color: var(--cinesist-button-text-color);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(var(--cinesist-accent-color-rgb), 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 15px; /* Space between button and snark */
}

.comment-form .submit:hover {
    background-color: #ff3333; /* Lighter red on hover */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(var(--cinesist-accent-color-rgb), 0.6);
}

.cinesist-form-snark {
    font-size: 0.9em;
    color: var(--cinesist-light-grey);
    font-style: italic;
    margin-top: 5px; /* Adjust if button wraps above it */
}

/* --- Existing Comments List --- */
.comments-title {
    font-family: var(--cinesist-heading-font);
    font-size: 2em;
    color: var(--cinesist-heading-color);
    margin-top: 40px;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.comments-title .cinesist-snark-emoji {
    font-size: 0.8em;
    margin-left: 8px;
    color: var(--cinesist-accent-color);
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    background-color: var(--cinesist-dark-grey);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Avatar styling */
.comment-author .avatar {
    border-radius: 50%; /* Circular avatars */
    border: 2px solid var(--cinesist-accent-color);
    margin-right: 15px;
    vertical-align: middle;
}

.comment-author .fn {
    font-weight: 700;
    color: var(--cinesist-heading-color);
    font-size: 1.1em;
}

.comment-author .says {
    color: var(--cinesist-light-grey);
    font-style: italic;
}

.comment-metadata a {
    color: var(--cinesist-light-grey);
    font-size: 0.85em;
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-metadata a:hover {
    color: var(--cinesist-accent-color);
    text-decoration: underline;
}

.comment-content {
    margin-top: 15px;
    line-height: 1.6;
    color: var(--cinesist-text-color);
}

.comment-content p {
    margin-bottom: 1em;
}

.reply {
    margin-top: 15px;
    text-align: right;
}

.comment-reply-link {
    display: inline-block;
    background-color: var(--cinesist-heading-color);
    color: var(--cinesist-button-text-color);
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.comment-reply-link:hover {
    background-color: #f0c94b;
    transform: translateY(-2px);
}

/* Pingbacks and Trackbacks */
.pingback, .trackback {
    background-color: var(--cinesist-dark-grey);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    font-size: 0.9em;
    color: var(--cinesist-light-grey);
}

/* Child comments (replies) */
.children {
    list-style: none;
    margin: 0;
    padding-left: 30px; /* Indent replies */
    margin-top: 20px;
}

.children .comment {
    margin-top: 20px;
    background-color: var(--cinesist-dark-grey-lighter); /* Slightly lighter for nested comments */
    border-left: 3px solid var(--cinesist-accent-color); /* Visual indicator for replies */
}

/* Comment navigation */
.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.comment-navigation a {
    color: var(--cinesist-accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.comment-navigation a:hover {
    color: var(--cinesist-heading-color);
    text-decoration: underline;
}

.no-comments {
    font-family: var(--cinesist-body-font);
    font-size: 1.1em;
    color: var(--cinesist-light-grey);
    text-align: center;
    padding: 30px;
    background-color: var(--cinesist-dark-grey);
    border-radius: 10px;
    margin-top: 30px;
    font-style: italic;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .cinesist-comments-section {
        padding: 35px;
        margin-top: -7px; /* Keep consistent for now, adjust if needed */
        padding-top: 220px; /* Adjusted padding for smaller screens */
    }
    .cinesist-deadpool-overwatch {
        margin-bottom: -7px; /* Keep consistent for now */
    }
    .deadpool-comments-guardian {
        max-width: 200px; /* Adjust size for smaller screens */
    }
    .deadpool-commentary-caption {
        font-size: 1em;
        margin-bottom: 15px; /* Adjust margin for smaller screens */
    }
    .deadpool-commentary-caption::after {
        border-left: 15px solid transparent;
        border-right: 15px solid transparent;
        border-top: 15px solid #FFFFFF; /* Tail color matches bubble */
        bottom: -15px;
    }
}

@media (max-width: 768px) {
    .cinesist-comments-section {
        padding: 25px;
        margin: 30px auto;
        margin-top: -7px; /* Keep consistent for now, adjust if needed */
        padding-top: 180px; /* Adjusted padding for smaller screens */
    }
    .cinesist-deadpool-overwatch {
        margin-bottom: -7px; /* Keep consistent for now */
    }
    .deadpool-comments-guardian {
        max-width: 150px;
    }
    .deadpool-commentary-caption {
        font-size: 0.95em;
        margin-bottom: 10px;
    }
    .deadpool-commentary-caption::after {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 12px solid #FFFFFF; /* Tail color matches bubble */
        bottom: -12px;
    }
    .comment-respond {
        padding: 20px;
    }
    #reply-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .comment-form .submit {
        padding: 10px 20px;
        font-size: 1em;
        margin-right: 0; /* Remove margin on small screens if it causes issues */
        width: 100%; /* Full width button */
    }
    .cinesist-form-snark {
        margin-top: 10px;
        text-align: center;
        width: 100%; /* Ensure snark text is centered below button */
    }
    .comments-title {
        font-size: 1.8em;
        margin-top: 30px;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    .comment {
        padding: 20px;
    }
    .children {
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .cinesist-comments-section {
        padding: 15px;
        margin: 20px auto;
        margin-top: -7px; /* Keep consistent for now, adjust if needed */
        padding-top: 150px; /* Adjusted padding for smallest screens */
    }
    .cinesist-deadpool-overwatch {
        margin-bottom: -7px; /* Keep consistent for now */
    }
    .deadpool-comments-guardian {
        max-width: 120px;
    }
    .deadpool-commentary-caption {
        font-size: 0.85em;
        margin-bottom: 8px;
    }
    .deadpool-commentary-caption::after {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #FFFFFF; /* Tail color matches bubble */
        bottom: -10px;
    }
    .comment-respond {
        padding: 15px;
    }
    #reply-title {
        font-size: 1.3em;
    }
    .comments-title {
        font-size: 1.5em;
    }
    .comment {
        padding: 15px;
    }
    .children {
        padding-left: 15px;
    }
}
