/* Shared fluid layout, loaded after page-specific styles. */
html{box-sizing:border-box;-webkit-text-size-adjust:100%;scroll-padding-top:110px}
*,*::before,*::after{box-sizing:inherit}
body{min-width:0;margin:0}
img,video,iframe,svg{max-width:100%}
img{height:auto}
input,select,textarea,button{max-width:100%;font-family:inherit}
main,section,article,aside,.container,.wrap,.comments-list-wrap{min-width:0}
p,h1,h2,h3,h4,address,a,summary{overflow-wrap:break-word}
.comments-section .comment-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.comments-section .comment-header{flex-wrap:wrap}
.comments-section .comments-layout>*{min-width:0}
.work-dialog{max-width:calc(100vw - 20px);max-height:92vh;max-height:92dvh}
:focus-visible{outline:3px solid #d19120;outline-offset:3px}
@media(max-width:600px){
 .comments-section .comment-form-grid{grid-template-columns:1fr}
 .comments-section .comment-form-head,.comments-section .comment-form-actions{flex-direction:column;align-items:stretch}
 .comments-section .comment-header{flex-direction:column;align-items:flex-start}
 .comments-section .comment-date{white-space:normal}
 .comments-section .comment-form-card{padding:18px 14px}
 input,select,textarea{font-size:16px}
 .real-work-grid,.brand-service-content .real-work-grid{grid-template-columns:minmax(0,1fr)!important}
 .showcase-rail:not(#brands .showcase-rail){grid-auto-columns:100%;gap:14px}
 .price-table td:last-child{white-space:normal}
 .gallery-copy{padding:16px}
 .gallery-header h2{min-width:0}
 .gallery-close{flex-shrink:0}
}
@media(max-width:360px){
 .container,.wrap{padding-inline:12px}
 h1{font-size:clamp(1.35rem,6.5vw,1.9rem)}
 .comments-section .container{width:calc(100% - 16px);padding-inline:0}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

@media(max-width:600px){#home-work-rail{grid-auto-columns:100%}.comments-section .rating-star{min-width:44px;min-height:44px}}

/* Compact portfolio cards at normal browser zoom. */
@media(min-width:901px){
 #home-work-rail,#brand-work-rail{grid-auto-columns:calc((100% - 32px)/3);gap:16px;align-items:start}
 .showcase-card .work-open img,.real-work-card>a>img,#home-work-rail .work-open img{height:clamp(150px,24vh,210px)!important;aspect-ratio:auto!important;object-fit:contain!important;width:100%;background:#f2f5f8}
 .showcase-card .no-photo{height:clamp(150px,24vh,210px)}
 .showcase-card .showcase-body{padding:12px 14px}
 .showcase-card .showcase-body h3{font-size:.95rem;line-height:1.65;min-height:3.3em;margin:6px 0}
 .showcase-card .showcase-body>p{font-size:.84rem;line-height:1.7;height:3.4em;margin:6px 0}
 .showcase-card .work-details{padding:7px 0;font-size:.82rem}
 .showcase-card .photo-count,.showcase-card .work-open-hint{font-size:.68rem;padding:4px 6px;bottom:8px}
 .showcase-card .photo-count{right:8px}.showcase-card .work-open-hint{left:8px}
 .work-dialog{width:min(900px,94vw);max-height:90vh;max-height:90dvh}
 .work-dialog .gallery-image,.work-dialog .gallery-video{height:clamp(150px,48vh,400px);object-fit:contain}
 .work-dialog .gallery-header{padding:10px 16px}
 .work-dialog .gallery-nav{padding:8px}
 .work-dialog .gallery-copy{padding:12px 18px}
}
@media(min-width:1440px){#home-work-rail,#brand-work-rail{grid-auto-columns:calc((100% - 48px)/4)}}

/* Mobile portfolio: full photos, compact cards and viewport-aware gallery. */
@media(max-width:900px){
 #home-work-rail,#brand-work-rail{grid-auto-columns:calc((100% - 14px)/2);gap:14px;align-items:start}
 .showcase-card .work-open img,.real-work-card>a>img,#home-work-rail .work-open img,.works .card img.cover{display:block;width:100%;height:clamp(130px,28vh,210px)!important;height:clamp(130px,28svh,210px)!important;aspect-ratio:auto!important;object-fit:contain!important;background:#f2f5f8}
 .showcase-card .no-photo{height:clamp(130px,28vh,210px);height:clamp(130px,28svh,210px)}
 .showcase-card .showcase-body,.real-work-card .real-work-body,.works .card .body{padding:12px 14px}
 .showcase-card .showcase-body h3{font-size:.95rem;line-height:1.65;min-height:0;margin:5px 0}
 .showcase-card .showcase-body>p{font-size:.85rem;line-height:1.7;height:auto;max-height:3.4em;margin:6px 0}
 .showcase-card .work-details{min-height:44px;padding:8px 0;font-size:.85rem}
 .showcase-card .photo-count,.showcase-card .work-open-hint{font-size:.67rem;padding:4px 6px;bottom:7px;max-width:calc(50% - 12px)}
 .showcase-card .photo-count{right:7px}.showcase-card .work-open-hint{left:7px}
 .work-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);margin:auto;border-radius:14px;overflow:auto;overscroll-behavior:contain}
 .work-dialog .gallery-header{padding:8px 12px;gap:10px}
 .work-dialog .gallery-header h2{font-size:.9rem;line-height:1.6;overflow-wrap:anywhere;max-height:4.8em;overflow:auto}
 .work-dialog .gallery-stage{min-height:0}
 .work-dialog .gallery-image,.work-dialog .gallery-video{height:min(38vh,280px);height:min(38svh,280px);object-fit:contain}
 .work-dialog .gallery-nav{padding:7px 10px;gap:12px}
 .work-dialog .gallery-counter{min-width:0;font-size:.8rem}
 .work-dialog .gallery-copy{padding:12px 14px}
 .work-dialog .gallery-details p{font-size:.9rem;line-height:1.85}
}
@media(max-width:600px){
 #home-work-rail,#brand-work-rail{grid-auto-columns:100%;gap:12px;padding-top:4px;margin-top:16px}
}
