
/* ============================================
   WOMEN RECLAIMING AI
   COMPLETE WEBSITE STYLESHEET
   ============================================ */

/* GENERAL */

html {
  scroll-behavior: smooth;
}

.section {
  width: 80%;
  max-width: 1400px;
  margin: 75px auto 105px;
}

#about,
#events,
#collaborators {
  scroll-margin-top: 20px;
}

/* ============================================
   HEADER AND LOGO
   ============================================ */

header {
  height: clamp(240px, 20dvh, 300px);
  position: relative;
  box-sizing: border-box;
}

header img {
  position: absolute;
  display: block;
  top: 32px;
  right: 2%;
  height: calc(100% - 24px);
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  transform: none;
}

/* ============================================
   GAN PORTRAITS
   16 columns x 5 rows
   ============================================ */

#GANS {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  opacity: 0.62;
}

#ri-grid,
.ri-grid {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

#myList,
.ri-grid ul {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}

#myList li,
.ri-grid ul li {
  display: block;
  position: relative;
  float: none;
  width: 100%;
  height: auto;
  min-width: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #9b1515;
}

#myList li > img:not(.portrait-crossfade) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1 !important;
  transition: none !important;
}

/* Display exactly 80 portraits */

#myList li:nth-child(n+81) {
  display: none;
}

/* ============================================
   SMOOTH IMAGE CROSSFADE
   ============================================ */

#myList li > img.portrait-crossfade {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease-in-out;
}

/* ============================================
   ABOUT SECTION POSITION
   Keep About below first desktop screen
   ============================================ */

@media (min-width: 601px) {

  #about.section {
    margin-top: max(
      75px,
      calc(
        100dvh
        - clamp(150px, 20dvh, 210px)
        - 31.25vw
        + 2px
      )
    );
  }

}

/* ============================================
   ABOUT CONTENT
   ============================================ */

#about h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 400;
  text-align: right;
  margin: 0 2% 18px 0;
}

#about p {
  font-size: clamp(21px, 2.1vw, 28px);
  line-height: 1.55;
  width: 800px;
  max-width: 90%;
}

#about p img {
  display: block;
  max-width: 100%;
  width: min(450px, 100%);
}

#about .video {
  display: block;
  width: 760px;
  max-width: 100%;
  height: auto;
  margin: 24px auto 0;
}

/* ============================================
   ABOUT DESCRIPTION
   ============================================ */

#description {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: start;
}

#description .column {
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

#description .column > :first-child {
  margin-top: 0;
}

#description p {
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.65;
}

#description img {
  max-width: 80%;
}

/* ============================================
   EVENTS
   ============================================ */

#events {
  position: relative;
}

#events .events-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 70px;
}

#events .events-heading h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 400;
  position: relative;
  margin: 0 2% 4px 0;
  text-align: right;
}

#events .events-heading h1:after {
  right: 0;
  top: 50%;
  width: 105px;
  height: 16px;
}

#events .events-heading img {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: 42px;
  object-fit: contain;
  margin: 0 0 -2px auto;
}

/* Events table */

#events table {
  width: 100%;
  margin-top: 0;
  border-collapse: collapse;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.5;
}

#events table td {
  padding: 9px 8px;
  border-top: 1px solid rgba(0,0,0,0.55);
  vertical-align: top;
}

#events table td:first-child {
  width: 15%;
  min-width: 145px;
  border-right: 1px solid rgba(0,0,0,0.55);
  padding-left: 0;
}

#events table td:nth-child(2) {
  padding-left: 15px;
}

#events .event .details {
  padding-left: 12px;
}

#events .event-title,
#events .event .event-title {
  color: #fff;
  text-decoration: underline;
}

/* ============================================
   COLLABORATORS
   ============================================ */

#collaborators h1 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 34px;
}

#collaborators h1 img {
  position: static;
  width: 52%;
  height: auto;
  object-fit: contain;
}

#collaborators h1 span {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
}

