@charset "UTF-8";

/*
  ## Table of Contents

  1 GLOBAL RULES AND DEFINITIONS
  1.1 Variables & font definitions
  1.2 Reset & Normalization
  1.3 General Typography
  1.4 Images & Figures

  2 Layout Helpers & Reusable Components
  2.1 Kirbytext
  2.2 Grid & Layout

  3 Site Layout
  3.1 Sidebar
  3.2 Main Content

  4 Template-specific Components
  4.1 Midtstilt bilete
  4.2 Prosjektoversikt
  4.3 Prosjektside
  4.4 Bildestraum

*/
/* =====  1 Global Rules & Definitions  ===================================== */
/* -----  1.1 Variables & font definitions  --------------------------------- */
:root {
  --background: #e5e5e5;
  --foreground: #000;
  --flavor: #db221e;
  --aa: #E0B152;
  --ah: #F48771;
  --brg: #D99362;
  --in: #4D7FB2;
  --jm: #9E8BD8;
  --mj: #FF5E1A;
  --nl: #2E56BC;
  --od: #64B46B;
  --pp: #1B984F;
  --sk: #CF90D5;
  --font: 'terza', courier, serif;
  --grid-margin: 1rem;
  --neg-gm: -1rem;
  --double-grid-margin: 2rem;
  --break-1: 80em;
}

@font-face {
  font-family: 'terza';
  src: url(../fonts/TerzaEditor-Regular-Web.woff2);
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'terza';
  src: url(../fonts/TerzaEditor-RegularItalic-Trial.otf);
  font-weight: 400;
  font-style: italic;
}

/* -----  1.2 Reset & Normalization  ---------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  border: none;
  box-sizing: border-box;
  list-style: none;
}

article, aside, details, figcaption, figure,
footer, header, main, menu, nav, section, summary {
  /* Add correct display for IE 9- and some newer browsers */
  display: block;
}

::-moz-selection {
  color: var(--flavor);
}

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

::selection {
  color: var(--flavor);
}

/* -----  1.3 General Typography  ------------------------------------------- */
h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, pre {
  /* Reset font-sizes and normalize margins */
  font-size: 1rem;
  line-height: inherit;
  margin: 0;
  font-weight: 400;
}

h1 {
  font-variant-numeric: lining-nums;
}

em {
  font-family: inherit;
}

a {
  text-decoration: none;
  font-variant-numeric: lining-nums;
  color: var(--foreground);
}

a:hover {
  text-decoration: underline;
}

/* -----  1.4 Images & Figures  --------------------------------------------- */

img {
    max-width: 100%;
}

/* =====  2 Layout Helpers & Reusable Components  =========================== */
/* The Clearfix™: A classic … */
.cf::after {
  content: "";
  display: block;
  height: 0;
  overflow: hidden;
  clear: both;
}

/* -----  2.1 Kirbytext  ---------------------------------------------------- */
p {
  margin-bottom: .675rem;
}

/* -----  2.2 Grid & Layout  ------------------------------------------------ */
main {
  max-width: 70em;
  margin: 0 auto;
  padding: var(--grid-margin);
  display: grid;
  /* overflow: hidden; */
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr;
  column-gap: var(--grid-margin);
  row-gap: var(--grid-margin);
}


/* =====  3 Site Layout  ==================================================== */
html {
  background: var(--background);
  color: var(--foreground);
  font: normal 500 1.3em/1.4 var(--font);
  font-size: clamp(1em, 1.25vw, 1.5em);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Always show the vertical scrollbar to prevent `jumps`
     of page content after navigating from a very short page
     that does not scroll to a long pager */
  overflow-y: scroll;
  /* Setting this to `default` prevents the cursors from
     changing when hovering blocks of text or whitespace,
     which is less distracting */
  cursor: default;
  /* Neccessary for sticks footer. */
  position: relative;
  height: 100vh;
  /* Fallback for browsers that do not support Custom Properties */
  height: calc(var(--vh) * 100);
  /* Prevent adjustments of font size after orientation
     changes in IE and iOS. */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  /* Highlight color for WebKit-bases touch devices. */
  -webkit-tap-highlight-color: rgba(255, 180, 50, .5);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  transition: all 50ms ease-out;
  will-change: background;
  z-index: 0;
}

