/*--------------------------------------------------------------
# AuthorPro Gutenberg Blocks & Patterns Architecture
# Description: Pure Vanilla CSS for Core Gutenberg Blocks, Custom Block
#              Styles, Query Loop, Post Templates, and Block Patterns
--------------------------------------------------------------*/

/* =============================================================
   1. Custom Button Block Styles
   ============================================================= */
/* Primary Block Button (.is-style-authorpro-primary) */
.wp-block-button.is-style-authorpro-primary .wp-block-button__link,
.wp-block-button.is-style-authorpro-primary > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-white);
    font-weight: 700;
    border-radius: var(--authorpro-radius-lg);
    box-shadow: var(--authorpro-shadow-lg);
    text-decoration: none;
    transition: all var(--authorpro-transition-base);
    border: none;
    cursor: pointer;
    width: 100%;
}

@media (min-width: 640px) {
    .wp-block-button.is-style-authorpro-primary .wp-block-button__link,
    .wp-block-button.is-style-authorpro-primary > a {
        width: auto;
    }
}

.wp-block-button.is-style-authorpro-primary .wp-block-button__link:hover,
.wp-block-button.is-style-authorpro-primary > a:hover {
    background-color: var(--authorpro-color-brand-700);
    color: var(--authorpro-color-white);
    transform: translateY(-2px);
    box-shadow: var(--authorpro-shadow-xl);
}

/* Outline Block Button (.is-style-authorpro-outline) */
.wp-block-button.is-style-authorpro-outline .wp-block-button__link,
.wp-block-button.is-style-authorpro-outline > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background-color: var(--authorpro-color-white);
    color: var(--authorpro-color-slate-700);
    font-weight: 700;
    border-radius: var(--authorpro-radius-lg);
    border: 1px solid var(--authorpro-color-slate-200);
    box-shadow: var(--authorpro-shadow-sm);
    text-decoration: none;
    transition: all var(--authorpro-transition-base);
    cursor: pointer;
    width: 100%;
}

@media (min-width: 640px) {
    .wp-block-button.is-style-authorpro-outline .wp-block-button__link,
    .wp-block-button.is-style-authorpro-outline > a {
        width: auto;
    }
}

.wp-block-button.is-style-authorpro-outline .wp-block-button__link:hover,
.wp-block-button.is-style-authorpro-outline > a:hover {
    border-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-brand-600);
    background-color: var(--authorpro-color-slate-50);
}

/* General Buttons Block Styling */
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--authorpro-radius-md);
    box-shadow: var(--authorpro-shadow-sm);
    text-decoration: none;
    transition: all var(--authorpro-transition-base);
    cursor: pointer;
}

.wp-block-button__link:not(.has-background) {
    background-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-white);
}

.wp-block-button__link:not(.has-background):hover {
    background-color: var(--authorpro-color-brand-700);
}

.is-style-outline .wp-block-button__link {
    background-color: transparent !important;
}

.is-style-outline .wp-block-button__link:not(.has-text-color) {
    border: 2px solid var(--authorpro-color-brand-600);
    color: var(--authorpro-color-brand-600);
}

.is-style-outline .wp-block-button__link:not(.has-text-color):hover {
    background-color: var(--authorpro-color-brand-50, #eff6ff) !important;
}

.wp-block-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* =============================================================
   2. Blockquotes & Pullquotes
   ============================================================= */
.wp-block-quote {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 4px solid var(--authorpro-color-slate-300);
}

.wp-block-quote:not(.has-text-color) {
    color: var(--authorpro-color-slate-700);
}

.wp-block-quote p {
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.wp-block-quote cite {
    display: block;
    font-weight: 700;
    font-style: normal;
    font-size: 0.875rem;
    color: var(--authorpro-color-slate-900);
}

.wp-block-pullquote {
    padding: 2rem 1.5rem;
    margin: 2.5rem 0;
    font-weight: 700;
    text-align: center;
    border-radius: var(--authorpro-radius-lg);
    font-size: 1.5rem;
}

.wp-block-pullquote:not(.has-background) {
    background-color: var(--authorpro-color-slate-50);
}

.wp-block-pullquote:not(.has-text-color) {
    color: var(--authorpro-color-slate-800);
    font-style: italic;
}

.wp-block-pullquote:not(.has-background):not(.has-text-color) {
    border-left: 4px solid var(--authorpro-color-brand-600);
}

/* =============================================================
   3. Separator Block & Columns Block
   ============================================================= */
.wp-block-separator {
    border: none !important;
    height: 1px !important;
    margin: 2rem auto;
}

.wp-block-separator:not(.has-background):not(.has-text-color) {
    background-color: var(--authorpro-color-slate-200) !important;
}

/* Core Gutenberg Columns */
.wp-block-columns {
    display: flex;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-wrap: nowrap;
    }
}

.wp-block-columns.is-not-stacked-on-mobile {
    flex-wrap: nowrap;
}

.wp-block-column {
    flex-grow: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* =============================================================
   4. Query Loop & Post Template
   ============================================================= */
.wp-block-query {
    margin-bottom: 2rem;
}

.wp-block-post-template {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid;
    gap: 2rem;
}

.wp-block-post-template.is-layout-flow {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.wp-block-post-template .wp-block-post {
    margin-top: 0;
    margin-bottom: 0;
}

/* Post Title */
.wp-block-post-title:not(.editor-post-title__input) {
    margin-bottom: 0.75rem;
    line-height: 1.25;
    font-size: 1.5rem;
    font-family: var(--authorpro-font-heading);
    font-weight: 700;
}

.wp-block-post-title:not(.has-text-color) {
    color: var(--authorpro-color-slate-900);
}

.wp-block-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color var(--authorpro-transition-base);
}

.wp-block-post-title a:hover {
    color: var(--authorpro-color-brand-600);
}

/* Post Excerpt */
.wp-block-post-excerpt {
    line-height: 1.6;
    font-size: 1rem;
}

.wp-block-post-excerpt:not(.has-text-color) {
    color: var(--authorpro-color-slate-600);
}

/* Post Date */
.wp-block-post-date {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.wp-block-post-date:not(.has-text-color) {
    color: var(--authorpro-color-slate-500);
}

/* Query Pagination */
.wp-block-query-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--authorpro-color-slate-200);
}

.wp-block-query-pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.wp-block-query-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--authorpro-radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--authorpro-color-slate-600);
    background-color: var(--authorpro-color-white);
    border: 1px solid var(--authorpro-color-slate-200);
    transition: all var(--authorpro-transition-base);
    text-decoration: none;
}

