* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #f7f7f7;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  -webkit-font-smoothing: auto;
}

::selection { background: #222; color: #fff; }

a { color: #0000EE; }
a:visited { color: #551A8B; }
a:hover { text-decoration: none; }

/* ===== HEADER ===== */
.header {
  border-bottom: 1px solid #ccc;
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  background: #f0f0f0;
}

.header h1 {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: -0.02em;
}

.header h1 a {
  text-decoration: none;
  color: inherit;
}

.header nav {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.header nav a {
  text-decoration: none;
  color: #0000EE;
}

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

/* ===== SEARCH ===== */
.search-bar {
  border-bottom: 1px solid #ddd;
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fafafa;
}

.search-bar input {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid #bbb;
  width: 280px;
  outline: none;
}

.search-bar input:focus {
  border-color: #888;
}

.search-bar button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  padding: 5px 14px;
  background: #eee;
  border: 1px solid #bbb;
  cursor: pointer;
}

.search-bar button:hover {
  background: #ddd;
}

.search-bar .filter-links {
  margin-left: 12px;
  font-size: 12px;
  color: #666;
}

.search-bar .filter-links a {
  margin: 0 4px;
  font-size: 12px;
}

/* ===== CATEGORIES ===== */
.categories {
  padding: 14px 24px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 13px;
  background: #fff;
}

.categories a {
  text-decoration: none;
  color: #0000EE;
  white-space: nowrap;
}

.categories a:hover {
  text-decoration: underline;
}

.categories a .count {
  color: #888;
  font-size: 11px;
}

/* ===== FONT LISTING ===== */
.listings {
  max-width: 900px;
  padding: 0 24px;
}

.listing {
  border-bottom: 1px solid #e8e8e8;
  padding: 14px 0;
}

.listing:hover {
  background: #ffffee;
  margin: 0 -24px;
  padding: 14px 24px;
}

.listing-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.listing-title {
  font-size: 14px;
  font-weight: bold;
}

.listing-title a {
  text-decoration: none;
  color: #0000EE;
}

.listing-title a:hover {
  text-decoration: underline;
}

.listing-price {
  font-weight: bold;
  color: #222;
  font-size: 14px;
}

.listing-free {
  font-weight: bold;
  color: #080;
  font-size: 14px;
}

.listing-soon {
  font-weight: bold;
  color: #888;
  font-size: 14px;
}

.listing-meta {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.listing-preview {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.3;
  color: #111;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.listing-tags {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 1px 6px;
  background: #eee;
  border-radius: 2px;
  color: #555;
  text-decoration: none;
}

.tag:hover {
  background: #ddd;
  color: #333;
}

/* ===== DETAIL PAGE (shown when clicking a font) ===== */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.3);
}

.detail-overlay.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.detail-panel {
  background: #fff;
  border: 1px solid #ccc;
  max-width: 700px;
  width: 100%;
  padding: 24px;
}

.detail-panel .back-link {
  font-size: 13px;
  margin-bottom: 16px;
  display: inline-block;
}

.detail-panel h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.detail-panel .detail-designer {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.detail-panel .detail-preview {
  font-size: 48px;
  line-height: 1.2;
  padding: 24px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
  color: #111;
}

.detail-panel .detail-preview-input {
  font-family: inherit;
  font-size: 48px;
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  color: #111;
}

.detail-info {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 20px;
  color: #444;
}

.detail-info span {
  color: #222;
  font-weight: bold;
}

.buy-section {
  border-top: 1px solid #eee;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.buy-btn {
  display: inline-block;
  padding: 8px 24px;
  background: #eee;
  color: #0000EE;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #bbb;
  cursor: pointer;
  text-decoration: none;
}

.buy-btn:hover {
  background: #ddd;
}

.buy-btn.free {
  background: #eee;
  color: #080;
}

.buy-btn.free:hover {
  background: #ddd;
}

.buy-price {
  font-size: 20px;
  font-weight: bold;
  color: #222;
}

/* ===== VARIABLE SLIDER ===== */
.variable-controls {
  border: 1px solid #eee;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #fafafa;
}

.variable-controls label {
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.variable-controls label:last-child {
  margin-bottom: 0;
}

.variable-controls label b {
  min-width: 50px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

.variable-controls input[type="range"] {
  flex: 1;
  height: 2px;
  accent-color: #222;
}

.variable-controls .val {
  min-width: 30px;
  text-align: right;
  font-size: 12px;
  font-family: monospace;
  color: #444;
}

/* ===== PAGE CONTENT (for standalone pages) ===== */
.page-wrap {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 24px;
}

.page-panel {
  background: #fff;
  border: 1px solid #ccc;
  padding: 24px;
}

.page-panel h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid #ccc;
  padding: 16px 24px;
  font-size: 12px;
  color: #888;
  margin-top: 40px;
  background: #f0f0f0;
}

.footer a {
  color: #888;
}

/* ===== FONT FACE ===== */
@font-face {
  font-family: 'Talc';
  src: url('Talc/WOFF2/Talc-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@media (max-width: 600px) {
  .header { padding: 12px 16px; }
  .search-bar { padding: 8px 16px; }
  .categories { padding: 10px 16px; }
  .listings { padding: 0 16px; }
  .listing:hover { margin: 0 -16px; padding: 14px 16px; }
  .listing-preview { font-size: 22px; }
  .detail-panel .detail-preview { font-size: 32px; }
  .detail-panel .detail-preview-input { font-size: 32px; }
  .search-bar input { width: 160px; }
  .page-wrap { margin: 20px auto; padding: 0 16px; }
}