/* ----- 3.1  Header/sidebar  ----------------------------------------------- */
header, .navigation {
    grid-column: 1 / span 6;
}

/* -----  3.2 Main Content  ------------------------------------------------- */
.primary {
    max-width: 100%;
    grid-column: 7 / span 6;
}

a.classmate {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    column-gap: var(--grid-margin);
    row-gap: var(--grid-margin);
    z-index: 2;
}

a.classmate p {
  margin-bottom: 0;
}

/* a.classmate:hover {
  color: var(--background);
  text-decoration: none;
} */

.hero-reveal {
  display: block; /* Change this from 'none' to 'block' to make it always render, but invisible by default */
  position: fixed; 
  translate: -50% -50%; /* This centers the image */
  top: 50vh; /* Position the image vertically in the middle of the viewport */
  left: 50vw; /* Position the image horizontally in the middle of the viewport */
  z-index: 1; /* Set to a lower z-index so it's beneath the link text */
  width: 60vw; /* Adjust the size of the image */
  max-height: 65vh;
  opacity: 0; /* Make the image initially invisible */
  visibility: hidden; /* Make the image invisible */
  transition: opacity 0.3s ease, visibility 0.3s ease, top 0.3s ease; /* Smooth transitions */
}

.classmate:hover + .hero-reveal {
  opacity: 1; /* Make the image fully visible */
  visibility: visible; /* Ensure the image is visible */
  z-index: 1; /* Place the image under the text but above the background */
}

/* -----  3.3 Project page  ------------------------------------------------- */
.project-detail {
    grid-column: 1 / span 12;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: 1fr;
    column-gap: var(--grid-margin);
    row-gap: var(--grid-margin);
    margin-bottom: var(--double-grid-margin);
}

.project-detail h2 {
    grid-column: 1 / span 2;
    position: sticky;
    position: -webkit-sticky;
    top: var(--grid-margin);
}

.project-detail h3 {
  position: sticky;
  position: -webkit-sticky;
  top: var(--grid-margin);
}

h3.designer-name {
  grid-column: 3 / span 5;
}

h3.project-name {
  grid-column: 8 / span 5;
}

h3.designer-name-mobile {
  display: none;
}

h3.project-name-mobile {
  display: none;
}

.project-text {
  grid-column: 3 / span 10;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  column-gap: var(--grid-margin);
  row-gap: var(--grid-margin);
  margin-bottom: var(--double-grid-margin);
}

.personal {
    grid-column: 1 / span 5;
    display: grid;
    grid-template-rows: auto;
    row-gap: var(--grid-margin);
    height: fit-content;
}

.project-info {
    grid-column: 6 / span 5;
    display: grid;
    grid-template-rows: auto;
    row-gap: var(--grid-margin);
    height: fit-content;
}

.specimen {
    grid-column: 1 / span 12;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--grid-margin);
    margin-bottom: var(--double-grid-margin);
    width: 100%; 
    height: auto;
    aspect-ratio: 16/9;
}

.specimen img {
  width: auto;
  flex-shrink: 0;
  height: 100%;
  margin-right: var(--grid-margin);
}

.process {
  display: grid; 
  grid-column: 3 / span 10;
  column-gap: var(--grid-margin);
  row-gap: var(--grid-margin);
}

.process img {
width: 100%;
}

.flickity-viewport {
  width: 100%; /* Ensure the Flickity viewport takes up full width of the parent */
}
.flickity-slider {
  display: flex; /* Ensure the slider is laid out as a flex container */
  width: 100%; /* Ensure the entire slider takes the full width */
}
.flickity-cell {
  flex-shrink: 0; /* Prevent shrinking */
  flex-grow: 0; /* Prevent growing */
  width: auto; /* Allow width to be determined by the images inside */
}

/* Container for the whole slider */
.slider-container {
  position: relative;
  grid-column: span 12;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;  /* Enable horizontal scroll */
  overflow-y: hidden;  /* Disable vertical scroll */
  scroll-snap-type: x mandatory;  /* Snapping on scroll */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  display: block;
  aspect-ratio: 16/9;
  height: 100%;
  box-sizing: border-box;
}

/* The actual slider (this will hold the images) */
.slider {
  display: flex;
  width: max-content;
  height: 100%;  /* Full height of the container */
  align-items: center;  /* Vertically center slides if needed */
}

