/* Some CSS cribed from Emina Torlak's webpage: https://homes.cs.washington.edu/~emina/ */
/* Contact & Bio */
/** Contact */
#contact {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

#contact .information {
  max-width: 50%;
}

@media (max-width: 585px) {

  /* Adjust breakpoint as needed */
  #contact {
    flex-direction: column;
  }

  .portrait {
    border-radius: 50%;
  }

  #contact .portrait {
    order: 1;
  }

  #contact .information {
    order: 2;
    max-width: 100%;
    /* center text */
    text-align: center;
    justify-content: center;
  }

  #contact .contact-links {
    display: flex;
    justify-content: space-evenly;
    /* Ensure links are centered */
    width: 100%;
    /* Ensure the .contact-links take up full width to center content correctly */
    flex-wrap: wrap;
    /* Wrap items if necessary */
  }
}

.portrait {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  /* border-radius: 50%; */
  background-size: cover;
}

/*** Portrait Title */
.portrait-title {
  margin: 1em auto;
  /* text-align: center; */
}

.portrait-name {
  font-size: 48px;
}

.portrait-title h1,
.portrait-title h3,
.portrait-title h4 {
  margin: 0;
}

/*** Contact Links */
.big-icon {
  font-size: 2rem;
}

#contact a {
  border: none;
}

.contact-links {
  display: flex;
  gap: .7em;
  width: 200px;
}

.contact-link-item {
  flex: auto;
}

/** Post RSS */
.with-feed {
  display: flex;
  justify-content: space-between;
}

/********** Content *********/
section {
  margin-top: 3em;
}

a {
  color: rgb(0, 0, 0, 0.8);
  text-decoration: none;
  border-bottom: #aaa 0.1em dotted;
}

a:hover,
a:focus {
  background: #fbf3f3;
  transition-property: background;
  transition-duration: 0.2s;
}

/** Remove link styling */
a.unstyled-link {
  border: none;
}

a.unstyled-link:hover,
a.unstyled-link:focus {
  background: none;
}

/********** Layout **********/
body {
  margin: auto;
  width: 80%;
  max-width: 600px;
  background-color: #fffff8;
}

body.gallery-page {
  width: 90%;
  max-width: 1200px;
}

header {
  display: flex;
  flex-flow: row wrap;
  border-bottom: 1px solid #ddd;
  margin-top: 20px;
  justify-content: center;
}

.name {
  white-space: nowrap;
}

header h1 {
  margin-top: 0;
}

header a {
  color: #333333;
}

nav {
  flex: 0 0;
  height: 45px;
  white-space: nowrap;
  display: flex;
  align-content: end;
  align-items: end;
  justify-content: space-between;
}

a.nav-item {
  font-variant: small-caps;
  flex: 1;
  display: block;
  margin: 17px 0 0 0;
  padding: 0;
  text-transform: uppercase;
  font-weight: 500;
  text-align: center;
  border: none;
  border-bottom: 2px solid #fff;
  margin-right: 1em;
  margin-left: 1em;
}

a.nav-item:last-child {
  margin-right: 0;
}

a.nav-item:first-child {
  margin-left: 0;
}

a.nav-item:hover,
a.nav-item:focus {
  transition-property: border-bottom;
  border-bottom: 2px solid #000;
  transition-duration: 0.2s;
  background: none;
}

nav a.active {
  color: #A6A6AF;
}

.container {
  margin-top: 30px;
  margin-bottom: 30px;
}

footer {
  border-top: 1px solid #ddd;
  padding-top: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  font-weight: 300;
  font-size: 80%;
  text-align: center;
}

/********** Basic styling **********/

html,
button,
input,
select,
textarea {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: #333333;
  text-rendering: optimizeLegibility;
  /*hyphens: auto;*/
  counter-reset: sidenote-counter;

}

h1,
h2 {
  margin-top: 1em;
  margin-bottom: 0.1em;
}

h3 {
  margin-top: 0.5em;
}

h1,
h2,
h3 {
  font-weight: 300;
  hyphens: none;
}

/* Subsubheadings are a crutch. Don't use them. */
h4,
h5,
h6 {
  color: red;
}

h1 {
  font-size: 36px;
  line-height: 1.25;
  /* letter-spacing: -1px; */
}

h2 {
  font-size: 24px;
  line-height: 1.35;
}

h3 {
  font-size: 20px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  font-family: 'Bebas Neue';
}

hr {
  width: 10rem;
  border: 0;
  height: 1px;
  background: #aaa;
  text-align: left;
  margin-left: 0
}

p {
  margin: 15px 0px 15px 0px;
  /* max-width: 600px; */
  text-align: left;
}

ul {
  list-style: circle;
}

ol {
  list-style: decimal;
}

