@import 'tailwindcss';

/*
 * Adeptus — Warhammer Theme
 * Ciemna, premium estetyka z akcentami złota i krwistej czerwieni
 */

/* === Tailwind v4 Theme === */
@theme {
  --color-wh-black: #0a0a0f;
  --color-wh-darker: #111118;
  --color-wh-dark: #1a1a24;
  --color-wh-surface: #22222e;
  --color-wh-border: #2e2e3a;
  --color-wh-muted: #6b6b80;
  --color-wh-text: #c8c8d4;
  --color-wh-light: #e4e4ec;
  --color-wh-gold: #c9a84c; /* Custodes Gold (Bazowy, stonowany) */
  --color-wh-gold-light: #e4c96a;
  --color-wh-gold-dark: #8a6d1b;
  --color-wh-red: #8b1a1a;
  --color-wh-red-light: #c41e1e;
  --color-wh-red-dark: #5a0f0f;
  --color-wh-blue: #1a3a6b;

  /* Frakcje (Palety Tonowane, Grimdark) */
  --color-deathguard: #4a5d23;
  --color-deathguard-light: #6b823b;
  --color-deathguard-dark: #2e3b15;
  
  --color-spacewolves: #4b6b8b;
  --color-spacewolves-light: #6a8db3;
  --color-spacewolves-dark: #2e4359;
  
  --color-thousandsons: #106a78;
  --color-thousandsons-light: #2699a8;
  --color-thousandsons-dark: #073840;

  --color-nightlords: #1c2341;
  --color-nightlords-red: #8b1a1a;
  --color-nightlords-red-dark: #4a0d0d;

  --color-custodes: #d4af37;

  --font-heading: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Inter', 'Atkinson', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* === Global Styles === */
:root {
  --box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  color: var(--color-wh-text);
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:not(.admin-body) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--color-wh-black);
  background-image: linear-gradient(rgba(10, 10, 15, 0.8), rgba(10, 10, 15, 0.8)), url('/images/banners/metal-texture-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

main {
  flex-grow: 1;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-wh-gold);
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.4em; }
h5 { font-size: 1.15em; }

a {
  color: var(--color-wh-gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-wh-gold-light);
}

strong, b {
  font-weight: 700;
  color: var(--color-wh-light);
}

p {
  margin-bottom: 1em;
}

/* === Main Content === */
main:not(.admin-main) {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex-grow: 1;
}

/* === Utilities === */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

/* === Grimdark Card Edges (Ujednolicenie PostCard i ProductCard) === */
.post-card, .product-card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 0 !important;
  clip-path: polygon(5% 0, 100% 0, 100% 95%, 95% 100%, 0 100%, 0 5%);
  transition: transform 0.2s, box-shadow 0.2s, border 0.2s;
}

/* Wygląd Kafelków Bloga (Night Lords / Death Guard) */
.post-card {
  background: rgba(18, 18, 25, 0.6);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(139, 26, 26, 0.2);
  background: rgba(18, 18, 25, 0.9);
}
.post-card-link {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.post-card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Wygląd Kafelków Sklepu (Space Wolves / Thousand Sons) */
#shop h2, .product-card h3 {
  color: var(--color-spacewolves-light);
}
.product-card {
  background: var(--color-wh-dark);
  padding: 1.5rem;
  border-top: 2px solid var(--color-thousandsons-light);
  border-bottom: 2px solid var(--color-spacewolves-dark);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(106, 141, 179, 0.15);
  border-top: 2px solid var(--color-thousandsons);
}
.product-card > p {
  flex-grow: 1;
}

.posts-grid, .products-grid {
  align-items: stretch;
}

/* === Shop Layout (Grid & Sidebar) === */
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.shop-mode-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--color-wh-dark);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-wh-border);
}

.mode-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--color-wh-muted);
  border: none;
  font-family: var(--font-heading);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}

.mode-btn.active {
  background: var(--color-thousandsons);
  color: #fff;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.shop-sidebar {
  background: var(--color-wh-dark);
  padding: 1.5rem;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  border: 1px solid var(--color-wh-border);
  height: fit-content;
}

.system-group-title {
  font-family: var(--font-heading);
  color: var(--color-spacewolves-light);
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--color-wh-border);
  padding-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.05em;
}
.system-group:first-child .system-group-title {
  margin-top: 0;
}
.system-group-title:hover {
  color: #fff;
}

.faction-group-title {
  font-family: var(--font-heading);
  color: var(--color-spacewolves-light);
  margin-bottom: 0.2rem;
  margin-top: 0.8rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(106, 141, 179, 0.2);
  padding-bottom: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.faction-group-title:hover {
  color: var(--color-thousandsons-light);
}

.accordion-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--color-wh-muted);
}

.accordion-content {
  display: none;
  overflow: hidden;
  animation: fadeIn 0.3s ease-in-out;
}

.accordion-group.open > .accordion-content {
  display: block;
}

.accordion-group.open > .accordion-trigger > .accordion-icon {
  transform: rotate(-180deg);
}

.system-content {
  padding-left: 0.5rem;
  margin-bottom: 1rem;
}

.system-all-btn {
  margin-top: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
}

