/*--------------------------------------------------------------
# Modern Gutenberg Block Styles
# Ensures consistency between frontend and backend
--------------------------------------------------------------*/

/* Alignment Classes */
.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: auto;
    max-width: 1000%;
}

.alignwide {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
}

.alignleft {
    float: left;
    margin-right: 2em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 2em;
    margin-bottom: 1em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Button Block */
.wp-block-button {
    margin-bottom: 1.5em;
}

.wp-block-button__link {
    background-color: #0073aa;
    border: none;
    border-radius: 28px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    padding: 12px 24px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    background-color: #005a87;
    transform: translateY(-2px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 2px solid currentColor;
    color: #0073aa;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: #0073aa;
    color: #fff;
}

.wp-block-button.is-style-squared .wp-block-button__link {
    border-radius: 4px;
}

/* Image Block */
.wp-block-image {
    margin-bottom: 1.5em;
}

.wp-block-image img {
    display: block;
    height: auto;
    max-width: 100%;
}

.wp-block-image figcaption {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin-top: 0.5em;
    text-align: center;
}

/* Gallery Block */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    list-style-type: none;
    padding: 0;
    margin: 1.5em 0;
}

.wp-block-gallery .blocks-gallery-item,
.wp-block-gallery .wp-block-image {
    margin: 0 1em 1em 0;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    position: relative;
}

.wp-block-gallery.columns-2 .blocks-gallery-item,
.wp-block-gallery.columns-2 .wp-block-image {
    width: calc(50% - 0.5em);
}

.wp-block-gallery.columns-3 .blocks-gallery-item,
.wp-block-gallery.columns-3 .wp-block-image {
    width: calc(33.33% - 0.67em);
}

.wp-block-gallery.columns-4 .blocks-gallery-item,
.wp-block-gallery.columns-4 .wp-block-image {
    width: calc(25% - 0.75em);
}

.wp-block-gallery.columns-5 .blocks-gallery-item,
.wp-block-gallery.columns-5 .wp-block-image {
    width: calc(20% - 0.8em);
}

.wp-block-gallery.columns-6 .blocks-gallery-item,
.wp-block-gallery.columns-6 .wp-block-image {
    width: calc(16.66% - 0.84em);
}

.wp-block-gallery img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Quote Block */
.wp-block-quote {
    border-left: 4px solid #0073aa;
    margin: 1.5em 0;
    padding: 1em 0 1em 2em;
}

.wp-block-quote p {
    font-size: 1.2em;
    font-style: italic;
    line-height: 1.6;
}

.wp-block-quote cite {
    color: #666;
    font-size: 0.9em;
    font-style: normal;
    font-weight: 600;
}

.wp-block-quote.is-large,
.wp-block-quote.is-style-large {
    border: none;
    padding: 2em;
    text-align: center;
}

.wp-block-quote.is-large p,
.wp-block-quote.is-style-large p {
    font-size: 1.5em;
    line-height: 1.4;
}

/* Pullquote Block */
.wp-block-pullquote {
    border-top: 4px solid #0073aa;
    border-bottom: 4px solid #0073aa;
    margin: 2em 0;
    padding: 2em;
    text-align: center;
}

.wp-block-pullquote p {
    font-size: 1.5em;
    line-height: 1.4;
    margin: 0;
}

.wp-block-pullquote cite {
    color: #666;
    display: block;
    font-size: 0.9em;
    font-style: normal;
    margin-top: 1em;
    text-transform: uppercase;
}

.wp-block-pullquote.is-style-solid-color {
    background-color: #0073aa;
    color: #fff;
}
/* Cover Block */
.wp-block-cover {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-height: 430px;
    background-size: cover;
    background-position: center center;
    overflow: hidden;
}

.wp-block-cover-text {
    color: #fff;
    font-size: 2em;
    font-weight: bold;
    line-height: 1.25;
    padding: 0;
    text-align: center;
    z-index: 1;
}

/* Heading Blocks */
.wp-block-heading h1,
.wp-block-heading h2,
.wp-block-heading h3,
.wp-block-heading h4,
.wp-block-heading h5,
.wp-block-heading h6 {
    font-family: inherit;
    font-weight: 700;
    line-height: 1.3;
    margin: 1em 0 0.5em;
}

/* Paragraph Block */
.wp-block-paragraph {
    margin-bottom: 1.5em;
}

.wp-block-paragraph.has-drop-cap:not(:focus)::first-letter {
    float: left;
    font-size: 8.4em;
    line-height: 0.68;
    font-weight: 100;
    margin: 0.05em 0.1em 0 0;
    text-transform: uppercase;
    font-style: normal;
}

/* List Blocks */
.wp-block-list {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.wp-block-list li {
    margin-bottom: 0.5em;
}

/* Latest Posts Block */
.wp-block-latest-posts {
    list-style: none;
    padding: 0;
}

.wp-block-latest-posts li {
    margin-bottom: 1em;
}

.wp-block-latest-posts.is-grid {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

.wp-block-latest-posts.is-grid li {
    flex: 1;
    margin: 0 1.25em 1.25em 0;
    min-width: 300px;
}

.wp-block-latest-posts__post-title a {
    text-decoration: none;
}

.wp-block-latest-posts__post-title a:hover {
    text-decoration: underline;
}

/* Table Block */
.wp-block-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
}

.wp-block-table table {
    width: 100%;
}

.wp-block-table td,
.wp-block-table th {
    border: 1px solid #ddd;
    padding: 0.75em;
    text-align: left;
}

.wp-block-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

/* Separator Block */
.wp-block-separator {
    border: none;
    border-top: 2px solid #ddd;
    margin: 2em auto;
    width: 100px;
}

.wp-block-separator.is-style-wide {
    width: 100%;
}

.wp-block-separator.is-style-dots {
    background: none;
    border: none;
    text-align: center;
    max-width: none;
    line-height: 1;
}

.wp-block-separator.is-style-dots::before {
    content: "···";
    color: #999;
    font-size: 1.5em;
    letter-spacing: 2em;
    padding-left: 2em;
}

/* Embed Block */
.wp-block-embed {
    margin: 1.5em 0;
}

.wp-block-embed figcaption {
    color: #666;
    font-size: 14px;
    margin-top: 0.5em;
    text-align: center;
}

.wp-block-embed.type-video > .wp-block-embed__wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%;
}

.wp-block-embed.type-video > .wp-block-embed__wrapper > iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Wide and Full width embeds */
.alignwide.wp-block-embed,
.alignfull.wp-block-embed {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 25px;
    height: 0;
}

.alignwide.wp-block-embed iframe,
.alignfull.wp-block-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.alignwide.wp-block-embed figcaption,
.alignfull.wp-block-embed figcaption {
    bottom: -10px;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    position: absolute;
}

/* Columns Block */
.wp-block-columns {
    display: flex;
    margin: 1.5em 0;
    flex-wrap: wrap;
}

.wp-block-column {
    flex: 1;
    margin-bottom: 1.5em;
    margin-right: 2em;
}

.wp-block-column:last-child {
    margin-right: 0;
}

@media (max-width: 781px) {
    .wp-block-columns {
        flex-direction: column;
    }
    
    .wp-block-column {
        margin-right: 0;
    }
}

/* Group Block */
.wp-block-group {
    margin: 1.5em 0;
}

.wp-block-group__inner-container {
    padding: 1.5em;
}

/* Verse Block */
.wp-block-verse {
    font-family: monospace;
    white-space: pre-wrap;
    overflow: auto;
    background-color: #f8f9fa;
    padding: 1em;
    margin: 1.5em 0;
}

/* Code Block */
.wp-block-code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-family: Menlo, Consolas, monaco, monospace;
    font-size: 14px;
    padding: 1em;
    margin: 1.5em 0;
    overflow-x: auto;
}

