
/* --- Mobile Optimizations (Standard phones ~360-414px width) --- */
:root{
  --tap: 44px;
}

img, video { max-width: 100%; height: auto; }

/* Base typography scaling */
html { -webkit-text-size-adjust: 100%; }
body { word-wrap: break-word; overflow-wrap: anywhere; }

/* Ensure headers/nav are sticky and compact */
header, .site-header, .topbar {
  position: sticky;
  top: 0;
  z-index: 999;
}

/* Touch target sizing for nav links/buttons */
a, button { min-height: var(--tap); line-height: 1.2; }

/* Global container padding adjustments */
.container, .content, main, .section, .wrapper {
  padding-left: clamp(12px, 3vw, 20px);
  padding-right: clamp(12px, 3vw, 20px);
}

/* Works grid responsive rules */
.works-grid, .grid, .gallery, .cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px){
  .works-grid, .grid, .gallery, .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px){
  .works-grid, .grid, .gallery, .cards { grid-template-columns: 1fr; gap: 12px; }
}

/* Cards/images */
.card, .work-card, .art-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
}
.card img, .work-card img, .art-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
/* Avoid overlapping labels over images on small screens */
.label-pill, .floorplan-label, .tag-pill {
  position: static !important;
  display: inline-block;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
}

/* Header/logo sizing */
.logo, .site-logo, header .logo img {
  max-height: 32px;
}
@media (max-width: 480px){
  .nav, nav ul, .menu { gap: 8px; }
  .nav a, nav a, .menu a { font-size: 0.95rem; padding: 8px 10px; }
}

/* Prevent horizontal scroll */
html, body { max-width: 100%; overflow-x: hidden; }

/* Hero sections: constrain to viewport */
.hero, .banner {
  min-height: 40vh;
  padding-top: 24px;
  padding-bottom: 24px;
}

/* Forms/buttons */
button, .btn, .cta {
  padding: 10px 14px;
  border-radius: 8px;
}

/* Tables -> scrollable on mobile */
.table-responsive { width: 100%; overflow-x: auto; }
.table-responsive table { min-width: 600px; }

/* Fix images that had fixed px width */
img[width] { height: auto; }

/* Ensure iframes are responsive */
.responsive-iframe, iframe {
  width: 100%;
  max-width: 100%;
}

/* Footer spacing */
footer { padding-bottom: clamp(16px, 4vh, 32px); }


/* --- Tight Mobile Adjustments (<=480px) --- */
:root{
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 14px;
  --tap: 42px;
}

/* Base scaling */
body { font-size: clamp(14px, 3.5vw, 16px); line-height: 1.35; }
p { margin: 0 0 0.6em 0; }

h1,h2,h3,h4,h5,h6 { margin-top: 0.6em; margin-bottom: 0.4em; line-height: 1.15; }
h1 { font-size: clamp(22px, 5.6vw, 28px); }
h2 { font-size: clamp(20px, 5.0vw, 24px); }
h3 { font-size: clamp(18px, 4.6vw, 22px); }
h4,h5,h6 { font-size: clamp(16px, 4.2vw, 18px); }

/* Containers and sections */
.container, .content, main, .section, .wrapper, section {
  padding-left: clamp(10px, 3vw, 16px);
  padding-right: clamp(10px, 3vw, 16px);
}
section, .section { padding-top: var(--space-md); padding-bottom: var(--space-md); }

/* Hero/banner tightening */
.hero, .banner {
  min-height: 28vh;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

/* Works grid spacing */
.works-grid, .grid, .gallery, .cards { gap: 10px; }
@media (max-width: 480px){
  .works-grid, .grid, .gallery, .cards { gap: 8px; }
}

/* Cards and labels */
.card, .work-card, .art-card { border-radius: 6px; }
.label-pill, .floorplan-label, .tag-pill { margin-top: 4px; padding: 5px 8px; font-size: 0.8rem; }

/* Nav/header sizing */
header, .site-header, .topbar { padding-top: 6px; padding-bottom: 6px; }
.nav a, nav a, .menu a { font-size: 0.9rem; padding: 6px 8px; }
.logo, .site-logo, header .logo img { max-height: 28px; }

/* Buttons/CTAs */
button, .btn, .cta { padding: 8px 12px; font-size: 0.95rem; border-radius: 6px; }

/* Lists and tables */
ul, ol { margin: 0 0 0.6em 1.2em; }
.table-responsive table { min-width: 520px; }

/* Reduce excessive top/bottom margins on common elements */
h1 + p, h2 + p, h3 + p { margin-top: 0.2em; }
img { margin-bottom: 0.4em; }

/* Ensure no accidental large vertical gaps */
*[style*="margin-top: 40"], *[style*="margin-bottom: 40"] { margin-top: 16px !important; margin-bottom: 16px !important; }

@media (max-width: 480px){
  body { font-size: clamp(14px, 3.8vw, 15px); }
}
