/* ==========================================================
   NEDA CUSTOM ELEMENTS
   ==========================================================

   01. Recent Posts
   02. Contact Form
   03. Tablet Responsive
   04. Mobile Responsive
   05. Reduced Motion

   ========================================================== */


/* ==========================================================
   01. RECENT POSTS
   ========================================================== */

/* Grid container */

.neda-recent-posts {
    display: grid !important;

    grid-template-columns: repeat(
        var(--neda-desktop-columns, 3),
        minmax(0, 1fr)
    );

    gap: 25px;
    width: 100%;
    max-width: 100%;
    padding: 20px 0;
    margin: 0;

    align-items: stretch;
    justify-items: stretch;
}

.neda-recent-posts,
.neda-recent-posts * {
    box-sizing: border-box;
}


/* ----------------------------------------------------------
   Individual post card
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-item {
    display: flex;
    flex-direction: column;

    /* Reset old width restrictions */

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    float: none !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden;

    background-color: var(
        --neda-card-bg,
        #ffffff
    );

    border: var(--neda-card-border-width, 1px)
        solid var(--neda-card-border, #eeeeee);

    border-radius: var(
        --neda-card-radius,
        0px
    );

    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}


/* Card hover */

.neda-recent-posts .recent-post-item:hover {
    background-color: var(
        --neda-card-hover-bg,
        #ffffff
    );

    border-color: var(
        --neda-card-hover-border,
        #eeeeee
    );

    transform: translateY(-4px);

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
}


/* ----------------------------------------------------------
   Featured image
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-thumbnail {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.neda-recent-posts .recent-post-thumbnail a {
    display: block;
    width: 100%;
}

.neda-recent-posts .recent-post-thumbnail img,
.neda-recent-posts .recent-post-thumbnail .neda-post-image {
    display: block;

    width: 100% !important;
    max-width: 100% !important;

    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;

    margin: 0;
}


/* ----------------------------------------------------------
   Post content
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    padding: 25px;
    margin: 0;
}


/* ----------------------------------------------------------
   Post categories
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-category {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.neda-recent-posts .recent-post-category a {
    text-decoration: none;
}


/* ----------------------------------------------------------
   Post title
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-title {
    width: 100%;

    font-size: 24px;
    line-height: 1.4;

    margin: 0 0 12px;
    padding: 0;

    overflow-wrap: anywhere;
}

.neda-recent-posts .recent-post-title a {
    color: inherit;
    text-decoration: none;
}


/* ----------------------------------------------------------
   Post date
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-date {
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.7;
    margin-bottom: 15px;
}


/* ----------------------------------------------------------
   Post excerpt
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-excerpt {
    display: block;
    visibility: visible;
    opacity: 1;

    width: 100%;
    max-width: 100%;
    height: auto;

    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: inherit;

    margin: 0 0 25px;
    padding: 0;

    white-space: normal;
    overflow-wrap: anywhere;
}

.neda-recent-posts .recent-post-excerpt:empty {
    display: none;
}


/* ----------------------------------------------------------
   Button container
   ---------------------------------------------------------- */

.neda-recent-posts .recent-post-button {
    margin-top: auto;
    padding-top: 10px;
    max-width: 100%;
}


/* ----------------------------------------------------------
   Read More button
   ---------------------------------------------------------- */

.neda-recent-posts .read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    max-width: 100%;

    padding: 6px 15px;

    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;

    background-color: var(
        --neda-button-bg,
        #0EA6B3
    );

    color: var(
        --neda-button-text,
        #ffffff
    );

    border: var(--neda-button-border-width, 1px)
        solid var(--neda-button-border, #0EA6B3);

    border-radius: var(
        --neda-button-radius,
        25px
    );

    cursor: pointer;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;
}


/* Outlined button */

.neda-recent-posts.neda-recent-posts--outline .read-more-btn {
    background-color: transparent;

    color: var(
        --neda-button-text,
        #0EA6B3
    );
}


