/* Reset and base styles */
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  background: #fff;
  color: #222;
}

header {
  background: #2973C1; /* fallback */
  background: linear-gradient(
    to bottom,
    #2973C1 0%,
    #2362a5 100%
  );
  padding: 1rem;
  text-align: center;
  color: #fff;
}

footer {
  background: #2973C1;
  padding: 1rem;
  text-align: center;
  color: #fff;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
}

header p {
  margin: 0.5rem 0 0;
  color: #fff;
}

a {
  color: #007acc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}

/* Icon grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.icon-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
  background: #fff;
}

.icon-preview:hover {
  box-shadow: 0 0 0 2px #007acc44;
}

.icon-preview svg {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  fill: currentColor;
}

.icon-preview span {
  font-size: 0.875rem;
  text-align: center;
  color: #333;
}

/* Icon detail page */
.preview svg {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 1rem;
  fill: currentColor;
}

pre {
  background: #f4f4f4;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid #ccc;
  font-size: 0.85rem;
  line-height: 1.4;
}

.copy-btn {
  display: inline-block;
  margin-top: 0.5rem;
  background: #007acc;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  background: #005fa3;
}

ul {
  padding-left: 1.25rem;
}

footer p {
  font-size: 0.875rem;
  color: #fff;
  margin: 0.25rem 0;
}

header a {
  color: #fff;
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
}

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

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

.letter-nav {
  margin-bottom: 2rem;
  padding: 0.5rem;
  font-size: 0.95rem;
  text-align: center;
}

.letter-nav a {
  margin: 0 0.5rem;
  color: #007acc;
  text-decoration: none;
  font-weight: bold;
}

.letter-nav a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2.5rem 0;
}
.header-ad {
  text-align: center;
  background: #f9f9f9;
  padding: 1rem 0;
  border-bottom: 1px solid #ddd;
}

.header-ad img {
  max-width: 100%;
  height: auto;
}
.icon-search {
  text-align: center;
  margin: 1.5rem 0 0.5rem;
}

#iconSearch {
  padding: 0.5rem;
  width: 280px;
  max-width: 90%;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 3rem 0 2rem;
}

/* Smooth fade for sections */
section[id^="letter-"] {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

/* When hidden via JS */
section.fade-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Smooth fade for icon cards */
.icon-preview {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.icon-preview[style*="display: none"] {
  opacity: 0 !important;
  transform: scale(0.95);
}
.icon-grid .icon-preview {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body.scrolled header {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.3s ease;
}
.ad-icon {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 8px;
}