/* Project History only. Shared header, footer and site styles stay in place. */

/* Local Myanmar font keeps client names readable without an external request. */
@font-face {
  font-family: "SWAM YEE Myanmar";
  src: url("assets/fonts/noto-sans-myanmar-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.project-history-page {
  font-family: "Inter", "SWAM YEE Myanmar", Arial, sans-serif;
}

.project-history-page [lang="my"] {
  font-family: "SWAM YEE Myanmar", "Myanmar Text", sans-serif;
  font-weight: 400;
  line-height: 1.9;
}

/* HERO AND INTRODUCTION */
.project-history-page .history-hero {
  min-height: 340px;
}

.project-history-page .history-hero .page-hero-photo {
  opacity: .65;
  object-position: center 42%;
}

.history-hero-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
  color: #d6e8f5;
  font-size: .8rem;
}

.history-hero-summary span + span {
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, .35);
}

.history-intro {
  padding: 64px 0 0;
  background: #fff;
}

.history-intro-heading {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: end;
  gap: 56px;
  margin-bottom: 32px;
}

.history-intro-heading h2 {
  margin-top: 12px;
  color: var(--blue-deep);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.history-intro-heading > p {
  max-width: 510px;
  color: var(--muted);
  line-height: 1.85;
  font-size: .95rem;
}

.history-project-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.history-project-nav a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  background: #f3f7fa;
  color: var(--blue-deep);
  border: 1px solid #e3ebf1;
  border-radius: 3px;
  font-size: .77rem;
  font-weight: 600;
}

.history-project-nav a span {
  color: var(--blue);
  font-size: .7rem;
}

.history-project-nav a:hover {
  background: var(--blue-soft);
  border-color: #a8c6dc;
}

/* PROJECT INFORMATION: A QUIET TEXT COLUMN BESIDE EACH PHOTO ALBUM */
.history-project {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.55fr);
  align-items: start;
  gap: clamp(28px, 4vw, 64px);
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 150px;
}

.history-project:last-child {
  border-bottom: 0;
  padding-bottom: 80px;
}

.history-project-copy,
.history-project-album {
  min-width: 0;
}

.history-project-category {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--blue);
  font-size: .69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.history-project-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid #d4e1eb;
  border-top: 2px solid var(--red);
  color: var(--blue-deep);
  letter-spacing: 0;
  font-size: .75rem;
}

.history-project-copy h2 {
  margin: 20px 0 12px;
  color: var(--blue-deep);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
}

.history-project-client {
  color: #355269;
  font-size: .97rem;
  font-weight: 600;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.history-project-details {
  display: grid;
  gap: 12px;
  margin: 25px 0 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.history-project-details > div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  font-size: .8rem;
  line-height: 1.6;
}

.history-project-details dt {
  color: var(--muted);
}

.history-project-details dd {
  margin: 0;
  color: var(--blue-deep);
  font-weight: 600;
}

.history-completed::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: var(--blue);
}

.history-project-description {
  max-width: 410px;
  color: var(--muted);
  font-size: .91rem;
  line-height: 1.85;
}

/* PHOTO GRIDS: EACH COUNT GETS A COMPLETE LAYOUT WITHOUT EMPTY CELLS */
.history-album-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 20px;
}

.history-album-heading p {
  color: #607383;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
}

.history-album-heading > span {
  color: var(--blue-deep);
  font-size: .76rem;
  font-weight: 600;
}

.history-photo-grid {
  display: grid;
  gap: 8px;
}

.history-photo {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 3px;
  background: #e8eef3;
  cursor: zoom-in;
}

.history-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.history-photo-index,
.history-photo-expand {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  background: rgba(6, 38, 65, .84);
  color: #fff;
}

.history-photo-index {
  left: 9px;
  bottom: 9px;
  font-size: .66rem;
  font-weight: 600;
}

.history-photo-expand {
  right: 9px;
  top: 9px;
  font-size: 1rem;
  background: rgba(255, 255, 255, .92);
  color: var(--blue-deep);
}