.wp-block-query-pagination .page-numbers:hover:not(.current):not(.dots) {
    border-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-brand-600);
    background-color: var(--authorpro-color-slate-50);
}

.wp-block-query-pagination .page-numbers.current {
    background-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-white);
    border-color: var(--authorpro-color-brand-600);
}

.wp-block-query-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--authorpro-color-slate-700);
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: color var(--authorpro-transition-base);
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    color: var(--authorpro-color-brand-600);
}

/* =============================================================
   5. Post Author Block
   ============================================================= */
.wp-block-post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: var(--authorpro-radius-xl);
    border: 1px solid var(--authorpro-color-slate-100);
}

.wp-block-post-author:not(.has-background) {
    background-color: var(--authorpro-color-slate-50);
}

.wp-block-post-author__avatar img {
    width: 3rem;
    height: 3rem;
    border-radius: var(--authorpro-radius-full);
    border: 2px solid var(--authorpro-color-white);
    box-shadow: var(--authorpro-shadow-sm);
    object-fit: cover;
}

.wp-block-post-author__content {
    flex: 1 1 0%;
}

.wp-block-post-author__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--authorpro-color-slate-900);
    display: block;
    line-height: 1.25;
}

.wp-block-post-author__bio {
    font-size: 0.875rem;
    color: var(--authorpro-color-slate-600);
    margin-top: 0.25rem;
    line-height: 1.6;
}

/* =============================================================
   6. Post Navigation Links
   ============================================================= */
.wp-block-post-navigation-link {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.wp-block-post-navigation-link a {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--authorpro-color-slate-600);
    text-decoration: none;
    transition: color var(--authorpro-transition-base);
}

.wp-block-post-navigation-link a:hover {
    color: var(--authorpro-color-brand-600);
}

.wp-block-post-navigation-link.post-navigation-link-previous a::before {
    content: "←";
    margin-right: 0.5rem;
    font-weight: 400;
}

.wp-block-post-navigation-link.post-navigation-link-next a::after {
    content: "→";
    margin-left: 0.5rem;
    font-weight: 400;
}

/* =============================================================
   7. Block Comments & Respond
   ============================================================= */
.wp-block-comments {
    margin-top: 3rem;
}

.wp-block-comments-title,
.wp-block-post-comments-form h2,
.wp-block-comments h2 {
    font-family: var(--authorpro-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--authorpro-color-slate-900);
    margin-bottom: 2rem;
}

.wp-block-comment-template {
    list-style: none !important;
    padding-left: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wp-block-comment-template li.comment {
    margin-bottom: 0;
}

/* =============================================================
   8. Search Block
   ============================================================= */
.wp-block-search__input {
    width: 100%;
    border: 1px solid var(--authorpro-color-slate-300);
    border-radius: var(--authorpro-radius-md) 0 0 var(--authorpro-radius-md);
    padding: 0.5rem 1rem;
    background-color: var(--authorpro-color-white);
    color: var(--authorpro-color-slate-900);
    outline: none;
    transition: border-color var(--authorpro-transition-base);
}

.wp-block-search__input:focus {
    border-color: var(--authorpro-color-brand-600);
}

.wp-block-search__button {
    background-color: var(--authorpro-color-brand-600);
    color: var(--authorpro-color-white);
    border-radius: 0 var(--authorpro-radius-md) var(--authorpro-radius-md) 0;
    padding: 0.5rem 1rem;
    border: 1px solid var(--authorpro-color-brand-600);
    cursor: pointer;
    transition: background-color var(--authorpro-transition-base);
}

.wp-block-search__button:hover {
    background-color: var(--authorpro-color-brand-700);
}

/* =============================================================
   9. Block Patterns Styling
   ============================================================= */
/* Common Pattern Utilities */
.authorpro-italic-brand,
.authorpro-italic-text {
    font-style: italic;
    color: var(--authorpro-color-brand-600);
}

.authorpro-pattern-eyebrow {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--authorpro-color-brand-600);
    margin-bottom: 0.5rem;
}

