/* ============================================================
   MAKERPANEL — Site Theme
   © Ranch Hand Robotics, LLC — MIT License
   ============================================================ */

/* ----- Variables ----- */
:root {
  --green:      #4a9d5f;
  --green-dim:  rgba(74, 157, 95, 0.1);
  --dark-bg:    #1a1a1a;
  --darker-bg:  #0d0d0d;
  --header-bg:  #111111;
  --text:       #c8c8c8;
  --text-dim:   #808080;
  --border:     rgba(74, 157, 95, 0.25);
  --max-w:      1400px;
  /* legacy alias used by inline page styles */
  --muted-green: #4a9d5f;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  background: var(--dark-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ----- Site Header ----- */
.site-header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--green);
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: auto;
}

.site-logo img { width: 28px; height: 28px; display: block; }
.site-logo:hover { color: #fff; text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.site-nav__link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.35rem 0.8rem;
  border-radius: 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--green);
  background: var(--green-dim);
  text-decoration: none;
}

.site-nav__link.is-active { color: var(--green); }

.site-nav__link--icon {
  padding: 0.35rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

@media (max-width: 640px) {
  .site-logo span { display: none; }
  .site-nav__link { padding: 0.35rem 0.45rem; font-size: 0.7rem; letter-spacing: 0.05em; }
}

/* ----- Page Layout ----- */
.page-main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 1rem 2rem 3rem;
}

/* ----- Markdown Prose ----- */
.page-main h1,
.page-main h2,
.page-main h3,
.page-main h4,
.page-main h5,
.page-main h6 {
  line-height: 1.3;
  font-weight: 700;
}

