/* =========================================
   DAINDIA Project Windows - Mobile & Tablet Styles
   Breakpoints: 768px (tablet), 480px (phone)
   ========================================= */

/* =========================================
   TABLET (≤ 768px)
   ========================================= */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --page-padding: 24px;
    --left-col-width: clamp(160px, 26vw, 220px);
    --grid-gap: clamp(20px, 3.5vw, 36px);
  }

  #smooth-wrapper {
    position: relative;
    top: auto;
    width: 100%;
  }

  .scroll-window {
    max-width: 100%;
  }

  .project-content {
    padding: 0 var(--page-padding);
    gap: var(--grid-gap);
  }

  .meta {
    width: var(--left-col-width);
  }

  /* Proportional Closed Thumbnail on Tablet */
  .img-wrapper {
    width: clamp(180px, 30vw, 240px);
    height: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
  }

  .project.is-expanded {
    padding: 40px 0 50px 0;
  }

  /* Proportional Expanded View on Tablet */
  .project.is-expanded .img-wrapper {
    height: clamp(340px, 55vh, 600px);
    width: auto;
    max-width: 85vw;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .project.is-expanded .img-wrapper img {
    height: 100%;
    width: auto;
    max-width: 85vw;
    object-fit: contain;
  }

  .gallery-text {
    width: clamp(260px, 42vw, 360px);
    font-size: 13px;
    line-height: 1.7;
  }

  .daindia-pagination {
    margin: 40px auto 20px auto;
    padding: 0 var(--page-padding);
  }
}

/* =========================================
   PHONE (≤ 480px)
   ========================================= */
@media (max-width: 480px) {
  :root {
    --header-height: 54px;
    --page-padding: 16px;
    --left-col-width: 100%;
    --grid-gap: 16px;
  }

  #smooth-wrapper {
    top: auto;
    position: relative !important;
    transform: none !important;
  }

  body {
    height: auto !important;
    overscroll-behavior: auto;
  }

  .project {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .scroll-window {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    cursor: default;
  }

  .project-content {
    padding: 0 var(--page-padding);
    gap: var(--grid-gap);
    flex-direction: column;
    width: 100%;
  }

  .meta {
    width: 100%;
    text-align: left;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .title {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .location {
    font-size: 9px;
    width: 100%;
    margin-top: -4px;
  }

  .meta-extended {
    width: 100%;
  }

  .meta-extended-inner {
    text-align: left;
    padding-top: 10px;
  }

  .meta-row {
    align-items: flex-start;
    margin-top: 8px;
  }

  .gallery {
    gap: var(--grid-gap);
    padding-right: var(--page-padding);
    width: max-content;
  }

  /* Fluid Proportional Closed Thumbnail on Mobile */
  .img-wrapper {
    width: clamp(140px, 48vw, 220px);
    height: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    max-width: none;
    max-height: none;
  }

  .gallery-text {
    width: clamp(240px, 82vw, 360px);
    font-size: 12px;
    line-height: 1.65;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .project.is-expanded {
    padding: 24px 0 40px;
  }

  /* Generous, Proportional Expanded View on Mobile */
  .project.is-expanded .img-wrapper {
    height: clamp(280px, 58vh, 520px);
    width: auto;
    max-width: 88vw;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .project.is-expanded .img-wrapper img {
    height: 100%;
    width: auto;
    max-width: 88vw;
    object-fit: contain;
  }

  .daindia-pagination {
    margin: 30px auto 10px auto;
    padding: 0 var(--page-padding);
  }

  .daindia-pagination .page-numbers {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
    padding: 0 8px;
  }
}

/* =========================================
   TOUCH DEVICE OPTIMIZATION
   ========================================= */
@media (hover: none) {
  .project:hover .img-wrapper img {
    opacity: 1;
    transform: none;
  }
}
