/* ============================================================================
   GLOBAL SECTION RULES - Content containers max-width on desktop
   ========================================================================== */

/*
  NOTE: Container max-width: 1600px is already set in custom.css
  This file only adds responsive overrides for mobile/tablet
*/

/* ============================================================================
   16. ACCOMMODATION SECTION RESPONSIVE RULES
   ========================================================================== */

/* Accommodation container uses grid layout from custom.css - don't override display property */

.accommodation-left,
.accommodation-right {
  flex: 0 0 100%; /* Mobile: full width */
}

@media (min-width: 768px) {
  .accommodation-left,
  .accommodation-right {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* Full-width tables in accommodation section on mobile */
.unit-data-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
}

.unit-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto 1.5rem auto;
  display: table;
}

.unit-data-table th,
.unit-data-table td {
  padding: 0.75rem;
  text-align: left;
  word-break: break-word;
}

/* Align columns 2 and 3 to the right for all screen sizes */
.unit-data-table td:nth-child(2),
.unit-data-table td:nth-child(3) {
  text-align: right;
}

@media (max-width: 768px) {
  .unit-data-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .unit-data-table {
    width: 100%;
    font-size: 0.9rem;
    margin: 0 auto 1.5rem auto;
    display: table;
    table-layout: auto;
  }

  .unit-data-table th,
  .unit-data-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
  }

  /* Align columns: first column left, columns 2 and 3 right */
  .unit-data-table td:first-child {
    text-align: left;
  }

  .unit-data-table td:nth-child(2),
  .unit-data-table td:nth-child(3) {
    text-align: right;
  }
}

/* Unit selector buttons should be touch-friendly */
.unit-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-bottom: 1.5rem;
}