/* Preformatted Block */
.wp-block-preformatted {
    background-color: #f8f9fa;
    font-family: Menlo, Consolas, monaco, monospace;
    font-size: 14px;
    padding: 1em;
    margin: 1.5em 0;
    white-space: pre-wrap;
    overflow: auto;
}

/* Media & Text Block */
.wp-block-media-text {
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-areas: "media-text-media media-text-content";
    grid-gap: 2em;
    margin: 1.5em 0;
    align-items: center;
}

.wp-block-media-text.has-media-on-the-right {
    grid-template-areas: "media-text-content media-text-media";
}

.wp-block-media-text .wp-block-media-text__media {
    grid-area: media-text-media;
    margin: 0;
}

.wp-block-media-text .wp-block-media-text__content {
    grid-area: media-text-content;
    padding: 0;
}

@media (max-width: 600px) {
    .wp-block-media-text {
        grid-template-columns: 100%;
        grid-template-areas: "media-text-media" "media-text-content";
    }
}

/* Font Sizes */
.has-small-font-size {
    font-size: 14px;
}

.has-medium-font-size {
    font-size: 18px;
}

.has-large-font-size {
    font-size: 24px;
    line-height: 1.4;
}

.has-larger-font-size {
    font-size: 32px;
    line-height: 1.3;
}

/* Responsive Typography */
@media screen and (min-width: 768px) {
    .wp-block-cover-text p {
        padding: 1.5em 0;
    }
    
    .has-large-font-size {
        font-size: 28px;
    }
    
    .has-larger-font-size {
        font-size: 36px;
    }
}

