@import './blocks.css';

:root {
  --purple: #8D306B;
  --darkgreen: #05561F;
  --white: #F8F5EE;
  --green: #64D790;
  --grey: #DDDDD6;
  --yellow: #E0FF00;
  --darkgrey: #707070;
  --black: #323233;
  --grid-border: 1px solid #111;
  --grid-gap: 0px;
  --panel-padding: 14px 24px;
}

body{
  overflow-x: hidden;
  max-width: 100vw;
  padding: 0;
  margin: 0;
  font-family: helvetica;
  background: var(--white);
  color: var(--black);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
}

h1{
  line-height: 1.05;
}

p{
  line-height: 1.4;
}

/*
 * Header styles
 */

.site-header {
  border-bottom: var(--grid-border);
  background: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--panel-padding);
  max-width: 100%;
}

.logo {
  flex-shrink: 0;
}

.logo a {
  display: block;
  text-decoration: none;
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
}

.main-nav {
  flex-shrink: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 48px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--black);
  text-decoration: none;
  font-size: 24px;
  font-weight: 400;
  transition: opacity 0.2s ease;
}

.nav-list a:hover {
  opacity: 0.7;
  text-decoration: none;
}

/*
 * Mobile header
 */

@media (max-width: 800px) {
  .header-inner {
    padding: 16px var(--panel-padding);
  }
  
  .logo-img {
    height: 40px;
  }
  
  .nav-list {
    gap: 20px;
  }
  
  .nav-link {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .nav-list {
    gap: 16px;
    width: 100%;
    justify-content: center;
  }
}


* {
  box-sizing: border-box;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
  min-height: calc(100vh - 80px);
  border-top: var(--grid-border);
  border-left: var(--grid-border);
}

.home-grid.is-viewing-all {
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
}

/*
 * The active panel always takes the complete left column.
 */
.home-panel.is-active {
  grid-column: 1;
  grid-row: 1 / -1;
}

/*
 * When viewing all, the active panel takes 75% of the width
 */
.home-grid.is-viewing-all .home-panel.is-active {
  grid-column: 1;
  grid-row: 1 / -1;
}

/*
 * Inactive panels are placed underneath each other on the right.
 */
.home-panel:not(.is-active) {
  grid-column: 2;
}


/*
 * JavaScript sets these more reliable row classes whenever
 * the active panel changes.
 */
.home-panel.is-secondary-first {
  grid-column: 2;
  grid-row: 1;
}

.home-panel.is-secondary-second {
  grid-column: 2;
  grid-row: 2;
}

.home-panel.is-secondary-third {
  grid-column: 2;
  grid-row: 3;
}

.home-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: var(--grid-border);
  border-bottom: var(--grid-border);
}

/*
 * When viewing all, the active panel content should be scrollable
 */
.home-grid.is-viewing-all .home-panel.is-active .panel-content {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: fit-content;
  margin: 14px auto;
  padding: 10px 24px;
  color: inherit;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  border-radius: 24px;
  border: 0;
  position: relative;
  z-index: 5;
}

.panel-heading.projects-heading {
  background-color: var(--purple);
}
.panel-heading.projects-heading span, .panel-heading.precedents-heading span{
  color: var(--white);
  font-weight: 300;
}
.panel-heading.precedents-heading {
  background-color: var(--darkgreen);
}
.panel-heading.places-heading {
  background-color: var(--yellow);
} 
.panel-heading.people-heading {
  background-color: var(--green);
}

.panel-count {
  display: grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}

.panel-content {
  padding: var(--panel-padding);
  position: relative;
  z-index: 1;
}

.entries-grid {
  display: grid;
  gap: 0;
}

.entry-card {
  padding: 18px 0;
  border-bottom: var(--grid-border);
}

.entry-card:first-child {
  padding-top: 0;
}

/*
 * Hide entries beyond the 10th item in each panel
 */
.entries-grid .entry-card:nth-child(n+11) {
  display: none;
}

/*
 * When viewing all, show all entries (with !important to override nth-child rule)
 */
.home-grid.is-viewing-all .entries-grid .entry-card {
  display: block !important;
}

