/**
Theme Name: Designs
Author: Brainstorm Force
Author URI: http://wpastra.com/about/
Description: Astra child theme for custom designs.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: designs
Template: astra
*/

/* === Custom Single Design Post Styles === */
/* These styles apply to the single post page for the "Design" CPT */

body#single-design .design-entry-title {
    font-size: 2.25rem;
    text-align: center;
    margin: 1.5em 0;
}

body#single-design .design-featured-image-wrapper {
    text-align: center;
    margin: 2em 0;
    width: 1240px;
    max-width: 100%;
}

body#single-design .design-featured-image-wrapper img {
    border-radius: 12px;
}

body#single-design .design-description-wrapper {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-top: 1.5em;
}

body#single-design .pdf-embed-wrapper {
    margin-top: 20px;
    width: 1240px;
    max-width: 100%;
}

body#single-design .design-cta-button-wrapper {
    text-align: center;
    margin: 2em 0;
}

body#single-design .design-cta-button-wrapper .ast-button {
    padding: 12px 28px;
    font-size: 1.2em;
    display: inline-block;
}

body#single-design .ast-separate-container {
    margin: 0;
}

body#single-design.ast-separate-container .ast-article-post,
body#single-design.ast-separate-container .ast-article-single {
    padding: 0;
}

body#single-design .featured-image {
    object-fit: none;
}


/* === Admin Area Styles === */
/* Hides the default taxonomy box in the editor */
.components-panel__header button[aria-label="تصنيفات التصاميم"],
.components-panel__header button[aria-label="تصنيفات التصاميم"]+.components-panel__body {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}


/* === Design Picker Modal Styles (For the Form) === */
/* This is the corrected section. These styles now apply to ALL screen sizes. */

.design-picker-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Lifts it out of the page flow to become a pop-up */
    z-index: 1001;
    /* Sits on top of all other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Adds scrollbar if content is too tall */
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent black overlay */
}

.design-picker-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    /* Centered vertically and horizontally */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 80%;
    border-radius: 8px;
    position: relative;
}

.design-picker-close {
    color: #aaa;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.design-picker-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.design-card {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    align-items: center;
    gap: 15px;
}

.design-card.selected {
    border-color: #0073aa;
    border-width: 2px;
    background-color: #f0f8ff;
}

.design-card-img {
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.design-card-info {
    flex: 1;
}

.design-card-info h4 {
    margin: 0 0 5px 0;
}

.design-card-info p {
    margin: 0;
    font-size: 0.9em;
    color: #555;
    height: 100%;
    max-height: 100px;
    text-overflow: ellipsis;
    overflow: hidden;
}

.design-card-info a {
    font-size: 0.9em;
}

.choose-button-class {
    width: fit-content;
}

.design-picker-actions {
    text-align: left;
    margin-top: 20px;
}

.design-picker-actions button {
    padding: 10px 20px;
}

#selected-design-view {
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

#selected-design-view-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* === Responsive Styles === */

@media (max-width: 768px) {

    /* --- Single Design Post Mobile Styles --- */
    body#single-design .design-featured-image-wrapper {
        width: 100%;
    }

    body#single-design .design-featured-image-wrapper img {
        border-radius: 0;
    }

    body#single-design .design-entry-title {
        font-size: 1.75rem;
    }

    body#single-design .design-description-wrapper {
        font-size: 1rem;
    }

    body#single-design .design-cta-button-wrapper .ast-button {
        padding: 10px 20px;
        font-size: 1em;
    }

    body#single-design .featured-image {
        object-fit: cover;
    }

    /* --- Design Picker Modal Mobile Styles --- */
    .design-picker-modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10% auto;
    }

    .design-card {
        flex-direction: column;
        /* Stack image and text vertically */
        text-align: center;
    }

    .design-card-img {
        width: 100%;
        /* Make image full-width of the card */
        height: 150px;
    }

    .design-card-info p {
        max-height: 300px;
    }
}