/*
Theme Name: Castellón Digital
Theme URI: https://castellondigital.com
Author: Castellón Digital
Author URI: https://castellondigital.com
Description: Un tema optimizado para rendimiento y SEO, construido con Gutenberg nativo.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: MIG
Text Domain: castellondigital
*/

/* Reset & Normalize - Minimal for Modern Browsers */
*,
*:before,
*:after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--wp--preset--font-family--body, "Inter", sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: #ffffff;
    background-image: none;
    background-attachment: fixed;
    background-size: cover;
}

/* Accessibility: Visually Hidden */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Skip link focus styles */
.skip-link:focus {
    clip: auto;
    clip-path: none;
    height: auto;
    width: auto;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100000;
    background: #000;
    color: #fff;
    padding: 15px 20px;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Prevent horizontal scroll without breaking sticky */
main,
#primary,
.site-content,
article {
    overflow-x: clip;
}

/* --- Universal Block Styles --- */

/* "Más Estirado" Style */
.is-style-stretched [class*="-container"]:not(.marquee-container),
.is-style-stretched [class*="-grid"],
.is-style-stretched [class*="-wrapper"],
.is-style-stretched .omni-container {
    max-width: 1600px !important;
}

@media (min-width: 1800px) {

    .is-style-stretched [class*="-container"]:not(.marquee-container),
    .is-style-stretched [class*="-grid"],
    .is-style-stretched [class*="-wrapper"],
    .is-style-stretched .omni-container {
        max-width: 1700px !important;
    }
}

/* --- Single Post Styles --- */

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content h2 {
    font-size: var(--wp--preset--font-size--main-title);
    font-family: var(--wp--preset--font-family--heading);
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    letter-spacing: -0.02em;
}

.entry-content h3 {
    font-size: var(--wp--preset--font-size--subtitle);
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    letter-spacing: -0.01em;
}

.entry-content h4 {
    font-size: var(--wp--preset--font-size--section-heading);
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.post-tags a {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    text-decoration: none;
    color: var(--wp--preset--color--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-tags a:hover {
    background: var(--wp--preset--color--magenta);
    color: white;
}

.nav-previous a,
.nav-next a {
    text-decoration: none;
    color: var(--wp--preset--color--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
    color: var(--wp--preset--color--magenta);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

.related-card h3 a:hover {
    color: var(--wp--preset--color--magenta) !important;
}

/* --- Blog Page Styles --- */

.blog-card:hover {
    transform: translateY(-8px);
}

.blog-card:hover .blog-card-thumbnail img {
    transform: scale(1.05);
}

.blog-card-title a:hover {
    color: var(--wp--preset--color--primary) !important;
}

.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 5rem;
    margin-bottom: 5rem;
}

.blog-pagination .page-numbers {
    padding: 0.8rem 1.2rem;
    background: white;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #000000;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.blog-pagination .page-numbers:hover {
    background: var(--wp--preset--color--primary);
    color: white;
    transform: translateY(-2px);
}

.blog-pagination .page-numbers.current {
    background: var(--wp--preset--color--magenta);
    color: white;
}

.post-thumbnail img {
    width: 100%;
    height: 500px;
    display: block;
    object-fit: cover;
}

/* Global Mobile Button Fix */
/* Global Mobile Heading Support - Forced Scaling */
@media (max-width: 768px) {

    /* Target common large headings and those with inline styles from the editor */
    h1,
    h2,
    h3,
    .wp-block-heading {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-align: center;
    }

    /* Force scaling for headings that might have been set to fixed px/rem sizes in the editor */
    .wp-block-heading[style*="font-size"] {
        font-size: clamp(1.25rem, 6vw, 2.25rem) !important;
        line-height: 1.2 !important;
        letter-spacing: -0.01em !important;
        padding: 10px;
    }

    /* Specifically target elements that the user likely configured as h2/h3 with large sizes */
    h2.wp-block-heading,
    .entry-content h2,
    .entry-content h3 {
        font-size: clamp(1.4rem, 7vw, 2.1rem) !important;
        letter-spacing: -0.01em !important;
        padding: 10px;
    }

    /* Global margin reset for blocks set with manual spacing in the editor */
    .wp-block-heading[style*="margin"],
    .wp-block-paragraph[style*="margin"],
    .wp-block-group[style*="margin"],
    .wp-block-columns[style*="margin"] {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Target the specific case of larger titles used for impact */
    .wp-block-button__link,
    .btn,
    .button,
    button:not(.hamburger-toggle):not(.drawer-close) {
        padding: 0.5rem 1.25rem !important;
        font-size: 0.9rem !important;
        width: auto !important;
        display: inline-flex !important;
        max-width: 100%;
    }
}



.resaltado {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.resaltadobloquevanguardia {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    font-size: 20px !important;
}


/* Blocks transparency fixed - Section removed */

/* Ensure blocks are transparent enough if they don't have a background-color set */
.wp-block-group,
section {
    position: relative;
    z-index: 1;
}