/* ============================================================
   ProjectDetails styles (moved from project_information.css)
   This file contains container definition, information grid, description
   layout and responsive rules for the project details view.
   ============================================================ */

/* Make the project details content area a size container */
.project-details__content {
  container-type: inline-size;
  container-name: project-content;
}

/* ----------------------------------------------------------
   DEFAULT (wide): container > 500px
   - Information grid: 2 columns, column layout per field
   - Description aside: visible, right-aligned, intrinsic width
   - Dividers: hidden
   - Developer/Website compact fields: hidden
   ---------------------------------------------------------- */

.project-information__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  align-items: start;
  box-sizing: border-box;
}

/* Each field: column layout (label on top, value below) */
.project-information__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Dividers hidden by default (wide layout) */
.project-information__divider {
  display: none;
  height: 1px;
  background: var(--color-glass-border-faint);
}

/* Developer/Website compact fields: hidden on wide */
.project-information__mobile-only {
  display: none !important;
}

/* Compact field style (row layout with icon at far right) */
.project-information__compact {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

/* Icon element */
.project-information__icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--cupertino-gray);
  flex-shrink: 0;
}

/* Link styling */
.project-information__link {
  color: var(--cupertino-blue);
  text-decoration: none;
  cursor: pointer;
}

/* ----------------------------------------------------------
   Description with aside (wide)
   ---------------------------------------------------------- */

.project-details__description {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 24px;
  align-items: start;
}

.project-details__description-text {
  min-width: 0;
}

.project-details__description-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

/* Each aside item: label + icon aligned right */
.project-details__aside-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------------------------------------------------
   NARROW: container <= 500px
   - Information grid: single column, row layout per field, dividers shown
   - Description aside: hidden
   - Developer/Website compact fields: shown
   ---------------------------------------------------------- */

