/* ========================================
   Enhanced Responsive Design
   Complete responsive improvements with text overflow handling
   ======================================== */
/* Global text overflow handling */
* {
  word-break: break-word;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

/* Headings responsive text */
h1, h2, h3, h4, h5, h6 {
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Paragraph text handling */
p, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Links should not break layout */
a {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========================================
   Extra Small Devices (480px and below)
   ======================================== */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .section {
    padding: 50px 0;
  }
  .hero {
    padding-top: 110px !important;
  }
  /* Typography scaling */
  .hero-title {
    font-size: clamp(32px, 8vw, 42px);
    line-height: 1.3;
    word-break: keep-all;
  }
  .section-title {
    font-size: clamp(20px, 6vw, 28px);
    line-height: 1.3;
  }
  .section-title::after,
  .section-title-en::after {
    bottom: -8px;
    height: 2px;
  }
  .section-subtitle {
    font-size: 14px;
    line-height: 1.7;
  }
  /* Button responsive */
  .btn {
    padding: 10px 24px;
    font-size: 12px;
    white-space: nowrap;
  }
  .btn-large {
    padding: 14px 32px;
    font-size: 14px;
  }
  /* Card responsive */
  .benefit-card-modern,
  .business-card,
  .news-card {
    padding: 24px 20px;
  }
  /* Image responsive */
  img {
    max-width: 100%;
    height: auto;
  }
}
/* ========================================
   iPhone SE / Small Mobile (375px)
   ======================================== */
@media (max-width: 375px) {
  .container {
    padding: 0 12px;
  }
  .section {
    padding: 40px 0;
  }
  .hero {
    padding-top: 120px !important;
  }
  .hero-title {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.3;
  }
  .section-title {
    font-size: clamp(18px, 5.5vw, 24px);
  }
  .section-title::after,
  .section-title-en::after {
    bottom: -6px;
    height: 2px;
  }
  .btn {
    padding: 9px 20px;
    font-size: 11px;
  }
}
/* ========================================
   Specific Component Responsiveness
   ======================================== */
/* Navigation responsive improvements */
@media (max-width: 768px) {
  .nav-menu li {
    width: 100%;
    padding: 12px 0;
    text-align: center;
  }
  .nav-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
  }
  .hero {
    padding-top: 90px !important;
  }
  .hero-title {
    font-size: clamp(38px, 8vw, 56px);
  }
  .scroll-indicator {
    display: none;
  }
}
/* Hero section responsive */
@media (max-width: 640px) {
  .hero {
    height: auto;
    min-height: 100vh;
    padding-top: 100px !important;
  }
  .hero-content {
    padding: 20px;
    padding-top: 40px;
  }
  .hero-description {
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.7;
  }
  .hero-subtitle {
    margin-top: 15px;
    margin-bottom: 25px;
    font-size: 14px;
  }
  .hero-actions {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
  .scroll-indicator {
    display: none;
  }
}
/* Section headers responsive */
@media (max-width: 640px) {
  .section-header {
    padding: 0 10px;
    margin-bottom: 40px;
  }
  .section-label {
    margin-bottom: 8px;
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .section-subtitle {
    margin-top: 12px;
    font-size: 13px;
  }
}
/* Grid layouts responsive */
@media (max-width: 640px) {
  .business-grid,
  .works-grid,
  .news-grid,
  .benefits-grid-modern {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
/* Footer responsive */
@media (max-width: 640px) {
  .footer {
    padding: 50px 0 30px;
  }
  .footer-content {
    gap: 30px;
  }
  .footer-logo {
    max-width: 200px;
  }
  .footer-logo-image {
    max-width: 150px;
    margin-bottom: 12px;
  }
  .footer-logo h3 {
    font-size: 20px;
  }
  .footer-logo p {
    font-size: 12px;
  }
  .footer-column h4 {
    margin-bottom: 12px;
    font-size: 14px;
  }
  .footer-column a {
    padding: 8px 0;
    font-size: 13px;
  }
  .footer-bottom {
    padding-top: 20px;
    margin-top: 30px;
  }
  .footer-bottom p {
    font-size: 11px;
  }
}
/* Sponsorship section responsive */
@media (max-width: 768px) {
  .sponsorship-highlight-content {
    flex-direction: column;
    gap: 40px;
  }
  .sponsorship-highlight-text h2 {
    font-size: 28px;
    line-height: 1.3;
  }
  .sponsorship-highlight-text p {
    font-size: 14px;
    line-height: 1.8;
  }
}
@media (max-width: 640px) {
  .sponsorship-card {
    padding: 40px 24px !important;
  }
  .sponsorship-card h3 {
    font-size: 24px !important;
    line-height: 1.4 !important;
  }
  .sponsorship-description {
    padding: 30px 24px !important;
  }
  .sponsorship-description h4 {
    font-size: 18px !important;
  }
  .sponsorship-description p {
    font-size: 14px !important;
  }
}
/* Access section responsive */
@media (max-width: 640px) {
  .access-content {
    flex-direction: column;
  }
  .access-map iframe {
    height: 300px;
    border-radius: 12px;
  }
  .access-info {
    padding: 30px 20px;
  }
  .access-info h3 {
    margin-bottom: 12px;
    font-size: 16px;
  }
  .access-address,
  .access-station {
    font-size: 14px;
    line-height: 1.8;
  }
}
/* Recruitment sections responsive */
@media (max-width: 640px) {
  .benefit-card-modern {
    padding: 30px 20px;
  }
  .benefit-icon-modern {
    margin-bottom: 16px;
    font-size: 32px;
  }
  .benefit-title-modern {
    margin-bottom: 12px;
    font-size: 16px;
  }
  .benefit-description-modern {
    font-size: 13px;
    line-height: 1.7;
  }
}
/* Office environment images responsive */
@media (max-width: 640px) {
  .office-image-grid {
    gap: 16px;
  }
  .office-main-image,
  .office-sub-image {
    border-radius: 12px;
  }
  .office-image-badge {
    padding: 8px 16px;
    font-size: 11px;
  }
}
/* Company info responsive */
@media (max-width: 640px) {
  .info-grid {
    gap: 20px;
  }
  .info-row {
    gap: 0;
    padding: 20px;
  }
  .info-label {
    padding: 0 0 8px;
    font-size: 13px;
    background: transparent;
    border-right: 0;
    border-bottom: 0;
  }
  .info-value {
    padding: 0;
    font-size: 15px;
  }
}
/* Group companies responsive */
@media (max-width: 640px) {
  .group-grid,
  .group-grid-five,
  .group-grid-six {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .group-card {
    padding: 30px 20px;
  }
  .group-card h3 {
    margin: 16px 0 12px;
    font-size: 16px;
  }
  .group-card p {
    font-size: 13px;
    line-height: 1.7;
  }
}
/* Executives section responsive */
@media (max-width: 640px) {
  .executives-grid {
    gap: 30px;
  }
  .executive-card {
    padding: 24px 20px;
  }
  .executive-info {
    padding: 0 16px 20px;
  }
  .executive-name {
    margin-bottom: 4px;
    font-size: 18px;
  }
  .executive-name-en {
    font-size: 12px;
  }
  .executive-role {
    font-size: 11px;
  }
  .bio-item {
    gap: 12px;
    padding: 8px 0;
  }
  .bio-year {
    min-width: 70px;
    font-size: 12px;
  }
  .bio-text {
    font-size: 12px;
    line-height: 1.7;
  }
}
/* Contact form responsive */
@media (max-width: 640px) {
  .contact-form {
    padding: 30px 20px;
  }
  .form-group label {
    margin-bottom: 8px;
    font-size: 13px;
  }
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 12px 16px;
    font-size: 14px;
  }
  .form-group textarea {
    min-height: 120px;
  }
  .submit-btn {
    padding: 14px 32px;
    font-size: 14px;
  }
}
/* Office info cards responsive */
@media (max-width: 640px) {
  .office-info-grid {
    gap: 20px;
  }
  .office-info-card {
    padding: 24px 20px;
  }
  .office-info-label {
    margin-bottom: 8px;
    font-size: 12px;
  }
  .office-info-value {
    font-size: 14px;
    line-height: 1.8;
  }
}
/* Blog / News cards responsive */
@media (max-width: 640px) {
  .news-card,
  .blog-card {
    padding: 20px;
  }
  .news-date,
  .blog-date {
    margin-bottom: 12px;
    font-size: 11px;
  }
  .news-title,
  .blog-title {
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
  }
  .news-excerpt,
  .blog-excerpt {
    font-size: 13px;
    line-height: 1.7;
  }
}
/* Table responsive */
@media (max-width: 640px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .req-row {
    flex-direction: column;
    gap: 8px;
    padding: 16px;
  }
  .req-label {
    min-width: 100%;
    padding-bottom: 8px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
  }
  .req-value {
    padding-left: 0;
    font-size: 13px;
  }
}
/* CTA sections responsive */
@media (max-width: 640px) {
  .cta-section {
    padding: 50px 20px;
  }
  .cta-title {
    margin-bottom: 16px;
    font-size: 24px;
  }
  .cta-text {
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
  }
}
/* Prevent text overflow in all containers */
@media (max-width: 768px) {
  .container,
  .section,
  .card,
  div[class*=content],
  div[class*=wrapper] {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}
/* Long URL handling */
@media (max-width: 768px) {
  a[href*=http] {
    word-break: break-all;
    overflow-wrap: anywhere;
  }
}
/* Ensure images don't overflow */
@media (max-width: 768px) {
  img,
  video,
  iframe {
    max-width: 100%;
    height: auto;
  }
  .office-image-badge,
  .sponsorship-badge,
  div[style*="position: absolute"] {
    max-width: 90%;
  }
}
/* ========================================
   Blog Member Photo Responsive
   ======================================== */
@media (max-width: 640px) {
  .member-icon-large {
    width: 150px;
    height: 150px;
    border: 3px solid var(--bg-light);
  }
  .blog-placeholder-icon {
    width: 90px;
    height: 90px;
  }
  .article-image {
    margin: 40px 0;
  }
}
@media (max-width: 480px) {
  .member-icon-large {
    width: 120px;
    height: 120px;
    border: 2px solid var(--bg-light);
  }
  .blog-placeholder-icon {
    width: 70px;
    height: 70px;
  }
  .article-image {
    margin: 30px 0;
  }
}