/* Project archive cards: image, brand, linked services, short description. */
/* Three equal units: 2+1, 1+2, then 1+1+1. Project order stays unchanged. */
body.aapo-project-list .project-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-auto-flow: row;
    align-items: stretch;
    gap: clamp(40px, 4.5vw, 72px) clamp(22px, 2.5vw, 40px) !important;
}
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project) {
    grid-column: span 1;
    min-width: 0;
    margin-top: 0 !important;
    height: 100%;
    --aapo-image-ratio: 1.6;
    --aapo-image-height: clamp(220px, 23vw, 360px);
}
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(7n + 1),
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(7n + 4) { grid-column: span 2; }
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(7n + 5),
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(7n + 6),
body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(7n + 7) { --aapo-image-height: clamp(190px, 19vw, 290px); }
body.aapo-project-list .elementor article.project {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: 100%;
    padding: 16px !important;
    margin: 0 !important;
    border: 1px solid #d8d8d8;
    border-radius: 22px;
    background: #fff;
    box-shadow: none;
    box-sizing: border-box;
    min-width: 0;
}
body.aapo-project-list article.project > .project-image {
    order: 0;
    width: 100%;
    margin: 0 0 24px !important;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: var(--aapo-image-ratio, 1.6) !important;
    height: var(--aapo-image-height, auto) !important;
    flex-shrink: 0;
}
body.aapo-project-list article.project .project-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
body.aapo-project-list article.project .project-image > .elementor-widget-image,
body.aapo-project-list article.project .project-image .elementor-widget-container {
    width: 100%;
    height: 100%;
}
body.aapo-project-list article.project > .project-title,
body.aapo-project-list article.project > .elementor-widget-heading {
    order: 1;
    margin: 0 0 14px !important;
    padding: 0 !important;
    min-height: 0;
}
body.aapo-project-list article.project > .project-title:not(:has(h3)) { display: none !important; }
body.aapo-project-list article.project h3.elementor-heading-title,
body.aapo-project-list article.project h3.elementor-heading-title a {
    margin: 0;
    font-size: clamp(26px, 2.5vw, 34px) !important;
    line-height: 1.2 !important;
    font-weight: 500;
    color: #111;
    text-decoration: none;
}
body.aapo-project-list article.project > .elementor-widget-aael-dynamic {
    order: 2;
    margin: 0 0 18px !important;
}
body.aapo-project-list article.project .tags,
.aapo-detail-intro .aapo-detail-tags p {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin: 0 !important;
    padding: 0;
}
body.aapo-project-list article.project .tags a,
.aapo-detail-intro .aapo-detail-tags a {
    display: inline-block;
    padding: 7px 13px;
    margin: 0;
    border: 1px solid #d8d8d8 !important;
    border-radius: 999px;
    font-size: 14px !important;
    line-height: 1.35;
    font-weight: 400;
    color: #686868;
    background: #fff;
    text-decoration: none !important;
    white-space: normal;
    transition: color .15s ease, border-color .15s ease;
}
body.aapo-project-list article.project .tags a:hover,
.aapo-detail-intro .aapo-detail-tags a:hover {
    color: #111;
    border-color: #777 !important;
}
body.aapo-project-list article.project .tags a:focus-visible,
.aapo-detail-intro .aapo-detail-tags a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
body.aapo-project-list article.project > .project-description {
    order: 3;
    margin: 0 0 4px !important;
    padding: 0;
    font-size: 18px;
    line-height: 1.6;
    color: #656565;
    max-width: none;
}
/* Project detail opening: identity on the left, original intro on the right. */
body.single-aa_project #main { background: #fff; }
.elementor .aapo-detail-intro,
.aapo-detail-intro {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    align-items: start;
    column-gap: clamp(36px, 5vw, 100px);
    padding-top: clamp(36px, 5vw, 76px);
    padding-bottom: clamp(42px, 6vw, 96px);
    margin-top: 0;
    margin-bottom: 0;
    background: #fff;
}
.aapo-detail-intro .aapo-detail-identity,
.aapo-detail-intro .aapo-detail-description { min-width: 0; }
.aapo-detail-intro .aapo-detail-identity h1 {
    font-size: clamp(36px, 4vw, 64px) !important;
    line-height: 1.1 !important;
    letter-spacing: -.035em;
    color: #080808;
    font-weight: 500 !important;
    margin: 0 0 36px !important;
}
.aapo-detail-intro .aapo-detail-tags {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}
.aapo-detail-intro .aapo-detail-description {
    padding-top: clamp(8px, 2.8vw, 48px);
}
.aapo-detail-intro .aapo-detail-description > * {
    margin: 0 0 16px !important;
    max-width: none !important;
    width: 100% !important;
}
.aapo-detail-intro .aapo-detail-description p {
    font-size: clamp(19px, 1.65vw, 26px) !important;
    line-height: 1.5 !important;
    font-weight: 400;
    letter-spacing: -.015em;
    color: #111;
    margin: 0 0 16px !important;
}
@media (max-width: 767px) {
    body.aapo-project-list .elementor article.project { padding: 12px !important; border-radius: 18px; }
    body.aapo-project-list article.project > .project-image { margin-bottom: 20px !important; border-radius: 11px; }
    body.aapo-project-list article.project > .project-description { font-size: 16px; }
    body.aapo-project-list article.project .tags a,
    .aapo-detail-intro .aapo-detail-tags a { font-size: 12px !important; padding: 6px 10px; }
    .elementor .aapo-detail-intro, .aapo-detail-intro { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
    .aapo-detail-intro .aapo-detail-identity h1 { margin-bottom: 24px !important; }
    .aapo-detail-intro .aapo-detail-description { padding-top: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    body.aapo-project-list .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 40px 24px !important; }
    body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(n) { grid-column: span 1; --aapo-image-height: auto; --aapo-image-ratio: 1.5; }
}
@media (max-width: 767px) {
    body.aapo-project-list .project-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 32px !important; }
    body.aapo-project-list .project-grid > :is(.e-loop-item, article.project):nth-child(n) { grid-column: auto; --aapo-image-height: auto; --aapo-image-ratio: 1.5; }
}

