/* ============================================================
Buttons: brand buttons, site buttons, the footer's Cookie settings button, social buttons, scroll-to-top
and the cookie banner buttons
============================================================ */

/* ---------------------------------------------------
  BRAND BUTTONS (.btn-brand, .btn-outline-brand)
----------------------------------------------------- */
/* Bootstrap's .btn in the brand colors (Home hero, 404 page, project links, and the site buttons below): the same padding and border on every side, like
   "View details", so the text stays centered on every screen and browser */
.btn-brand,
.btn-outline-brand {
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-padding-y: 0.625rem;
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: 10px;
  --bs-btn-focus-shadow-rgb: 169, 51, 57;
  --bs-btn-active-color: var(--bs-btn-hover-color);
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-border-color: var(--bs-btn-hover-border-color);
  --bs-btn-disabled-color: var(--bs-btn-color);
  --bs-btn-disabled-bg: var(--bs-btn-bg);
  --bs-btn-disabled-border-color: var(--bs-btn-border-color);
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Filled red (main button, e.g. "See projects"): turns white on hover */
.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: var(--brand);
  --btn-icon: #fff;
  --btn-hover-icon: var(--brand);
}

/* White with a light red border (second button, e.g. "Get in touch"): turns red on hover */
.btn-outline-brand {
  --bs-btn-color: var(--text);
  --bs-btn-bg: #fff;
  --bs-btn-border-color: color-mix(in srgb, var(--brand) 40%, #fff);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --btn-icon: var(--brand);
  --btn-hover-icon: #fff;
}

:is(.btn-brand, .btn-outline-brand) i {
  color: var(--btn-icon);
  transition: color 0.3s ease;
}

:is(.btn-brand, .btn-outline-brand):hover i {
  color: var(--btn-hover-icon);
}

/* Dark theme: dark grey instead of white, and the full red border (the light red would glow on the dark page) */
[data-bs-theme="dark"] .btn-brand {
  --bs-btn-hover-color: #dee2e6;
  --bs-btn-hover-bg: #2b3035;
}

[data-bs-theme="dark"] .btn-outline-brand {
  --bs-btn-color: #dee2e6;
  --bs-btn-bg: #2b3035;
  --bs-btn-border-color: var(--brand);
}

/* ---------------------------------------------------
  SITE BUTTONS (.tp-btn)
----------------------------------------------------- */
/* A brand button with more weight: class="btn btn-outline-brand tp-btn" (Let's Talk, Send, All projects,
   Go back). Bigger bold text, a soft shadow, and two red dots that grow and fill the button on hover */
.tp-btn {
  --bs-btn-padding-x: 1.25rem;
  --bs-btn-padding-y: 0.75rem;
  --bs-btn-font-size: 1.0625rem;
  --bs-btn-font-weight: 800;
  position: relative;
  z-index: 1;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 55px rgba(168, 182, 218, 0.32);
}

/* The two dots: one above the button, one below it, both in the hover color */
.tp-btn::before,
.tp-btn::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -12px;
  left: 20%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bs-btn-hover-bg);
  transition: width 0.3s cubic-bezier(0.785, 0.135, 0.15, 0.86);
}

.tp-btn::after {
  top: auto;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
}

.tp-btn:hover::before,
.tp-btn:hover::after {
  width: 100%;
}

/* Arrows move on hover: "All projects" to the right, "Go back" to the left */
.tp-btn .arrow {
  transition: transform 0.3s ease, color 0.3s ease;
}

.tp-btn-all-projects:hover .arrow {
  transform: translateX(10px);
}

.tp-btn-go-back:hover .arrow {
  transform: translateX(-10px);
}

/* Dark theme: a darker shadow */
[data-bs-theme="dark"] .tp-btn {
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

/* ---------------------------------------------------
  FOOTER LINK BUTTON: Cookie settings
----------------------------------------------------- */
/* Footer: "Cookie settings" opens the cookie banner, so it's a button, but it looks like the links next to it */
.footer-link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
}

/* ---------------------------------------------------
  SOCIAL BUTTONS
----------------------------------------------------- */
/* Social media icons (Home and About), shown in grey */
.socialButtons {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.socialButtons a {
  margin-left: 5px;
}

.socialButtons img {
  -webkit-filter: grayscale(100%);
  /* Safari 6.0 - 9.0 */
  filter: grayscale(100%);
}

/* Phones (575px and down) */
@media (max-width: 575.98px) {
  /* Home: smaller social icons under the hero buttons */
  .home-social img {
    width: 42px;
    height: 42px;
  }
}

/* Landscape tablets and smaller (894px and down) */
@media (max-width: 894px) {
  /* Social media icons centered below the content */
  .socialButtons {
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }

  /* Home: more space between the hero buttons and the social icons below them */
  .socialButtons.home-social {
    margin-top: 1.75rem;
  }
}

/* ---------------------------------------------------
  SCROLL-TO-TOP BUTTON
----------------------------------------------------- */
/* Scroll-to-top button (shown by main.js after scrolling down) */
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 8px;
  right: 7px;
  z-index: 999;
  border: none;
  background-color: #252525;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 5px;
  font-size: 0.2em;
  opacity: 0.5;
}

/* Dark theme: a lighter grey, so it shows on the dark page */
[data-bs-theme="dark"] #scrollTopBtn {
  background-color: #495057;
}

/* ---------------------------------------------------
  COOKIE BANNER BUTTONS
----------------------------------------------------- */
/* "Accept all" button in the brand red, like the site's other buttons
   (double class: stronger selector to override cookieconsent styles) */
.cm__btn.cm__btn[data-role="all"] {
  background-color: var(--brand) !important;
  color: #fff !important;
  font-weight: bold !important;
  padding: 12px 24px !important;
  border-radius: 6px !important;
  border: none !important;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent) !important;
  transition: background-color 0.3s ease !important;
}

.cm__btn.cm__btn[data-role="all"]:hover {
  background-color: var(--brand-dark) !important;
}

/* "Only necessary" button */
.cm__btn.cm__btn[data-role="necessary"] {
  background-color: transparent !important;
  border: 1px solid #ccc !important;
  color: #333 !important;
  font-weight: normal !important;
  border-radius: 6px !important;
  padding: 10px 20px !important;
}

.cm__btn.cm__btn[data-role="necessary"]:hover {
  background-color: #c1c1c1 !important;
  color: #fff !important;
}

/* Dark theme: a grey outline and light text */
[data-bs-theme="dark"] .cm__btn.cm__btn[data-role="necessary"] {
  border-color: #495057 !important;
  color: #dee2e6 !important;
}