.entry-card h3 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2vw, 32px);
  line-height: 1.05;
}

.entry-card a {
  color: inherit;
  text-decoration: none;
}

.entry-card a:hover {
  text-decoration: underline;
}

.entry-card p {
  max-width: 52ch;
  margin: 0;
  line-height: 1.4;
}

.view-all {
  display: inline-block;
  margin-top: 24px;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.view-all:hover {
  text-decoration: underline;
}

.back-button {
  position: absolute;
  top: 14px;
  left: 24px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 20px;
  color: var(--black);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
  line-height: 1.2;
}

.back-button:hover {
  background: var(--black);
  color: var(--white);
  text-decoration: none;
}

.home-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-right: var(--grid-border);
  border-bottom: var(--grid-border);
}

/*
 * Inactive section presentation
 */
.home-panel:not(.is-active) {
  cursor: pointer;
}

.home-panel:not(.is-active) .panel-content {
  max-height: calc(30vh - 80px);
  overflow: hidden;
  overflow-y: auto;
}

.home-panel:not(.is-active) .entry-card {
  padding: 10px 0;
}

.home-panel:not(.is-active) .entry-card h3 {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 24px);
}

.home-panel:not(.is-active) .entry-card p {
  display: none;
}

.home-panel:not(.is-active) .view-all {
  display: none;
}


/*
 * Detail grid: 75% content, 25% related items
 */

.detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 3fr)
        minmax(260px, 1fr);
    min-height: calc(100vh - 80px);
    border-top: var(--grid-border);
    border-left: var(--grid-border);
    view-transition-name: content-grid;
}

.detail-main,
.detail-related {
    min-width: 0;
    border-right: var(--grid-border);
    border-bottom: var(--grid-border);
}

.detail-main {
    view-transition-name: main-panel;
}

.detail-related {
    view-transition-name: related-panel;
}


/* Main content */

.detail-header {
    padding: var(--panel-padding);
}

