body {
  background: #111;
  color: #fff;
  font-family: 'Avenir', Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2.5rem 0.5rem 2.5rem;
  background: #181818;
  /* border-bottom: 1px solid #222; */
}

.site-logo {
  width: 96px;
  height: 96px;
  margin-right: 1.5rem;
  display: block;
  padding-left: 0.5rem;
}

nav {
  padding-right: 0.5rem;
}

nav a {
  color: #8800aa;
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.2s;
}

nav a.active, nav a:hover {
  color: #fff;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem 3rem 1rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}
h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 1.5rem 0 1rem 0;
}

.intro {
  color: #8800aa;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  font-weight: 400;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
  width: 100%;
  max-width: 1000px;
  margin-top: 2rem;
  min-width: 0;
  min-height: 0;
  justify-content: center;
}
.gallery-grid:only-child, .gallery-grid:empty {
  grid-template-columns: repeat(2, 1fr);
}
.gallery-grid img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(44, 34, 84, 0.18);
  background: #222;
  height: 180px;
  object-fit: cover;
}

.profile-photo {
  display: block;
  margin: 2rem auto 0 auto;
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 22px;
  border: 3px solid #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

footer {
  text-align: center;
  padding: 1.5rem 0 1rem 0;
  color: #8800aa;
  font-size: 0.95rem;
  background: #181818;
  /* border-top: 1px solid #222; */
}

footer a {
  color: #8800aa;
  text-decoration: underline;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.92);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.lightbox-image-container {
  position: relative;
  display: inline-block;
}
.lightbox-image-container img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
  display: block;
}
.lightbox-overlay:target {
  display: flex;
}
.lightbox-overlay .close {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: pointer;
  text-decoration: none;
}
.lightbox-overlay img {
  position: relative;
  z-index: 2;
}

.lightbox-arrow, .lightbox-close-btn {
  position: absolute;
  color: #fff;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  transition: none;
}
.lightbox-arrow.left {
  top: 50%;
  left: 2vw;
  transform: translateY(-50%);
}
.lightbox-arrow.right {
  top: 50%;
  right: 2vw;
  transform: translateY(-50%);
}
.lightbox-close-btn {
  top: 4vh;
  right: 4vw;
  left: auto;
  font-size: 1.8rem;
}

.gallery-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 280px;
  max-width: 100%;
  margin: 0;
}
.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.9rem;
  gap: 0.2rem;
  pointer-events: none;
  border-radius: 0 0 16px 16px;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
}
.gallery-item:hover .photo-caption {
  opacity: 1;
  pointer-events: auto;
}
.photo-caption span {
  display: block;
}
.photo-caption span:last-child {
  font-size: 0.8rem;
  opacity: 0.9;
}

.lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  padding: 2rem 1rem 1rem 1rem;
  font-size: 1.1rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  border-radius: 0;
  z-index: 3;
}
.lightbox-image-container:hover .lightbox-caption {
  opacity: 1;
}
.lightbox-caption .date {
  font-size: 0.9rem;
  opacity: 0.9;
}
.lightbox-caption .location {
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: center;
}
.social-link {
  color: #8800aa;
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-link:hover {
  color: #fff;
  transform: translateY(-2px);
}
.social-link svg {
  width: 24px;
  height: 24px;
}

.type-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  text-shadow: 0 2px 12px #000, 0 0 2px #fff2;
  background: rgba(0,0,0,0.38);
  pointer-events: none;
  border-radius: 16px;
  text-align: center;
  z-index: 2;
  letter-spacing: 0.04em;
  line-height: 1.1;
  padding: 0 0.5rem;
}
.gallery-back-btn-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-top: 2rem;
}
.gallery-back-btn {
  background: none;
  color: #8800aa;
  border: none;
  border-radius: 8px;
  padding: 0.3rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s;
  font-weight: 500;
  display: flex;
  align-items: center;
}
.gallery-back-btn .triangle {
  font-size: 1.2em;
  margin-right: 0.5em;
  display: inline-block;
}
.gallery-back-btn:hover {
  color: #fff;
}

.location-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.92);
  color: #181818;
  font-size: 1.2rem;
  font-weight: 500;
  border-radius: 0 0 16px 16px;
  padding: 0.7rem 0.5rem 0.5rem 0.5rem;
  text-align: center;
  z-index: 2;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.gallery-back-btn.bottom-right {
  position: fixed;
  right: 2.5rem;
  bottom: 2.5rem;
  margin: 0;
  z-index: 1001;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.5rem;
  max-width: 800px;
  margin: 2rem auto 0 auto;
  justify-content: center;
  justify-items: center;
}

.type-grid .gallery-item {
  width: 400px;
  max-width: 100%;
}

.gallery-grid h2 {
  font-size: 1.3rem !important;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}
.gallery-grid h3 {
  font-size: 1.05rem !important;
  font-weight: 500;
  margin: 1.5rem 0 1rem 0;
}

