/* Shared responsive polish for frontend pages */

img,
iframe {
  max-width: 100%;
}

.page-hero .container {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.drawer {
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.drawer .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination {
  flex-wrap: wrap;
}

.article-meta,
.article-footer,
.latest-work-head,
.port-header {
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-minimal .footer-copy,
.work-content h3,
.work-desc,
.contact-item p,
.contact-item a,
.article-body,
.project-description,
.footer-minimal .ftr-contact-value,
.p-name,
.blog-title {
  overflow-wrap: anywhere;
}

.filter-bar {
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1024px) {
  #nav {
    padding: 0 1.5rem;
  }

  .page-hero {
    padding: 136px 0 72px;
  }

  .page-hero h1 {
    font-size: clamp(2.15rem, 6vw, 3.25rem);
  }

  .page-hero p {
    font-size: 1rem;
    padding-inline: 0.5rem;
  }

  .port-header,
  .latest-work-head {
    align-items: flex-start;
  }

  .footer-minimal .ftr-contact-row {
    gap: 2.5rem;
    max-width: 100%;
  }

  .project-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  #nav {
    padding: 0 1rem;
    column-gap: 0.75rem;
  }

  .nav-logo {
    gap: 0.55rem;
    min-width: 0;
  }

  .nav-logo img {
    height: 38px;
  }

  .nav-logo-text {
    min-width: 0;
  }

  .nav-logo-en {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
  }

  .nav-logo-th {
    display: none;
  }

  .nav-right {
    gap: 0.55rem;
    margin-left: auto;
  }

  .lang-btn {
    padding: 0.28rem 0.5rem;
    font-size: 0.64rem;
  }

  .drawer {
    padding: 1rem 1rem 1.35rem;
  }

  .drawer a {
    font-size: 0.84rem;
  }

  .drawer .nav-cta {
    display: inline-flex !important;
    width: auto;
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
  }

  .page-hero {
    padding: 118px 0 60px;
  }

  .page-hero p {
    font-size: 0.96rem;
    line-height: 1.75;
  }

  .services-section,
  .portfolio-section,
  .blog-section,
  .contact-section,
  .latest-section,
  .article-section,
  .related-section,
  .project-section,
  .cta-section,
  .map-section,
  .values-section {
    padding-inline: 1rem !important;
  }

  footer.footer-minimal {
    padding: 3rem 1rem 1.6rem;
  }

  .footer-minimal .ftr-brand {
    flex-direction: column;
    gap: 0.7rem;
    text-align: center;
  }

  .footer-minimal .ftr-brand-name {
    font-size: 1.65rem;
    letter-spacing: 0.14em;
  }

  .footer-minimal .ftr-brand-sub {
    text-align: center;
    line-height: 1.6;
    letter-spacing: 0.12em;
  }

  .footer-minimal .ftr-contact-row {
    gap: 1.25rem;
    flex-wrap: wrap;
  }

  .footer-minimal .ftr-contact-card {
    flex: 1 1 220px;
    min-width: min(100%, 220px);
  }

  .footer-minimal .ftr-contact-value {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  .footer-minimal .footer-copy {
    font-size: 0.82rem;
    line-height: 1.65;
  }

  .article-hero-content {
    left: 1rem;
    right: 1rem;
    bottom: 1.25rem;
  }

  .article-meta {
    gap: 0.5rem 1rem;
    font-size: 0.82rem;
  }

  .article-content {
    margin-top: -36px;
  }

  .article-body {
    font-size: 1rem;
    line-height: 1.85;
  }

  .contact-item {
    padding: 1rem;
    gap: 0.9rem;
  }

  .contact-form {
    padding: 1.6rem 1.2rem;
  }

  .contact-form h2 {
    font-size: 1.55rem;
    margin-bottom: 1.2rem;
  }

  .map-container {
    height: 320px;
  }

  .work-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .work-link {
    justify-content: center;
  }

  .work-meta {
    gap: 0.75rem 1rem;
  }

  .pagination {
    gap: 0.5rem;
  }

  .page-btn {
    min-width: 44px;
    padding: 0.65rem 0.9rem;
    text-align: center;
  }

  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
  }

  .filter-btn {
    white-space: nowrap;
  }

  .contact-btn::before,
  .contact-btn::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .page-hero .container {
    width: min(1200px, calc(100% - 1.5rem));
  }

  .drawer-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .drawer-bottom .lang-toggle,
  .drawer-bottom .nav-cta {
    width: 100%;
    justify-content: center;
  }

  .page-hero {
    padding: 108px 0 54px;
  }

  .page-hero h1 {
    font-size: 1.9rem;
  }

  .footer-minimal .ftr-brand-name {
    font-size: 1.45rem;
    letter-spacing: 0.1em;
  }

  .article-hero {
    height: 280px;
  }

  .article-hero-content h1 {
    font-size: 1.55rem;
  }

  .article-content {
    padding: 1.35rem 1rem;
  }

  .article-category {
    font-size: 0.72rem;
    padding: 0.35rem 0.8rem;
  }

  .work-image {
    height: 220px;
  }

  .work-content {
    padding: 1rem;
  }

  .work-content h3 {
    font-size: 1.2rem;
  }

  .map-container {
    height: 260px;
  }

  .contact-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .contact-item h4 {
    font-size: 1rem;
  }

  .pagination {
    justify-content: flex-start;
  }
}
