/* Additions on top of the Twenty Twenty theme (static/theme/style.css) */

/* ---- slider (replaces Master Slider on the home page) ---- */
.bs-slider { position: relative; margin: 0 auto 3rem; width: 100%; }
.bs-slider .bs-viewport { position: relative; overflow: hidden; background: #fff; }
.bs-slider .bs-slide {
  position: absolute; inset: 0; display: block; opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility .6s; text-decoration: none;
}
.bs-slider .bs-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.bs-slider .bs-slide img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.bs-slider .bs-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem 2rem;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.8rem; line-height: 1.4; text-align: center;
}
.bs-slider .bs-arrow {
  position: absolute; top: 50%; z-index: 2; width: 4.4rem; height: 4.4rem; margin: -2.2rem 0 0; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); cursor: pointer;
}
.bs-slider .bs-arrow:hover, .bs-slider .bs-arrow:focus { background: rgba(0, 0, 0, .8); text-decoration: none; }
.bs-slider .bs-arrow::before {
  content: ""; display: block; width: 1.2rem; height: 1.2rem; margin: auto;
  border: solid #fff; border-width: 0 .3rem .3rem 0;
}
.bs-slider .bs-prev { left: 1.5rem; }
.bs-slider .bs-prev::before { transform: translateX(.2rem) rotate(135deg); }
.bs-slider .bs-next { right: 1.5rem; }
.bs-slider .bs-next::before { transform: translateX(-.2rem) rotate(-45deg); }
.bs-slider .bs-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: .8rem; }
.bs-slider .bs-thumb {
  width: 14rem; max-width: 18%; height: 8rem; padding: 0; border: .2rem solid transparent;
  background: none; opacity: .6; cursor: pointer;
}
.bs-slider .bs-thumb.is-active, .bs-slider .bs-thumb:hover { opacity: 1; border-color: #cd2653; }
.bs-slider .bs-thumb img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; }

/* ---- newsletter widget (footer, second column) ---- */
.widget_newsletter .newsletter-form input[type=text],
.widget_newsletter .newsletter-form input[type=email] { width: 100%; margin-bottom: 1rem; }
.widget_newsletter .consent { display: block; margin: 0 0 1.5rem; font-size: 1.5rem; font-weight: 400; }
.widget_newsletter .consent input { margin-right: .6rem; }
.widget_newsletter .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- content details ---- */

/* ---- code (static/js/code.js adds the header and the colors) ---- */
.entry-content pre {
    margin-top: 3rem; margin-bottom: 3rem; padding: 1.8rem 2rem; border: 0; border-radius: .8rem;
    background: #0d1117; color: #c9d1d9; font-size: 1.45rem; line-height: 1.65; tab-size: 4;
    max-height: 64rem; overflow: auto; box-shadow: 0 .4rem 1.6rem rgba(0, 0, 0, .14);
}
.entry-content pre, .entry-content pre code, .entry-content code, .entry-content kbd {
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.entry-content pre code, .entry-content pre code.hljs {
    display: block; padding: 0; overflow: visible; background: transparent; color: inherit;
    font-size: inherit; white-space: pre; border-radius: 0;
}
/* a bit wider than the text column (58rem), centered like the rest of the content */
/* (same selector shape as the theme's 58rem rule, so this one wins) */
.entry-content > pre:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide), .entry-content > .code-box:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide) { width: calc(100% - 4rem); max-width: 72rem; }
.entry-content .code-box {
    margin-top: 3rem; margin-bottom: 3rem; border-radius: .8rem; overflow: hidden; background: #0d1117;
    box-shadow: 0 .4rem 1.6rem rgba(0, 0, 0, .14);
}
.entry-content .code-box pre { margin: 0; max-width: none; width: auto; border-radius: 0; box-shadow: none; }
.code-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .6rem 1rem .6rem 2rem; background: #161b22; border-bottom: .1rem solid #30363d;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
}
.code-lang { color: #8b949e; font-size: 1.2rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.code-head .code-copy {
    margin: 0; padding: .4rem 1.2rem; border: .1rem solid #30363d; border-radius: .5rem;
    background: transparent; color: #c9d1d9; font-size: 1.25rem; font-weight: 500; letter-spacing: 0;
    text-transform: none; text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.code-head .code-copy:hover, .code-head .code-copy:focus { background: #30363d; color: #fff; text-decoration: none; }
.code-head .code-copy.done { color: #3fb950; border-color: #3fb950; }
/* inline code in the text */
.entry-content :not(pre) > code, .entry-content kbd {
    padding: .15em .45em; border-radius: .4rem; background: #ede7d9; color: #b3173f; font-size: .85em;
}
.entry-content > code { display: inline; }
.entry-content code:empty { display: none; }
@media (max-width: 699px) {
    .entry-content pre { padding: 1.4rem 1.4rem; font-size: 1.3rem; max-height: 52rem; }
    .entry-content > pre:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide), .entry-content > .code-box:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.is-style-wide) { width: 100%; max-width: none; border-radius: 0; }
    .code-head { padding-left: 1.4rem; }
}
.entry-content img { height: auto; }
.entry-content span.center { display: block; text-align: center; }   /* old <center> tags, see WpContent.oldMarkup */
.read-more-button-wrap { margin-top: 3rem; text-align: center; }

/* slides whose image must be shown whole (e.g. a portrait book cover): add "bs-contain" to the slide */
.bs-slider .bs-slide.bs-contain img, .bs-slider .bs-thumb.bs-contain img { object-fit: contain; background: #fff; }

/* book slides: cover, then "buy" badges (Casa do Código / Amazon), then the caption, stacked so nothing hides the cover */
.bs-slider .bs-slide.bs-book { display: flex; flex-direction: column; }
.bs-slider .bs-book .bs-cover { flex: 1; min-height: 0; display: block; }
.bs-slider .bs-book .bs-info { position: static; }
.bs-slider .bs-buy { display: flex; justify-content: center; align-items: center; gap: 1.5rem; padding: .8rem 0; background: #fff; }
.bs-slider .bs-buy a { display: block; border: 1px solid #dcd7ca; border-radius: .6rem; background: #fff; padding: .2rem .8rem; }
.bs-slider .bs-buy a:hover, .bs-slider .bs-buy a:focus { border-color: #cd2653; }
.bs-slider .bs-slide .bs-buy img { width: auto; height: 4.4rem; object-fit: contain; }
@media (max-width: 700px) { .bs-slider .bs-slide .bs-buy img { height: 3.2rem; } }

/* "Livros" menu: Casa do Código / Amazon badges under each book (desktop dropdown and mobile menu) */
.menu-item-book .book-buy { display: flex; gap: .8rem; align-items: center; }
.menu-item-book .book-buy a { display: block; width: auto; padding: .3rem .6rem; border-radius: .4rem; background: #fff; line-height: 0; }
.menu-item-book .book-buy img { width: auto; height: 2.2rem; }
.primary-menu .menu-item-book > a { padding-bottom: .4rem; }
.primary-menu .menu-item-book .book-buy { padding: 0 2rem 1.2rem; }
.primary-menu .menu-item-book .book-buy a:hover, .primary-menu .menu-item-book .book-buy a:focus { background: #f5efe0; }
.modal-menu .menu-item-book .book-buy { width: 100%; padding: 0 2.5rem 1.8rem; }
.modal-menu .menu-item-book .ancestor-wrapper > a { padding-bottom: 1rem; }
.modal-menu .menu-item-book .book-buy a { border: 1px solid #dcd7ca; }
.modal-menu .menu-item-book .book-buy img { height: 2.8rem; }
