
@font-face {
  font-family: 'Ubuntu Mono';
  src: url('fonts/UbuntuMono-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
  font-family: 'Ubuntu Mono', 'Monaco', 'Consolas', 'Lucida Console', monospace;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.1;
  font-family: 'Ubuntu Mono', 'Monaco', 'Consolas', 'Lucida Console', monospace;
  color: #444;
  margin: 0;
}

h1 {
    font-family: 'Lora', 'Monaco', 'Consolas', 'Lucida Console', monospace;
}

h2, h3, h4,
button, input, label {
  font-family: 'Ubuntu Mono', 'Monaco', 'Consolas', 'Lucida Console', monospace;
}
/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Center main content */
main {
  text-align: center;
  padding-top: 5rem; /* Space for navbar */
  padding-bottom: 5rem; /* Space at the bottom */
}

/* Card grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  justify-items: center;
}

/* Individual card layout */
.card {
  display: flex;
  align-items: center;
  max-width: 300px;
  margin: 0 auto;
  transition: box-shadow 0.3s ease;
}

/* Remove default link styling for linked cards */
a.card {
  color: inherit;
  text-decoration: none;
}

/* Box with shadow and centered icon */
.box {
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  margin: 0.5rem;
  background-color: #f9f9f9;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Text content to the right, in dark grey */
.content {
  margin-left: 1rem;
  text-align: left;
  color: #333333;
}

/* Hover effect moves shadow toward center */
.card:hover .box {
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive stacking on mobile */
@media (max-width: 600px) {
  .cards {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .card {
    width: 100%;
    max-width: 90%;
  }
  .instructions-box {
    padding: 1rem;
    font-size: 0.95rem;
  }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 1rem auto;
  height: 54px;
  width: calc(100% - 4rem);
  max-width: 900px;
  background: rgba(255, 255, 255, 0.75); /* semi-transparent white */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Left: D logo */
.navbar-left .navbar-brand {
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  font-weight: bold;
  text-decoration: none;
  color: #888;
}

/* Right: pizza icon */
.navbar-right .navbar-logo {
  text-decoration: none;
  color: #333;
  display: flex;
  align-items: center;
  font-size: 32px;
  line-height: 1;
}

/* When scrolled */
.navbar.scrolled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.85);
}

/* Optional button style */
.navbar-button {
  font-size: 1rem;
  padding: 0.4rem 0.8rem;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}
.navbar-button:hover {
  background-color: #eee;
}

/* New minimal input-control layout for ± buttons */
.input-content {
  margin: 0 auto;
  text-align: center;
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  font-weight: bold;
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #333;
}

.input-control {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  height: 40px;
  overflow: hidden;
  background-color: #fff;
}

.input-control input {
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  border: none;
  outline: none;
  background: transparent;
}

/* Remove number input arrows (Chrome, Safari, Edge) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove number input arrows (Firefox) */
input[type=number] {
  -moz-appearance: textfield;
}

/* + and - buttons */
.input-control button {
  background-color: #ffffff;
  border: none;
  width: 60px;
  height: 100%;
  font-size: 1.2rem;
  cursor: pointer;
}

.input-control button:hover {
  background-color: #e0e0e0;
}

/* Submit button for form */
.calculate-btn {
  display: block;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  height: 40px;
  overflow: hidden;
  background-color: #ccc;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  width: 100%;
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.2);
}

.calculate-btn:hover {
  background-color: #555;
}

/* “Calculate with Biga” – same style as the main submit */
.input-control button.submit-alt {
  background-color: #ccc;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  width: 100%;
}

.input-control button.submit-alt:hover {
  background-color: #555;
}

/* Left button: add border to the right */
.input-control button:first-child {
  border-right: 1px solid #ccc;
}

/* Right button: add border to the left */
.input-control button:last-child {
  border-left: 1px solid #ccc;
}

/* Instructions box */
.instructions-box {
  max-height: 0;
  margin-top: 2rem;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  padding: 0 1.5rem; /* preserve horizontal spacing while collapsed */
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.2);
  text-align: left;
}
.instructions-box.open {
  max-height: 3000px;
  opacity: 1;
  padding: 1.5rem;
}
.instructions-box ol {
  padding-left: 1.25rem;
  margin-top: 1rem;
}
.instructions-box li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* ====== Toggle Switch for “Use 50% Biga” ====== */
.toggle-container {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #555;
}

.switch input:checked + .slider:before {
  transform: translateX(26px);
}

/* Toggle label text */
.toggle-label {
  font-size: 0.95rem;
  color: #333;
  user-select: none;
}