.authorpro-pattern-heading {
    font-family: var(--authorpro-font-heading);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--authorpro-color-slate-900);
    margin-bottom: 1.5rem;
}

/* Pattern: Hero Section */
.authorpro-pattern-hero {
    padding: 5rem 0;
    background-color: var(--authorpro-color-slate-50);
    overflow: hidden;
}

.authorpro-pattern-hero-columns,
.authorpro-about-columns {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

@media (min-width: 1024px) {
    .authorpro-pattern-hero-columns,
    .authorpro-about-columns {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 3rem;
        align-items: center;
    }

    .authorpro-pattern-hero-content,
    .authorpro-pattern-hero-image-col,
    .authorpro-about-image-col,
    .authorpro-about-content-col {
        flex: 1 1 50%;
        width: 50%;
        min-width: 0;
    }
}

.authorpro-pattern-hero-badge {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--authorpro-color-brand-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.authorpro-pattern-hero-title {
    font-family: var(--authorpro-font-heading);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--authorpro-color-slate-900);
    margin-bottom: 1.5rem;
}

.authorpro-pattern-hero-desc {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--authorpro-color-slate-600);
    margin-bottom: 2rem;
}

.authorpro-pattern-hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.authorpro-pattern-hero-image-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: var(--authorpro-radius-lg);
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.15));
}

/* Hero Image Right Alignment */
@media (min-width: 1024px) {
    .authorpro-pattern-hero-image-col {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        text-align: right;
    }

    .authorpro-pattern-hero-image-wrap,
    .authorpro-pattern-hero-image-col .wp-block-image {
        display: flex;
        justify-content: flex-end;
        width: 100%;
        margin-left: auto;
        margin-right: 0;
    }

    .authorpro-pattern-hero-image-col .wp-block-image img {
        margin-left: auto;
        margin-right: 0;
        display: block;
    }
}

/* Pattern: About Section */
.authorpro-pattern-about-section {
    padding: 5rem 0;
    background-color: var(--authorpro-color-white);
}

.authorpro-about-image-col img {
    width: 100%;
    height: auto;
    border-radius: var(--authorpro-radius-2xl);
    box-shadow: var(--authorpro-shadow-xl);
    object-fit: cover;
}

.authorpro-pattern-body p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--authorpro-color-slate-600);
    margin-bottom: 1.5rem;
}

/* Pattern: Article Section */
.authorpro-pattern-article-section {
    padding: 5rem 0;
    background-color: var(--authorpro-color-slate-50);
}

.authorpro-pattern-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.authorpro-pattern-view-all a {
    font-weight: 700;
    color: var(--authorpro-color-brand-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color var(--authorpro-transition-base);
}

.authorpro-pattern-view-all a:hover {
    color: var(--authorpro-color-brand-700);
    text-decoration: underline;
}

/* Latest Blog Pattern Grid */
.authorpro-pattern-articles-grid,
.wp-block-post-template.authorpro-pattern-articles-grid {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

@media (min-width: 768px) {
    .authorpro-pattern-articles-grid,
    .wp-block-post-template.authorpro-pattern-articles-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    .authorpro-pattern-articles-grid,
    .wp-block-post-template.authorpro-pattern-articles-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.authorpro-pattern-card {
    background-color: var(--authorpro-color-white);
    border-radius: var(--authorpro-radius-xl);
    overflow: hidden;
    border: 1px solid var(--authorpro-color-slate-100);
    box-shadow: var(--authorpro-shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all var(--authorpro-transition-base);
}

.authorpro-pattern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--authorpro-shadow-lg);
    border-color: var(--authorpro-color-slate-200);
}

.authorpro-pattern-card-thumbnail img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.authorpro-pattern-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.authorpro-pattern-card-category a {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--authorpro-color-brand-600);
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.authorpro-pattern-card-title {
    font-family: var(--authorpro-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.authorpro-pattern-card-title a {
    color: var(--authorpro-color-slate-900);
    text-decoration: none;
    transition: color var(--authorpro-transition-base);
}

.authorpro-pattern-card-title a:hover {
    color: var(--authorpro-color-brand-600);
}

.authorpro-pattern-card-excerpt {
    font-size: 0.9375rem;
    color: var(--authorpro-color-slate-600);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.authorpro-pattern-card-more a {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--authorpro-color-brand-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.authorpro-pattern-card-more a:hover {
    color: var(--authorpro-color-brand-700);
}