.page-main h1 { font-size: 2rem;   color: var(--green);  margin: 2rem 0 1rem; }
.page-main h2 { font-size: 1.5rem; color: #e8e8e8; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin: 2.5rem 0 1rem; }
.page-main h3 { font-size: 1.15rem; color: #e0e0e0; margin: 2rem 0 0.75rem; }
.page-main h4 { font-size: 1rem;   color: #d0d0d0; margin: 1.5rem 0 0.5rem; }

.page-main p  { margin: 1rem 0; }
.page-main ul,
.page-main ol { margin: 1rem 0; padding-left: 2rem; }
.page-main li { margin: 0.3rem 0; }
.page-main strong { color: #e0e0e0; font-weight: 700; }

.page-main hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Permalink anchors from toc extension */
.page-main .headerlink {
  opacity: 0;
  margin-left: 0.4em;
  color: var(--green);
  font-size: 0.85em;
  text-decoration: none;
  transition: opacity 0.15s;
}

.page-main h1:hover .headerlink,
.page-main h2:hover .headerlink,
.page-main h3:hover .headerlink,
.page-main h4:hover .headerlink,
.page-main h5:hover .headerlink,
.page-main h6:hover .headerlink {
  opacity: 1;
}

.page-main blockquote {
  border-left: 3px solid var(--green);
  padding: 0.6rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  background: var(--darker-bg);
  border-radius: 0 0.2rem 0.2rem 0;
}

/* ----- Tables ----- */
.page-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.page-main th {
  background: var(--darker-bg);
  color: var(--green);
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.page-main td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}

.page-main tr:last-child td { border-bottom: none; }
.page-main tr:hover td { background: rgba(255,255,255,0.02); }

/* ----- Code ----- */
pre, code {
  font-family: 'Courier New', 'Monaco', 'Menlo', 'Consolas', monospace !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  tab-size: 4 !important;
}

code {
  background: var(--darker-bg);
  border: 1px solid var(--border);
  border-radius: 0.2rem;
  padding: 0.15em 0.45em;
  white-space: pre-wrap !important;
}

pre {
  background: var(--darker-bg);
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  white-space: pre !important;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  white-space: pre !important;
}

@media (max-width: 768px) {
  pre, code { font-size: 11px !important; }
  .page-main { padding: 1rem; }
}

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-footer .dot { opacity: 0.3; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--green); text-decoration: none; }


/* ============================================================
   PAGE COMPONENTS
   ============================================================ */

/* Hero section - simple border instead of glow */
.hero-section, .gallery-hero {
    animation: none;
    background-size: 200% 200%;
}

/* Hero button effects - minimal hover */
.hero-btn-primary:hover, .gallery-cta:hover {
    transform: translateY(-2px);
    background: var(--muted-green);
    border-color: var(--muted-green);
}

.hero-btn-secondary:hover {
    transform: translateY(-2px);
    background: rgba(74, 157, 95, 0.1);
    border-color: var(--muted-green);
}

/* Feature card - simple styling */
.feature-card {
    animation: none;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--muted-green);
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-section, .gallery-hero {
        animation: none;
    }
    .feature-card {
        animation: none;
    }
    a[href*="gallery.html"]:hover,
    a[href*="contributing.html"]:hover,
    .panel-card:hover,
    .panel-card:hover img,
    .hero-btn-primary:hover,
    .hero-btn-secondary:hover,
    .gallery-cta:hover,
    .feature-card:hover {
        transform: none;
        transition: none;
    }
}

/* Tabbed extension styles for pymdownx.tabbed alternate style */
.tabbed-set {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    margin: 2.5em 0;
    border-radius: 0.25rem;
    overflow: hidden;
    border: 1px solid var(--muted-green);
}

.tabbed-set > input {
    position: absolute;
    opacity: 0;
}

.tabbed-labels {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--muted-green);
    background: var(--dark-bg);
    padding: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tabbed-labels label {
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    background: transparent;
    color: #808080;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tabbed-labels label:hover {
    color: var(--muted-green);
    background: rgba(74, 157, 95, 0.1);
    border-color: var(--muted-green);
}

.tabbed-set input:nth-child(1):checked ~ .tabbed-labels label:nth-child(1),
.tabbed-set input:nth-child(2):checked ~ .tabbed-labels label:nth-child(2),
.tabbed-set input:nth-child(3):checked ~ .tabbed-labels label:nth-child(3),
.tabbed-set input:nth-child(4):checked ~ .tabbed-labels label:nth-child(4),
.tabbed-set input:nth-child(5):checked ~ .tabbed-labels label:nth-child(5),
.tabbed-set input:nth-child(6):checked ~ .tabbed-labels label:nth-child(6) {
    color: #ffffff;
    background: var(--muted-green);
    font-weight: 900;
    border-color: var(--muted-green);
}

.tabbed-content {
    width: 100%;
    padding: 3rem 1.5rem;
    background: var(--darker-bg);
    border: none;
}

.tabbed-block {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2.5rem;
}

@media screen and (min-width: 600px) {
    .tabbed-block {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.tabbed-set input:nth-child(1):checked ~ .tabbed-content .tabbed-block:nth-child(1),
.tabbed-set input:nth-child(2):checked ~ .tabbed-content .tabbed-block:nth-child(2),
.tabbed-set input:nth-child(3):checked ~ .tabbed-content .tabbed-block:nth-child(3),
.tabbed-set input:nth-child(4):checked ~ .tabbed-content .tabbed-block:nth-child(4),
.tabbed-set input:nth-child(5):checked ~ .tabbed-content .tabbed-block:nth-child(5) {
    display: grid;
}

/* Hide code blocks in tabs */
.tabbed-block .highlight {
    display: none;
}

/* Panel card container */
.panel-card {
    position: relative;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--muted-green);
    background: var(--dark-bg);
    height: 100%;
}

.panel-card:hover {
    transform: translateY(-4px);
    border-color: var(--muted-green);
    border-width: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .panel-card:hover {
        transform: none;
    }
}

/* Panel card link */
.panel-card a {
    display: block;
    text-decoration: none;
    position: relative;
    height: 100%;
}

.panel-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.panel-card:hover img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* Card title overlay on image */
.panel-card a::after {
    content: attr(data-title);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(74, 157, 95, 0.1) 100%);
    color: var(--muted-green);
    padding: 2rem 1.5rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.3;
    z-index: 10;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Description text - displayed below the image */
.panel-card p {
  margin: 0;
  padding: 0.9rem 1.2rem 1.1rem;
  font-size: 0.85rem;
  color: #b0b0b0;
  line-height: 1.6;
  border-top: 1px solid rgba(74, 157, 95, 0.3);
}

/* Buy Now badge */
.panel-card__buy {
  display: block;
  margin: 0.6rem 1.2rem 0;
  padding: 0.4rem 0.9rem;
  background: var(--muted-green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 0.2rem;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.panel-card__buy:hover {
  background: #3a8a4e;
  text-decoration: none;
  color: #fff;
}


