/* =========================================================
   AVOZOVA — SINGLE POST SYSTEM (PRODUCTION READY & POLISHED)
   Single Post Layout / Article / Responsive
   ========================================================= */


/* =========================================================
   1. SINGLE POST CONTAINER
   ========================================================= */

.avozova-single-container {
    max-width: var(--avozova-container-width) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: var(--avozova-container-spacing) !important;
    padding-right: var(--avozova-container-spacing) !important;
    padding-top: 60px;
    padding-bottom: 60px;
    box-sizing: border-box !important;
    overflow-x: hidden;
}


/* =========================================================
   2. SINGLE POST LAYOUT
   The default is two columns (content + sidebar). The class
   .avozova-sidebar-active-{none|bottom|left|right} is printed by
   page.php / single.php and always holds the layout that really applies
   (General default or page-type exception), so a layout without a sidebar
   never keeps an empty sidebar column.
   ========================================================= */

.avozova-single-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--avozova-sidebar-width, 320px));
    gap: var(--avozova-layout-gap, 32px);
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

/* No sidebar, or sidebar below the content: one column. */
.avozova-single-layout.avozova-sidebar-active-none,
.avozova-single-layout.avozova-sidebar-active-bottom {
    grid-template-columns: minmax(0, 1fr);
}

/* Left sidebar: sidebar first, content second (desktop only). */
@media (min-width: 993px) {

    .avozova-single-layout.avozova-sidebar-active-left {
        grid-template-columns: minmax(0, var(--avozova-sidebar-width, 320px)) minmax(0, 1fr);
    }

    .avozova-single-layout.avozova-sidebar-active-left > .avozova-sidebar {
        order: -1;
    }
}


/* =========================================================
   3. SINGLE POST CARD (Surface Model)
   ========================================================= */

.avozova-single-post {
    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--avozova-shadow);
    box-sizing: border-box !important;
    width: 100%;
}


/* =========================================================
   4. SINGLE POST HEADER — FEATURED IMAGE
   Printed by avozova_single_post_header_render() inside the header
   (inc/render/single-post-header-render.php). Not printed in the Cover layout,
   where the image is the header background.
   ========================================================= */

.avozova-single-header-image {
    border-radius: 14px;
    overflow: hidden;
}

.avozova-single-header-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}


/* =========================================================
   5. SINGLE POST HEADER
   The order of its children (image, title, meta) is set in the Customizer.
   Space between them: first rule below, replaced by the Customizer
   "Space Between Elements" value (dynamic CSS) once it is saved.
   ========================================================= */

.avozova-single-header {
    padding: 35px 40px 20px;
    box-sizing: border-box;
}

.avozova-single-header > * + * {
    margin-top: 15px;
}


/* 5.1 Cover layout: the featured image is the header background.
   The background image comes from the inline style printed by the render
   function; position, size and the overlay are in the dynamic CSS file. */

.avozova-single-header--cover {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 380px;
    padding: 60px 40px 40px;
}

/* Text sits on a dark overlay, so it is light by default.
   A colour saved in the Customizer (dynamic CSS) wins over these. */
.avozova-single-header--cover .avozova-single-title,
.avozova-single-header--cover .avozova-single-meta {
    color: #ffffff;
}


/* =========================================================
   6. SINGLE POST TITLE
   ========================================================= */

.avozova-single-title {
    margin: 0;
    color: var(--avozova-color-heading);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    line-height: 1.2;
    font-weight: 700;
    word-break: break-word;
}


/* =========================================================
   7. SINGLE POST META
   Items (.avozova-meta-item) and the "/" separators (.avozova-meta-sep)
   are printed by avozova_single_post_header_meta_html().
   ========================================================= */

.avozova-single-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--avozova-color-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.avozova-single-meta a {
    color: inherit;
    text-decoration: none;
}

.avozova-single-meta a:hover,
.avozova-single-meta a:focus {
    text-decoration: underline;
}

/* Every item (and the <time> of the date) takes the colour of .avozova-single-meta,
   so Meta Color and the Cover layout colour reach the date too. */
.avozova-single-meta .avozova-meta-item,
.avozova-single-meta time {
    color: inherit;
}

.avozova-meta-sep {
    opacity: 0.6;
}


/* =========================================================
   8. SINGLE POST CONTENT
   ========================================================= */

.avozova-single-content {
    padding: 10px 40px 45px;
    color: var(--avozova-color-text);
    font-size: 1.05rem;
    line-height: 1.85;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.avozova-single-content p {
    margin: 0 0 1.4em;
}

.avozova-single-content h2,
.avozova-single-content h3,
.avozova-single-content h4 {
    color: var(--avozova-color-heading);
    line-height: 1.3;
    margin-top: 1.7em;
}

/* Mobile safety: keep images and tables inside the content from overflowing. */
.avozova-single-content img,
.avozova-single-content figure,
.avozova-single-content table,
.avozova-single-content iframe,
.avozova-single-content embed,
.avozova-single-content object {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
}


/* =========================================================
   9. RELATED POSTS
   ========================================================= */

.avozova-related-posts {
    margin-top: 40px;
    padding: 30px 40px;
    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: 18px;
    box-shadow: var(--avozova-shadow);
    box-sizing: border-box;
    grid-column: 1 / -1;
    width: 100%;
}

.avozova-related-posts-title {
    margin: 0 0 22px;
    color: var(--avozova-color-heading);
    font-size: 1.4rem;
    font-weight: 700;
}

.avozova-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.avozova-related-post-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease;
}