/* Project detail spacing and typography. */
body.single-aa_project :is(.aa-migration-content, .aa-prose) {
    gap: 0 !important;
    padding-top: 0 !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) > * + * {
    margin-top: clamp(72px, 7vw, 112px) !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) > :is(h2,h3,.wp-block-heading) + :is(p,.wp-block-paragraph),
body.single-aa_project :is(.aa-migration-content, .aa-prose) > :is(p,.wp-block-paragraph) + :is(p,.wp-block-paragraph) {
    margin-top: 26px !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-columns {
    column-gap: clamp(40px, 7vw, 104px) !important;
    row-gap: 48px !important;
    align-items: center;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-column {
    min-width: 0;
    row-gap: 26px !important;
}
/* Migrated Elementor containers render these columns as stacked blocks. */
body.single-aa_project .elementor :is(.aa-migration-content, .aa-prose) .aael-box.wp-block-columns > .wp-block-column + .wp-block-column {
    margin-top: 48px !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-column > :is(.wp-block-image,.wp-block-video) + *,
body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-column > * + :is(.wp-block-image,.wp-block-video) {
    margin-top: 48px !important;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) h2 {
    font-size: clamp(34px, 3.6vw, 54px) !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    letter-spacing: -.035em !important;
    color: #141414;
    margin: 0 0 26px !important;
    overflow-wrap: break-word;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) :is(p,li) {
    font-size: clamp(17px, 1.25vw, 19px) !important;
    font-weight: 400;
    line-height: 1.8 !important;
    color: #555;
}
body.single-aa_project :is(.aa-migration-content, .aa-prose) p { margin: 0 0 22px; }
/* Quote link next to the existing arrow. */
.contact-cta .cta-row.aapo-has-quote {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 32px;
}
.contact-cta .cta-row.aapo-has-quote > .elementor-widget-heading {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
}
.contact-cta .aapo-cta-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    flex: 0 0 auto;
    margin-left: auto;
}
.contact-cta .aapo-cta-actions > .cta-circle:not(a) {
    border: 0 !important;
    background: none !important;
    padding: 0 !important;
}
.contact-cta .aapo-quote-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    padding: 16px 30px;
    border: 1px solid #fff;
    border-radius: 999px;
    color: var(--blue,#204de3) !important;
    background: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background .2s ease, color .2s ease;
}
.contact-cta .aapo-quote-button:hover { color: #fff !important; background: transparent; }
.contact-cta .aapo-quote-button:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
@media (max-width: 767px) {
    body.single-aa_project :is(.aa-migration-content, .aa-prose) > * + * { margin-top: 56px !important; }
    body.single-aa_project :is(.aa-migration-content, .aa-prose) > :is(h2,h3,.wp-block-heading) + :is(p,.wp-block-paragraph),
    body.single-aa_project :is(.aa-migration-content, .aa-prose) > :is(p,.wp-block-paragraph) + :is(p,.wp-block-paragraph) { margin-top: 20px !important; }
    body.single-aa_project :is(.aa-migration-content, .aa-prose) h2 { font-size: clamp(28px, 7.8vw, 34px) !important; margin-bottom: 20px !important; }
    body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-columns { row-gap: 36px !important; }
    body.single-aa_project .elementor :is(.aa-migration-content, .aa-prose) .aael-box.wp-block-columns > .wp-block-column + .wp-block-column,
    body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-column > :is(.wp-block-image,.wp-block-video) + *,
    body.single-aa_project :is(.aa-migration-content, .aa-prose) .wp-block-column > * + :is(.wp-block-image,.wp-block-video) { margin-top: 36px !important; }
    .contact-cta .cta-row.aapo-has-quote { flex-direction: column !important; align-items: flex-start !important; gap: 28px; }
    .contact-cta .aapo-cta-actions { margin-left: 0; gap: 18px; }
    .contact-cta .aapo-quote-button { min-height: 54px; padding: 14px 26px; font-size: 17px; }
}
