/* DevCloudLab, Flux CD handouts
   Brand palette sampled from the DevCloudLab mark:
     blue  #2d6da4   teal #3ba79e   orange #e99a63   navy #2b3557          */

:root {
  --dcl-blue:   #2d6da4;
  --dcl-teal:   #3ba79e;
  --dcl-orange: #e99a63;
  --dcl-navy:   #2b3557;

  --bg:        #ffffff;
  --bg-soft:   #f6f8fb;
  --fg:        #1f2733;
  --fg-muted:  #5b6675;
  --border:    #e3e8ef;
  --code-bg:   #f4f6fa;
  --code-fg:   #24303f;

  --radius: 10px;
  --maxw: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:       #0f141b;
    --bg-soft:  #161d26;
    --fg:       #e6ebf2;
    --fg-muted: #9aa7b8;
    --border:   #263141;
    --code-bg:  #131a23;
    --code-fg:  #d8e2ee;
    --dcl-blue: #6ba9dd;
    --dcl-teal: #4cc0b6;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------- top bar */

.dcl-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.dcl-bar img { height: 34px; width: auto; display: block; }

.dcl-bar a.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--dcl-navy);
  font-weight: 700;
  letter-spacing: -.01em;
}

.dcl-bar .spacer { flex: 1; }

.dcl-bar .cta {
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  color: #fff;
  background: var(--dcl-blue);
  padding: .4rem .85rem;
  border-radius: 999px;
  white-space: nowrap;
}

.dcl-bar .cta:hover { background: var(--dcl-teal); }

/* ---------------------------------------------------------------- layout */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dcl-teal);
  border: 1px solid var(--dcl-teal);
  border-radius: 999px;
  padding: .2rem .6rem;
  margin-bottom: .9rem;
}

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; }

h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  margin: 0 0 .4rem;
  color: var(--dcl-navy);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1 { color: #dbe6f5; }
}

h2 {
  font-size: 1.35rem;
  margin: 2.4rem 0 .8rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--border);
}

h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }

.lede { color: var(--fg-muted); font-size: 1.05rem; margin: 0 0 1.6rem; }

a { color: var(--dcl-blue); text-underline-offset: 2px; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---------------------------------------------------------------- tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: .94rem;
  display: block;
  overflow-x: auto;
}

th, td { padding: .55rem .7rem; border: 1px solid var(--border); text-align: left; }
th { background: var(--bg-soft); font-weight: 650; }

/* ------------------------------------------------------------------- code */

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
}

:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: .12em .38em;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.dcl-code {
  position: relative;
  margin: 1.2rem 0;
}

.dcl-code pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem .95rem;
  overflow-x: auto;
  line-height: 1.55;
}

.dcl-copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font: 600 .74rem/1 inherit;
  font-family: inherit;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .35rem .55rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}

.dcl-code:hover .dcl-copy,
.dcl-copy:focus-visible { opacity: 1; }

.dcl-copy:hover { color: var(--dcl-blue); border-color: var(--dcl-blue); }

.dcl-copy.copied {
  color: #fff;
  background: var(--dcl-teal);
  border-color: var(--dcl-teal);
  opacity: 1;
}

/* Touch devices have no hover, keep the button permanently visible. */
@media (hover: none) {
  .dcl-copy { opacity: 1; }
}

/* ---------------------------------------------------------------- callouts */

blockquote {
  margin: 1.2rem 0;
  padding: .8rem 1rem;
  border-left: 4px solid var(--dcl-teal);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--fg);
}

blockquote p:first-child { margin-top: 0; }
blockquote p:last-child  { margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */

.dcl-foot {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 2.5rem 1rem 3rem;
  text-align: center;
}

.dcl-foot img { height: 72px; width: auto; margin-bottom: .8rem; }

.dcl-foot .big {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dcl-navy);
  margin: 0 0 .35rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dcl-foot .big { color: #dbe6f5; }
}

.dcl-foot p { color: var(--fg-muted); margin: 0 0 1.1rem; }

.dcl-foot .cta {
  display: inline-block;
  text-decoration: none;
  font-weight: 650;
  color: #fff;
  background: var(--dcl-blue);
  padding: .6rem 1.4rem;
  border-radius: 999px;
}

.dcl-foot .cta:hover { background: var(--dcl-teal); }

/* ------------------------------------------------------------------- index */

.sec { margin: 2rem 0; }

.sec h2 { border-bottom: 2px solid var(--dcl-teal); }

ul.lessons { list-style: none; padding: 0; margin: 0; }

ul.lessons li {
  border-bottom: 1px solid var(--border);
  padding: .55rem 0;
}

ul.lessons li a { text-decoration: none; font-weight: 550; }
ul.lessons li a:hover { text-decoration: underline; }

ul.lessons li .num {
  display: inline-block;
  min-width: 3.4rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
}
