body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #fff;
  color: #333;
  overflow-x: hidden;
}

.header-spacer {
  height: 40px;
  background: #fff;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #C0F0AF;
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
  border-bottom: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  text-decoration: none;
}

.logo {
  height: 100px;
  margin-top: -30px;
  margin-bottom: -30px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
  transform: translateY(-5px) scale(1.05);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.text-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #007acc;
}

.nav-link.current {
  color: #007acc;
}

.icon-nav {
  display: none;
}
.icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}
.icon-link:hover { color: #007acc; }
.icon-link svg { width: 24px; height: 24px; display: block; }

.social-nav {
  display: flex;
  align-items: center;
}

/* Archive grid */
.horse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.horse-card {
  border: none;
  border-radius: 3px;
  padding: 10px 10px 28px;
  background: #fff;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: #333;
  display: block;
  box-shadow: 0 6px 14px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
  transform: rotate(-2deg);
}
.horse-card:nth-child(even) {
  transform: rotate(2deg);
}
.horse-card:nth-child(3n) {
  transform: rotate(-1deg);
}

.horse-card img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eee;
}

.horse-card:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.horse-card .n {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.page-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Home / Horse of the Day */
.horse-of-day-title {
  font-size: 2rem;
  margin: 2rem 0 1rem;
  text-align: center;
  color: #444;
  font-weight: 600;
}

.horse-of-day-image {
  display: block;
  margin: 0 auto 1rem;
  max-width: 80%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.view-link, .archive-link {
  display: block;
  text-align: center;
  color: #007acc;
  font-weight: bold;
  text-decoration: none;
  margin-bottom: 3rem;
}
.view-link:hover, .archive-link:hover { text-decoration: underline; }

/* Single horse page */
.frame {
  max-width: 420px;
  margin: 30px auto 0;
  text-align: center;
  background: #fff;
  padding: 16px 16px 46px;
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
  transform: rotate(-2deg);
}
.frame.tilt-right {
  transform: rotate(2deg);
}
.frame .pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #E8A33D;
  box-shadow: 0 2px 3px rgba(0,0,0,0.3), inset 0 -2px 2px rgba(0,0,0,0.15);
  margin: -30px auto 12px;
  position: relative;
  z-index: 2;
}
.frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eee;
}
.caption {
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 0.75rem;
}
.counter {
  color: #777;
  font-size: 0.9rem;
  margin-top: 0.2rem;
}
.pagenav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}
.pagenav a, .pagenav span {
  font-size: 1.4rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.pagenav a {
  color: #333;
  background: #C0F0AF;
}
.pagenav a:hover { background: #007acc; color: #fff; }
.pagenav span {
  color: #ccc;
  border: 2px solid #eee;
}
.back-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: #007acc;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* About page */
.about-wrap {
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.75;
  font-size: 1.8rem;
}
.about-wrap h1 { color: #444; font-size: 2.6rem; }

footer {
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  padding: 20px 0 40px;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .header-spacer { height: 16px; }

  .site-header {
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
  }
  .logo {
    height: 44px;
    margin-top: -8px;
    margin-bottom: -8px;
  }
  .site-title {
    font-size: 1rem;
  }
  .text-nav {
    display: none;
  }
  .icon-nav {
    display: flex;
    align-items: center;
    gap: 0.9rem;
  }
  .icon-link svg { width: 22px; height: 22px; }

  .page-container {
    margin: 1rem auto;
    padding: 0 0.75rem;
  }

  .horse-of-day-title {
    font-size: 1.5rem;
    margin: 1rem 0 0.75rem;
  }

  .frame {
    max-width: 100%;
    margin: 20px 8px 0;
    padding: 12px 12px 34px;
    transform: rotate(-1deg);
  }
  .frame.tilt-right { transform: rotate(1deg); }

  .horse-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
  }
  .horse-card {
    margin: 4px;
  }
  .horse-card,
  .horse-card:nth-child(even),
  .horse-card:nth-child(3n) {
    transform: rotate(-0.5deg);
  }
  .horse-card:nth-child(even) { transform: rotate(0.5deg); }
}