/* Solid and outlined button hover */

.neda-recent-posts .read-more-btn:hover,
.neda-recent-posts .read-more-btn:focus,
.neda-recent-posts.neda-recent-posts--outline .read-more-btn:hover,
.neda-recent-posts.neda-recent-posts--outline .read-more-btn:focus {

    background-color: var(
        --neda-button-hover-bg,
        #43CEC6
    );

    color: var(
        --neda-button-hover-text,
        #ffffff
    );

    border-color: var(
        --neda-button-hover-border,
        #43CEC6
    );

    text-decoration: none;
}


/* Keyboard accessibility */

.neda-recent-posts .read-more-btn:focus-visible {
    outline: 2px solid var(
        --neda-button-border,
        #0EA6B3
    );

    outline-offset: 3px;
}


/* ==========================================================
   02. CONTACT FORM
   ========================================================== */

/* Main contact form container */

.neda-contact-form {
    position: relative;
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 0;
    padding: 0;
}

.neda-contact-form,
.neda-contact-form * {
    box-sizing: border-box;
}


/* ----------------------------------------------------------
   Contact form title
   ---------------------------------------------------------- */

.neda-contact-form .neda-contact-title {
    margin: 0 0 30px;
    padding: 0;
}


/* ----------------------------------------------------------
   Form container
   ---------------------------------------------------------- */

.neda-contact-form .neda-custom-form {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}


/* ----------------------------------------------------------
   Form groups
   ---------------------------------------------------------- */

.neda-contact-form .form-group {
    position: relative;
    width: 100%;
    margin: 0 0 20px;
    padding: 0;
}

.neda-contact-form .form-group:last-child {
    margin-bottom: 0;
}


/* ----------------------------------------------------------
   Form labels
   ---------------------------------------------------------- */

.neda-contact-form label {
    display: block;

    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;

    color: #777777;

    margin-top: 8px;
    margin-bottom: 8px;
}


/* ----------------------------------------------------------
   Input fields and textarea
   ---------------------------------------------------------- */

.neda-contact-form input.form-control,
.neda-contact-form textarea.form-control {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;

    margin: 0;
    padding: 12px 15px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;

    color: inherit;
    background-color: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 0;

    box-shadow: none;

    transition:
        border-color 0.3s ease,
        background-color 0.3s ease;
}


/* Input placeholder */

.neda-contact-form input.form-control::placeholder,
.neda-contact-form textarea.form-control::placeholder {
    color: #999999;
    opacity: 1;
}


/* Input hover */

.neda-contact-form input.form-control:hover,
.neda-contact-form textarea.form-control:hover {
    border-color: #bbbbbb;
}


/* Input focus */

.neda-contact-form input.form-control:focus,
.neda-contact-form textarea.form-control:focus {

    border-color: var(
        --neda-contact-button-border,
        #007bff
    );

    outline: 2px solid var(
        --neda-contact-button-border,
        #007bff
    );

    outline-offset: 2px;

    box-shadow: none;
}


/* ----------------------------------------------------------
   Textarea
   ---------------------------------------------------------- */

.neda-contact-form textarea.form-control {
    min-height: 150px;
    resize: vertical;
}


/* ----------------------------------------------------------
   Submit button
   ---------------------------------------------------------- */

.neda-contact-form .neda-custom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto;
    max-width: 100%;

    background-color: var(
        --neda-contact-button-bg,
        #007bff
    );

    color: var(
        --neda-contact-button-text,
        #ffffff
    );

    border: 3px solid var(
        --neda-contact-button-border,
        #007bff
    );

    border-radius: var(
        --neda-contact-button-radius,
        5px
    );

    padding: 10px 20px;

    margin-top: 20px;
    margin-bottom: 20px;

    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    box-shadow: none;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;
}


/* Submit button hover */