@container project-content (max-width: 500px) {
  /* Single-column grid */
  .project-information__grid {
    grid-template-columns: 1fr;
    gap: 8px 24px;
  }

  /* Each field: row layout (label left, value right) */
  .project-information__field {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
  }

  /* Show dividers */
  .project-information__divider {
    display: block;
  }

  /* Show Developer/Website compact fields */
  .project-information__mobile-only {
    display: flex !important;
  }

  /* Hide description aside */
  .project-details__description-aside {
    display: none;
  }

  /* Description becomes single column */
  .project-details__description {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PROJECT DETAILS — RESPONSIVE ELEMENTS
   3-tier Apple-inspired sizing: Mobile -> Medium -> Desktop

   Container: project-content (.project-details__content), defined above.

   All responsive properties use CSS transitions for smooth animated
   resizing as the user drags the window edges.

   All elements scale together so icon + title + subtitle behave
   as a single visual unit.

   **IMPORTANT:** All screenshots in a project MUST have the same orientation
   (all portrait OR all landscape). Mixed orientations are not supported.

   PORTRAIT screenshots are HEIGHT-driven (height fixed, width from aspect-ratio).
   LANDSCAPE screenshots are WIDTH-driven (width fitted to show 2 or 3 items,
   height from aspect-ratio).

   Tier Breakdown — Portrait:
   ───────────────────────────────────────────────────────────────
   Tier      Container Width   Screenshot   Icon     Radius  Title   Subtitle
   ───────────────────────────────────────────────────────────────
   Mobile    ≤ 670px           300px (h)    88px     19px    18px    13px
   Medium    671–920px (base)  360px (h)    104px    23px    22px    15px
   Desktop   ≥ 921px           450px (h)    116px    26px    26px    17px

   Tier Breakdown — Landscape:
   ───────────────────────────────────────────────────────────────
   Tier      Container Width   Screenshot Width
   ───────────────────────────────────────────────────────────────
   Mobile    ≤ 670px           300px (w)
   Medium    671–920px (base)  360px (w)
   Desktop   ≥ 921px           450px (w)
   ============================================================ */

/* ---- Smooth transitions for all responsive elements ---- */
/* !important is required to override FadeInImage's inline transition style. */
img.project-screenshot {
  transition: opacity 0.35s ease-in-out,
              width var(--duration-medium) var(--curve-standard),
              height var(--duration-medium) var(--curve-standard) !important;
}

.project-details-header__icon {
  transition: width var(--duration-medium) var(--curve-standard),
              height var(--duration-medium) var(--curve-standard),
              border-radius var(--duration-medium) var(--curve-standard);
}

.project-details-header__title {
  transition: font-size var(--duration-medium) var(--curve-standard);
}

.project-details-header__subtitle {
  transition: font-size var(--duration-medium) var(--curve-standard);
}

.project-details-header__platforms-label {
  transition: font-size var(--duration-medium) var(--curve-standard);
}

/* ============================================================
   PORTRAIT SCREENSHOTS — Height-driven
   Width is auto, derived from inline aspect-ratio.
   Fixed pixel heights at breakpoints, smoothed by CSS transition.
   ============================================================ */

/* ---- Base/Default: Medium (671–920px) ---- */
.project-screenshots-preview__images--portrait img.project-screenshot {
  height: 360px;
  width: auto;
}

/* ---- Mobile: Narrow windows ---- */
@container project-content (max-width: 670px) {
  .project-screenshots-preview__images--portrait img.project-screenshot {
    height: 300px;
  }
}

/* ---- Desktop: Wide windows ---- */
@container project-content (min-width: 921px) {
  .project-screenshots-preview__images--portrait img.project-screenshot {
    height: 450px;
  }
}

/* ============================================================
   LANDSCAPE SCREENSHOTS — Width-driven
   Height is auto, derived from inline aspect-ratio.
   Fixed pixel widths at breakpoints, smoothed by CSS transition.
   Same values as portrait (just applied to width instead of height).
   Horizontal scroll + scroll-snap handles visibility naturally.
   ============================================================ */

/* ---- Base/Default: Medium (671–920px) ---- */
.project-screenshots-preview__images--landscape img.project-screenshot {
  width: 360px;
  height: auto;
}

/* ---- Mobile: Narrow windows ---- */
@container project-content (max-width: 670px) {
  .project-screenshots-preview__images--landscape img.project-screenshot {
    width: 300px;
  }
}

/* ---- Desktop: Wide windows ---- */
@container project-content (min-width: 921px) {
  .project-screenshots-preview__images--landscape img.project-screenshot {
    width: 450px;
  }
}

/* ============================================================
   ICON / TITLE / SUBTITLE — Shared across both orientations
   ============================================================ */

/* ---- Base/Default: Medium ---- */

.project-details-header__icon {
  width: 104px;
  height: 104px;
  border-radius: 23px;
}

.project-details-header__title {
  font-size: 22px;
}

.project-details-header__subtitle {
  font-size: 15px;
}

.project-details-header__platforms-label {
  font-size: 13px;
}

/* ---- Mobile: Narrow windows ---- */
@container project-content (max-width: 670px) {
  .project-details-header__icon {
    width: 88px;
    height: 88px;
    border-radius: 19px;
  }
  .project-details-header__title {
    font-size: 18px;
  }
  .project-details-header__subtitle {
    font-size: 13px;
  }

  .project-details-header__platforms-label {
    font-size: 11px;
  }
}

/* ---- Desktop: Wide windows ---- */
@container project-content (min-width: 921px) {
  .project-details-header__icon {
    width: 116px;
    height: 116px;
    border-radius: 26px;
  }
  .project-details-header__title {
    font-size: 26px;
  }
  .project-details-header__subtitle {
    font-size: 17px;
  }
  .project-details-header__platforms-label {
    font-size: 14px;
  }
}

/* ---- Icon image: fill its wrapper ---- */
/* FadeInImage wraps <img> in a <div>, both get .project-details__icon.
   The wrapper controls size/transition; the <img> just fills it. */
img.project-details-header__icon {
  width: 100% !important;
  height: 100% !important;
}

/* ============================================================
   SELECTABLE TEXT
   Windows globally disable user-select (in window.css).
   Re-enable on content the user might want to copy.
   ============================================================ */
.about-this-project__description,
.project-details__description-text,
.project-information__value {
  user-select: text;
  -webkit-user-select: text;
}