/* Each slide (image container) */
.slide {
  flex: 0 0 auto;  /* Prevent the slides from shrinking or growing */
  width: auto;  /* Ensure each slide is the full width of the container */
  height: 100%;  /* Ensure the height is 100% of the slider's height */
  scroll-snap-align: center;  /* Ensure each slide snaps to the center */
  display: flex;  /* Use flexbox for centering the image */
  justify-content: center;
  align-items: center;
  margin-right: 1rem;  /* Optional: space between slides */
}

.slide:last-of-type {
  margin-right: 0;
}

/* Make images fill the slide area while maintaining aspect ratio */
.slide img {
  height: 100%;  /* The height is 100% of the slide */
  width: auto;   /* The width is adjusted automatically to maintain aspect ratio */
  object-fit: cover;  /* Ensure the image covers the slide area without distortion */
}


.bottom-menu {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto 1fr;
  grid-column: 1 / span 12;
  column-gap: var(--grid-margin);
  row-gap: var(--grid-margin);
  height: calc(100vh - var(--double-grid-margin));
}

/* =====  4 Library styling ==================================== */
/* -----  4.1 Flickity  --------------------------------------------- */
.flickity-page-dots {
  right: 0;
  bottom: -1.5rem;
  width: auto;
  color: var(--foreground);
}

.flickity-page-dots .dot {
  width: 2px;
  height: 2px;
  margin-right: 0;
  margin-top: auto;
  margin-bottom: auto;
  opacity: 1;
  position: relative;
  top: -2px;
  background-color: var(--foreground);
}

.flickity-page-dots .dot.is-selected {
  width: 6px;
  height: 6px;
  top: 0;
  opacity: 1;
}

html, a, .project-detail h3 {
  transition: background 0.1s ease, color 0.1s ease, mix-blend-mode 0.1s ease;
}

/* =====  5 Media Queries ==================================== */

@media all and (max-width: 80em) {
  header, .navigation {
    grid-column: 1 / span 5;
  }

  .primary {
    grid-column: 6 / span 7;
  }
}

@media all and (max-width: 52em) {
  header, .navigation {
    grid-column: 1 / span 12;
    margin-bottom: var(--double-grid-margin);
    height: fit-content;
  }

  .primary {
    grid-column: 1 / span 12;
  }

  .name {
    grid-column: 1 / span 6;
  }

  .project {
    grid-column: 7 / span 6;
  }
  
  a.classmate {
    margin-bottom: calc(var(--grid-margin) / 2);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-column: 1 / span 12;
    column-gap: var(--grid-margin);
    row-gap: var(--grid-margin);
  }

  a.classmate p {
    font-size: 1.3rem;
  }

  .project-detail h2 {
    display: none;
  }

  .project-text {
    grid-template-columns: repeat(12, 1fr);
    grid-column: 1 / span 12;
    row-gap: var(--double-grid-margin);
  }

  h3.designer-name, h3.project-name {
    display: none;
  }
  
  h3.designer-name-mobile, h3.project-name-mobile {
    grid-column: 1 / span 4;
    display: block;
    position: static;
  }
  
  .personal, .project-info {
    grid-column: 5 / span 8;
  }

  .process {
    grid-column: 1 / span 12;
  }

}


@media all and (max-width: 40em) {
  a.classmate {
    margin-bottom: var(--grid-margin);
  }

  .name {
    grid-column: 1 / span 8;
  }

  .project {
    grid-column: 9 / span 4;
  }

  .hero-reveal {
    width: 80vw;
  }

}

@media all and (max-width: 32em) {
  .project-text {
    row-gap: var(--grid-margin);
  }

  h3.designer-name-mobile, h3.project-name-mobile {
    grid-column: 1 / span 12;
    display: block;
    position: static;
  }

  .personal, .project-info {
    grid-column: 1 / span 12;
  }

  .personal {
    margin-bottom: var(--double-grid-margin);
  }

  a.classmate p {
    font-size: 1rem;
  }

  .hero-reveal {
    width: 85vw;
  }
}


@media all and (max-width: 24em) {
  a.classmate {
    row-gap: 0;
    margin-bottom: var(--double-grid-margin);
  }

  a.classmate p {
    font-size: 1.25rem;
  }

  .name {
    grid-column: 1 / span 12;
  }

  .project {
    grid-column: 1 / span 12;
  }

}

