/* Single scale for atelier components, including legacy Elementor widgets. */
:root {
    --ao-hero-title-size: clamp(2rem, 1.25rem + 2.5vw, 3.5rem);
    --ao-title-size: clamp(1.75rem, 1.25rem + 2vw, 3rem);
    --ao-work-title-size: clamp(1.75rem, 1.375rem + 1.25vw, 2.5rem);
    --ao-heading-line: 1.22;
    --ao-heading-size: clamp(1.5rem, 1.125rem + 1.25vw, 2.25rem);
    --ao-subheading-size: clamp(1.25rem, 1.125rem + .5vw, 1.5rem);
    --ao-contact-title-size: clamp(1.5rem, 1rem + 1.5625vw, 2rem);
    --ao-body-size: 18px;
    --ao-section-space: 32px;
    --ao-content-start: 20px;
    --ao-stack-gap: 16px;
    --ao-grid-gap: 24px;
    --ao-cta-gap: 24px;
    --ao-phone-size: 24px;
    --ao-dialog-padding: 32px;
}

.ao-page h1, .ao-work-detail h1,
.ao-page .elementor-widget-heading h1.elementor-heading-title {
    font-size: var(--ao-title-size) !important;
    line-height: 1.15 !important;
    letter-spacing: -.015em;
    margin-block: 0;
}
.ao-page.ao-hero h1, .ao-page.ao-hero .elementor-widget-heading h1.elementor-heading-title,
.ao-page .ao-hero h1 { font-size: var(--ao-hero-title-size) !important; max-width: 22ch; }
.ao-work-detail h1 { font-size: var(--ao-work-title-size) !important; line-height: 1.2 !important; letter-spacing: -.01em; }
.ao-page h2, .ao-work-detail h2,
.ao-page .elementor-widget-heading h2.elementor-heading-title {
    font-size: var(--ao-heading-size) !important;
    line-height: var(--ao-heading-line) !important;
    letter-spacing: -.01em;
    margin-block: 0;
}
.ao-page h3, .ao-portfolio h3,
.ao-page .elementor-widget-heading h3.elementor-heading-title {
    font-size: var(--ao-subheading-size) !important;
    line-height: 1.3 !important;
    letter-spacing: 0;
    margin-block: 0 12px;
}
.ao-page p, .ao-work-detail p,
.ao-page .elementor-widget-text-editor {
    font-size: var(--ao-body-size);
    line-height: 1.65;
}
.ao-page p, .ao-work-detail p { margin-block: 0 16px; }
.ao-page p:last-child, .ao-work-detail p:last-child { margin-bottom: 0; }
.ao-page .ao-eyebrow, .ao-work-detail .ao-eyebrow { margin-bottom: 8px; }