ol,
ul {
  margin-top: 0;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-top: 1px solid #E1E1E1;
  border-bottom: 1px solid #E1E1E1;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

figcaption {
  margin-top: 15px;
  font-size: 80%;
}

dt {
  margin-top: 15px;
}

/** Publication styling */
.publication {
  margin-bottom: 0.8em;
  display: flex;
  flex-flow: row wrap;
}

.publication-venue {
  font-weight: 300;
  vertical-align: top;
  flex: 1 100%;
}

.publication-venue i {
  font-weight: 400;
}

.publication-details {
  vertical-align: top;
  flex: 1 100%;
  margin-left: 1em;
  flex: 1 1;
}

.publication-title {
  font-size: 1.1em;
  line-height: 1.25;
  hyphens: none;
  margin-bottom: 0.2em;
}

.publication-author {
  font-size: 0.92em;
  color: #111;
}

.publication-highlight {
    color: black;
    font-weight: bold;
}

.publication-link>a {
  font-size: 0.92em;
  margin-left: -0.6em;
  margin-right: 0.2em;
}

/** Post Styling */

.post-tease {
  color: #999;
  font-size: 0.9em;
}

.post img {
  max-width: 90%;
}

.post h2 {
  padding-top: 15px;
  margin-top: 30px;
  max-width: 600px;
}

.post-header .date {
  margin-top: -0.3em;
}

.post-header {
  margin-bottom: 2em;
}

/*** Sidenotes */
.sidenote::before {
  content: counter(sidenote-counter) " ";
  font-size: 75%;
  top: -0.5rem;
}

.sidenote,
.marginnote {
  float: right;
  clear: right;
  margin-right: -60%;
  width: 300px;
  margin-top: 0.3rem;
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.3;
  vertical-align: baseline;
  position: relative;
}

.sidenote-number {
  counter-increment: sidenote-counter;
}

.sidenote-number::after {
  content: counter(sidenote-counter);
  display: inline-block;
  font-size: 80%;
  /* Remove space before and after footnote in markdown */
  margin-left: -0.5em;
  top: -0.5rem;
  left: 0.1rem;
}

.sidenote-number::after,
.sidenote::before {
  position: relative;
  vertical-align: baseline;
}

label.sidenote-number {
  display: inline;
}

input.margin-toggle {
  display: none;
}

label.margin-toggle:not(.sidenote-number) {
  display: inline;
}


@media (max-width: 1130px) {
  label.margin-toggle:not(.sidenote-number) {
    display: inline;
  }

  .sidenote,
  .marginnote {
    display: none;
  }

  .margin-toggle:checked+.sidenote,
  .margin-toggle:checked+.marginnote {
    display: block;
    float: left;
    left: 1rem;
    clear: both;
    width: 95%;
    margin: 1rem 2.5%;
    vertical-align: baseline;
    position: relative;
  }

  label {
    cursor: pointer;
  }
}

label.sidenote-number {
  display: inline;
}

label.margin-toggle:not(.sidenote-number) {
  display: none;
}

/*** Footnotes */
.footnote-definition>p {
  display: inline;
}

.footnote-definition {
  margin-bottom: 1em;
}

/********** Additional styling **********/

div.footnotes {
  max-width: 600px;
  border-top: 1px dashed #AAAAAA;
  margin-top: 40px;
  font-size: 80%;
}

.center {
  text-align: center;
}

.date {
  font-weight: 300;
  text-align: left;
}

.blurb {
  margin-bottom: 0.8em;
  display: flex;
  flex-flow: row wrap;
}

.blurb>.date {
  vertical-align: top;
  flex: 1 100%;
}

.blurb>.description {
  vertical-align: top;
  margin-left: 1em;
  flex: 1 1;
}

.blurb>.description>.title {
  vertical-align: top;
}

.blurb p {
  display: inline;
}

@media screen and (min-width: 585px) {
  .name {
    flex: 1 0;
  }

  a.nav-item:first-child {
    margin-left: 2em;
  }
}

@media screen and (min-width: 800px) {
  .blurb>.date {
    text-align: right;
    flex: 0 0 65px;
  }

  .blurb {
    margin-bottom: 4px;
  }

  .publication-venue {
    margin-left: 1em;
    text-align: right;
    flex: 0 0 90px;
  }

}

@media screen and (min-width: 1130px) {
  body {
    margin-left: 14%;
  }
}

/* On really big screens, shift the left margine more */
@media screen and (min-width: 1500px) {
  body {
    margin-left: 20%;
  }
}

@media screen and (min-width: 1800px) {
  body {
    margin-left: 25%;
    max-width: 800px;
  }
  body.gallery-page {
    margin-left: auto;
    max-width: 1200px;
  }

  .sidenote,
  .marginnote {
    margin-right: -45%;
  }
}

@media screen and (min-width: 2100px) {
  body {
    margin-left: 30%;
  }
}

/* Code blocks */
pre {
  font-size: 90%;
  border-radius: 5px;
  max-width: inherit;
  padding-left: 0.2em;
  overflow: auto;
  max-height: 25em;
  background-color: #fffff8;
  border-left: 2px solid #aaa;
}

code {
  font-family: "Source Code Pro", monospace;
  /* scroll if the block overflows */
  overflow: scroll;
  max-width: inherit;
  max-lines: 10;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.preview-gallery-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  align-items: start;
}


@media (min-width: 900px) {
  .preview-gallery-grid {
      grid-template-columns: 1fr 1fr 1fr;
  }
}

.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.gallery-item img:hover {
  transform: scale(1.03);
}
.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.gallery-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background-color: #fff;
  transition: box-shadow 0.2s ease;
}

.gallery-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-card h2 {
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.gallery-thumbnail {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-top: 0.5rem;
}



a img {
  display: block;
}

a img:hover {
  text-decoration: none;
}

/* Gallery preview column */
.gallery-preview-row {
  display: none;
}

@media screen and (min-width: 1000px) {
  .gallery-preview-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }
  .gallery-preview-row img {
    flex: 1;
    width: 100%;
  }
}
