/*
Theme Name: CTOP Base
Theme URI: https://ctop.cl/
Author: CTOP
Author URI: https://ctop.cl/
Description: Tema de bloques reutilizable para los sitios desarrollados por CTOP.
Requires at least: 7.1
Requires PHP: 8.4
Version: 0.4.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ctop-base
Tags: full-site-editing, block-patterns, custom-colors, custom-logo
*/

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("assets/fonts/Montserrat-Latin.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("assets/fonts/Montserrat-Latin.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("assets/fonts/Montserrat-Latin.woff2") format("woff2");
}

:root {
    text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
    transition: color var(--wp--custom--transition), text-decoration-color var(--wp--custom--transition);
}

a:hover {
    color: var(--wp--preset--color--brand);
}

:where(a, button, input, textarea, select, summary):focus-visible {
    outline: 3px solid var(--wp--preset--color--brand);
    outline-offset: 3px;
}

.wp-site-blocks {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
}

.wp-site-blocks > main {
    flex: 1;
}

.ctop-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--wp--preset--color--border);
    background: color-mix(in srgb, var(--wp--preset--color--surface) 94%, transparent);
    backdrop-filter: blur(12px);
}

.ctop-header .wp-block-site-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.ctop-header .wp-block-site-title a,
.ctop-footer .wp-block-site-title a {
    text-decoration: none;
}

.ctop-brand-lockup {
    flex: 0 0 auto;
    gap: var(--wp--preset--spacing--xs);
}

.ctop-brand-lockup .wp-block-site-logo img {
    width: auto;
    max-height: 2.5rem;
}

.ctop-header .wp-block-navigation-item__content {
    min-height: 2.75rem;
    padding: 0.7rem 0.45rem;
    text-decoration: none;
}

.ctop-header .wp-block-navigation-item__content:hover,
.ctop-header .current-menu-item > .wp-block-navigation-item__content {
    color: var(--wp--preset--color--brand);
}

.wp-block-navigation__responsive-container.is-menu-open {
    padding: var(--wp--preset--spacing--md);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    min-height: 3rem;
    align-items: center;
    font-size: var(--wp--preset--font-size--lead);
}

.wp-element-button,
.wp-block-button__link {
    box-shadow: var(--wp--custom--shadow--small);
    text-decoration: none;
    transition: background-color var(--wp--custom--transition), box-shadow var(--wp--custom--transition), transform var(--wp--custom--transition);
}

.wp-element-button:hover,
.wp-block-button__link:hover {
    color: var(--wp--preset--color--surface);
    background: var(--wp--preset--color--dark);
    box-shadow: var(--wp--custom--shadow--medium);
    transform: translateY(-1px);
}

.is-style-outline > .wp-block-button__link {
    border-color: currentColor;
    color: var(--wp--preset--color--brand);
    background: transparent;
    box-shadow: none;
}

.is-style-outline > .wp-block-button__link:hover {
    color: var(--wp--preset--color--surface);
    background: var(--wp--preset--color--dark);
}

.ctop-hero .is-style-outline > .wp-block-button__link,
.ctop-page-hero .is-style-outline > .wp-block-button__link {
    border-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--surface);
}

.ctop-hero .is-style-outline > .wp-block-button__link:hover,
.ctop-page-hero .is-style-outline > .wp-block-button__link:hover {
    color: var(--wp--preset--color--dark);
    background: var(--wp--preset--color--surface);
}

.ctop-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link,
.ctop-page-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
    color: var(--wp--preset--color--dark);
    background: var(--wp--preset--color--accent);
}

.ctop-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover,
.ctop-page-hero .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
    background: var(--wp--preset--color--surface);
}

.ctop-section {
    padding-block: var(--wp--preset--spacing--xxl);
}

.ctop-section--compact {
    padding-block: var(--wp--preset--spacing--xl);
}

.ctop-section-heading {
    max-width: 48rem;
    margin-bottom: var(--wp--preset--spacing--xl);
}

.ctop-section-heading p:last-child {
    max-width: 42rem;
    color: var(--wp--preset--color--content-muted);
    font-size: var(--wp--preset--font-size--lead);
}