.ao-section { padding: var(--ao-section-space) max(var(--ao-gutter), calc((100% - 1280px) / 2)); }
.ao-page.elementor-element.ao-section, .ao-page.elementor-element.ao-hero {
    padding: var(--ao-section-space) max(var(--ao-gutter), calc((100% - 1280px) / 2)) !important;
    min-height: 0 !important;
    gap: var(--ao-stack-gap);
    --row-gap: var(--ao-stack-gap);
    --column-gap: var(--ao-grid-gap);
}
.ao-page.elementor-element.ao-section:has(h1) { padding-block: 32px !important; }
.ao-page.ao-section:has(h1) + .ao-section { padding-top: var(--ao-content-start) !important; }
.ao-hero { min-height: 0; padding: var(--ao-section-space) max(var(--ao-gutter), calc((100% - 1280px) / 2)); }
.ao-hero-copy.elementor-element {
    padding: 0 !important;
    gap: var(--ao-stack-gap);
    --row-gap: var(--ao-stack-gap);
    width: 100% !important;
    max-width: 680px !important;
}
.ao-page .elementor-widget { min-width: 0; margin-block: 0 !important; }
/* Normal block flow lets aspect-ratio cards contribute their complete height. */
.ao-page.elementor-element.ao-section:has(.ao-portfolio) { display: block !important; }
.ao-page.ao-section:has(.ao-portfolio) > .elementor-element:not(:last-child) { margin-bottom: var(--ao-stack-gap) !important; }
.ao-page .elementor-widget-ao-portfolio,
.ao-page .elementor-widget-ao-portfolio > .elementor-widget-container,
.ao-page.ao-section:has(.ao-portfolio) > .elementor-widget,
.ao-page.ao-section:has(.ao-portfolio) > .elementor-widget > .elementor-widget-container { height: auto !important; }
.ao-page.ao-editor-split { display: grid !important; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 48px; }
.ao-editor-split > .ao-section-title, .ao-editor-split > .ao-section-copy { width: 100% !important; min-width: 0; }
.ao-page.elementor-element.ao-section:has(.ao-portfolio), .ao-work-detail .ao-gallery-section {
    padding-inline: max(var(--ao-gutter), calc((100% - 1440px) / 2)) !important;
}
.ao-faq { max-width: 800px; }
.ao-actions { margin-top: var(--ao-stack-gap); gap: 12px; }
.ao-category-grid, .ao-step-grid, .ao-material-grid { gap: var(--ao-grid-gap); }
.ao-category, .ao-step, .ao-material { padding: 24px; }
.ao-faq details { padding-block: 16px; }
.ao-faq summary { font-size: var(--ao-body-size); }
.ao-section.ao-cta { padding-block: var(--ao-section-space); gap: var(--ao-cta-gap); }
.ao-page.ao-cta h2, .ao-work-detail .ao-cta h2,
.ao-page.ao-cta .elementor-widget-heading h2.elementor-heading-title {
    font-size: var(--ao-contact-title-size) !important;
    line-height: 1.25 !important;
    margin: 0;
}
.ao-portfolio { gap: var(--ao-grid-gap); --ao-gap: var(--ao-grid-gap); }
.ao-work-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, calc((100% - (var(--ao-columns) - 1) * var(--ao-gap)) / var(--ao-columns))), 1fr));
}
.ao-work-grid:has(> .ao-work-card:only-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ao-work-card { min-width: 0; }
.ao-card-caption { padding: 16px 28px 16px 0; }
.ao-card-caption h3 { margin: 0; font-size: 22px !important; }
.ao-card-caption .ao-eyebrow { font-size: 12px !important; line-height: 1.5 !important; letter-spacing: .06em; color: #716253; }
.ao-card-arrow { top: 20px; }
.ao-result-count { margin: 0 0 12px !important; }
.ao-active-filters { font-size: 14px !important; line-height: 1.5 !important; margin: 0 0 8px !important; }
.ao-results-reset { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 12px; }
.ao-filters { padding: 20px; }
.ao-filters summary { line-height: 1.5; }
.ao-filters label { margin-bottom: 16px; line-height: 1.5; }
.ao-filters select { line-height: 1.4; }
.ao-header-phone { font-size: 20px; line-height: 1.4; }
.ao-managed #colophon .site-primary-footer-wrap {
    padding: var(--ao-section-space) var(--ao-gutter) !important;
}
.ao-managed #colophon .site-primary-footer-inner-wrap { min-height: 0; row-gap: 12px; align-items: center; }
.ao-managed #colophon .site-footer-section,
.ao-managed #colophon .ast-footer-html-1 { margin: 0; }

/* Contact uses the same scale with space reserved for the close control. */
.ao-contact-dialog {
    padding: var(--ao-dialog-padding);
    width: min(680px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
}
.ao-contact-dialog h2 {
    font-size: var(--ao-contact-title-size);
    line-height: 1.25;
    margin: 0 44px 16px 0;
}
.ao-contact-dialog .ao-dialog-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--ao-brown);
    font: 28px/44px var(--ao-sans);
}
.ao-contact-dialog .ao-dialog-close:hover,
.ao-contact-dialog .ao-dialog-close:focus { background: #f1ebe2; color: var(--ao-brown); }
.ao-contact-content { min-width: 0; }
.ao-contact-content .ao-contact-phone {
    display: block;
    font-size: var(--ao-phone-size);
    line-height: 1.4;
    margin: 0 0 8px;
    letter-spacing: 0;
    white-space: nowrap;
}
.ao-contact-content > p { margin: 0; font: 16px/1.6 var(--ao-sans); overflow-wrap: anywhere; }
.ao-contact-content .wpcf7 { margin-top: 24px; }
.ao-contact-content .wpcf7-form { display: grid; gap: 16px; }
.ao-contact-content .wpcf7-form > p { margin: 0; }
.ao-contact-content .wpcf7-form > p:has(> label) { display: grid; gap: 16px; }
.ao-contact-content .wpcf7-form > br,
.ao-contact-content .wpcf7-form > p > br,
.ao-contact-content .wpcf7-form > p:empty,
.ao-contact-content .wpcf7-response-output:empty { display: none; }
.ao-contact-content label { margin: 0; font: 500 14px/1.5 var(--ao-sans); }
.ao-contact-content input:not([type=submit]):not([type=hidden]),
.ao-contact-content textarea { margin-top: 8px; padding: 12px; line-height: 1.5; min-width: 0; }
.ao-contact-content textarea { min-height: 120px; height: 140px; }
.ao-contact-content .ao-upload { margin: 0; }
.ao-contact-content .ao-upload p { margin: 8px 0 0; }
.ao-contact-content .ao-file-list:empty { display: none; }
.ao-contact-content input[type=submit] { background: #38271e; color: #fff; border: 1px solid #38271e; border-radius: 2px; font: 600 14px/1.4 var(--ao-sans); min-height: 48px; padding: 12px 24px; }
.ao-contact-content input[type=submit]:hover { background: #5b3d2b; color: #fff; }
.ao-contact-content .ao-privacy-note { font-size: 14px !important; line-height: 1.5 !important; }
.ao-page h4 { font-size: 20px; line-height: 1.35; letter-spacing: 0; }
.ao-page h5 { font-size: 18px; line-height: 1.4; letter-spacing: 0; }
.ao-page h6 { font-size: 16px; line-height: 1.4; letter-spacing: 0; }
.ao-404 h1 { font-size: clamp(2rem, 1.25rem + 2vw, 3rem) !important; }
@media (max-width: 1024px) {
    .ao-page.ao-editor-split { grid-template-columns: minmax(0,1fr); gap: 20px; }
    .ao-page.elementor-element.ao-section:has(h1) { padding-block: 28px !important; }
    .ao-work-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 599px) {
    .ao-work-grid, .ao-work-grid:has(> .ao-work-card:only-child) { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 479px) {
    .ao-actions { flex-direction: column; align-items: stretch; gap: 12px; }
    .ao-actions .ao-button { width: 100%; white-space: normal; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    :root { --ao-grid-gap: 20px; --ao-phone-size: 22px; --ao-dialog-padding: 24px; }
    .ao-header-phone { font-size: 18px; }
    .ao-card-caption h3 { font-size: 20px !important; }
}
@media (max-width: 1024px) {
    .ao-filters { margin-bottom: 20px; }
    .ao-filters label { margin: 0; }
}
@media (max-width: 767px) {
    :root {
        --ao-body-size: 16px;
        --ao-section-space: 28px;
        --ao-content-start: 14px;
        --ao-stack-gap: 12px;
        --ao-grid-gap: 16px;
        --ao-cta-gap: 20px;
        --ao-phone-size: 20px;
        --ao-dialog-padding: 20px;
    }
    .ao-card-caption h3 { font-size: 20px !important; }
    .ao-page.elementor-element.ao-section:has(h1) { padding-block: 24px !important; }
    .ao-page h4 { font-size: 18px; }
    .ao-page h5 { font-size: 17px; }
    .ao-header-phone { font-size: 18px; }
    .ao-category, .ao-step, .ao-material, .ao-filters { padding: 16px; }
    .ao-contact-content .wpcf7 { margin-top: 20px; }
}
