/* Main Stylesheet - Retroweird Theme */

/* CSS Custom Properties */
:root {
  /* Fonts */
  --font-pixel: 'Silkscreen', 'Press Start 2P', monospace;
  --font-display: 'Press Start 2P', monospace;
  --font-body: 'VT323', 'Comic Neue', cursive;
  --font-handwriting: 'Indie Flower', cursive;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Border styles */
  --border-thick: 4px;
  --border-medium: 2px;
  --border-thin: 1px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Page Layout */
html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  min-height: 100vh;
  background-attachment: fixed;
  background-repeat: repeat;
  background-size: auto;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

section, div, article, main, aside {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.page-container {
  display: grid;
  grid-template-columns: minmax(0, 250px) minmax(0, 1fr);
  gap: var(--spacing-md);
  max-width: 100%;
  margin: 0 auto;
  padding: var(--spacing-md);
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .page-container {
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    padding: var(--spacing-sm);
  }
}

@media (max-width: 900px) {
  .page-container {
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  }
}

/* Switch to single column at 800px to avoid cramped layout */
@media (max-width: 800px) {
  .page-container {
    display: block !important;
    padding: 0.75rem;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .sidebar {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 1rem;
  }
  
  .main-content {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 600px) {
  .page-container {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .page-container {
    padding: 0.5rem;
  }
  
  :root {
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
  }
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Main content area */
.main-content {
  min-height: 400px;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  min-width: 0;
  flex: 1;
}

.content-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border: 5px solid #000;
  border-style: ridge;
  padding: var(--spacing-md);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
  min-width: 0;
}

.content-wrapper > * {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: var(--spacing-sm);
    border-width: 3px;
  }
}

@media (max-width: 480px) {
  .content-wrapper {
    padding: 0.5rem;
    border-width: 2px;
  }
}

/* Widgets */
.widget {
  background: rgba(255, 255, 255, 0.95);
  border: var(--border-medium) solid #000;
  border-style: ridge;
  padding: var(--spacing-sm);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  margin-bottom: var(--spacing-md);
}

.widget-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: var(--spacing-sm);
  padding: var(--spacing-xs);
  background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
  border: var(--border-medium) solid #000;
  text-transform: uppercase;
  color: #000;
  text-shadow: 1px 1px 0 #fff;
}

.widget-content {
  font-family: var(--font-body);
  font-size: 1.125rem;
}

/* Links */
a {
  color: #0000ff;
  text-decoration: underline;
  transition: var(--transition-fast);
}

a:visited {
  color: #800080;
}

a:hover {
  color: #ff00ff;
  text-decoration: none;
  background: #ffff00;
}

a:active {
  color: #ff0000;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: 2rem;
  text-shadow: 2px 2px 0 #ff00ff, 4px 4px 0 #00ffff;
}

h2 {
  font-size: 1.5rem;
  text-shadow: 1px 1px 0 #ff00ff;
}

h3 {
  font-size: 1.25rem;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.35rem;
  }
  
  h3 {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
    text-shadow: 1px 1px 0 #ff00ff, 2px 2px 0 #00ffff;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.0625rem;
  }
}

/* Paragraphs */
p {
  margin-bottom: var(--spacing-sm);
  font-family: var(--font-body);
  font-size: 1.25rem;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@media (max-width: 768px) {
  p {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  p {
    font-size: 1rem;
  }
}

/* Lists */
ul, ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

ul {
  list-style: none;
}

ul li::before {
  content: "⭐";
  margin-right: var(--spacing-xs);
}

ol {
  list-style: decimal;
}

/* Code blocks */
code {
  font-family: 'Courier New', monospace;
  background: #f0f0f0;
  padding: 2px 6px;
  border: 1px solid #ccc;
}

pre {
  background: #000;
  color: #0f0;
  padding: var(--spacing-sm);
  overflow-x: auto;
  border: var(--border-medium) solid #0f0;
  margin-bottom: var(--spacing-sm);
}

pre code {
  background: none;
  border: none;
  color: #0f0;
}

/* Images */
img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  max-width: 100%;
  height: auto;
}

/* Dividers */
.divider {
  text-align: center;
  margin: var(--spacing-md) 0;
  overflow: hidden;
}

.divider img {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  border: 2px solid #000;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  table {
    font-size: 0.75rem;
  }
}

th, td {
  padding: var(--spacing-xs);
  border-style: ridge;
}

th {
  background: linear-gradient(45deg, #ff00ff, #00ffff);
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-transform: uppercase;
}

td {
  background: #fff;
  font-family: var(--font-body);
  font-size: 1.125rem;
}

/* Forms */
input, textarea, select {
  width: 100%;
  padding: var(--spacing-xs);
  border: var(--border-medium) solid #000;
  border-style: inset;
  background: #fff;
  font-family: var(--font-body);
  font-size: 1.125rem;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid #ff00ff;
  outline-offset: 2px;
}

button, .btn {
  padding: var(--spacing-xs) var(--spacing-md);
  background: linear-gradient(135deg, #ff00ff, #00ffff);
  border: var(--border-thick) solid #000;
  border-style: outset;
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #000;
  cursor: pointer;
  text-shadow: 1px 1px 0 #fff;
  transition: var(--transition-fast);
}

button:hover, .btn:hover {
  background: linear-gradient(135deg, #00ffff, #ff00ff);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:active, .btn:active {
  border-style: inset;
  transform: translateY(0);
}

/* Blockquotes */
blockquote {
  border-left: var(--border-thick) solid #ff00ff;
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  font-style: italic;
  background: rgba(255, 0, 255, 0.1);
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Horizontal rules */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
  margin: var(--spacing-md) 0;
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  marquee {
    animation: none !important;
  }
}

/* Print styles */
@media print {
  .sidebar,
  .site-header,
  .site-footer,
  .widget-webring,
  .widget-support,
  marquee {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .content-wrapper {
    border: 1px solid #000;
    box-shadow: none;
  }
}