.avozova-related-post-card:hover {
    transform: translateY(-4px);
}

.avozova-related-post-image {
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.avozova-related-post-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.avozova-related-post-title {
    margin: 0;
    color: var(--avozova-color-heading);
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.avozova-related-post-card:hover .avozova-related-post-title {
    color: var(--avozova-color-primary);
}


/* =========================================================
   10. PREVIOUS / NEXT POST NAVIGATION
   ========================================================= */

.avozova-post-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 22px 40px;
    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: 18px;
    box-shadow: var(--avozova-shadow);
    box-sizing: border-box;
    grid-column: 1 / -1;
    width: 100%;
}

.avozova-post-nav-prev,
.avozova-post-nav-next {
    flex: 1;
}

.avozova-post-nav-next {
    text-align: right;
}

.avozova-post-nav a {
    color: var(--avozova-color-text);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.25s ease;
}

.avozova-post-nav a:hover {
    color: var(--avozova-color-primary);
}

.avozova-post-nav-divider {
    width: 1px;
    height: 20px;
    margin: 0 20px;
    background: var(--avozova-color-border);
    flex-shrink: 0;
}


/* =========================================================
   11. COMMENTS BOX
   ========================================================= */

.avozova-comments-box {
    margin-top: 40px;
    padding: 30px 40px;
    background: var(--avozova-color-surface);
    border: 1px solid var(--avozova-color-border);
    border-radius: 18px;
    box-shadow: var(--avozova-shadow);
    box-sizing: border-box;
    grid-column: 1 / -1;
    width: 100%;
}

.avozova-comments-title {
    margin: 0 0 20px;
    color: var(--avozova-color-heading);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Comment List */
.avozova-comment-list {
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.avozova-comment-list .comment {
    padding: 18px 0;
    border-bottom: 1px solid var(--avozova-color-border);
}

.avozova-comment-list .comment:first-child {
    padding-top: 0;
}

.avozova-comment-list ol.children {
    margin: 18px 0 0 40px;
    padding: 0;
    list-style: none;
}

.avozova-comment-list .comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.avozova-comment-list .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.avozova-comment-list .fn {
    color: var(--avozova-color-heading);
    font-style: normal;
    font-weight: 700;
}

.avozova-comment-list .comment-metadata {
    margin-bottom: 8px;
    color: var(--avozova-color-text);
    font-size: 0.85rem;
}

.avozova-comment-list .comment-metadata a {
    color: var(--avozova-color-text);
}

.avozova-comment-list .comment-content p {
    margin: 0 0 0.8em;
    color: var(--avozova-color-text);
    line-height: 1.7;
}

.avozova-comment-list .reply a {
    display: inline-block;
    margin-top: 6px;
    color: var(--avozova-color-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.avozova-comments-closed {
    color: var(--avozova-color-text);
    font-size: 0.9rem;
}

/* Comment Form */
.avozova-comments-box .comment-reply-title {
    margin: 0 0 18px;
    color: var(--avozova-color-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.avozova-comments-box .comment-form p {
    margin: 0 0 18px;
}

.avozova-comments-box .comment-form input[type="text"],
.avozova-comments-box .comment-form input[type="email"],
.avozova-comments-box .comment-form input[type="url"],
.avozova-comments-box .comment-form textarea {
    width: 100%;
    padding: 16px 18px;
    background: var(--avozova-color-bg);
    color: var(--avozova-color-heading);
    border: 1px solid var(--avozova-color-border);
    border-radius: 12px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus ring follows the primary colour (first box-shadow is the fallback for old browsers). */
.avozova-comments-box .comment-form input[type="text"]:focus,
.avozova-comments-box .comment-form input[type="email"]:focus,
.avozova-comments-box .comment-form input[type="url"]:focus,
.avozova-comments-box .comment-form textarea:focus {
    border-color: var(--avozova-color-primary);
    box-shadow: 0 0 0 3px rgba(184, 115, 51, 0.15);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--avozova-color-primary) 15%, transparent);
}

.avozova-comments-box .comment-form input::placeholder,
.avozova-comments-box .comment-form textarea::placeholder {
    color: var(--avozova-color-text);
    opacity: 0.7;
}

.avozova-comments-box .comment-form textarea {
    resize: vertical;
}

.avozova-comments-box .comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avozova-comments-box .comment-form-cookies-consent label {
    margin: 0;
    color: var(--avozova-color-text);
    font-size: 0.9rem;
    font-weight: 400;
}

.avozova-comments-box .comment-notes,
.avozova-comments-box .logged-in-as {
    margin-bottom: 20px;
    color: var(--avozova-color-text);
    font-size: 0.9rem;
}

.avozova-comment-submit {
    padding: 14px 32px;
    background: var(--avozova-color-primary);
    color: var(--avozova-color-bg);
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.avozova-comment-submit:hover {
    background: var(--avozova-color-heading);
    transform: translateY(-2px);
}

/* Pagination */
.avozova-comments-box .comments-pagination {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.avozova-comments-box .comments-pagination a {
    color: var(--avozova-color-primary);
    font-weight: 600;
}


/* =========================================================
   12. SINGLE POST FOOTER
   Printed by avozova_single_post_footer_render() (inc/render/single-post-footer-render.php)
   inside the post card, under the content, as a <footer> element.
   The footer is a column: the space between its children (elements and dividers) is the
   "gap", so no child needs a margin of its own. The Customizer "Space Between Elements"
   value (dynamic CSS) replaces the default gap below.
   Dividers: the reusable Divider component (inc/customizer/controls/ashkt-divider.php) is
   printed between two elements by the render file. No element draws a private line:
   Social Share has no line or outer space of its own (assets/css/social-share.css).
   This section holds the base look of Tags and the Author Box. Colours follow the theme
   variables, so dark mode works. Post Meta uses the .avozova-single-meta rules of section 7.
   Everything saved in the Customizer (colours, Margin / Padding, border, gap, alignment,
   Tag Style) is printed by inc/dynamic-css/post-types/single-post-footer-options.php
   and wins over these defaults.
   The top padding is kept on every screen size (desktop 24px, tablet 20px, mobile 18px),
   so the first element never touches the content above it.
   ========================================================= */

.avozova-single-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px 40px 45px;
    box-sizing: border-box;
}


/* 12.1 Tags (pill style; the "Plain Text" style is an override in the dynamic CSS) */

.avozova-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avozova-single-tags a {
    display: inline-block;
    padding: 4px 12px;
    color: var(--avozova-color-text);
    background-color: var(--avozova-color-bg);
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.avozova-single-tags a:hover,
.avozova-single-tags a:focus {
    color: var(--avozova-color-primary);
}


/* 12.2 Author Box */

.avozova-single-author-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background-color: var(--avozova-color-bg);
    border-radius: 8px;
    box-sizing: border-box;
}

.avozova-author-avatar {
    flex-shrink: 0;
}

.avozova-author-avatar img {
    display: block;
    border-radius: 50%;
}

.avozova-author-info {
    min-width: 0;
}

.avozova-author-name {
    display: inline-block;
    color: var(--avozova-color-heading);
    font-weight: 600;
    text-decoration: none;
}

.avozova-author-name:hover,
.avozova-author-name:focus {
    color: var(--avozova-color-primary);
}

.avozova-author-bio {
    margin: 4px 0 0;
    color: var(--avozova-color-text);
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   13. RESPONSIVE MEDIA QUERIES (TABLET & MOBILE)
   ========================================================= */

@media (max-width: 992px) {
    .avozova-single-layout {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }

    /* No !important on the header: the Customizer padding (dynamic CSS) must be able to win. */
    .avozova-single-header {
        padding: 25px 20px 15px;
    }

    .avozova-single-header--cover {
        min-height: 300px;
        padding: 40px 20px 25px;
    }

    .avozova-single-content {
        padding: 10px 20px 30px !important;
    }

    /* No !important on the footer either: the Customizer padding (dynamic CSS) must be able to win. */
    .avozova-single-footer {
        padding: 20px 20px 30px;
    }

    .avozova-single-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }
}

@media (max-width: 768px) {
    .avozova-single-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        overflow-x: hidden !important;
    }

    .avozova-single-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .avozova-single-post,
    .avozova-sidebar,
    .avozova-related-posts,
    .avozova-post-nav,
    .avozova-comments-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .avozova-single-header {
        padding: 20px 18px 12px;
    }

    .avozova-single-header--cover {
        min-height: 260px;
        padding: 30px 18px 20px;
    }

    .avozova-single-content {
        padding: 10px 18px 25px !important;
    }

    .avozova-single-footer {
        padding: 18px 18px 25px;
    }

    .avozova-single-author-box {
        padding: 16px;
        gap: 12px;
    }

    .avozova-comment-list ol.children {
        margin-left: 18px;
    }

    /* Mobile order: Post -> Navigation -> Related Posts -> Comments -> Sidebar */
    .avozova-single-post {
        order: 1;
    }

    .avozova-post-nav {
        order: 2;
        padding: 18px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .avozova-related-posts {
        order: 3;
        padding: 22px 20px;
    }

    .avozova-related-posts-grid {
        grid-template-columns: 1fr;
    }

    .avozova-comments-box {
        order: 4;
        padding: 22px 20px;
    }

    .avozova-sidebar {
        order: 5;
    }
}