/*--------------------------------------------------------------
# Block Color Palette
--------------------------------------------------------------*/
.has-strong-blue-color {
    color: #0073aa;
}

.has-strong-blue-background-color {
    background-color: #0073aa;
}

.has-lighter-blue-color {
    color: #229fd8;
}

.has-lighter-blue-background-color {
    background-color: #229fd8;
}

.has-very-light-gray-color {
    color: #eee;
}

.has-very-light-gray-background-color {
    background-color: #eee;
}

.has-very-dark-gray-color {
    color: #444;
}

.has-very-dark-gray-background-color {
    background-color: #444;
}

.has-white-color {
    color: #fff;
}

.has-white-background-color {
    background-color: #fff;
}

.has-black-color {
    color: #000;
}

.has-black-background-color {
    background-color: #000;
}

/*--------------------------------------------------------------
# Block Editor Improvements
--------------------------------------------------------------*/
.wp-block {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.wp-block[data-align="wide"] {
    max-width: 1200px;
}

.wp-block[data-align="full"] {
    max-width: none;
}

/* Clear floats */
.wp-block:after {
    content: "";
    display: table;
    clear: both;
}

/*--------------------------------------------------------------
# Legacy Block Styles (for backward compatibility)
--------------------------------------------------------------*/
.wp-block-gallery.columns-3 ul li {
    width: 33.33%;
    float: left;
}

.wp-block-gallery.columns-2 ul li {
    width: 50%;
    float: left;
}

.wp-block-gallery.columns-4 ul li {
    width: 25%;
    float: left;
}

.wp-block-gallery.columns-5 ul li {
    width: 20%;
    float: left;
}

.wp-block-gallery.columns-6 ul li {
    width: 16.66%;
    float: left;
}

.wp-block-gallery.columns-7 ul li {
    width: 14.28%;
    float: left;
}

.wp-block-gallery.columns-8 ul li {
    width: 12.5%;
    float: left;
}

/*--------------------------------------------------------------
# Custom Block Styles (register_block_style)
--------------------------------------------------------------*/

/* Button Block Styles */
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 2px solid currentColor;
    color: #0073aa;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: #0073aa;
    color: #fff;
}

.wp-block-button.is-style-squared .wp-block-button__link {
    border-radius: 4px;
}

/* Quote Block Styles */
.wp-block-quote.is-style-fancy-quote {
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2em;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.wp-block-quote.is-style-fancy-quote::before {
    content: '"';
    font-size: 4em;
    color: #0073aa;
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
    opacity: 0.3;
    font-family: Georgia, serif;
}

.wp-block-quote.is-style-fancy-quote p {
    font-style: italic;
    font-size: 1.2em;
    margin-left: 40px;
    position: relative;
    z-index: 2;
}

/* Image Block Styles */
.wp-block-image.is-style-rounded img {
    border-radius: 50%;
}

/* Cover Block Styles */
.wp-block-cover.is-style-blur-overlay {
    overflow: hidden;
}

.wp-block-cover.is-style-blur-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(2px);
    z-index: 1;
}

/* Group Block Styles */
.wp-block-group.is-style-shadow-box {
    padding: 2em;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    background: #fff;
    border: 1px solid #e9ecef;
}

/* List Block Styles */
.wp-block-list.is-style-no-bullets {
    list-style: none;
    padding-left: 0;
}

.wp-block-list.is-style-checkmark-list {
    list-style: none;
    padding-left: 0;
}

.wp-block-list.is-style-checkmark-list li {
    position: relative;
    padding-left: 2em;
    margin-bottom: 0.5em;
}

.wp-block-list.is-style-checkmark-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #00a32a;
    font-weight: bold;
    font-size: 1.2em;
}

/* Separator Block Styles */
.wp-block-separator.is-style-wide {
    width: 100%;
    border: none;
    border-top: 2px solid #ddd;
    margin: 2em auto;
}

.wp-block-separator.is-style-dots {
    background: none;
    border: none;
    text-align: center;
    max-width: none;
    line-height: 1;
    height: auto;
}

.wp-block-separator.is-style-dots::before {
    content: "···";
    color: #999;
    font-size: 1.5em;
    letter-spacing: 2em;
    padding-left: 2em;
}

/* Table Block Styles */
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

/* Social Links Block Styles */
.wp-block-social-links.is-style-logos-only .wp-social-link {
    background-color: transparent !important;
    color: #666;
}

.wp-block-social-links.is-style-logos-only .wp-social-link:hover {
    color: #0073aa;
    transform: scale(1.1);
}