/* Casa Bom Dia — shared header and footer (see /assets/site-nav.js). Self-contained: it does not
   depend on each page's own stylesheet, and resets what generic page rules (header{}, footer{}, nav a{}) might add. */
.cbd-head, .cbd-foot {
  --cbd-bg: #ffffff; --cbd-ink: #12324a; --cbd-muted: #3f5567; --cbd-sand: #f5efe6; --cbd-line: #e3dcd1;
  --cbd-sun: #f2b232; --cbd-on-sun: #12324a; --cbd-orange: #b8462e; --cbd-band: #12324a; --cbd-on-band: #ffffff;
  --cbd-tri3: #12324a; --cbd-band-muted: #c9d4dc;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--cbd-ink); box-sizing: border-box; text-align: left;
}
@media (prefers-color-scheme: dark) {
  .cbd-head, .cbd-foot {
    --cbd-bg: #0f2232; --cbd-ink: #f2ede4; --cbd-muted: #c2ccd3; --cbd-sand: #16304a; --cbd-line: #2a4560;
    --cbd-orange: #f29a68; --cbd-band: #0a1926; --cbd-tri3: #ffffff;
  }
}
.cbd-head *, .cbd-foot * { box-sizing: border-box; }
.cbd-tri3 { fill: var(--cbd-tri3); }

/* ---------- header ---------- */
.cbd-head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; margin: 0; padding: 0; width: 100%;
  background: var(--cbd-bg); border: 0; border-bottom: 1px solid var(--cbd-line); box-shadow: none; }
.cbd-bar { max-width: 1240px; margin: 0 auto; padding: 12px 24px; min-height: 72px; display: flex; align-items: center; gap: 22px; }
.cbd-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cbd-ink); flex: none; }
.cbd-logo span { font-family: "Caveat", cursive; font-weight: 700; font-size: 2.05rem; line-height: 1; white-space: nowrap; }
.cbd-panel { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.cbd-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; background: none; }
.cbd-menu > a, .cbd-drop > summary { font-size: 1rem; font-weight: 500; color: var(--cbd-ink); text-decoration: none; padding: 10px 12px;
  border-radius: 10px; line-height: 1.2; cursor: pointer; background: none; border: 0; white-space: nowrap; }
.cbd-menu > a:hover, .cbd-drop > summary:hover { background: var(--cbd-sand); }
.cbd-menu a[aria-current="page"], .cbd-drop[data-active] > summary { text-decoration: underline; text-decoration-color: var(--cbd-sun);
  text-decoration-thickness: 3px; text-underline-offset: 6px; }