.unit-numbers {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.unit-number {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  flex-shrink: 0;
}

.unit-arrow {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  flex-shrink: 0;
}

/* Mobile: hide arrows and ensure numbers stay in one line */
@media (max-width: 767px) {
  .unit-selector {
    gap: 0.3rem;
    justify-content: center;
  }

  .unit-arrow {
    display: none;
  }

  .unit-numbers {
    gap: 0.3rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .unit-number {
    min-width: 40px;
    min-height: 40px;
    padding: 0.4rem;
  }
}

/* ============================================================================
   17. SPECIFICATIONS SECTION RESPONSIVE RULES
   ========================================================================== */

/* Stack specifications left/right columns on mobile */
.specifications-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.specs-left,
.specs-right {
  flex: 0 0 100%; /* Mobile: full width */
}

@media (min-width: 768px) {
  .specs-left,
  .specs-right {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* Specs grid: responsive 3-column to 2-column */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns */
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .specs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spec-icon {
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

/* ============================================================================
   18. DEMOGRAPHICS SECTION RESPONSIVE RULES
   ========================================================================== */

/* Stack demographics columns on mobile */
.demographics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
    justify-content: space-around;
}

.demographics-left,
.demographics-right,
.demographics-content {
  flex: 0 0 100%; /* Mobile: full width */
  width: 100%;
}

@media (min-width: 768px) {
  .demographics-left,
  .demographics-right {
    flex: 0 0 calc(50% - 1rem);
  }

  /* On desktop, demographics-content should take full width */
  .demographics-content {
    flex: 0 0 100%;
    width: 100%;
  }
}

/* Demographics grid: responsive stacking */
.demographics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns */
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .demographics-grid {
    grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
  }
}

@media (min-width: 1024px) {
  .demographics-grid {
    grid-template-columns: repeat(4, 1fr); /* Desktop: 4 columns in 1 row */
  }
}

/* Demographics source - center in new row below icons */
.demographics-source {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  grid-column: 1 / -1; /* Span full width */
}

/* ESG Icons Grid: separate rules for sustainability section */
.esg-icons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2 columns */
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .esg-icons-grid {
    grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
  }
}

@media (min-width: 1024px) {
  .esg-icons-grid {
    grid-template-columns: repeat(4, 1fr); /* Desktop: 4 columns, 2 rows */
  }
}

/* ============================================================================
   19. HERO SECTION RESPONSIVE RULES
   ========================================================================== */

.hero-section,
.hero-container {
  width: 100%;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .hero-section,
  .hero-container {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .hero-section,
  .hero-container {
    padding: 3rem;
  }
}

/* ============================================================================
   20. LOCATION & MAP SECTION RESPONSIVE RULES
   ========================================================================== */

.location-container,
.map-container {
  width: 100%;

}

.location-content {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.location-text,
.location-map {
  flex: 0 0 100%; /* Mobile: full width */
}

@media (min-width: 768px) {
  .location-text,
  .location-map {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

/* Location section left/right columns responsive */
.location-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.location-left,
.location-right {
  flex: 0 0 100%; /* Mobile: full width */
  width: 100%;
}

@media (min-width: 768px) {
  .location-left,
  .location-right {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* Transport Tables - Full Width and Centered on Mobile */
.transport-table-wrapper {
  width: 100%;
  margin: 0 auto;
}

.transport-table {
  width: 100%;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
}

/* Transport table headers - white color and right alignment for columns 2 and 3 */
.transport-table th {
  color: #ffffff;
}

.transport-table th:nth-child(2),
.transport-table th:nth-child(3) {
  text-align: right;
}

@media (max-width: 767px) {
  .transport-table-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto 2rem auto;
  }

  .transport-table {
    width: 100%;
    display: table;
    table-layout: auto;
  }

  .transport-table th,
  .transport-table td {
    padding: 8px 5px;
    font-size: 11px;
    line-height: 1.4;
    word-wrap: break-word;
  }

  .transport-table th {
    font-size: 10px;
    color: #ffffff;
  }

  /* Ensure columns distribute evenly */
  .transport-label-header {
    width: 50%;
  }

  .transport-value-header {
    width: 25%;
    text-align: right;
  }
}

/* Map Section - Desktop max-width and mobile padding */
.map-section {
  width: 100%;
}

.map-container {
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 767px) {
  .map-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .map-container {
    max-width: 100%;
  }
}

/* Embed maps responsively */
.map-wrapper,
.map-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
}

.map-wrapper iframe,
.map-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================================
   21. GALLERY SECTION RESPONSIVE RULES
   ========================================================================== */

.gallery-section {
  width: 100%;
  padding: 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 column */
  gap: 1rem;
}

/* Reduce gap on mobile only */
@media (max-width: 639px) {
  .gallery-grid {
    gap: 0.5rem !important;
  }
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 0;
  position: relative;
}

.gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Mobile: narrower aspect ratio for better fit */
@media (max-width: 767px) {
  .gallery-item {
    aspect-ratio: 16/10;
    border-radius: 0 !important;
  }
}

/* ============================================================================
   22. SUSTAINABILITY SECTION RESPONSIVE RULES
   ========================================================================== */

.sustainability-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* Desktop: center content */
.sustainability-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Desktop: ESG icons grid centered */
.esg-icons-grid {
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Mobile: stack full width */
@media (max-width: 767px) {
  .sustainability-container {
    gap: 1.5rem;
  }

  .sustainability-content {
    padding: 0 15px;
  }
}

/* ============================================================================
   23. VIDEO SECTION RESPONSIVE RULES
   ========================================================================== */

.video-section {
  width: 100%;
  padding: 1.5rem;
}

.video-wrapper,
.video-embed {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 4px;
}

.video-wrapper iframe,
.video-wrapper video,
.video-embed iframe,
.video-embed video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================================
   24. AERIAL SECTION RESPONSIVE RULES
   ========================================================================== */

.aerial-section {
  width: 100%;
  padding: 1.5rem;
}



@media (min-width: 768px) {
  .aerial-content {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

.aerial-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

@media (max-width: 768px) {
 .aerial-direction-image {
    max-width: 100%;
    height: auto;
    max-width:100px;
}}

/* Mobile: Replace background image with aerial-mobile.jpg */
@media (max-width: 767px) {
  .aerial-section {
    background: url('../images/aerial-mobile.jpg') bottom center / cover no-repeat !important;
    background-position: bottom center !important;
  }
}

/* ============================================================================
   25. COMPREHENSIVE MOBILE TABLE RULES - ACCOMMODATION & LOCATION
   ========================================================================== */

/* Mobile-first approach: Ensure all tables are full width and centered */
@media (max-width: 767px) {
  /* Accommodation Section - Container Level */
  .accommodation-section {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }

  .accommodation-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0 auto;
  }

  .accommodation-left,
  .accommodation-right {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100% !important;
    margin: 0 auto;
  }

  /* Unit Data Table - Full Width and Centered */
  .unit-data-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .unit-data-table {
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
    display: table;
  }

  /* Location Section - Container Level */
  .location-section {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }

  .location-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0 auto;
  }

  .location-left,
  .location-right {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100% !important;
    margin: 0 auto;
  }

  /* Transport Table - Full Width and Centered */
  .transport-table-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 2rem auto;
    padding: 0;
  }

  .transport-table {
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto;
    display: table;
  }

  /* Prevent horizontal scrolling for properly sized tables */
  .unit-data-table,
  .transport-table {
    box-sizing: border-box;
  }

  .unit-data-table th,
  .unit-data-table td,
  .transport-table th,
  .transport-table td {
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
  }
}

/* Tablet adjustments (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .accommodation-container,
  .location-container {
    max-width: 100%;
    padding: 0 20px;
  }

  .unit-data-table,
  .transport-table {
    width: 100%;
    margin: 0 auto 1.5rem auto;
  }
}
