/*
Theme: 1303ArMy - Dual theme (Light & Dark)
*/

/* Theme Variables */
:root {
  /* Light theme (default) */
  --bg-color: #e8e8e8;
  --text-color: #1a1a1a;
  --heading-color: #ff6600;
  --link-color: #ff6600;
  --link-hover-color: #ff9933;
  --border-color: #cccccc;
  --accent-color: #ff6600;
  --meta-color: #666666;
  --code-bg: #f5f5f5;
  --blockquote-bg: #f0f0f0;
  --footer-bg: #e8e8e8;
}

/* Dark theme - browser preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-color: #000000;
    --text-color: #cecece;
    --heading-color: #ff6600;
    --link-color: #ff9933;
    --link-hover-color: #ffaa55;
    --border-color: #333333;
    --accent-color: #ff6600;
    --meta-color: #999999;
    --code-bg: #1a1a1a;
    --blockquote-bg: #111111;
    --footer-bg: #000000;
  }
}

/* Dark theme - manual override */
:root[data-theme="dark"] {
  --bg-color: #000000;
  --text-color: #cecece;
  --heading-color: #ff6600;
  --link-color: #ff9933;
  --link-hover-color: #ffaa55;
  --border-color: #333333;
  --accent-color: #ff6600;
  --meta-color: #999999;
  --code-bg: #1a1a1a;
  --blockquote-bg: #111111;
  --footer-bg: #000000;
}

/* Light theme - manual override */
:root[data-theme="light"] {
  --bg-color: #e8e8e8;
  --text-color: #1a1a1a;
  --heading-color: #ff6600;
  --link-color: #ff6600;
  --link-hover-color: #ff9933;
  --border-color: #cccccc;
  --accent-color: #ff6600;
  --meta-color: #666666;
  --code-bg: #f5f5f5;
  --blockquote-bg: #f0f0f0;
  --footer-bg: #e8e8e8;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--bg-color);
  position: relative;
  min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  clear: both;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--heading-color);
}

h1 {
  font-size: 2.5em;
}

h2 {
  font-size: 2em;
}

h3 {
  font-size: 1.5em;
}

p {
  margin-bottom: 1.5em;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* Layout */
.site {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  padding-bottom: 0;
}

.site-header {
  padding: 2rem 0;
  border-bottom: 3px solid var(--accent-color);
  margin-bottom: 3rem;
}

.header-image {
  text-align: center;
  margin-bottom: 2rem;
}

.header-image img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.site-branding {
  margin-bottom: 1.5rem;
}

.site-title {
  margin: 0;
  font-size: 3em;
  line-height: 1.2;
}

.site-title a {
  color: var(--heading-color);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--link-hover-color);
}

.site-description {
  margin: 0.5rem 0 0;
  font-size: 1.1em;
  color: var(--meta-color);
  font-style: italic;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.main-navigation li {
  margin: 0;
}

.main-navigation a {
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1em;
  padding: 0.5rem 0;
  display: inline-block;
  border-bottom: 2px solid transparent;
}

.main-navigation a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  text-decoration: none;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: rotate(15deg);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
  transition: opacity 0.3s ease;
}

/* Show sun icon in dark mode, moon in light mode */
.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon {
    display: block;
  }

  :root:not([data-theme="light"]) .moon-icon {
    display: none;
  }
}

:root[data-theme="dark"] .sun-icon {
  display: block;
}

:root[data-theme="dark"] .moon-icon {
  display: none;
}

:root[data-theme="light"] .sun-icon {
  display: none;
}

:root[data-theme="light"] .moon-icon {
  display: block;
}

/* Content */
.site-content {
  min-height: 60vh;
  margin-bottom: 3rem;
  position: relative;
  z-index: 10;
  /* background-color: #000000; */
}

.site-main {
  max-width: 800px;
  margin: 0 auto;
}

/* Articles/Posts */
article {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
}

article:last-child {
  border-bottom: none;
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.entry-title a {
  color: var(--heading-color);
}

.entry-title a:hover {
  color: var(--link-hover-color);
}

.entry-meta {
  font-size: 0.9em;
  color: var(--meta-color);
  margin-bottom: 1rem;
}

.posted-on time {
  color: var(--meta-color);
}

.entry-content {
  color: var(--text-color);
}

.entry-content h2,
.entry-content h3 {
  color: var(--link-hover-color);
  margin-top: 2.5rem;
}

.entry-summary {
  color: var(--text-color);
  margin-bottom: 1rem;
}

.entry-footer {
  margin-top: 1.5rem;
}

.read-more {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background-color: var(--accent-color);
  color: var(--bg-color);
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
}

.read-more:hover {
  background-color: var(--link-hover-color);
  color: var(--bg-color);
  text-decoration: none;
}

/* Page Header */
.page-header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent-color);
}

.page-title {
  margin: 0;
  color: var(--heading-color);
}

/* Recent Posts Section */
.recent-posts {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 3px solid var(--accent-color);
}

.recent-posts h2 {
  color: var(--heading-color);
  margin-bottom: 2rem;
}

/* Comments Section */
.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  padding-bottom: 100px;
}

.comments-section h2 {
  color: var(--heading-color);
  margin-bottom: 2rem;
}

/* Cusdis theme integration */
#cusdis_thread {
  margin-top: 2rem;
  min-height: 600px;
  width: 100%;
}

#cusdis_thread iframe {
  width: 100%;
  min-height: 600px;
  border: none;
  background: transparent !important;
  background-color: transparent !important;
  color-scheme: normal;
  overflow: hidden !important; /* Prevent scrollbars */
}

/* Home Page */
.home-page {
  border-bottom: none;
}

.home-page .entry-content {
  font-size: 1.1em;
  line-height: 1.9;
}

.home-page ul {
  list-style: none;
  padding-left: 0;
}

.home-page li {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  position: relative;
}

.home-page li:before {
  content: "→";
  color: var(--accent-color);
  position: absolute;
  left: 0;
  font-weight: bold;
  font-size: 1.2em;
}

/* Footer */
.site-footer {
  border-top: 3px solid var(--accent-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--meta-color);
  position: relative;
  overflow: visible;
}

.footer-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-65%, 25%);
  width: 100vw;
  max-width: none;
  pointer-events: none;
  z-index: 1;
}

.footer-image img {
  width: 120%;
  max-width: 120%;
  height: auto;
  display: block;
}

.site-info {
  position: relative;
  z-index: 2;
}

.site-info p {
  margin: 0;
  display: inline-block;
  padding: 0.5rem 1rem;
}

/* Blockquotes */
blockquote {
  margin: 2rem 0;
  padding: 1rem 2rem;
  border-left: 4px solid var(--accent-color);
  background-color: var(--blockquote-bg);
  font-style: italic;
  color: var(--text-color);
}

/* Code */
code {
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: "Courier New", Courier, monospace;
  color: var(--link-hover-color);
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  border-left: 3px solid var(--accent-color);
}

pre code {
  background: transparent;
  padding: 0;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

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

  .site-title {
    font-size: 2em;
  }

  h1 {
    font-size: 2em;
  }

  h2 {
    font-size: 1.5em;
  }

  .main-navigation {
    flex-direction: column;
    align-items: stretch;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  .theme-toggle {
    align-self: flex-end;
    margin-top: 1rem;
  }

  .site-header {
    padding: 1.5rem 0;
  }

  article {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .site-header,
  .site-footer,
  .main-navigation,
  .theme-toggle {
    display: none;
  }
}
