/* =========================================================
   SNMF INFRATECH — RESPONSIVE SAFETY LAYER
   Keeps existing visual design while improving fit on all screens.
========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { width: 100%; max-width: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: clip; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { max-width: 100%; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
main, section, header, footer, nav, .container, .section-container { min-width: 0; }
p, h1, h2, h3, h4, a, span, li { overflow-wrap: anywhere; }
input, select, textarea { min-width: 0; }

/* Project portfolio cards and image consistency */
.real-projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.7vw, 24px); }
.real-project-card { min-width: 0; }
.real-project-card .project-card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #090a0a;
}
.real-project-card .project-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
}
.real-project-card .project-card-content { min-width: 0; }
.project-gallery-dialog { width: min(920px, calc(100vw - 32px)); }
.project-gallery-photo-wrap { width: 100%; min-width: 0; }
.project-gallery-photo-wrap img { max-width: 100%; max-height: 62vh; object-fit: contain; }

/* Flexible media and common two-column sections */
@media (max-width: 1100px) {
    .real-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .container, .section-container { max-width: calc(100% - 48px); }
}
@media (max-width: 767px) {
    .real-projects-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .container, .section-container { width: calc(100% - 36px); max-width: none; }
    .project-gallery-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
    .project-gallery-photo-wrap { min-height: 180px; max-height: 58dvh; padding: 38px 42px; }
    .project-gallery-photo-wrap img { max-height: 52dvh; }
    .project-gallery-nav { min-width: 34px; min-height: 34px; }
    .project-gallery-close { min-width: 38px; min-height: 38px; }
    .contact-form input, .contact-form select, .contact-form textarea { width: 100%; }
    table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 480px) {
    .container, .section-container { width: calc(100% - 28px); }
    .real-project-card .project-card-content { padding-left: 14px; padding-right: 14px; }
    .real-project-card .project-card-image { aspect-ratio: 4 / 3; }
    .project-gallery-dialog { width: calc(100vw - 16px); }
    .project-gallery-photo-wrap { padding: 34px 34px; }
    button, .btn, .projects-btn { max-width: 100%; }
}
@media (min-width: 1600px) {
    .real-projects-grid { gap: 26px; }
    .container, .section-container { max-width: min(1440px, calc(100% - 96px)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
