/* ----------------------------------------
   Global & Container
---------------------------------------- */

:root {
  --bg: #ffffff;
  --text: #000000;
  --border-strong: #000000;
  --border-soft: #aaaaaa;
  --card-bg: #f9f9f9;
  --accent: #f78da7;
  --accent-muted: #f3d2de;
  --tag-muted: rgba(0,0,0,0.35);
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.08);
  --shadow-strong: 0 4px 12px rgba(0,0,0,0.16);
}

/* ----------------------------------------
   Auto two-column layout for long text
---------------------------------------- */

.auto-columns {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid #eee;
}

/* Avoid ugly splits of paragraphs / images */
.auto-columns p,
.auto-columns img,
.auto-columns .note-block,
.auto-columns .quiz-block {
  break-inside: avoid;
}

/* On smaller screens, fall back to single column */
@media (max-width: 900px) {
  .auto-columns {
    column-count: 1;
  }
}

/* ----------------------------------------
   Two-column list block (Blueprint / Data Panel)
---------------------------------------- */

.list-two-column {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  align-items: flex-start;
  margin: 24px auto 28px;
  padding: 18px 20px;
  max-width: 900px;
  background: #f9f9f9;
  border: 1px solid #000;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  box-sizing: border-box;
  text-align: left;
}

/* Columns */
.list-two-column ol,
.list-two-column ul {
  flex: 1;
  padding-left: 1.5rem;
  margin: 0;
}

/* Items */
.list-two-column li {
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Highlight key term before dash — e.g. "On/Off Switch — text" */
.list-two-column li::first-line {
  font-weight: 600;
}

/* Optional: subtle bullet marker tweak for UL */
.list-two-column ul li {
  list-style-type: "• ";
}

/* Optional: make OL numbers a bit more “technical” */
.list-two-column ol {
  list-style-position: outside;
}

/* Responsive: stack on narrow screens */
@media (max-width: 700px) {
  .list-two-column {
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
    padding: 14px 12px;
  }

  .list-two-column ol,
  .list-two-column ul {
    padding-left: 1.3rem;
  }
}



#container {
  font-family: monospace;
  font-size: 1.35em;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
}

#container main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
}

#container h1 {
  font-family: monospace !important;
  font-size: 2em;
}

#container header,
#container footer {
  text-align: center;
  padding: 1rem 0;
}

#container footer {
  margin-top: 20px;
  border-top: 1px solid var(--border-strong);
}

/* Links */

#container a {
  color: var(--text);
  text-decoration: none;
}

#container a:visited {
  color: var(--text);
}

/* Top navigation */

#container nav {
  text-align: center;
  margin: 10px 0;
  padding-bottom: 8px;
}

#container nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0 10px;
}


/* Make dialogs behave: title bar stays visible, body scrolls/clips */
#dslEditorDialog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

#dslEditorDialog .window-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* two-panel layout */
.dsl-editor-body { height: 100%; }
.dsl-editor-row {
  display: flex;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.dsl-editor-left {
  flex: 1.4;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dsl-editor-right {
  flex: 1;
  min-width: 320px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  min-height: 0;
  padding-left: 6px;
  border-left: 1px solid #AAC1CB;
}

.dsl-editor-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 0;
}

.dsl-editor-controls label {
  font-size: 12px;
  opacity: 0.8;
}

.dsl-editor-textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  resize: none;
  font-family: monospace;
}

.dsl-editor-status {
  font-size: 12px;
  opacity: 0.8;
  padding-top: 6px;
}

.dsl-tools-box {
  border: 1px solid #AAC1CB;
  border-radius: 10px;
  padding: 10px;
}

.dsl-tools-header {
  font-weight: bold;
  margin-bottom: 8px;
}

.dsl-tools-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dsl-resource-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding-top: 6px;
  border-top: 1px solid #ddd;
}

.dsl-resource-gallery img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #ccc;
}

.dsl-export-textarea{
  width:100%;
  min-height: 110px;
  font-family: monospace;
}

/* ----------------------------------------
   Blog Grid + Cards
---------------------------------------- */

#blog-container {
  /* Isotope handles positioning; this is mostly padding */
  padding: 20px;
}

/* Base article style */
#blog-container article {
  box-sizing: border-box;
  text-align: center;
}

/* Card appearance */
.blog-article.grid-item {
  background-color: var(--card-bg);
  padding: 10px 14px 16px;
  margin: 10px 0;
  display: inline-block;
  width: 30%;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  transition:
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    width 0.4s ease,
    height 0.4s ease;
}

.blog-article.grid-item:hover {
  box-shadow: var(--shadow-strong);
  z-index: 2;
}

/* Expanded card occupies most of the width */
.grid-item.expanded {
  width: 92%;
  height: auto !important;
  background-color: #ffffff !important;
  border-color: var(--border-soft);
  padding: 40px 40px 50px;
  z-index: 10;
}

/* In expanded view, hide the short description under the title */
.blog-article.grid-item.expanded .article-description {
  display: none !important;
}

/* Header inside cards */

#container article h2 {
  font-size: 1.2em;
}

article h2 {
  padding-top: 30px;
  padding-bottom: 20px;
  margin: 0;
}

.grid-item.expanded h2 {
  padding-top: 30px;
  padding-bottom: 20px;
}

/* Hover accent on headings */
h2:hover {
  color: var(--accent);
}

/* Body text inside cards */
#container article p {
  display: inline-block;
  text-align: left;
}

