/* ============================================================
   OptionsPlay Research — Site Styles

   All site-level styling lives here. Tony's post content
   uses its own inline styles and is NOT affected by this file.

   To restyle the site: change the CSS variables below.
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Brand */
  --op-green: #7AC143;
  --op-blue: #0068b3;
  --op-dark: #1a2a3a;

  /* Layout */
  --site-max-width: 900px;
  --site-padding: 24px;

  /* Colors */
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text-primary: #1a2a3a;
  --text-secondary: #4a5e70;
  --text-muted: #8899aa;
  --border-light: #e2e8f0;
  --border-accent: var(--op-green);

  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 15px;
  --font-size-sm: 13px;
  --font-size-xs: 11px;
  --font-size-h1: 28px;
  --font-size-h2: 20px;
  --line-height: 1.6;

  /* Cards */
  --card-radius: 10px;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.15s ease;
}

/* --- Dark Theme Overrides --- */
[data-theme="dark"] {
  --bg-page: #08090d;
  --bg-card: #0f1219;
  --bg-header: #0f1219;
  --text-primary: #e8edf5;
  --text-secondary: #b0b8cc;
  --text-muted: #6b7394;
  --border-light: #1a1f2e;
  --border-accent: var(--op-green);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .site-logo img {
  filter: brightness(0) invert(1);
}

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

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--op-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* --- Site Header --- */
.site-header {
  background: var(--bg-header);
  border-bottom: 3px solid var(--border-accent);
  padding: 14px var(--site-padding);
}

.site-header-inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo img {
  height: 36px;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--op-blue);
  text-align: right;
  letter-spacing: 0.3px;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.site-title-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 600;
}

/* --- Main Content Area --- */
.site-main {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: var(--site-padding);
}

/* --- Index Page --- */
.index-header {
  margin-bottom: 32px;
}

.index-header h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.index-header p {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
}

/* --- Post Cards (Index Page) --- */
.post-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  display: block;
  color: inherit;
}

.post-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.post-card-date {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.post-card-title {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.post-card-summary {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.post-card-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-card-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--op-blue);
  background: #e8f2fc;
  padding: 2px 8px;
  border-radius: 4px;
}

/* --- Post Page (Article Shell) --- */
.post-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.post-header h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.post-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.post-content {
  /* Tony's content renders here — no styling interference */
  margin-bottom: 48px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--op-blue);
  margin-bottom: 20px;
}

.post-back:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* --- Site Footer --- */
.site-footer {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 24px var(--site-padding);
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  :root {
    --site-padding: 16px;
    --font-size-h1: 22px;
    --font-size-h2: 17px;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-title {
    text-align: left;
  }

  .post-card {
    padding: 16px;
  }
}