.detail-back {
    display: inline-block;
    margin: 0 0 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.detail-header h1 {
    margin: 0;
    margin-bottom: 14px;
    font-size: 60px;
    font-weight: inherit;
    overflow-wrap: anywhere;
}

.detail-content {
    padding: var(--panel-padding);
}

.detail-introduction {
    max-width: 45rem;
    margin: auto;
    margin-bottom: clamp(48px, 8vw, 120px);
    font-size: 36px;
    line-height: 1.05;
}


/* Related column */

/* Related column */

.detail-related {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 100%;
    overflow: visible;
}

.related-section {
    position: relative;
    inset: auto;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
}

.related-section + .related-section {
    border-top: var(--grid-border);
}

.related-section h2 {
    position: relative;
    margin: 14px auto;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: inherit;
    line-height: 1;
    background-color: var(--grey);
    width: fit-content;
}

.related-section.projects h2 {
    background-color: var(--purple);
    color: var(--white);
}
.related-section.precedents h2 {
    background-color: var(--darkgreen);
    color: var(--white);
}
.related-section.places h2 {
    background-color: var(--yellow);  
}
.related-section.people h2 {  
    background-color: var(--green);
}

.related-list {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.related-item {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    padding: 16px var(--panel-padding);
    border-bottom: var(--grid-border);
}

.related-item:last-child {
    border-bottom: 0;
}

.related-item h3 {
    margin: 0;
    font-size: clamp(17px, 1.5vw, 24px);
    font-weight: inherit;
    line-height: 1.1;
}

.related-item h3 a {
    color: inherit;
    text-decoration: none;
}

.related-item h3 a:hover {
    text-decoration: underline;
}

.related-item p {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.35;
}

.related-empty {
    margin: 0;
    padding: var(--panel-padding);
}

.main-image img{
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 24px auto;
  object-fit: cover;
}

/* people page */
.type-people .detail-header h1{
  font-size: 36px;
  position: absolute;
  top: 90px;
}
.type-people .main-image img{
  width: 100%;
  height: 100%;
  display: block;
  margin: 0 auto 24px auto;
  object-fit: cover;
  border-radius: 50%;
  max-width: 400px;
  max-height: 400px;
  aspect-ratio: 1/1;
}
.type-people .detail-introduction{
  text-align: center;
}

.type-projects .detail-header{
  display: flex;
}

.type-projects .detail-header-text{
  margin-left: 24px;
}

.type-projects .detail-header .main-image{
  max-width: 50%;
  height: auto;
}

article{
  background: var(--white);
}

aside{
  z-index: -1;
}

.places-panel .entry-card{
  position: relative;
}

.places-panel .entry-card h3{
  padding-left: 45px;
}

.places-panel .entry-card:before{
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--yellow);
}

.places-map {
  position: relative;
  display: none;
  height: calc(100vh - 148px);
  min-height: 520px;
  overflow: hidden;
  background: transparent;
}

.places-panel.is-active .places-map {
  display: block;
}

.places-panel.is-active .entries-grid {
  display: none;
}

.home-grid.is-viewing-all .places-panel.is-active .places-map {
  height: calc(100vh - 148px);
}

.places-map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.places-map-canvas {
  position: absolute;
  inset: 0;
  transform: scale(1.3);
  transform-origin: center;
}

.places-map-lines path {
  fill: none;
  stroke: var(--darkgrey);
  stroke-width: 0.45px;
  stroke-linecap: round;
  opacity: 0.7;
  vector-effect: non-scaling-stroke;
}

.places-map-lines .places-map-link--project {
  stroke: var(--purple);
}

.places-map-lines .places-map-link--person {
  stroke: var(--green);
}

.places-map-lines .places-map-link--precedent {
  stroke: var(--darkgreen);
}

.places-map-lines .places-map-link--concept {
  stroke: var(--darkgrey);
}

.places-map-lines .places-map-link--other {
  stroke: var(--black);
}

.places-map-node {
  position: absolute;
  left: var(--place-x);
  top: var(--place-y);
  display: block;
  width: min(calc(28px + (var(--place-connections) * 10px)), 78px);
  height: min(calc(28px + (var(--place-connections) * 10px)), 78px);
  color: var(--black);
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.places-map-marker {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--black);
  border-radius: 50%;
  background: var(--yellow);
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.places-map-relations {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.places-map-relation {
  --relation-radius: calc(42px + (var(--place-connections) * 7px) + var(--relation-offset));
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--relation-radius);
  height: 1px;
  transform: rotate(calc(360deg / var(--relation-count) * var(--relation-index)));
  transform-origin: left center;
}

.places-map-relation::before {
  position: absolute;
  inset: 0;
  content: "";
  background: currentColor;
  opacity: 0.6;
}

.places-map-relation-dot {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  content: "";
  border: 1px solid var(--black);
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
  animation: places-relation-pulse 2.8s ease-in-out infinite;
  animation-delay: calc(var(--relation-index) * -0.35s);
}

@keyframes places-relation-pulse {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(1.2);
  }
}

.places-map-relation--project {
  color: var(--purple);
}

.places-map-relation--person {
  color: var(--green);
}

.places-map-relation--precedent {
  color: var(--darkgreen);
}

.places-map-relation--concept {
  color: var(--darkgrey);
}

.places-map-relation--other {
  color: var(--black);
}

.places-map-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 160px;
  padding: 5px 8px;
  background: var(--white);
  font-size: 14px;
  line-height: 1.1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
  z-index: 3;
}

.places-map-node:hover .places-map-marker,
.places-map-node:focus-visible .places-map-marker {
  transform: scale(1.3);
}

.places-map-node:hover .places-map-label,
.places-map-node:focus-visible .places-map-label {
  opacity: 1;
}

.places-map-node:focus-visible {
  outline: none;
}

@media (max-width: 800px) {
  .places-map {
    height: calc(100vh - 130px);
    min-height: 440px;
  }

  .places-map-label {
    font-size: 12px;
  }
}

/* People Carousel */
.people-carousel {
  --carousel-gap: 24px;
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 56px;
}

.carousel-track-wrapper {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: var(--carousel-gap);
  justify-content: flex-start;
  will-change: transform;
}

