/* =====================================================
   GLOBAL BASE STYLES — RETRO PASTEL RESTORED
   ===================================================== */

:root {
  --bg-main: url("gmcbg.gif");
  --bg-sidebar: #fdf6f0;
  --bg-widget: #ffffff;
  --border-color: #d8cfc7;
  --accent: #e8dff5;
  --accent-dark: #d7c2e3;
  --text-main: #333;
  --text-muted: #666;
  --link-color: #6a4c93;
  --link-hover: #8b6bb8;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  background-repeat: repeat;
}

.no-dark-mode {
  background: var(--bg-main);
}

/* Skip Links */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px;
  background: #000;
  color: #fff;
  z-index: 999;
}

/* =====================================================
   BANNER
   ===================================================== */

.banner img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 4px solid var(--border-color);
}

/* =====================================================
   LAYOUT
   ===================================================== */

.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
}

.layout-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* =====================================================
   SIDEBAR — RETRO PASTEL RESTORED
   ===================================================== */

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  padding: 10px;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.site-title {
  font-family: 'Dancing Script', cursive;
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 20px;
  color: #5a3e85;
}

/* =====================================================
   WIDGET BASE — RETRO RESTORED
   ===================================================== */

.widget {
  background: var(--bg-widget);
  border: 2px solid var(--border-color);
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.widget-title {
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-weight: bold;
  color: #5a3e85;
}

.sidebar-divider {
  border-bottom: 2px solid var(--border-color);
  margin: 12px 0;
}

/* =====================================================
   COLLAPSIBLE WIDGETS — RETRO RESTORED
   ===================================================== */

.widget-toggle {
  width: 100%;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  padding: 8px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  margin-bottom: 6px;
  border-radius: 4px;
  font-size: 1rem;
}

.widget-toggle:hover {
  background: var(--accent-dark);
}

.widget-toggle:focus {
  outline: 2px solid #000;
}

.widget-toggle[aria-expanded="true"]::after {
  content: "▲";
  float: right;
}

.widget-toggle[aria-expanded="false"]::after {
  content: "▼";
  float: right;
}

.widget-content {
  padding-left: 4px;
}

/* =====================================================
   RETRO BUTTONS — RESTORED
   ===================================================== */

.retro-button {
  display: block;
  width: 100%;
  padding: 8px;
  margin: 6px 0;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  text-align: center;
}

.retro-button:hover {
  background: var(--accent-dark);
}

.retro-button:focus {
  outline: 2px solid #000;
}

/* Retro Select */
.retro-select {
  width: 100%;
  padding: 6px;
  margin-bottom: 10px;
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
}

/* =====================================================
   SEARCH BOX
   ===================================================== */

.search-box {
  width: 100%;
  padding: 6px;
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
  margin-bottom: 10px;
}

/* =====================================================
   MAIN CONTENT — RETRO RESTORED
   ===================================================== */

.content {
  flex-grow: 1;
  max-width: 800px;
  background: #ffffff;
  padding: 20px;
  border: 3px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.page-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.breadcrumb {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =====================================================
   POSTS — RETRO RESTORED
   ===================================================== */

.post {
  background: #fff;
  border: 2px solid var(--border-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 6px;
}

/* =====================================================
   COMMENTS — RETRO RESTORED
   ===================================================== */

.comments-section {
  margin-top: 40px;
}

.comment-item {
  background: #fff;
  border: 2px solid var(--border-color);
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.comment-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* =====================================================
   LINK ME BUTTON
   ===================================================== */

.linkme-button {
  width: 88px;
  height: auto;
  border: 2px solid var(--accent-dark);
  margin-bottom: 10px;
}

.linkme-code {
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  resize: vertical;
  padding: 6px;
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
}

/* =====================================================
   BACK TO TOP
   ===================================================== */

.back-to-top {
  display: inline-block;
  margin-top: 20px;
  font-weight: bold;
  color: var(--link-color);
}

.back-to-top:hover {
  color: var(--link-hover);
}

/* =====================================================
   ACCESSIBILITY MODES
   ===================================================== */

.high-contrast {
  background: #000 !important;
  color: #fff !important;
}

.high-contrast .sidebar,
.high-contrast .content,
.high-contrast .widget {
  background: #000 !important;
  border-color: #fff !important;
}

.large-text {
  font-size: 1.25rem;
}

.dyslexia-font {
  font-family: 'Lexend', sans-serif;
}

.reading-mode .sidebar {
  display: none;
}

.extra-spacing {
  line-height: 2;
}

.reduce-motion * {
  transition: none !important;
  animation: none !important;
}

/* =====================================================
   READ-ALOUD HIGHLIGHT
   ===================================================== */

.spoken-highlight {
  background: #fff3a3;
  padding: 2px;
  border-radius: 3px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {
  .sidebar {
    width: 100%;
  }

  .layout-row {
    flex-direction: column;
  }
}