.neda-contact-form .neda-custom-btn:hover,
.neda-contact-form .neda-custom-btn:focus-visible {

    background-color: var(
        --neda-contact-button-hover-bg,
        #0056b3
    );

    color: var(
        --neda-contact-button-hover-text,
        #ffffff
    );

    border-color: var(
        --neda-contact-button-hover-border,
        #0056b3
    );

    text-decoration: none;
}


/* Submit button keyboard focus */

.neda-contact-form .neda-custom-btn:focus-visible {

    outline: 2px solid var(
        --neda-contact-button-border,
        #007bff
    );

    outline-offset: 3px;
}


/* Disabled submit button */

.neda-contact-form .neda-custom-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ----------------------------------------------------------
   Contact form notifications
   ---------------------------------------------------------- */

.neda-contact-form .neda-contact-notice {
    display: block;

    width: 100%;
    max-width: 100%;

    padding: 15px 20px;
    margin: 0 0 25px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;

    border: 1px solid;
    border-radius: 4px;

    overflow-wrap: anywhere;
}


/* Success notification */

.neda-contact-form .neda-contact-success {
    background-color: #f0f9f2;
    border-color: #b7dfbf;
    color: #237a36;
}


/* Error notification */

.neda-contact-form .neda-contact-error {
    background-color: #fff2f2;
    border-color: #e9b5b5;
    color: #b42318;
}


/* ----------------------------------------------------------
   Honeypot spam protection
   ---------------------------------------------------------- */

.neda-contact-form .neda-contact-honeypot {
    position: absolute !important;

    left: -9999px !important;
    top: 0 !important;

    width: 1px !important;
    height: 1px !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
    opacity: 0 !important;

    pointer-events: none !important;
}


/* ==========================================================
   03. TABLET RESPONSIVE
   ========================================================== */

@media (max-width: 1200px) {

    /* Recent Posts */

    .neda-recent-posts {
        grid-template-columns: repeat(
            var(--neda-tablet-columns, 2),
            minmax(0, 1fr)
        );

        gap: 20px;
    }

    .neda-recent-posts .recent-post-content {
        padding: 20px;
    }

    .neda-recent-posts .recent-post-title {
        font-size: 22px;
    }

}


/* ==========================================================
   04. MOBILE RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {

    /* ------------------------------------------------------
       Recent Posts
       ------------------------------------------------------ */

    .neda-recent-posts {
        grid-template-columns: repeat(
            var(--neda-mobile-columns, 1),
            minmax(0, 1fr)
        );

        gap: 25px;
        padding: 12px 0;
    }

    .neda-recent-posts .recent-post-item {
        width: 100% !important;
        max-width: 100% !important;
    }

    .neda-recent-posts .recent-post-content {
        padding: 20px;
    }

    .neda-recent-posts .recent-post-title {
        font-size: 22px;
    }

    .neda-recent-posts .recent-post-thumbnail img {
        width: 100% !important;
    }


    /* ------------------------------------------------------
       Contact Form
       ------------------------------------------------------ */

    .neda-contact-form .neda-contact-title {
        margin-bottom: 20px;
    }

    .neda-contact-form .form-group {
        margin-bottom: 15px;
    }

    .neda-contact-form input.form-control,
    .neda-contact-form textarea.form-control {
        font-size: 16px;
        padding: 12px;
    }

    .neda-contact-form textarea.form-control {
        min-height: 130px;
    }

    .neda-contact-form .neda-custom-btn {
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .neda-contact-form .neda-contact-notice {
        padding: 12px 15px;
        margin-bottom: 20px;
        font-size: 14px;
    }

}


/* ==========================================================
   05. REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .neda-recent-posts .recent-post-item,
    .neda-recent-posts .read-more-btn,
    .neda-contact-form .neda-custom-btn,
    .neda-contact-form input.form-control,
    .neda-contact-form textarea.form-control {
        transition: none;
    }

    .neda-recent-posts .recent-post-item:hover {
        transform: none;
    }

}


/* ==========================================================
   END OF NEDA CUSTOM ELEMENTS STYLESHEET
   ========================================================== */