.serm-home-hero { padding: 145px 0 70px; }
.serm-refreshed-home h1 { font-size: clamp(34px,4.2vw,60px); line-height: 1.15; margin: 0 0 24px; }
.serm-refreshed-home p { font-family: var(--font-primary,sans-serif); line-height: 1.8; }
.serm-hero-position { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.serm-hero-intro { font-size: 18px; }
.serm-hero-portrait, .serm-about-portrait { width: 100%; height: auto; border-radius: 10px; }
.serm-about-portrait { max-height: 620px; object-fit: cover; }
.serm-home-actions { display: flex; flex-wrap: wrap; gap: 15px; margin: 28px 0; }
.serm-home-actions .rn-btn { text-align: center; margin: 0; font-size: 14px; padding: 17px 22px; }
.serm-home-social .social-icone { display: flex; gap: 20px; margin-top: 15px; }
.serm-home-social .social-icone a { display: inline-flex; padding: 12px; }
.serm-refreshed-home .rn-service { width: 100%; height: 100%; }
.serm-refreshed-home .rn-service h3 { font-size: 23px; line-height: 1.4; margin: 0 0 14px; }
.serm-refreshed-home .rn-service p { font-size: 16px; margin-bottom: 18px; }
.serm-project-card { display: flex; flex-direction: column; }
.serm-project-logo { height: 90px; margin-bottom: 24px; }
.serm-project-logo img { width: 100%; max-width: 230px; height: 100%; object-fit: contain; object-position: left center; }
.serm-project-card .serm-project-role { font-size: 14px; font-weight: 600; }
.serm-project-link { margin-top: auto; display: inline-block; font-size: 15px; font-weight: 600; }
.serm-expertise-card > img { display: block; width: 76px; height: 76px; object-fit: contain; margin-bottom: 24px; }
.serm-refreshed-home .serm-expertise-card h3 { font-size: 20px; }
.serm-refreshed-home .serm-collaboration { display: flex; gap: 28px; align-items: flex-start; height: auto; margin-top: 32px; }
.serm-collaboration > img { flex: 0 0 76px; width: 76px; height: 76px; }
.serm-collaboration .rn-btn { display: inline-block; height: auto; line-height: 1.5; padding: 16px 24px; text-align: center; }
.serm-contact-name { font-size: 25px; margin-top: 20px; }
.white-version .serm-refreshed-home h1, .white-version .serm-refreshed-home h3, .white-version .serm-refreshed-home p { color: var(--color-body-white,#3c3e41); }
.white-version .serm-refreshed-home .serm-project-link { color: var(--color-primary,#446f80); }
.white-version .serm-refreshed-home .rn-service:hover h3, .white-version .serm-refreshed-home .rn-service:hover p, .white-version .serm-refreshed-home .rn-service:hover .serm-project-link { color: #fff; }
@media(max-width:991px){
    .serm-home-hero { padding: 110px 0 50px; }
    .serm-hero-portrait { display: block; max-width: 480px; max-height: 520px; object-fit: contain; margin: 0 auto 32px; }
    .serm-about-portrait { display: block; max-width: 420px; margin: 0 auto 32px; }
    .serm-hero-position { font-size: 18px; }
    .serm-home-actions .rn-btn { flex: 1 1 200px; }
}
@media(max-width:575px){
    .serm-refreshed-home h1 { font-size: 34px; }
    .serm-refreshed-home .serm-collaboration { display: block; }
    .serm-collaboration > img { margin-bottom: 20px; }
    .serm-home-actions { flex-direction: column; }
    .serm-home-actions .rn-btn { flex: auto; }
    .serm-refreshed-home .rn-service { padding: 26px 22px; }
    .serm-collaboration .rn-btn { width: 100%; }
    .serm-refreshed-home #contacts .mail a { overflow-wrap: anywhere; }
}

/* Keep Bootstrap gutters within the viewport, including the existing header. */
.serm-refreshed-home .container > .row { margin-left: 0; margin-right: 0; }
.rn-header .header-wrapper.row { margin-left: 0 !important; margin-right: 0 !important; width: 100%; }
@media(max-width:1199px){
    .rn-header .header-wrapper .header-center { margin-left: 0 !important; }
    .rn-header .header-right { width: auto; margin: 0; padding-right: 0; justify-content: flex-end; }
}
@media(max-width:575px){
    .footer-area { flex-direction: column; align-items: center; text-align: center; }
    .footer-area p { max-width: 100%; overflow-wrap: anywhere; }
}

.white-version .serm-home-social .social-icone a { color: var(--color-body-white,#3c3e41); }
@media(max-width:1199px){
    .rn-header .header-wrapper > .col-lg-2.col-6 { flex: 1 1 auto; width: auto; max-width: calc(100% - 65px); }
    .rn-header .header-wrapper > .col-lg-10.col-6 { flex: 0 0 65px; width: 65px; max-width: 65px; }
}

.serm-project-page .section-title-features { margin-bottom: 40px; }
.serm-project-page h1 { font-size: clamp(30px,4vw,52px); line-height: 1.3; color: var(--color-body-white,#3c3e41); }
.serm-project-body { max-width: 1000px; margin: 0 auto; }
.serm-project-body p { font-family: var(--font-primary,sans-serif); line-height: 1.8; }
.serm-project-section + .serm-project-section { margin-top: 30px; }
.serm-project-page .features-gallery-wrapper { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 25px; }
.serm-project-page .features-gallery-img { width: calc(50% - 10px); height: auto; object-fit: contain; }
@media(max-width:575px){ .serm-project-page .features-gallery-img { width: 100%; } }

/* Project text used to inherit this color from .features-card.client-card a. */
.serm-project-page .serm-project-body a {
    color: var(--color-primary, #446f80);
    overflow-wrap: anywhere;
}
.serm-project-page .serm-project-body a:hover,
.serm-project-page .serm-project-body a:focus-visible {
    color: var(--color-body-white, #3c3e41);
    text-decoration: underline;
}
.serm-project-page .serm-project-body a:focus-visible {
    outline: 2px solid var(--color-primary, #446f80);
    outline-offset: 3px;
}

/* Compact project header, one shared gallery, and editor-safe CTA buttons. */
.serm-project-page .section-title-features { max-width: 1000px; margin-left: auto; margin-right: auto; }
.serm-project-page h1 { font-size: clamp(28px,3.2vw,42px); overflow-wrap: break-word; }
.serm-project-page .serm-project-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin: 28px 0 0; }
.serm-project-page .serm-project-gallery .features-gallery-img { display: block; width: 100%; max-width: 100%; height: auto; margin: 0; border-radius: 10px; }
.serm-project-page .serm-project-body a[style*="inline-flex"] {
    display: inline-flex !important; box-sizing: border-box; align-items: center !important;
    justify-content: center !important; height: 48px !important; min-height: 48px !important;
    padding: 0 24px !important; margin: 0 !important; line-height: 1.3 !important;
    font-size: 14px !important; vertical-align: middle; white-space: nowrap;
}
.serm-project-page .serm-project-body a[style*="inline-flex"] br { display: none; }
.serm-project-page .serm-project-body div[style*="display:flex"] { align-items: center; }
.serm-project-page .serm-project-body div[style*="display:flex"] > p { margin: 0; line-height: 1; }
@media(max-width:575px){
    .serm-project-page .serm-project-gallery { grid-template-columns: minmax(0,1fr); gap: 18px; }
}

/* Contact Form 7: stable validation slots and localized status cards. */
#contacts .contact-form-wrapper { --serm-field-error-space: 40px; }
#contacts .contact-form-wrapper .form-group { margin-bottom: 10px; }
#contacts .contact-form-wrapper .form-group > label {
    display: block; min-height: 36px; margin-bottom: 8px;
    color: #3c3e41; font-size: 12px; line-height: 1.5; letter-spacing: .6px;
}
#contacts .contact-form-wrapper .wpcf7-form-control-wrap {
    position: relative; display: block; padding-bottom: var(--serm-field-error-space);
}
#contacts .contact-form-wrapper input[type="text"],
#contacts .contact-form-wrapper input[type="email"],
#contacts .contact-form-wrapper input[type="tel"],
#contacts .contact-form-wrapper textarea {
    box-sizing: border-box; width: 100%; max-width: 100%; margin: 0;
    border: 1px solid #ccd3d9; border-radius: 8px;
    background: #fdfefe; color: #303438; box-shadow: none;
    font-family: var(--font-primary,sans-serif); font-size: 15px; letter-spacing: 0;
    transition: border-color .2s, box-shadow .2s;
}
#contacts .contact-form-wrapper input[type="text"],
#contacts .contact-form-wrapper input[type="email"],
#contacts .contact-form-wrapper input[type="tel"] { height: 52px; padding: 0 15px; }
#contacts .contact-form-wrapper textarea { display: block; height: 170px; min-height: 170px; padding: 14px 15px; resize: vertical; line-height: 1.6; }
#contacts .contact-form-wrapper input::placeholder,
#contacts .contact-form-wrapper textarea::placeholder { color: #737d86; opacity: 1; font-size: 14px; }
#contacts .contact-form-wrapper input:focus,
#contacts .contact-form-wrapper textarea:focus { border-color: #446f80; outline: none; box-shadow: 0 0 0 3px rgba(68,111,128,.13); }
#contacts .contact-form-wrapper .wpcf7-form-control.wpcf7-not-valid { border-color: #b83e45; }
#contacts .contact-form-wrapper .wpcf7-not-valid-tip {
    position: absolute; top: calc(100% - var(--serm-field-error-space) + 6px); left: 0; right: 0;
    margin: 0; color: #a6343b; font-family: var(--font-primary,sans-serif);
    font-size: 12px; line-height: 1.4; overflow-wrap: anywhere;
}
#contacts .contact-form-wrapper input[type="submit"].rn-btn {
    display: block; box-sizing: border-box; width: 100%; height: 52px;
    margin: 0; padding: 0 45px; border: 1px solid #1a1c1b;
    border-radius: 8px; background: #1a1c1b; color: #fff;
    font-size: 14px; line-height: normal; letter-spacing: .3px; box-shadow: none;
}
#contacts .contact-form-wrapper input[type="submit"].rn-btn:hover { background: #446f80; border-color: #446f80; color: #fff; }
#contacts .contact-form-wrapper input[type="submit"].rn-btn:focus-visible { outline: 2px solid #446f80; outline-offset: 4px; }
#contacts .rnt-contact-form > .col-lg-12:last-child { position: relative; }
#contacts .contact-form-wrapper .wpcf7-spinner { position: absolute; top: 14px; right: 25px; margin: 0; }
#contacts .contact-form-wrapper .wpcf7 form .wpcf7-response-output {
    display: block !important; box-sizing: border-box;
    height: 96px; min-height: 96px; max-height: 96px;
    margin: 16px 0 0; padding: 12px 16px; border: 0 !important; border-radius: 8px;
    background: transparent; color: #8f3037; font-family: var(--font-primary,sans-serif);
    font-size: 14px; line-height: 1.5; overflow: auto; overflow-wrap: anywhere;
    visibility: hidden;
}
#contacts .contact-form-wrapper .wpcf7 form:not(.init):not(.submitting):not(.resetting) .wpcf7-response-output:not(:empty) {
    visibility: visible; background: #fbecee;
}
#contacts .contact-form-wrapper .wpcf7 form.sent:not(.init):not(.submitting):not(.resetting) .wpcf7-response-output { background: #eaf3ee; color: #235d40; }
@media(max-width:575px){
    #contacts .contact-form-wrapper { --serm-field-error-space: 48px; padding: 24px 20px; }
    #contacts .contact-form-wrapper .form-group > label { min-height: 22px; }
    #contacts .contact-form-wrapper .wpcf7 form .wpcf7-response-output { font-size: 13px; padding: 10px 12px; }
}

#contacts .contact-form-wrapper .wpcf7 form:not(.init):not(.submitting):not(.resetting) .wpcf7-response-output:not(:empty) {
    background: #e2e8ec;
    color: #3c3e41;
}
/* Article title and metadata: scoped away from project pages and home cards. */
.serm-single-post .single-blog > h1.title {
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.25;
    margin: 0 0 18px;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
}
.serm-single-post .serm-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 24px;
    color: #52616b;
    font-size: 14px;
    line-height: 1.6;
}
.serm-single-post .post-read-more-title { margin-top: 0; padding-top: 40px; }
@media (max-width: 575px) {
    .serm-single-post .single-blog > h1.title { font-size: 28px; }
    .serm-single-post .single-blog { padding-left: 8px; padding-right: 8px; }
    .serm-single-post .post-read-more-title { font-size: 28px; line-height: 1.3; }
}

/* Shared container edges: cards line up with their section headings. */
.serm-refreshed-home .container > .serm-project-grid,
.serm-refreshed-home .container > .serm-expertise-grid {
    display: grid; margin: 0; width: 100%; gap: 30px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 30px;
}
.serm-refreshed-home .container > .serm-expertise-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.serm-project-grid > div, .serm-expertise-grid > div {
    width: 100%; max-width: none; min-width: 0; padding: 0; margin: 0 !important;
}
.serm-refreshed-home .rn-service { padding: 50px; }
.serm-refreshed-home #about p { font-size: 18px; }
.serm-project-logo a { display: block; width: 100%; height: 100%; }
.serm-project-title-link { color: inherit; font: inherit; text-decoration: none; }
.serm-project-card:hover .serm-project-title-link { color: inherit; }
.serm-project-card .serm-project-link { align-self: flex-start; }
.serm-project-logo a:focus-visible, .serm-project-title-link:focus-visible { outline: 2px solid #446f80; outline-offset: 5px; }

/* Neumorphic controls use the site's existing gradient and shadow tokens. */
.serm-refreshed-home a.rn-btn,
.serm-forum .serm-forum__button,
.serm-project-page .serm-project-body a[style*="inline-flex"],
.serm-single-post .news-details a[style*="background"],
#contacts .contact-form-wrapper input[type="submit"].rn-btn {
    display: inline-flex !important; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; height: auto !important; padding: 15px 24px !important;
    border: 0 !important; border-radius: 6px !important;
    background: var(--gradient-box-w, linear-gradient(145deg, #e2e8ec, #fff)) !important;
    box-shadow: var(--shadow-white-3, 5px 5px 15px #d1d9e6, -5px -5px 15px #fff) !important;
    color: #446f80 !important; font-family: var(--font-primary, sans-serif);
    font-size: 14px !important; font-weight: 500; line-height: 1.5 !important;
    text-decoration: none !important; text-align: center; white-space: normal !important;
    transition: transform .2s, background .2s, color .2s, box-shadow .2s;
}
.serm-refreshed-home a.rn-btn::before { display: none; }
.serm-refreshed-home a.rn-btn:hover,
.serm-forum .serm-forum__button:hover,
.serm-project-page .serm-project-body a[style*="inline-flex"]:hover,
.serm-single-post .news-details a[style*="background"]:hover,
#contacts .contact-form-wrapper input[type="submit"].rn-btn:hover {
    background: linear-gradient(145deg, #4d7b8d, #06202a) !important;
    color: #fff !important; opacity: 1; transform: translateY(-3px);
}
.serm-refreshed-home a.rn-btn:focus-visible,
.serm-forum .serm-forum__button:focus-visible,
.serm-project-page .serm-project-body a[style*="inline-flex"]:focus-visible,
.serm-single-post .news-details a[style*="background"]:focus-visible {
    outline: 2px solid #446f80; outline-offset: 4px;
}
#contacts .contact-form-wrapper input[type="submit"].rn-btn { display: block !important; width: 100%; height: 52px !important; padding: 0 24px !important; }
@media (min-width: 576px) and (max-width: 991px) {
    .serm-refreshed-home .container > .serm-expertise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .serm-refreshed-home .rn-service { padding: 32px; }
}
@media (max-width: 575px) {
    .serm-refreshed-home .container > .serm-project-grid,
    .serm-refreshed-home .container > .serm-expertise-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .serm-refreshed-home .rn-service { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .serm-refreshed-home a.rn-btn, .serm-forum .serm-forum__button { transition: none; }
}

/* Project galleries fill each column; override the legacy 275px height cap. */
.serm-project-page .serm-project-gallery .features-gallery-img {
    width: 100%; max-width: 100%; min-width: 0;
    height: auto; max-height: none;
    aspect-ratio: 3 / 2;
    object-fit: cover; object-position: center;
    border-radius: 10px;
}
