/* ==========================================================================
   1. GLOBAL & RESET STYLES
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  font-family: "Source Serif 4", serif;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

h1 {
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  font-size: 36pt;
  line-height: 42pt;
}

h2, h3, th {
  font-family: "PT Sans", "Source Sans 3", sans-serif;
}

main div {
  margin: 0;
  padding: 10pt;
}

#teaser,
#articles {
  border: 1px solid;
}

/* ==========================================================================
   2. NAVIGATION BAR
   ========================================================================== */

nav.site-nav {
  width: 100%;
}

nav.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0 0 10pt 0;
  padding: 0.5rem 1rem;
  background-color: #eeeeec;
  box-shadow: 0 3pt 3pt 0 gray;
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  gap: 1rem;
}

nav.site-nav li {
  font-size: 14pt;
}

#logo {
  width: 64pt;
  height: 64pt;
  display: block;
}

nav.site-nav li.language-code,
nav.site-nav li.language-switcher {
  margin-left: auto;
  font-weight: bold;
}

nav.site-nav li.language-switcher {
  display: flex;
  gap: 0.5rem;
}

nav.site-nav a {
  text-decoration: none;
  color: inherit;
}

nav.site-nav a.active {
  font-weight: bold;
  border-bottom: 2px solid #4F52B2;
}

@media (max-width: 600px) {
  nav.site-nav ul {
    gap: 0.75rem;
    padding: 0.5rem;
  }

  nav.site-nav li {
    font-size: 12pt;
  }

  nav.site-nav li.nav-item {
    font-size: 11pt;
  }
}

/* ==========================================================================
   3. BASE LAYOUT & GRID
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 2rem;
  line-height: 1.15em;
  font-size: 14pt;
}

/* Prevent layout overflow inside grid items */
.grid > div,
.blog-posts,
.list-content,
.project,
.page-body {
  min-width: 0;
  width: 100%;
}

.grid > div:last-child {
  border-top: 1px solid #ececee;
  padding-top: 1.5rem;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 280px;
  }

  .grid > div:last-child {
    border-top: none;
    padding-top: 0;
    padding-left: 1.5rem;
  }
}

/* ==========================================================================
   4. CONTENT ELEMENTS, TABLES & CODE
   ========================================================================== */

div.highlight pre,
code {
  max-width: 100%;
  width: 100%;
  margin: 1.5rem 0;
  box-sizing: border-box;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11pt;
}

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ececee;
}

th, td {
  padding: 5pt;
}

tbody tr:nth-child(odd) { background-color: #ececec; }
tbody tr:nth-child(even) { background-color: #ffffff; }

.page-children li {
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  padding: 2pt;
  list-style: square;
  line-height: 1.15em;
}

.address {
  border: 1px #ececee solid;
  background-color: #ececee;
}

ul#main-page-news,
ul#main-page-blog {
  list-style: none;
}

.page-content p img {
  max-width: 50%;
  display: block;
  margin: 0 auto;
}

p.centered-image {
  text-align: center;
}

a.button-teams {
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  display: inline-block;
  padding: 18px 32px;
  background-color: #4F52B2;
  color: white;
  font-size: 18pt;
  font-weight: bold;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Pagination */
#pagination-container {
  text-align: center;
}

ul.pagination {
  font-family: "PT Serif", "Source Serif 4", serif;
  margin: 0 0 10pt 0;
}

ul.pagination li {
  list-style: none;
  display: inline-block;
  font-size: 14pt;
  margin-left: 10pt;
}

/* ==========================================================================
   5. BLOG & POSTS
   ========================================================================== */

.post {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ececee;
}

.post-header {
  margin-bottom: 1rem;
}

.post-date {
  display: block;
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.post-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.post-title a,
.project h2 a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover,
.project h2 a:hover {
  color: #4F52B2;
}

.post-content {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Centered & Styled Media (Images, Videos, IFrames) */
.post-content img,
.post-content video,
.post-content iframe {
  width: auto;
  max-width: 100%;       /* Mobile: scale fluidly within viewport */
  height: auto;
  display: block;
  margin: 1.5rem auto;   /* Centers horizontally with vertical spacing */
  border-radius: 8px;    /* Rounded corners for a polished look */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); /* Subtle drop shadow */
}

/* Ensure embedded iframes (e.g. YouTube) maintain proper aspect ratio */
.post-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Tablet & Desktop: Limit media width so it doesn't dominate text */
@media (min-width: 600px) {
  .post-content img,
  .post-content video,
  .post-content iframe {
    max-width: 50%;
  }
}

.post-content pre,
.post-content table {
  max-width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   6. TEAM PROFILES
   ========================================================================== */

div.person,
article.person {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ececee;
}

img.team-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  display: block;
}

.person-info {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

.person-bio {
  margin: 0 0 1rem 0;
  padding: 0;
}

.person-social {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.social-row {
  display: grid;
  grid-template-columns: auto min-content 1fr;
  align-items: center;
  margin: 0;
  padding: 0;
}

.network-label {
  font-weight: bold;
  color: #333;
  text-align: right;
  min-width: 65px;
}

.colon {
  padding: 0 0.4rem;
  text-align: center;
  font-weight: bold;
}

.social-row a {
  color: #4F52B2;
  text-decoration: underline;
  word-break: break-all;
}

.social-row a:hover {
  color: #333;
}

@media (min-width: 600px) {
  div.person,
  article.person {
    grid-template-columns: 300px 1fr;
  }
}

/* ==========================================================================
   7. PAGE & PROJECT TEASERS
   ========================================================================== */

.project h2 {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  margin-bottom: 0.75rem;
}

.project-body,
.page-layout-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.project-text {
  width: 100%;
  flex: 1 1 auto;
}

.teaser-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.teaser-container:empty {
  display: none;
}

.page-teaser-img {
  width: 150px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Limit teasers to 1 image on mobile */
.teaser-container .page-teaser-img:nth-child(n+2) {
  display: none;
}

/* Desktop layout rules */
@media (min-width: 600px) {
  .teaser-container .page-teaser-img:nth-child(n+2) {
    display: block;
  }

  .page-layout-wrapper:has(.teaser-container) {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 2rem;
    align-items: start;
  }

  .teaser-container {
    grid-column: 2;
    grid-row: 1;
  }

  .page-body {
    grid-column: 1;
    grid-row: 1;
  }
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */

footer {
  text-align: right;
  font-family: "PT Sans", "Source Sans 3", sans-serif;
  padding: 10pt;
  background-color: #eeeeec;
  margin-top: 10pt;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  align-items: center;
}

.footer-grid > div:first-child {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
}

#linkedin,
#mastodon {
  width: 32px;
  display: inline-block;
}
