/* ============================================
   Guildya – Clean modern design system
   White backgrounds, neutral grays, terracotta accent
   ============================================ */

/* --- Base & Smoothing --- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --- HTMX Transitions --- */
.htmx-swapping { opacity: 0; transition: opacity 0.2s ease-out; }
#main-content { transition: opacity 0.2s ease-in; }

/* --- Alpine --- */
[x-cloak] { display: none !important; }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #E0E0E0; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #BDBDBD; }

/* --- Selection color --- */
::selection { background: #C75C2E; color: white; }

/* ===== Craft Card ===== */
.craft-card {
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
}
.craft-card:hover {
  box-shadow: 0 12px 28px -6px rgba(0,0,0,0.12), 0 4px 10px -4px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

/* ===== Masonry Layout ===== */
.masonry-grid {
  columns: 4;
  column-gap: 1.25rem;
}
.masonry-grid > * {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  display: inline-block;
  width: 100%;
}
@media (max-width: 1280px) {
  .masonry-grid { columns: 3; }
}
@media (max-width: 768px) {
  .masonry-grid { columns: 2; column-gap: 0.75rem; }
  .masonry-grid > * { margin-bottom: 0.75rem; }
}

/* Dense masonry for landing */
.masonry-grid-dense {
  columns: 5;
  column-gap: 1rem;
}
.masonry-grid-dense > * {
  break-inside: avoid;
  margin-bottom: 1rem;
  display: inline-block;
  width: 100%;
}
@media (max-width: 1280px) {
  .masonry-grid-dense { columns: 3; }
}
@media (max-width: 768px) {
  .masonry-grid-dense { columns: 2; column-gap: 0.75rem; }
  .masonry-grid-dense > * { margin-bottom: 0.75rem; }
}

/* ===== Pin Save Button ===== */
.pin-save-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}
.group:hover .pin-save-btn {
  opacity: 1;
  transform: scale(1);
}

/* ===== Pin Overlay ===== */
.pin-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.06) 40%, transparent 65%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.group:hover .pin-overlay { opacity: 1; }

/* ===== Aspect Ratios ===== */
.aspect-craft { aspect-ratio: 4/3; }
.aspect-portrait { aspect-ratio: 3/4; }
.aspect-square { aspect-ratio: 1; }
.aspect-editorial { aspect-ratio: 3/2; }

/* ===== Process Timeline ===== */
.process-step::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 2.5rem;
  bottom: -0.5rem;
  width: 1px;
  background: #E0E0E0;
}
.process-step:last-child::before { display: none; }

/* ===== Tabs ===== */
.tab-active {
  border-bottom: 2px solid #C75C2E;
  color: #1A1A1A;
}

/* ===== Filter Chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid #E0E0E0;
  background: transparent;
  color: #757575;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover {
  background: #F5F5F5;
  color: #1A1A1A;
  border-color: #BDBDBD;
}
.chip.active {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

/* ===== Star Ratings ===== */
.star-gold { color: #C75C2E; }
.star-gold.filled { fill: #C75C2E; color: #C75C2E; }
.star-gold.empty { opacity: 0.2; }

/* ===== Scrollbar Hide ===== */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #F5F5F5 25%, #FFFFFF 50%, #F5F5F5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ===== Stagger Animations ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fadeUp 0.55s ease-out both;
}
.stagger-1 { animation-delay: 0.06s; }
.stagger-2 { animation-delay: 0.12s; }
.stagger-3 { animation-delay: 0.18s; }
.stagger-4 { animation-delay: 0.24s; }
.stagger-5 { animation-delay: 0.3s; }
.stagger-6 { animation-delay: 0.36s; }

/* ===== Input styling ===== */
.input-editorial {
  border: 1px solid #E0E0E0;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-editorial:focus {
  outline: none;
  border-color: #C75C2E;
  box-shadow: 0 0 0 3px rgba(199, 92, 46, 0.1);
}

/* ===== Button styles ===== */
.btn-primary {
  background: #C75C2E;
  color: white;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-primary:hover {
  background: #A84A22;
}
.btn-primary:active {
  transform: scale(0.98);
}

/* ===== Nav underline indicator ===== */
#main-nav a.active {
  position: relative;
}
#main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -0.375rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 2px;
  background: #C75C2E;
  border-radius: 999px;
}