.carousel-track .people-card {
  flex: 0 0 calc((100% - (var(--carousel-gap) * 4)) / 5);
  text-align: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: calc((100% - (var(--carousel-gap) * 4)) / 5);
}

.related-section .people-carousel {
  --carousel-gap: 8px;
  padding: 0 24px;
  padding-bottom: 14px;
}

.related-section .carousel-track .people-card {
  flex-basis: calc((100% - (var(--carousel-gap) * 2)) / 3);
  min-width: 0;
  width: calc((100% - (var(--carousel-gap) * 2)) / 3);
}

.related-section .people-card  .people-card-image{
      max-height: 300px;
      max-width: 300px;
      margin-left: auto;
      margin-right: auto;
}


.related-section .carousel-track {
  justify-content: center;
}

.related-section .people-card h3 {
  font-size: clamp(13px, 1vw, 14px);
  overflow-wrap: break-word;
}

.related-section .carousel-button {
  width: 32px;
  height: 32px;
}

.related-section .carousel-button svg {
  width: 16px;
  height: 16px;
}

.related-section .carousel--single .carousel-track,
.related-section .carousel--pair .carousel-track {
  justify-content: center;
}

.related-section .carousel--single .people-card {
  flex-basis: 100%;
  width: 100%;
}

.related-section .carousel--pair .people-card {
  flex-basis: calc((100% - var(--carousel-gap)) / 2);
  width: calc((100% - var(--carousel-gap)) / 2);
}

/* Tablet: show 3 items with peek effect */
@media (min-width: 801px) and (max-width: 1200px) {
  .carousel-track .people-card {
    flex-basis: calc((100% - (var(--carousel-gap) * 2)) / 3);
    width: calc((100% - (var(--carousel-gap) * 2)) / 3);
  }
}

/* Mobile: one complete card per view */
@media (max-width: 800px) {
  .people-carousel {
    --carousel-gap: 16px;
  }

  .carousel-track .people-card {
    flex-basis: 100%;
    width: 100%;
  }

  .related-section .carousel--pair .carousel-track {
    justify-content: flex-start;
  }

  .related-section .carousel--pair .people-card {
    flex-basis: calc((100% - var(--carousel-gap)) / 2);
    width: calc((100% - var(--carousel-gap)) / 2);
  }

  .related-section .people-carousel {
    padding: 0 24px;
  }
}

.people-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50%;
  margin-bottom: 12px;
  background: var(--grey);
}

.people-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.people-card h3 {
  margin: 0;
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 400;
  line-height: 1.2;
}

.people-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.people-card a:hover {
  text-decoration: none;
}

.people-card a:hover h3 {
  text-decoration: underline;
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--white);
  border: 1px solid var(--black);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.carousel-button[hidden] {
  display: none;
}

.carousel-button:hover {
  background: var(--black);
  color: var(--white);
}

.carousel-button:hover svg {
  stroke: var(--white);
}

.carousel-button-prev {
  left: 0;
}

.carousel-button-next {
  right: 0;
}

.carousel-button svg {
  width: 24px;
  height: 24px;
  stroke: var(--black);
}

/* Tablet */
@media (max-width: 1200px) {
  .people-carousel {
    padding: 0 52px;
  }
}

/* Mobile */
@media (max-width: 800px) {
  .people-carousel {
    padding: 0 48px;
  }
  
  .carousel-button {
    width: 40px;
    height: 40px;
  }
  
  .carousel-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Mobile */
@media (max-width: 800px) {
  .home-grid {
    display: block;
    min-height: auto;
  }

  .home-panel,
  .home-panel.is-active,
  .home-panel.is-secondary-first,
  .home-panel.is-secondary-second, .home-panel.is-secondary-third {
    min-height: auto;
  }

  .home-panel:not(.is-active) .panel-content {
    display: none;
  }

  .home-panel.is-active .panel-content {
    display: block;
  }

  .panel-heading {
    font-size: 28px;
  }
      .detail-grid {
        display: block;
        min-height: auto;
    }

    .detail-header h1 {
        font-size: clamp(48px, 16vw, 90px);
    }

    .detail-related {
        border-top: var(--grid-border);
    }
}