.cbd-drop { position: relative; }
.cbd-drop > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.cbd-drop > summary::-webkit-details-marker { display: none; }
.cbd-drop > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.cbd-drop[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.cbd-dropbox { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 28px; min-width: 470px; padding: 20px 24px; background: var(--cbd-bg); border: 1px solid var(--cbd-line); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(18, 50, 74, .16); }
.cbd-group { display: flex; flex-direction: column; gap: 2px; }
.cbd-gh { margin: 0 0 6px; font-family: "Caveat", cursive; font-weight: 700; font-size: 1.35rem; line-height: 1.1; color: var(--cbd-orange); }
.cbd-group a { color: var(--cbd-ink); text-decoration: none; padding: 7px 0; font-size: 1rem; }
.cbd-group a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cbd-langs { display: flex; gap: 6px; }
.cbd-langs a { display: inline-grid; place-items: center; min-width: 42px; min-height: 36px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--cbd-line); color: var(--cbd-ink); text-decoration: none; font-size: .82rem; font-weight: 700; }
.cbd-langs a[aria-current="true"] { background: var(--cbd-ink); color: var(--cbd-bg); border-color: var(--cbd-ink); }
.cbd-book { flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--cbd-sun); color: var(--cbd-on-sun); font-weight: 700; font-size: 1rem; text-decoration: none; white-space: nowrap; }
.cbd-book:hover { filter: brightness(.96); }
.cbd-book-short { display: none; }
.cbd-burger { display: none; }
.cbd-head a:focus-visible, .cbd-head summary:focus-visible, .cbd-head button:focus-visible,
.cbd-foot a:focus-visible { outline: 3px solid #e06a2c; outline-offset: 2px; }

@media (max-width: 1180px) { .cbd-bar { gap: 14px; } .cbd-panel { gap: 14px; } .cbd-menu > a, .cbd-drop > summary { padding: 10px 8px; } }
@media (max-width: 959px) {
  .cbd-bar { padding: 10px 16px; min-height: 64px; gap: 10px; }
  .cbd-logo span { font-size: 1.75rem; }
  .cbd-book { margin-left: auto; min-height: 44px; padding: 0 18px; }
  .cbd-burger { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px;
    border: 1px solid var(--cbd-line); background: var(--cbd-bg); cursor: pointer; padding: 0; }
  .cbd-burger span, .cbd-burger span::before, .cbd-burger span::after { display: block; width: 18px; height: 2px; background: var(--cbd-ink);
    border-radius: 2px; position: relative; content: ""; transition: transform .15s; }
  .cbd-burger span::before { position: absolute; top: -6px; } .cbd-burger span::after { position: absolute; top: 6px; }
  .cbd-head[data-open] .cbd-burger span { background: transparent; }
  .cbd-head[data-open] .cbd-burger span::before { transform: translateY(6px) rotate(45deg); }
  .cbd-head[data-open] .cbd-burger span::after { transform: translateY(-6px) rotate(-45deg); }
  .cbd-panel { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; flex-direction: column; align-items: stretch; gap: 18px;
    padding: 16px 20px 24px; background: var(--cbd-bg); border-bottom: 1px solid var(--cbd-line); box-shadow: 0 18px 30px rgba(18, 50, 74, .12);
    max-height: calc(100vh - 64px); overflow-y: auto; }
  .cbd-head[data-open] .cbd-panel { display: flex; }
  .cbd-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .cbd-menu > a, .cbd-drop > summary { font-size: 1.1rem; padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--cbd-line); }
  .cbd-drop > summary { justify-content: space-between; display: flex; }
  .cbd-dropbox { position: static; transform: none; min-width: 0; grid-template-columns: 1fr; gap: 14px; padding: 12px 4px 4px; border: 0; box-shadow: none; }
  .cbd-group a { padding: 9px 0; font-size: 1.05rem; }
  .cbd-langs { flex-wrap: wrap; }
}
@media (max-width: 400px) { .cbd-book-full { display: none; } .cbd-book-short { display: inline; } .cbd-logo span { font-size: 1.55rem; } .cbd-logo svg { width: 30px; } }

/* ---------- footer ---------- */
.cbd-foot { display: block; margin: 0; padding: 56px 24px 28px; background: var(--cbd-band); color: var(--cbd-on-band); border: 0; }
.cbd-foot a { color: var(--cbd-on-band); }
.cbd-fwrap { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.4fr 1.4fr; gap: 32px; }
.cbd-foot .cbd-logo { color: var(--cbd-on-band); }
.cbd-foot .cbd-tri3 { fill: #ffffff; }
.cbd-foot p { margin: 0 0 10px; font-size: .95rem; line-height: 1.5; color: var(--cbd-band-muted); }
.cbd-fbrand p:first-of-type { margin-top: 14px; }
.cbd-hand { font-family: "Caveat", cursive; font-size: 1.4rem !important; line-height: 1.2 !important; color: var(--cbd-sun) !important; }
.cbd-fcol { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cbd-fh { font-weight: 700; color: var(--cbd-on-band) !important; font-size: 1rem !important; margin-bottom: 10px !important; }
.cbd-fcol > a { text-decoration: none; padding: 5px 0; font-size: .95rem; }
.cbd-fcol > a:hover, .cbd-fcol p a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cbd-fcol ul { margin: 0; padding: 0 0 0 18px; color: var(--cbd-band-muted); font-size: .92rem; line-height: 1.5; }
.cbd-fcol li { margin: 0 0 6px; }
.cbd-fcol p a { text-decoration: underline; text-underline-offset: 3px; }
.cbd-fbottom { max-width: 1240px; margin: 36px auto 0; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .18);
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: .88rem; color: var(--cbd-band-muted); }
.cbd-fbottom a { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; color: var(--cbd-sun); }
.cbd-flangs { margin-left: auto; display: flex; gap: 12px; }
.cbd-flangs a { color: var(--cbd-band-muted); font-weight: 700; text-decoration: none; }
.cbd-flangs a[aria-current="true"] { color: var(--cbd-on-band); text-decoration: underline; }
@media (max-width: 1100px) { .cbd-fwrap { grid-template-columns: 1fr 1fr 1fr; } .cbd-fbrand { grid-column: 1 / -1; } }
@media (max-width: 640px) { .cbd-fwrap { grid-template-columns: 1fr 1fr; gap: 28px 20px; } .cbd-fwrap > .cbd-fcol:nth-child(4), .cbd-fwrap > .cbd-fcol:nth-child(5) { grid-column: 1 / -1; }
  .cbd-flangs { margin-left: 0; } }