main h2 {
  font-size: 1.3rem !important;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  color: #fff;
}
main h3 {
  font-size: 1.05rem !important;
  font-weight: 500;
  margin: 1.5rem 0 1rem 0;
  color: #fff;
}

/* Sailing Page Styles */
.sailing-content {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

.sailing-section {
  margin-bottom: 3rem;
}

.sailing-section p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #ccc;
}

.external-link {
  color: #8800aa;
  text-decoration: none;
  transition: color 0.2s;
}

.external-link:hover {
  color: #fff;
}

.results-container {
  margin-top: 1.5rem;
}

.results-placeholder {
  background: #181818;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #333;
  text-align: center;
}

.results-placeholder p {
  margin: 0.5rem 0;
}

.note {
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
}

.sailing-photos {
  margin-top: 1.5rem;
}

.photo-placeholder {
  background: #181818;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #333;
  text-align: center;
  color: #888;
}

/* Racing Results Styles */
.top-finishes {
  margin: 2rem auto;
  max-width: 800px;
  width: 100%;
}

.top-finishes h3 {
  display: none;
}

.results-table {
  overflow-x: auto;
}

.results-table table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 1rem !important;
  table-layout: fixed !important;
}

.results-table th:nth-child(1),
.results-table td:nth-child(1) {
  width: 10% !important;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  width: 12% !important;
}

.results-table th:nth-child(3),
.results-table td:nth-child(3) {
  width: 8% !important;
}

.results-table th:nth-child(4),
.results-table td:nth-child(4) {
  width: 40% !important;
}

.results-table th:nth-child(5),
.results-table td:nth-child(5) {
  width: 30% !important;
}

.results-table th {
  color: #8800aa !important;
  padding: 1.5rem 1.5rem !important;
  text-align: center !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #333 !important;
}

.results-table td {
  padding: 1.5rem 1.5rem !important;
  border-bottom: 1px solid #333 !important;
  color: #ccc !important;
  text-align: center !important;
  vertical-align: middle !important;
}

.results-table tr:hover {
  /* Removed hover effect since no background */
}

.rank {
  font-weight: 600;
  color: #fff;
  text-align: center !important;
}

.date {
  color: #8800aa;
  font-weight: 500;
  text-align: center !important;
}

.series {
  color: #ccc;
  font-weight: 500;
  text-align: center !important;
}

.class {
  color: #ccc;
  text-align: center !important;
}

.races {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.race-result {
  background: #333;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: monospace;
  color: #ccc;
}

.race-result:contains("DNC") {
  color: #ff6b6b;
}

.race-result:contains("RTD") {
  color: #ffa500;
}

.race-number {
  color: #8800aa;
  font-weight: 500;
  text-align: center !important;
  font-family: monospace;
}

/* Sailing Page Layout */
.sailing-intro {
  margin: 2rem auto 0.5rem auto;
  max-width: 800px;
}

.intro-content {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.intro-photo {
  flex: 0 0 300px;
}

.sailing-photo {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #333;
}

.intro-photo .photo-placeholder {
  background: #181818;
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid #333;
  color: #888;
  font-style: italic;
  text-align: center;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-text-section {
  flex: 1;
  display: flex;
  align-items: center;
}

.intro-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #ccc;
  margin: 0;
}

.sailing-photos {
  margin: 3rem auto;
  max-width: 800px;
  text-align: center;
}

.sailing-photos h2 {
  color: #8800aa;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.photo-placeholder {
  background: #181818;
  padding: 3rem 2rem;
  border-radius: 12px;
  border: 1px solid #333;
  color: #888;
  font-style: italic;
}

.racing-results-section {
  text-align: center;
  margin: 0.5rem auto 0.5rem auto;
  max-width: 800px;
}

.racing-results-section h2 {
  color: #8800aa;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.results-intro {
  font-size: 1rem;
  line-height: 1.5;
  color: #ccc;
  margin: 0;
}

.external-link {
  color: #8800aa;
  text-decoration: none;
  font-weight: 500;
}

.external-link:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  header, main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2rem;
  }
  .site-logo {
    width: 64px;
    height: 64px;
  }
  .gallery-back-btn.bottom-right {
    right: 1rem;
    bottom: 1rem;
  }
  
  .results-container, .sailing-photos {
    margin-top: 1rem;
  }
  
  .results-table {
    font-size: 0.8rem;
  }
  
  .results-table th,
  .results-table td {
    padding: 0.4rem 0.3rem;
  }
  
  .races {
    gap: 0.3rem;
  }
  
  .race-result {
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
  }
  
  .sailing-content {
    padding: 0 0.5rem;
  }
} 

@media (max-width: 768px) {
  .intro-content {
    flex-direction: column;
    gap: 2rem;
  }
  
  .intro-photo {
    flex: none;
    width: 100%;
  }
  
  .intro-photo .photo-placeholder {
    height: 150px;
  }
} 