.ctop-eyebrow {
    margin-bottom: var(--wp--preset--spacing--sm);
    color: var(--wp--preset--color--brand);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ctop-hero .ctop-eyebrow,
.ctop-page-hero .ctop-eyebrow,
.has-dark-background-color .ctop-eyebrow {
    color: var(--wp--preset--color--accent);
}

.ctop-hero,
.ctop-page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--wp--preset--color--surface);
    background-color: var(--wp--preset--color--dark);
}

.ctop-hero::before,
.ctop-page-hero::before {
    position: absolute;
    z-index: -1;
    width: min(42rem, 88vw);
    height: min(32rem, 76vw);
    background-image:
        linear-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 20%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--accent) 20%, transparent) 1px, transparent 1px);
    background-size: 3rem 3rem;
    content: "";
    inset: -5rem -8rem auto auto;
    mask-image: linear-gradient(135deg, rgb(0 0 0 / 90%), transparent 72%);
    transform: rotate(-8deg);
}

.ctop-hero h1,
.ctop-hero h2,
.ctop-page-hero h1 {
    color: var(--wp--preset--color--surface);
}

.ctop-hero__content,
.ctop-page-hero__content {
    max-width: 52rem;
}

.ctop-hero__copy,
.ctop-page-hero__copy {
    max-width: 46rem;
    color: var(--wp--preset--color--surface-muted);
    font-size: var(--wp--preset--font-size--lead);
}

.ctop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: var(--wp--preset--spacing--md);
}

.ctop-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.ctop-card {
    height: 100%;
    padding: var(--wp--preset--spacing--lg);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--medium);
    background: var(--wp--preset--color--surface);
    box-shadow: var(--wp--custom--shadow--small);
    transition: border-color var(--wp--custom--transition), box-shadow var(--wp--custom--transition), transform var(--wp--custom--transition);
}

.ctop-card:hover {
    border-color: var(--wp--preset--color--brand);
    box-shadow: var(--wp--custom--shadow--medium);
    transform: translateY(-3px);
}

.ctop-card h3,
.ctop-card h4 {
    margin-top: 0;
}

.ctop-card p {
    color: var(--wp--preset--color--content-muted);
}

.ctop-card__number {
    color: var(--wp--preset--color--brand);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    letter-spacing: 0.08em;
}

.ctop-link-arrow::after {
    margin-left: 0.35em;
    content: "→";
    transition: margin-left var(--wp--custom--transition);
}

.ctop-link-arrow:hover::after {
    margin-left: 0.55em;
}

.ctop-check-list {
    padding-left: 1.2rem;
}

.ctop-check-list li {
    margin-block: 0.55rem;
    padding-left: 0.25rem;
}

.ctop-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--sm);
}

.ctop-capability {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--pill);
    color: var(--wp--preset--color--dark);
    background: var(--wp--preset--color--surface);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
}

.ctop-faq {
    border-top: 1px solid var(--wp--preset--color--border);
}

.ctop-faq details {
    margin: 0;
    padding-block: var(--wp--preset--spacing--md);
    border-bottom: 1px solid var(--wp--preset--color--border);
}

.ctop-faq summary {
    min-height: 2.75rem;
    color: var(--wp--preset--color--dark);
    font-size: var(--wp--preset--font-size--lead);
    font-weight: 700;
    cursor: pointer;
}

.ctop-faq details > :not(summary) {
    max-width: 46rem;
    color: var(--wp--preset--color--content-muted);
}

.ctop-final-cta {
    border-left: 4px solid var(--wp--preset--color--brand);
    border-radius: var(--wp--custom--radius--large);
    background: var(--wp--preset--color--surface-muted);
}

.ctop-final-cta h2 {
    max-width: 42rem;
}

.ctop-footer {
    color: var(--wp--preset--color--surface-muted);
    background: var(--wp--preset--color--dark);
}

.ctop-footer h2,
.ctop-footer h3,
.ctop-footer .wp-block-site-title,
.ctop-footer a {
    color: var(--wp--preset--color--surface);
}

.ctop-footer a:hover {
    color: var(--wp--preset--color--accent);
}

.ctop-footer__descriptor {
    color: var(--wp--preset--color--accent);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ctop-footer .wp-block-navigation-item__content {
    padding-block: 0.3rem;
    text-decoration: none;
}

.ctop-footer__bottom {
    border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--surface-muted) 22%, transparent);
}

