/*
  CICERO BLOG DESIGN SYSTEM
  Personality: Bold, Sophisticated, Modern
  Constraint: No Blue
*/

/* Typography - Google Fonts loaded in BaseLayout */
:root {
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing (Base unit 4px) */
  --space-xs: 0.25rem; /* 4px */
  --space-sm: 0.5rem; /* 8px */
  --space-md: 1rem; /* 16px */
  --space-lg: 1.5rem; /* 24px */
  --space-xl: 2rem; /* 32px */
  --space-2xl: 4rem; /* 64px */
  --space-3xl: 8rem; /* 128px */

  /* Shadows */
  --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  --shadow-strong: 8px 8px 0px 0px rgba(0, 0, 0, 1);
  --shadow-hover: 4px 4px 0px 0px rgba(0, 0, 0, 1);
}

/* Light Theme (Default) */
:root,
.theme-light {
  --color-bg: #f4f3f0; /* Warm Light Grey (Paper) */
  --color-surface: #ffffff; /* Pure White */
  --color-surface-subtle: #e8e6e1;
  --color-text-primary: #121212; /* Off-Black */
  --color-text-secondary: #595959;
  --color-border: #121212; /* High contrast borders */
  --color-border-subtle: #d1d1d1;

  /* Accent: International Orange / Burnt Clay */
  --color-accent: #7a0106;
  --color-accent-fg: #ffffff;

  /* Semantic Status */
  --color-success: #2d6a4f;
  --color-warning: #e9c46a;
  --color-error: #d62828;
}

/* Dark Theme */
.theme-dark {
  --color-bg: #121212; /* Off-Black */
  --color-surface: #1e1e1e; /* Dark Grey */
  --color-surface-subtle: #2a2a2a;
  --color-text-primary: #f4f3f0; /* Paper White */
  --color-text-secondary: #a0a0a0;
  --color-border: #f4f3f0; /* High contrast borders inverted */
  --color-border-subtle: #333333;

  /* Accent: Vibrant Vermilion for dark mode */
  --color-accent: #7a0106;
  --color-accent-fg: #121212;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base Styles applying Tokens */
body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utilities */
.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.text-accent {
  color: var(--color-accent);
}

.bg-accent {
  background-color: var(--color-accent);
}

.bg-surface {
  background-color: var(--color-surface);
}

.bg-surface-subtle {
  background-color: var(--color-surface-subtle);
}

.text-text-primary {
  color: var(--color-text-primary);
}

.text-text-secondary {
  color: var(--color-text-secondary);
}

.border-border {
  border-color: var(--color-border);
}

.border-border-subtle {
  border-color: var(--color-border-subtle);
}

.tracking-tighter {
  letter-spacing: -0.05em;
}

/* Custom Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  border: 2px solid var(--color-border);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 4px 4px 0px 0px var(--color-border);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px var(--color-border);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px 0px var(--color-border);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.theme-dark .btn-primary {
  border-color: var(--color-bg);
  color: var(--color-bg);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2rem;
  transition: transform 0.3s ease;
}

.card-hover:hover {
  border-color: var(--color-accent);
}

/* Layout Transitions */
.view-transition {
  animation: fadeIn 0.4s ease-out;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* Iframe Widget Specifics */
.widget-container {
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
}

/* Article Typography */
.article-content {
  max-width: 48rem;
  margin: 0 auto;
}

.article-content p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.875rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-primary);
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.article-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.article-content ul {
  margin-bottom: 2rem;
  list-style-type: disc;
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
}

.article-content ol {
  margin-bottom: 2rem;
  list-style-type: decimal;
  padding-left: 1.5rem;
  color: var(--color-text-secondary);
}

.article-content li {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.article-content strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.article-content blockquote {
  background: var(--color-surface-subtle);
  padding: 2rem;
  margin: 2.5rem 0;
  border-left: 4px solid var(--color-border);
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.article-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.article-content a:hover {
  text-decoration: none;
}

.article-content code {
  background: var(--color-surface-subtle);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Fira Code', monospace;
}

.article-content pre {
  background: var(--color-surface-subtle);
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 2rem;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* Container */
.container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Grid utilities */
.grid {
  display: grid;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

/* Spacing utilities */
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.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; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-7xl { font-size: 4.5rem; }
.text-8xl { font-size: 6rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: 'Fira Code', monospace; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Border utilities */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }

/* Aspect ratio */
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-square { aspect-ratio: 1 / 1; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Transitions */
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease; }
.transition-transform { transition: transform 0.3s ease; }
.duration-300 { transition-duration: 300ms; }

/* Hover states */
.hover-scale:hover { transform: scale(1.05); }
.hover-text-accent:hover { color: var(--color-accent); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive grid */
@media (min-width: 768px) {
  .md-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .md-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .md-flex { display: flex; }
  .md-text-5xl { font-size: 3rem; }
  .md-text-6xl { font-size: 3.75rem; }
  .md-text-7xl { font-size: 4.5rem; }
}

@media (min-width: 1024px) {
  .lg-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lg-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .lg-text-8xl { font-size: 6rem; }
}
