/* =========================================================
   FONTS (Pachinko)
========================================================= */

@font-face {
  font-family: 'Pachinko';
  src: url('../fonts/Pachinko-RegularText.woff2') format('woff2'),
       url('../fonts/Pachinko-RegularText.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pachinko';
  src: url('../fonts/Pachinko-RegularItalic.woff2') format('woff2'),
       url('../fonts/Pachinko-RegularItalic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Pachinko Mono';
  src: url('../fonts/Pachinko-RegularMono.woff2') format('woff2'),
       url('../fonts/Pachinko-RegularMono.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   VARIABLES
========================================================= */

:root {
  --color-border: #000;
  --color-text: #000;

  --small-spacing-unit: 4px;
  --spacing-unit: 12px;

  --column-gap: var(--spacing-unit);
  --border-default: 1px solid var(--color-border);
  
  --font-regular: 'Pachinko', serif;
  --font-italic: 'Pachinko', serif;
  --font-mono: 'Pachinko Mono', monospace;

  --font-size-base: 16px;
  --font-size-medium: 20px;
  --font-size-heading: 24px;
  
  --column-count: 8;
  --column-ratio-list: 3;
  --column-ratio-detail: 5;
}

/* =========================================================
   RESET & BASE
========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-regular);
}

html,
body {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;

  font-size: var(--font-size-base);
  line-height: 1.3;
  color: var(--color-text);
}

em {
  font-family: var(--font-regular);
  font-style: italic;
}

strong {
  font-family: var(--font-regular);
  font-weight: 400;
  color: yellowgreen;
}

/* =========================================================
   HEADER
========================================================= */

.site-header {
  position: relative;
  z-index: 100;

  padding: var(--spacing-unit) var(--spacing-unit) 0;
}

.site-header__content {
  flex: 1 1 0%;
  
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  
  padding-bottom: var(--small-spacing-unit);
  
  border-bottom: var(--border-default);
}

.site-header__content > a {
  
  text-decoration: none;
  color: var(--color-text);

  text-box-trim: trim-both;
}

/* =========================================================
   LAYOUT WRAPPER
========================================================= */

.site-wrapper {
  position: fixed;
  top: 36px;
  left: var(--spacing-unit);
  right: var(--spacing-unit);
  bottom: 0;

  overflow: hidden;
}

/* =========================================================
   PORTFOLIO STATES
========================================================= */

.portfolio {
  display: flex;
  height: 100%;
  gap: var(--column-gap);
}

.project-list {
  display: flex;
  flex-direction: column;
  
  width: calc((var(--column-ratio-list) / var(--column-count)) * 100%);
  padding: var(--spacing-unit) 0;
  gap: calc(var(--spacing-unit) * 3);
  
  overflow-y: auto;
}

/* Hide scrollbars */

.project-list::-webkit-scrollbar,
.project-detail::-webkit-scrollbar {
  display: none;
}

/* =========================================================
   SECTIONS
========================================================= */

.section-group {
  display: flex;
  flex-direction: column;

  gap: var(--spacing-unit);
}

.section-title {
  display: flex;
  flex-direction: column;

  margin-bottom: var(--spacing-unit);

  font-family: var(--font-regular);
  font-weight: 400;
  font-size: var(--font-size-heading);
  text-transform: uppercase;
  text-align: center;
}

.section-roman,
.section-name {
  text-box-trim: trim-both;
}

/* =========================================================
   PROJECT LIST
========================================================= */

.project-item {
  display: flex;

  border-bottom: 1px solid transparent;
}

.project-item:hover,
.project-item.is-active {
  border-color: var(--color-border);
}

.project-trigger {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex: 1 1 0%;

  padding-bottom: var(--small-spacing-unit);

  font-size: var(--font-size-base);
  color: var(--color-text);

  background: transparent;
  border-style: none;
  
  cursor: pointer;
}

.project-trigger-centre {
  display: flex;
  flex-direction: column;
}

.project-title {
  font-family: var(--font-regular);
  font-style: italic;
}

.project-reference,
.project-year {
  width: 81px;
  font-family: var(--font-mono);
}

.project-reference {
  text-align: left;
}

.project-year {
  text-align: right;
  font-variant-numeric: lining-nums;
}

/* =========================================================
   PROJECT DETAIL PANEL
========================================================= */

.project-detail {
  display: block;

  width: calc((var(--column-ratio-detail) / var(--column-count)) * 100%);
  height: 100%;
  padding: var(--spacing-unit) 0 var(--spacing-unit) var(--spacing-unit);

  text-align: center;

  background-image: linear-gradient(
    to bottom,
    transparent var(--spacing-unit),
    var(--color-border) var(--spacing-unit),
    var(--color-border) calc(100% - var(--spacing-unit)),
    transparent calc(100% - var(--spacing-unit))
  );
  background-repeat: no-repeat;
  background-size: 1px 100%;
  background-position: left top;

  overflow-y: auto;
}

.project-detail a {
  color: lightskyblue;
  text-decoration: none;
}

.project-detail a:hover {
  text-decoration: underline;
}

.project-detail__content {
  display: flex;
  flex-direction: column;

  width: 100%;
  padding-bottom: var(--spacing-unit);
}

.project-detail__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.project-detail__body {
  flex: 1;
  padding-bottom: var(--spacing-unit);
  min-height: 0;
}

/* =========================================================
   PRESENTATION
========================================================= */

.presentation-default {
  text-align: left;
  max-width: 900px;
}

.presentation-default :is(p, div) {
  margin-top: var(--spacing-unit);
}

.presentation-default :is(p, div):first-of-type {
  margin-top: 0;
}

.presentation-default a {
  color: lightskyblue;
  text-decoration: none;
}

.presentation-default a:hover {
  text-decoration: underline;
}

.presentation-credit {
  font-size: 16px;
  margin-top: var(--small-spacing-unit);  text-align: right;
  width: 100%;}

/* =========================================================
   DETAIL CONTENT
========================================================= */

.detail-close {
  display: none; 
  
  position: sticky;
  top: 0;
    
  background: white;
  padding-top: var(--spacing-unit);
  padding-bottom: var(--small-spacing-unit);

  border: none;
  border-bottom: var(--border-default);
  
  font-size: var(--font-size-base);
  cursor: pointer;
  
  z-index: 300;
  
  text-box-trim: trim-both;
}

.detail-text,
.detail-fiche,
.detail-meta {
  display: flex;
  flex-direction: column;
}

.detail-text {
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.detail-fiche {
  gap: var(--small-spacing-unit);
}

.detail-meta {
  gap: calc(var(--small-spacing-unit) * 2);
}

.detail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.detail-header-centre {
  display: flex;
  flex-direction: column;

  max-width: 500px;
  gap: calc(var(--spacing-unit) * 2);

  text-align: center;
}

.detail-reference,
.detail-year,
.detail-location,
.detail-tags,
.detail-title,
.detail-description {
  font-size: var(--font-size-heading);
  text-box-trim: trim-both;
}

.detail-description :is(p, div) {
  margin-top: var(--spacing-unit);
}

.detail-description :is(p, div):first-of-type {
  margin-top: 0;
}

.detail-reference,
.detail-year {
  width: 200px;
  font-family: var(--font-mono);
}

.detail-reference {
  text-align: left;
}

.detail-year {
  text-align: right;
  font-variant-numeric: lining-nums;
}

.detail-title {
  text-transform: uppercase;
}

/* =========================================================
   GALLERY
========================================================= */

.detail-slide-container {
  flex: 0 0 100%;
  display: flex; 
  flex-direction: column;
  position: relative;
  
  gap: var(--small-spacing-unit);
}

.gallery-counter {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0 var(--small-spacing-unit) 2px;
  font-size: var(--font-size-base);
  font-variant-numeric: lining-nums;
  font-family: var(--font-mono);
  background: #fff;
  border-bottom: var(--border-default);
  text-box-trim: trim-both;
}

.detail-gallery-caption {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1 1 0;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  text-align: center;
  line-height: 1.4;
  height: calc((2 * 1.4em) + var(--small-spacing-unit));
  min-height: calc((2 * 1.4em) + var(--small-spacing-unit));
  max-height: calc((2 * 1.4em) + var(--small-spacing-unit));
  overflow: hidden;
}

.detail-gallery {
  position: relative;
  
  width: 100%;
  
  overflow: hidden;
}

.detail-track {
  display: flex;

  width: 100%;

  transition: transform 0.4s ease;
  will-change: transform;
}

.detail-slide {
  flex: 0 0 100%;

  aspect-ratio: 15 / 10;

  background: #eee;
  overflow: hidden;
  position: relative;
}

.detail-slide img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
}

/* =========================================================
   GALLERY NAVIGATION
========================================================= */

.gallery-nav {
  position: absolute;
  bottom: 0;
  z-index: 10;

  padding: 0 var(--small-spacing-unit) 2px;

  font-size: var(--font-size-base);
  letter-spacing: 0.03em;
  color: var(--color-text);

  background: #fff;
  border: none;
  border-top: var(--border-default);

  cursor: pointer;

  text-box-trim: trim-both;
}

.gallery-prev {
  bottom: 0;
  left: 0;
}

.gallery-next {
  bottom: 0;
  right: 0;
}

/* =========================================================
   RESPONSIVE OVERLAY
========================================================= */
@media (max-width: 1130px) {
    
    .detail-gallery-caption {
    min-height: calc((3 * 1.4em) + var(--small-spacing-unit));
    max-height: calc((3 * 1.4em) + var(--small-spacing-unit));
    }
}


@media (max-width: 900px) {

  :root {
  --small-spacing-unit: 4px;
  --spacing-unit: 8px;

  --column-gap: var(--spacing-unit);
  --border-default: 1px solid var(--color-border);

  --font-size-base: 16px;
  --font-size-heading: 20px;
  }
  
  .portfolio {
    display: flex;
    flex-direction: column;
  }
  
  .site-wrapper {
    top: 31px;
  }

  .project-list {
    width: 100%;
  }


  .project-detail {
    position: fixed;

    top: 31px;
    left: 0;
    right: 0;
    bottom: 0;
    
    height: calc(100vh - 30px);
    width: 100%;
    
    background: white;
    z-index: 200;

    padding-top: 0px;
    padding-left: var(--spacing-unit);
    padding-right: var(--spacing-unit);
    padding-bottom: var(--spacing-unit);
    
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.35s ease;
  }
  
  .project-detail__body {
    padding-top: var(--spacing-unit);
  }

  .detail-gallery-caption {
    min-height: calc((4 * 1.4em) + var(--small-spacing-unit));
    max-height: calc((4 * 1.4em) + var(--small-spacing-unit));
  }
  
  /* Overlay actif */
  .portfolio[data-state="overlay"] .project-detail {
    transform: translateY(0%);
  }
  
  .portfolio[data-state="overlay"] .detail-close {
    display: block;
  }

} 