.ctop-contact-note {
    border-left: 4px solid var(--wp--preset--color--brand);
    border-radius: var(--wp--custom--radius--small);
    background: var(--wp--preset--color--surface-muted);
}

.ctop-form-shell {
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--large);
    background: var(--wp--preset--color--surface);
    box-shadow: var(--wp--custom--shadow--small);
}

.ctop-contact-form .ff-el-group {
    margin-bottom: var(--wp--preset--spacing--md);
}

.ctop-contact-form .ff-el-input--label label,
.ctop-contact-form .ff-el-form-check-label {
    color: var(--wp--preset--color--content);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
}

.ctop-contact-form :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: var(--wp--custom--radius--small);
    color: var(--wp--preset--color--content);
    background: var(--wp--preset--color--surface);
    font: inherit;
    line-height: 1.4;
}

.ctop-contact-form textarea {
    min-height: 10rem;
    resize: vertical;
}

.ctop-contact-form :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
    border-color: var(--wp--preset--color--brand);
    outline: 3px solid color-mix(in srgb, var(--wp--preset--color--brand) 24%, transparent);
    outline-offset: 1px;
}

.ctop-contact-form .ff-el-form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--wp--preset--spacing--xs);
}

.ctop-contact-form input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    margin-top: 0.18rem;
    accent-color: var(--wp--preset--color--brand);
}

.ctop-contact-form .ff-el-help-message {
    margin-top: 0.35rem;
    color: var(--wp--preset--color--content-muted);
    font-size: var(--wp--preset--font-size--caption);
}

.ctop-contact-form .ff-el-is-error :where(input, select, textarea) {
    border-color: var(--wp--preset--color--error);
}

.ctop-contact-form .text-danger,
.ctop-contact-form .error,
.ctop-contact-form .ff-el-is-error .text-danger {
    color: var(--wp--preset--color--error);
}

.ctop-contact-form .ff-btn-submit {
    min-height: 2.75rem;
    padding: 0.78rem 1.15rem;
    border: 0;
    border-radius: var(--wp--custom--radius--small);
    color: var(--wp--preset--color--surface);
    background: var(--wp--preset--color--brand);
    box-shadow: var(--wp--custom--shadow--small);
    font: inherit;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    cursor: pointer;
}

.ctop-contact-form .ff-btn-submit:hover {
    background: var(--wp--preset--color--dark);
}

.ctop-hero :where(a, button, summary):focus-visible,
.ctop-page-hero :where(a, button, summary):focus-visible,
.ctop-footer :where(a, button, summary):focus-visible {
    outline-color: var(--wp--preset--color--accent);
}

.ctop-contact-form .ff-btn-submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.ctop-contact-form .ff-message-success,
.ctop-contact-form .ff-errors-in-stack {
    padding: var(--wp--preset--spacing--md);
    border: 1px solid currentColor;
    border-radius: var(--wp--custom--radius--small);
}

.ctop-contact-form .ff-message-success {
    color: var(--wp--preset--color--success);
    background: color-mix(in srgb, var(--wp--preset--color--success) 8%, var(--wp--preset--color--surface));
}

.ctop-contact-form .ff-errors-in-stack {
    color: var(--wp--preset--color--error);
    background: color-mix(in srgb, var(--wp--preset--color--error) 7%, var(--wp--preset--color--surface));
}

@media (max-width: 860px) {
    .ctop-footer-columns {
        gap: var(--wp--preset--spacing--xl);
    }
}

@media (max-width: 600px) {
    .ctop-header .wp-block-site-title {
        font-size: 1.2rem;
    }

    .ctop-section-heading {
        margin-bottom: var(--wp--preset--spacing--lg);
    }

    .ctop-card {
        padding: var(--wp--preset--spacing--md);
    }

    .ctop-form-shell {
        padding: var(--wp--preset--spacing--md) !important;
    }

    .wp-block-buttons {
        width: 100%;
    }

    .wp-block-buttons > .wp-block-button {
        flex: 1 1 100%;
    }

    .wp-block-buttons > .wp-block-button .wp-block-button__link {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        transition-duration: 0.01ms;
    }
}
