/* Petition Detail Page Styles */

/* Header */
.petition-header {
    background: var(--bg-card);
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.container1 {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 50px;
}

.petition-hero-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.petition-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.petition-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.petition-meta {
    color: var(--text-muted);
}

.rich-text-content p {
    margin-bottom: 0;
    line-height: 1.6;
}

.rich-text-content ul,
.rich-text-content ol {
    margin-bottom: 1em;
    padding-left: 20px;
    margin-left: 0;
}

.rich-text-content ul {
    list-style: disc;
}

.rich-text-content ol {
    list-style: decimal;
}

.rich-text-content li {
    margin-bottom: 0.5em;
}

#pdf-template {
    width: 794px;
    min-height: 1123px;
    padding: 30px;
    display: none;
    background: #fff;
    color: #000;
    box-sizing: border-box;

    position: absolute;
    z-index: 9999;
    margin: 0;
    top: 0;

    overflow: visible;
}


/* Signing Bar */
.signing-bar {
    width: 60%;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 4px solid #17a2b8;
    /* Professional accent strip */
    padding: 20px 30px;
    color: var(--text-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

.signing-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.signing-bar-guest {
    flex: 1;
}

.signing-bar-guest h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-heading);
}

.signing-bar-guest p {
    margin: 5px 0 0 0;
    opacity: 0.8;
    color: var(--text-muted);
}

.signing-actions {
    display: flex;
    align-items: center;
}

.btn-register-signing {
    background: #0056b3;
    border: none;
    padding: 12px 25px;
    text-transform: uppercase;
    font-weight: bold;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

.btn-login-signing {
    color: var(--primary-color);
    margin-left: 15px;
    text-decoration: underline;
}

.signed-message {
    flex: 1;
    text-align: center;
    color: var(--text-color);
}

.signed-message h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #28a745;
    /* Green for success */
}

.signing-form {
    display: flex;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-end;
}

.signing-form-group {
    flex: 1;
    min-width: 200px;
}

.signing-form-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-muted);
}

.signing-input-readonly {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

.signing-select {
    background: var(--bg-input) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-sign {
    background: #0056b3;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

/* Sidebar Specifics */
.btn-download-pdf {
    width: 100%;
    margin-top: 10px;
    border: 1px solid white;
    color: white;
    /* Will be overridden by widget text color usually, but here specific */
    background: transparent;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.highlight-widget .btn-download-pdf {
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.highlight-widget .btn-download-pdf:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Mobile Responsiveness --- */

@media (max-width: 992px) {
    .signing-bar {
        width: 90%;
        margin-top: -20px;
    }
}

@media (max-width: 768px) {
    .container1 {
        padding: 0 15px;
        margin-bottom: 30px;
    }

    .petition-title {
        font-size: 1.8rem;
    }

    .petition-hero-image {
        height: 200px;
    }

    /* Signing Bar Mobile */
    .signing-bar {
        width: 100%;
        margin-top: 0;
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
        padding: 15px;
    }

    .signing-bar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .signing-form {
        flex-direction: column;
    }

    .signing-form-group {
        width: 100%;
    }

    .btn-sign {
        width: 100%;
    }

    .signing-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn-register-signing,
    .btn-login-signing {
        width: 100%;
        text-align: center;
        margin-left: 0;
        display: block;
    }

    /* Tabs */
    .petition-tabs {
        top: 0;
        /* Adjust if header is sticky differently on mobile */
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-list {
        padding: 0 15px;
        gap: 20px;
    }

    .tab-list li a {
        padding: 12px 0;
        font-size: 0.95rem;
    }

    /* Content Grid */
    .petition-grid-layout {
        /* Already handled in main style.css or logic but enforcing here just in case */
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Comments */
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* Sidebar Widgets */
    .share-buttons {
        justify-content: center;
    }

    .link-display {
        flex-direction: column;
        gap: 10px;
    }

    .link-display button {
        width: 100%;
    }
}