/*--- Vars */
:root {
	--font-size-label: 0.9em;
}

/*--- Responsive */
@media (max-width: 768px) {

  .grid-container,
  .method-grid {
    grid-template-columns: 1fr 1fr;
    /* or 1fr */
  }

  label.filters {
    visibility: hidden;
  }

  label.filters input {
    visibility: visible !important;
  }
  
  .modal-content {
	  width: 80vw !important;
  }
  
  .close-button {
	  left: 0;
	  font-size: 1rem;
  }
}

/*--- General + Typography */
body {
  font-family: system-ui, sans-serif;
  background: #f8f8f8;
  padding: 0;
  margin: 0;
}

h1 {
  position: sticky;
  top: 0;
  z-index: 30;
  text-align: left;
  font-size: 1.2rem;
  font-weight: normal;
  margin: 0;
  padding: 0.5rem 1rem;
}


h2 {
  font-size: 1rem;
  font-weight: normal;
  margin: 0;
  padding: 0;
  text-align: left;
  border: 1px solid #bbb;
}

/*--- Structure: Header */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 254, 0, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

#header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

#help-btn {
  background: rgba(255, 254, 0, 1);
  color: #000;
  border: none;
  width: 50px;
  height: 50px;
  font-weight: bold;
  font-size: 1.2rem;
  cursor: pointer;
}

#help-btn:hover {
  background: rgba(255, 219, 0, 1);
}

#search {
  background: rgba(255, 254, 0, 1);
  padding: 8px;
  font-size: 0.8rem;
  border: none;
  font-style: italic;
  border-bottom: 2px solid #999;
  flex: 1;
  min-width: 200px;
  /* remove OS default highlighting */
  outline: none;
}

#search:focus {
  border-bottom: 3px solid #000;
}

#search::placeholder {
  color: #888;
  opacity: 0.8;
}

/* Double Diamond part */
.grid-container {
  position: sticky;
  top: 50px;
  /* below header and filters */
  background: rgba(255, 254, 0, 1);
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  font-weight: bold;
  color: #444;
  margin-bottom: 0.3rem;
}

.grid-label {
  padding: 1rem 1rem 1rem 1rem;
  text-align: left;
  position: relative;
}

#filters {
  margin: 10px auto 20px;
  text-align: center;
  position: sticky;
  top: 0;
  background: #f8f8f8;
  padding: 10px;
  z-index: 20;
}

.filters {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-style: italic;
  color: #555;
  user-select: none;
}

/*--- Structure: Method grid */

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  grid-auto-rows: auto;
  grid-auto-flow: row dense;
  position: relative;
  padding: 0 0.5rem;
  margin-bottom: 2rem;
}

.method.disabled {
  opacity: 0.2;
  pointer-events: none;
}

.method {
  display: flex;
  height: 50px;
  position: relative;
  cursor: pointer;
  font-style: italic;
}

.method-label {
  font-size: var(--font-size-label);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 2px 4px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-segment {
  flex: 1;
  display: flex;
  border-bottom: 2px solid transparent;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
  padding: 0 4px;
  overflow: visible;
}

.phase-segment.solid {
  border-bottom: 2px solid #333;
}

.phase-segment.dashed {
  border-bottom: 2px dashed #aaa;
}

.method:hover .phase-segment {
	border-color: rgba(245, 39, 39, 0.8);
}

.phase-segment:first-child {
  min-width: 0;
  /* allow shrinking */
}


/*--- Structure: Modal Styles */
.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
}

.modal-overlay.active {
	display: block;
}

.modal-content {
	position: absolute;
	top: 0;
	right: 0;
	width: 50vw;
	height: 100vh;
	background-color: white;
	overflow-y: auto;
	padding: 2rem;
	z-index: 10001;
	transform: translateX(100%);
	transition: transofrm 0.5s ease;
}

.modal-overlay.active .modal-content {
	transform: translateX(0);
}
.close-button {
	position: absolute;
	top: 1rem;
	right: 60vw;
	font-size: 6rem;
	color: rgba(0,0,0,0.5);
	border-radius: 50%;
	padding: 0.3rem 0.6rem;
	cursor: pointer;
	z-index: 1002;
}