.grid-item.expanded p {
  max-width: 800px;
}

/* Thumbnail */

.article-thumb img {
  margin-top: 25px;
  width: 180px;
  max-width: 100%;
}

/* Tags */

.article-tags {
  color: var(--text);
  opacity: 0.35;
  font-size: 0.7em;
  margin-top: 6px;
}

/* Inner wrapper that constrains and aligns content */
.article-inner {
  display: inline-block;        /* allows centering via article's text-align:center */
  text-align: center;           /* default for card mode */
  max-width: 100%;
  width: 100%;
  transition:
    max-width 0.35s ease,
    padding 0.35s ease,
    text-align 0.35s ease;
}

.article-price {
  display: block;
  margin-top: 14px;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif; /* cleaner than monospace */
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #000;
  background: none;
  border: none;
  padding: 0;
}


/* When the card is expanded, the inner content becomes a readable column */
.blog-article.grid-item.expanded .article-inner {
  max-width: 800px;
  text-align: left;
  padding-inline: 8px;
  margin-inline: auto;          /* just in case */
}

/* ----------------------------------------
   Tag / Filter Buttons
---------------------------------------- */

/* Legacy #tag-buttons kept (if used anywhere) */

#tag-buttons {
  text-align: center;
  margin: 15px 0;
  position: relative;
  transition: all 0.2s ease;
}

#tag-buttons.fixed {
  position: fixed;
  top: -30px;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 30px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#tag-buttons button {
  margin: 0 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  background-color: #f9f9f9;
  cursor: pointer;
  font-size: 0.8em;
}

#tag-buttons button.active {
  background-color: #000;
  color: #fff;
}

/* Current mini tag row used by the DSL blog */

#mini-buttons {
  text-align: center;
  margin-left: 20vw;
  margin-right: 20vw;
  margin-bottom: 10px;
}

#mini-buttons button {
  margin: 0 5px 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
  background-color: #f1f1f1;
  cursor: pointer;
  font-size: 0.6em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#mini-buttons button:hover {
  background-color: var(--accent-muted);
}

#mini-buttons button.active {
  background-color: #000;
  color: #fff;
}

/* ----------------------------------------
   Additional Content (expanded article body)
---------------------------------------- */

.additional-content {
  margin-top: 18px;
  opacity: 1;
  transition: all 0.3s ease;
}

.additional-content img {
  max-width: 100%;
  height: auto;
  margin-top: 10px;
}

.additional-content a {
  display: block;
  margin-top: 10px;
  color: #007BFF;
  text-decoration: none;
}

.additional-content a:hover {
  text-decoration: underline;
}

/* Iframe wrapper */

.iframe-container {
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.iframe-container iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ----------------------------------------
   Quiz Block
---------------------------------------- */

.quiz-block {
  width: 75%;
  margin: 75px auto;
  border: 2px solid #444;
  padding: 40px;
  border-radius: 8px;
  background: #f3f3f3;
  box-shadow: var(--shadow-soft);
}

.quiz-question {
  font-weight: bold;
  margin-bottom: 10px;
}

.quiz-choices button {
  margin: 5px;
  padding: 6px 12px;
  cursor: pointer;
}

.quiz-feedback {
  margin-top: 10px;
  font-style: italic;
}

.quiz-feedback.correct {
  color: green;
}

.quiz-feedback.incorrect {
  color: red;
}

/* ----------------------------------------
   Note Block
---------------------------------------- */

.note-block {
  width: 75%;
  margin: 14px auto;
  background: linear-gradient(135deg, #fff7d1, #ffe9a6);
  border-left: 6px solid #f0b400;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.note-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.note-block strong {
  color: #b57b00;
  font-weight: 700;
  text-transform: uppercase;
  margin-right: 6px;
  letter-spacing: 0.04em;
}

/* ----------------------------------------
   Responsive Layout
---------------------------------------- */

@media (max-width: 900px) {
  /* Let Isotope still do its thing; give items more room */
  .blog-article.grid-item {
    width: 45%;
  }

  .grid-item.expanded {
    width: 96%;
    padding: 30px 20px 40px;
  }

  #mini-buttons {
    margin-left: 10vw;
    margin-right: 10vw;
  }
}

@media (max-width: 600px) {
  .blog-article.grid-item {
    width: 85%;
  }

  .grid-item.expanded {
    width: 100%;
    border-radius: 0;
    padding: 24px 14px 32px;
  }

  .quiz-block,
  .note-block {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
  }

  #mini-buttons {
    margin-left: 4vw;
    margin-right: 4vw;
  }
}


/* ----------------------------------------
   Code Block Buttons (Retro Terminal style)
---------------------------------------- */

.code-load-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  font-family: monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  border: 2px solid #000;
  background: linear-gradient(135deg, #ffffff, #f3f3f3);
  border-radius: 6px;
  cursor: pointer;
  transition: 
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.code-load-button:hover {
  background: #000;
  color: #fff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.code-load-button:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Optional “pulse glow” when code is loading or waiting */
.code-load-button.loading {
  animation: pulseButton 1.2s infinite ease-in-out;
}

@keyframes pulseButton {
  0%   { box-shadow: 0 0 0 rgba(0,0,0,0.0); }
  50%  { box-shadow: 0 0 12px rgba(0,0,0,0.25); }
  100% { box-shadow: 0 0 0 rgba(0,0,0,0.0); }
}