.history-photo-grid--1 .history-photo {
  aspect-ratio: 16 / 10;
}

.history-photo-grid--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-photo-grid--4 .history-photo,
.history-photo-grid--9 .history-photo {
  aspect-ratio: 4 / 3;
}

.history-photo-grid--9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-photo-grid--5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  aspect-ratio: 1.7;
}

.history-photo-grid--5 .history-photo:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.history-photo-grid--3 {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  aspect-ratio: 1.7;
}

.history-photo-grid--3 .history-photo:first-child {
  grid-row: span 2;
}

/* NATIVE DIALOG: FULL PHOTOS, KEYBOARD NAVIGATION AND FOCUS CONTAINMENT */
.history-lightbox {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  border: 1px solid #29445a;
  border-radius: 5px;
  background: #0a1927;
  color: #fff;
}

.history-lightbox::backdrop {
  background: rgba(2, 11, 19, .87);
}

.history-lightbox-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
}

.history-lightbox-header h2 {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.6;
}

.history-lightbox-header p {
  margin-top: 4px;
  color: #bacbd8;
  font-size: .8rem;
}

.history-lightbox button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #456074;
  border-radius: 3px;
  background: #142c3e;
  color: #fff;
  cursor: pointer;
  font-size: .82rem;
}

.history-lightbox .history-lightbox-close {
  flex-shrink: 0;
  width: 44px;
  padding: 0;
  font-size: 1.65rem;
  line-height: 1;
}

.history-lightbox button:hover {
  background: #23455f;
}

.history-lightbox button:disabled {
  opacity: .35;
  cursor: default;
}

.history-lightbox button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.history-lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 120px;
  background: #06121c;
}

.history-lightbox-stage img {
  width: 100%;
  max-height: calc(100dvh - 240px);
  object-fit: contain;
}

.history-lightbox-stage [hidden] {
  display: none;
}

#historyLightboxError {
  padding: 36px 20px;
  color: #d6e8f5;
  text-align: center;
}

.history-lightbox-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.history-lightbox-controls p {
  color: #d6e8f5;
  font-size: .85rem;
  white-space: nowrap;
}

/* TABLET AND MOBILE */
@media (max-width: 900px) {
  .history-project {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 28px;
  }

  .history-intro-heading {
    gap: 28px;
  }

  .history-project-details > div {
    grid-template-columns: 90px minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .project-history-page .history-hero {
    min-height: 300px;
  }

  .history-intro {
    padding-top: 44px;
  }

  .history-intro-heading,
  .history-project {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-intro-heading {
    gap: 20px;
    margin-bottom: 24px;
  }

  .history-project-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .history-project-nav a {
    padding: 10px;
    font-size: .73rem;
  }

  .history-project {
    padding: 44px 0;
    gap: 28px;
    scroll-margin-top: 130px;
  }

  .history-project:last-child {
    padding-bottom: 52px;
  }

  .history-project-copy h2 {
    font-size: 1.6rem;
    margin-top: 16px;
  }

  .history-project-description {
    max-width: none;
  }

  .history-project-details {
    margin-top: 18px;
  }

  .history-photo-grid--3,
  .history-photo-grid--5,
  .history-photo-grid--9 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    aspect-ratio: auto;
  }

  .history-photo-grid--3 .history-photo,
  .history-photo-grid--5 .history-photo {
    aspect-ratio: 4 / 3;
  }

  .history-photo-grid--3 .history-photo:first-child,
  .history-photo-grid--5 .history-photo:first-child,
  .history-photo-grid--9 .history-photo:first-child {
    grid-column: span 2;
    grid-row: auto;
    aspect-ratio: 16 / 10;
  }

  .history-lightbox {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .history-lightbox-header {
    gap: 10px;
  }

  .history-lightbox-header h2 {
    font-size: .9rem;
  }

  .history-lightbox-header p {
    font-size: .72rem;
  }

  .history-lightbox button {
    padding-inline: 12px;
    font-size: .75rem;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .history-photo:hover img {
    transform: scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-photo img {
    transition: none;
  }
}
