/* style.css - UDRP.LOL roast theme | Jan 2026 edition */

:root {
  --bg: #ffffff;
  --text: #393939;
  --text-light: #555;
  --heading: #333;
  --link: #0087be;
  --link-hover: #005a87;
  --border: #ddd;
  --quote-border: #0087be;
  --input-bg: #f9f9f9;
  --input-border: #ccc;
  --btn-bg: #0087be;
  --btn-text: white;
  --btn-hover: #006b9e;
  --card-bg: #f9f9f9;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --transition: background-color 0.3s ease, color 0.3s ease;
  color-scheme: light dark; /* tells browser we support both */
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --bg: #121212;
    --text: #e0e0e0;
    --text-light: #aaa;
    --heading: #f0f0f0;
    --link: #4db8ff;
    --link-hover: #80cfff;
    --border: #333;
    --quote-border: #4db8ff;
    --input-bg: #1e1e1e;
    --input-border: #444;
    --btn-bg: #4db8ff;
    --btn-text: #121212;
    --btn-hover: #3399ff;
    --card-bg: #1e1e1e;
    --shadow: 0 2px 12px rgba(0,0,0,0.5);
    --bubg: #ddd;
  }
}

/* Manual override classes (applied via JS toggle or persistent checkbox) */
.theme-dark {
  --bg: #121212;
  --text: #e0e0e0;
  --text-light: #aaa;
  --heading: #f0f0f0;
  --link: #4db8ff;
  --link-hover: #80cfff;
  --border: #333;
  --quote-border: #4db8ff;
  --input-bg: #1e1e1e;
  --input-border: #444;
  --btn-bg: #4db8ff;
  --btn-text: #121212;
  --btn-hover: #3399ff;
  --card-bg: #1e1e1e;
  --shadow: 0 2px 12px rgba(0,0,0,0.5);
  --bubg: #555;
}

.theme-light {
  /* resets to light vars — mostly for explicit toggle */
}

/* Base reset & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: var(--transition);
}

main, .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3.5em 1.75em;
}

@media (max-width: 768px) {
  main, .container {
    padding: 1.75em 1em;
  }
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  margin: 1.5em 0 0.75em;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.6rem; }

/* Paragraphs & general text */
p, li, blockquote:not(.quoted-text) {
  margin: 1em 0;
  font-size: 1.1rem;
}

p.date {font-style: italic; text-align: right;}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

a:visited {
  color: var(--link); /* no purple visited nonsense */
}

/* Quoted text (blockquotes with left bar) */
.quoted-text {
  margin: 1.5em 0;
  padding-left: calc(1.5em - 3px);
  border-left: 3px solid var(--quote-border);
  font-style: italic;
  color: var(--text-light);
  /* negative margin pulls bar left of content flow */
  margin-left: -1.5em;
  font-size: 1.1rem;
}

/* But keep text aligned with main content */
.quoted-text p {
  margin-left: 1.5em; /* counter negative */
}

/* Form elements */
input[type="text"],
input[type="search"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.9em 1.2em;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s ease;
  margin-bottom: 12px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 135, 190, 0.15);
}

button,
.button {
  padding: 0.9em 1.6em;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover,
.button:hover {
  background: var(--btn-hover);
}

/* Navigation / pagination buttons (assume .nav-buttons container) */
.nav-buttons {
  display: flex;
  gap: 1em;
  margin: 2em 0;
  justify-content: center;
}

.sharing {text-align: center; margin: 4em auto;}

/* Social sharing icons (assume <a class="share-icon"> with svg or font icon) */
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4em;
  height: 3.4em;
  border-radius: 5px;
  padding: 0.5em;
  margin: 4px;
  color: var(--text-light);
  transition: transform 0.2s ease, background 0.2s ease;
}

.share-icon:hover {
  background: rgba(135,135,135,0.15);
  transform: scale(1.12);
}

@media (prefers-color-scheme: dark) {
  .share-icon {
    background: rgba(255,255,255,0.08);
  }
  .share-icon:hover {
    background: rgba(99,99,99,0.2);
  }
}

/* Theme toggle switch (top-right) */
.theme-toggle {
  position: fixed;
  top: 1.2em;
  right: 1.2em;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.95rem;
  color: var(--text-light);
}

.theme-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle label {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  background: var(--border);
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.theme-toggle label::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.theme-toggle input:checked + label {
  background: var(--bubg);
}

.theme-toggle input:checked + label::after {
  transform: translateX(24px);
}

/* Mobile: fixed instead of sticky (but fixed is fine for both actually) */
@media (max-width: 768px) {
  .theme-toggle {
    top: 0.8em;
    right: 0.8em;
    position: absolute;
  }
    
.post {  overflow-x: hidden; }
    
    .quoted-text {margin-left:0;}    
    
}



.post a {margin-top: 2em; display: block; white-space: nowrap;}

/* Card/post list styling (for #posts container) */
#posts .post {
  background: var(--card-bg);
  padding: 1.8em;
  margin: 1.5em 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

#posts h2 {
  margin-top: 0;
}

ul {list-style-type: none;}

footer {margin-top:2em; color:#888; text-align: center; font-size:0.9em;}

.back-link {
  position: fixed;
  top: 1.2em;
  left: 1.2em;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.95rem;
  color: var(--text-light);
}

.back-link a {
  position: relative;
  display: inline-block;
  padding: 0;
  height: 28px;
  line-height: 28px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: color 0.3s ease;
}

.back-link a:hover {
}

@media (max-width: 768px) {
  .back-link {
    top: 0.8em;
    left: 0.8em;
    position: absolute;
  }
}