/* Import Source Serif Pro font */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+Pro:wght@300;400;600;700&display=swap');

:root {
  --text-color: #444;  /* Darkened for better readability with serif */
  --heading-color: #222;
  --link-color: #39c;
  --border-color: #e5e5e5;
  --code-color: #333;
  
  /* Refined spacing scale */
  --base-size: 18px;
  --line-height: 1.6;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Layout variables */
  --side-padding: 8rem;
  --column-gap: 6rem;
  --content-width: 1000px;
  --sidebar-width: 260px;
}

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  padding: var(--spacing-xl) var(--side-padding);
  font-family: 'Source Serif Pro', Georgia, "Times New Roman", serif;
  font-size: var(--base-size);
  line-height: var(--line-height);
  color: var(--text-color);
  font-weight: 400;  /* Regular weight for serif */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Refined Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  line-height: 1.1;
  font-weight: 600;
  margin: 0 0 var(--spacing-md);
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin-bottom: var(--spacing-md);
  white-space: normal; /* Allow text to wrap */
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
  margin-top: var(--spacing-xl);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--spacing-lg);
}

h4 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
}

h5, h6 {
  font-size: 1rem;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Content spacing */
p, ul, ol {
  margin: 0 0 var(--spacing-sm);
}

/* Tighter list spacing */
ul, ol {
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
}

/* Update small text elements */
small, a small {
  font-size: 0.875rem;
}

/* Layout */
.wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-areas: 
    "header main";
  gap: var(--column-gap);
  align-items: start;
  margin-bottom: 0;
  padding-bottom: 0;
}

header {
  width: 100%;
  position: sticky;
  top: var(--spacing-xl);
  grid-area: header;
}

.main-content {
  width: 100%;
  grid-area: main;
}

.social-links {
  margin-top: var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.social-links .icon {
  color: var(--text-color);
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.social-links .icon svg {
  width: 20px; /* Make icons slightly smaller */
  height: 20px;
}

.social-links .icon:hover {
  opacity: 1;
  color: var(--link-color);
}

/* Section spacing */
section > * + h2,
section > * + h3,
section > * + h4 {
  margin-top: var(--spacing-xl);  /* More space before new sections */
}

/* Add this new rule for the first h4 in the section */
section > h4:first-child {
  margin-top: 0;
}

/* Content Elements */
blockquote {
  border-left: 1px solid var(--border-color);
  margin: 0;
  padding: 0 0 0 20px;
  font-style: italic;
}

/* Code blocks */
code, pre {
  font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
  font-size: 0.875rem;
}

pre {
  padding: 8px 15px;
  background: #f8f8f8;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: #444;
}

/* Other Elements */
dt {
  color: #444;
  font-weight: 700;
}

img {
  max-width: 100%;
}

strong {
  color: var(--heading-color);
  font-weight: 700;
}

hr {
  border: 0;
  background: var(--border-color);
  height: 1px;
  margin: 0 0 20px;
}

/* Responsive adjustments */
@media print, screen and (max-width: 1400px) {
  :root {
    --side-padding: 6rem;
    --column-gap: 5rem;
  }
}

@media print, screen and (max-width: 1200px) {
  :root {
    --side-padding: 4rem;
    --column-gap: 4rem;
  }
}

@media print, screen and (max-width: 960px) {
  .wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "header"
      "main"
      "social";
  }
  
  header {
    position: static;
  }
  
  .social-links {
    margin-top: var(--spacing-md);
  }

  .scroll-indicator {
    display: none;
  }
}

@media print, screen and (max-width: 720px) {
  body {
    word-wrap: break-word;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  pre, code {
    word-wrap: normal;
  }

  .slideshow-container {
    margin-bottom: 0;
  }
}

@media print, screen and (max-width: 480px) {
  :root {
    --side-padding: 1rem;
  }
  
  body {
    padding: var(--spacing-md) var(--side-padding);
  }
  
  h1 {
    font-size: 1.5rem;
  }
}

@media print {
  body {
    padding: 0.4in;
    font-size: 12pt;
    color: #444;
  }
}

/* Slideshow styles */
.slideshow-container {
    margin: 50px 0 0 0; /* Remove bottom margin */
    padding: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    background: #f5f5f5;
}

.swiper {
    width: 100%;
    height: 700px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

.swiper-slide {
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-container {
    width: 1000px;
    height: 600px;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

/* Default for horizontal images */
.image-container img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Special handling for vertical images */
.image-container img.vertical {
    max-width: 400px; /* Fixed width instead of percentage */
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Multi-image specific styles */
.multi-image .image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    justify-content: center;
}

/* Adjust vertical images in multi-image layout */
.multi-image .image-container img.vertical {
    max-width: 400px; /* Fixed width for vertical images in multi-layout */
    max-height: 95%;
    margin: 0 10px;
}

/* Video container styles */
.video-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin: 0 auto; /* Center the container */
}

.swiper-slide .video-container {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    height: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.swiper-slide .video-container iframe {
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 450px;
    margin: 0 auto;
}

.slide-caption {
    width: 100%;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    padding: 0px;
    margin-top: 5px;
    background: rgba(245, 245, 245, 0.95);
}

/* Add responsive adjustments */
@media (max-width: 1100px) {
    .image-container {
        width: 90vw;
        height: 500px;
    }

    .image-container img.vertical {
        max-width: 300px;
    }

    .multi-image .image-container img.vertical {
        max-width: 250px;
    }

    .swiper-slide .video-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .swiper {
        height: 500px;
    }
    
    .image-container {
        width: 100%;
        height: 400px;
        padding: 10px;
    }

    .image-container img.vertical {
        max-width: 250px;
    }
    
    .multi-image .image-container {
        padding: 10px;
        gap: 10px;
    }

    .multi-image .image-container img.vertical {
        max-width: 200px;
        margin: 0 5px;
    }

    .swiper-slide .video-container {
        height: 400px;
        padding: 0 10px;
    }

    .swiper-slide .video-container iframe {
        max-width: 100%;
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .swiper {
        height: 400px;
    }

    .image-container {
        height: 300px;
        padding: 5px;
    }

    .image-container img.vertical {
        max-width: 200px;
    }

    .multi-image .image-container {
        padding: 5px;
        gap: 5px;
    }

    .multi-image .image-container img.vertical {
        max-width: 150px;
        margin: 0;
    }

    .swiper-slide .video-container {
        height: 300px;
        padding: 0 5px;
    }

    .swiper-slide .video-container iframe {
        max-height: 250px;
    }

    .slide-caption {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* Navigation arrows base styles */
.swiper-button-next,
.swiper-button-prev {
    color: #666;
    transform: scale(0.6);
    top: 50%; /* Center vertically */
    margin-top: -20px; /* Half of the arrow height */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    color: var(--link-color);
}

/* Adjust arrow size and position for different screen sizes */
@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        transform: scale(0.4);
        margin-top: -15px; /* Adjusted for smaller arrows */
    }

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

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

@media (max-width: 480px) {
    .swiper-button-next,
    .swiper-button-prev {
        transform: scale(0.3);
        margin-top: -10px; /* Adjusted for smallest arrows */
    }

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 20px !important;
    }

    .swiper-button-next {
        right: -5px;
    }

    .swiper-button-prev {
        left: -5px;
    }
}

.scroll-indicator {
  margin: 4rem 0 2rem 0;
  color: #666;
}

.scroll-indicator p {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  text-align: left;
  line-height: 1.4;
}

.scroll-arrow {
  animation: bounce 2s infinite;
  margin-left: 40px;
  margin-top: -10px;
  width: 40px;
  height: 40px;
  display: block;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
} 