#collaborators .collaborator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5%;
}

#collaborators .collaborator-column {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.55;
}

#collaborators .collaborator-column li {
  margin: 0;
  padding: 0;
}

#collaborators p {
  font-size: 13px;
  column-count: 1;
}

/* ============================================
   FOOTER
   ============================================ */

footer .logos a {
  color: #ff1212;
}

footer .contact a {
  color: #ff1212;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

/* ============================================
   DIALOGFLOW CHATBOT
   ============================================ */

df-messenger {
  --df-messenger-bot-message: #e9f0ff;
  --df-messenger-button-titlebar-color: #ff1212;
  --df-messenger-chat-background-color: #fff;
  --df-messenger-send-icon: #ff1212;
  --df-messenger-user-message: #e7e7e7;
  z-index: 1000;
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 600px) {

  header {
    height: auto;
    min-height: 150px;
  }

  header img {
    position: relative;
    display: block;
    top: auto;
    right: auto;
    left: auto;
    height: auto;
    width: 80%;
    max-width: 390px;
    transform: none;
    margin: 12px 3% 12px auto;
  }

  #GANS,
  #ri-grid,
  .ri-grid {
    width: 100%;
    max-width: 100%;
  }

  #myList,
  .ri-grid ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* Show 25 images on mobile */
  #myList li:nth-child(n+26) {
    display: none;
  }

  .section {
    width: 85%;
    margin: 45px auto 75px;
  }

  #about.section {
    margin-top: 45px;
  }

  #about h1,
  #events .events-heading h1,
  #collaborators h1 span {
    font-size: 25px;
  }

  #about h1 {
    margin: 0 0 16px;
  }

  #about p {
    font-size: 21px;
    line-height: 1.45;
    width: 100%;
    max-width: 100%;
  }

  #about p img {
    width: min(100%, 360px);
  }

  #about .video {
    width: 100%;
    max-width: 100%;
  }

  #description {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  #description .column {
    width: 100%;
  }

  #description p {
    font-size: 15px;
    line-height: 1.6;
  }

  #events .events-heading {
    min-height: 65px;
  }

  #events .events-heading img {
    width: min(95%, 330px);
    height: auto;
    margin: 0 0 3px auto;
  }

  #events table {
    font-size: 12px;
  }

  #events table td:first-child {
    min-width: 90px;
    width: 31%;
  }

  #events table td:nth-child(2) {
    padding-left: 8px;
  }

  #collaborators h1 {
    align-items: center;
  }

  #collaborators h1 img {
    display: block;
    width: 65%;
    max-width: 85%;
  }

  #collaborators .collaborator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  #collaborators .collaborator-column {
    font-size: 14px;
    line-height: 1.55;
  }
}

/* ============================================
   SMALLER DESKTOPS
   ============================================ */

@media (min-width: 601px) and (max-width: 900px) {

  #about p {
    font-size: 21px;
  }

  #description {
    gap: 24px;
  }

  #description p {
    font-size: 15px;
  }

  #events table {
    font-size: 12px;
  }
}

/* ============================================
   REDUCED MOTION ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  #myList li > img.portrait-crossfade {
    transition: none;
  }
}


/* ============================================
   MOBILE WIDTH AND LAYOUT FIX
   ============================================ */

@media (max-width: 600px) {

  /* Prevent unintended sideways scrolling */
  html, body {
    width: 100%;
    margin: 0;
    overflow-x: clip;
  }

  /* GAN grid extends to both screen edges */
  #GANS {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  #ri-grid,
  .ri-grid,
  #myList,
  .ri-grid ul {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Five equal-width portrait columns */
  #myList,
  .ri-grid ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  #myList li {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }

  #myList li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Keep the first 25 portraits visible */
  #myList li:nth-child(n+26) {
    display: none;
  }

  /* Keep text sections comfortably inset */
  .section {
    width: 88%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* Video fits neatly within About section */
  #about .video {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}