.faction-list {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 0.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-btn {
  width: 100%;
  text-align: left;
  background: rgba(10, 10, 15, 0.4);
  border: none;
  padding: 0.6rem 1rem;
  color: var(--color-wh-text);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  border-radius: 0;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  margin-bottom: 0.5rem;
}

.filter-btn:hover {
  color: var(--color-thousandsons-light);
  background: rgba(38, 153, 168, 0.15);
}

.filter-btn.active {
  color: var(--color-thousandsons-light);
  font-weight: bold;
  background: rgba(38, 153, 168, 0.25);
}

.product-meta {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-tag {
  background: rgba(106, 141, 179, 0.1);
  color: var(--color-spacewolves-light);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-thousandsons-light);
  background: rgba(38, 153, 168, 0.08);
  border: none;
  border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  margin-bottom: 1rem;
}

.ean-code {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--color-wh-muted);
  font-family: var(--font-mono);
}

.shop-subgrid-header {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--color-wh-border);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}
.shop-subgrid-header h3 {
  font-family: var(--font-heading);
  color: var(--color-wh-text);
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
}

/* === Prose (Blog Content) === */
.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose p {
  margin-bottom: 1.5em;
  color: var(--color-wh-text);
}

.prose h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-wh-gold-dark);
}

.prose h3 {
  margin-top: 2rem;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 4px solid var(--color-wh-gold);
  padding: 0.5em 0 0.5em 1.25em;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--color-wh-muted);
  background: var(--color-wh-darker);
  border-radius: 0 8px 8px 0;
}

.prose code {
  padding: 2px 6px;
  background-color: var(--color-wh-surface);
  border: 1px solid var(--color-wh-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose pre {
  padding: 1.5em;
  border-radius: 8px;
  background-color: var(--color-wh-darker) !important;
  border: 1px solid var(--color-wh-border);
  overflow-x: auto;
}

.prose pre > code {
  all: unset;
  font-family: var(--font-mono);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--color-wh-border);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--color-wh-border);
  margin: 2rem 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.prose th, .prose td {
  padding: 0.75em 1em;
  border: 1px solid var(--color-wh-border);
  text-align: left;
}

.prose th {
  background: var(--color-wh-surface);
  color: var(--color-wh-gold);
  font-family: var(--font-heading);
}

/* === Utility === */
.sr-only {
  border: 0;
  padding: 0;
  margin: 0;
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(201, 168, 76, 0.3); }
  50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.6); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* === Scrollbar Styling === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-wh-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--color-wh-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-wh-gold-dark);
}

/* === Responsive === */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 { font-size: 2em; }
  h2 { font-size: 1.6em; }

  main {
    padding: 1rem;
  }
}

/* === Faction Alerts (Semantics) === */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.alert-icon {
  font-size: 1.5rem;
  line-height: 1.2;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin: 0 0 0.2rem 0;
  font-size: 1.1rem;
}

.alert p {
  margin: 0;
}

/* Success / Death Guard */
.alert-deathguard {
  background: rgba(74, 93, 35, 0.2);
  border-color: rgba(143, 168, 91, 0.4);
  color: var(--color-wh-light);
}
.alert-deathguard .alert-title { color: var(--color-deathguard-light); }

/* Info / Space Wolves */
.alert-spacewolves {
  background: rgba(75, 107, 139, 0.25);
  border-color: rgba(135, 167, 200, 0.4);
  color: var(--color-wh-light);
}
.alert-spacewolves .alert-title { color: var(--color-spacewolves-light); }

/* Error / Night Lords */
.alert-nightlords {
  background: linear-gradient(135deg, rgba(28, 35, 65, 0.7) 0%, rgba(179, 27, 27, 0.2) 100%);
  border-color: rgba(179, 27, 27, 0.5);
  color: var(--color-wh-light);
}
.alert-nightlords .alert-title { color: var(--color-wh-red-light); }

/* Active / Custodes */
.alert-custodes {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--color-wh-light);
}
.alert-custodes .alert-title { color: var(--color-custodes); }

/* === Global Action Button === */
.action-btn {
  display: inline-block;
  background: var(--color-wh-dark);
  color: var(--color-wh-gold);
  border: 1px solid var(--color-wh-gold-dark);
  padding: 0.8rem 1.5rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.action-btn:hover:not(:disabled) {
  background: rgba(201, 168, 76, 0.15);
  color: var(--color-wh-gold-light);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.3);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(100%);
}

/* === Cloudflare Turnstile Ukrywanie po weryfikacji === */
.turnstile-fade-wrapper {
  transition: opacity 0.35s ease, max-height 0.4s ease, margin 0.35s ease, padding 0.35s ease;
  max-height: 120px;
  opacity: 1;
  overflow: hidden;
}

.turnstile-fade-wrapper.turnstile-hidden {
  opacity: 0 !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

/* === Navigation Link Styles (Astro Gothic Style) === */
.header-nav-link {
  color: var(--color-wh-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 0;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: all 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-nav-link:hover {
  color: var(--color-custodes);
  background: rgba(212, 175, 55, 0.15);
}

.header-nav-link.active {
  color: var(--color-custodes);
  background: rgba(212, 175, 55, 0.25);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

