/* Manual Theme */
:root {
  --border-width: 3px;
  --shadow-offset: 6px;
}

body {
  background-color: #fff;
  color: #000;
}

/* Utility: Stripes */
.bg-stripes {
  background-image: linear-gradient(45deg, #000 12.5%, transparent 12.5%, transparent 50%, #000 50%, #000 62.5%, transparent 62.5%, transparent 100%);
  background-size: 10px 10px;
}

/* Layout */
.page-container {
  max-width: 64rem;
  /* max-w-4xl */
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Title Block Header */
.title-block {
  border: var(--border-width) solid black;
  margin-bottom: 3rem;
  display: flex;
  flex-wrap: wrap;
}

.title-block-main {
  flex: 1;
  padding: 1.5rem;
  border-right: var(--border-width) solid black;
}

.title-block-meta {
  width: 200px;
  display: flex;
  flex-direction: column;
}

.title-block-cell {
  flex: 1;
  border-bottom: var(--border-width) solid black;
  padding: 0.5rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title-block-cell:last-child {
  border-bottom: none;
}

.manual-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 3.5rem;
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.manual-subtitle {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards / Steps */
.manual-card {
  border: var(--border-width) solid black;
  padding: 2rem;
  background: white;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 0 black;
  position: relative;
  margin-bottom: 2rem;
}

.manual-step {
  border: var(--border-width) solid black;
  padding: 2rem;
  background: white;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 0 black;
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  margin-bottom: 2rem;
}

.manual-step:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 0 black;
}

.step-badge {
  position: absolute;
  top: -1.5rem;
  left: -1px;
  background: black;
  color: white;
  padding: 0.25rem 1rem;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.5rem;
  transform: rotate(-2deg);
  border: var(--border-width) solid white;
  /* simulated sticker border */
}

.step-number {
  font-family: 'Archivo Black', sans-serif;
  font-size: 3rem;
  line-height: 1;
}

.step-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 2.5rem;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.step-description {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Buttons */
.btn-block {
  display: inline-block;
  background: black;
  color: white;
  font-family: 'Archivo Black', sans-serif;
  text-transform: uppercase;
  padding: 1rem 2rem;
  text-decoration: none;
  border: var(--border-width) solid black;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-block:hover {
  background: white;
  color: black;
  box-shadow: 4px 4px 0 0 black;
  transform: translate(-2px, -2px);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  border: var(--border-width) solid black;
  padding: 0.75rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.125rem;
  outline: none;
  background: #fff;
  transition: box-shadow 0.2s;
}

.form-input:focus {
  background: #fff;
  box-shadow: 4px 4px 0 0 black;
}

/* Utility */
.mono {
  font-family: monospace;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .manual-title {
    font-size: 2.5rem;
  }

  .title-block-meta {
    width: 100%;
    border-left: none;
    border-top: var(--border-width) solid black;
    flex-direction: row;
  }

  .title-block-cell {
    border-bottom: none;
    border-right: var(--border-width) solid black;
  }

  .title-block-cell:last-child {
    border-right: none;
  }
}

/* List Page Grid */
.manuals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
}

.manuals-grid .manual-card {
  transition: transform 0.1s, box-shadow 0.1s;
}

.manuals-grid .manual-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--shadow-offset) + 2px) calc(var(--shadow-offset) + 2px) 0 0 black;
}

.manual-card-header {
  border-bottom: var(--border-width) solid black;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.manual-card-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.75rem;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.manual-category-label {
  display: inline-block;
  background: black;
  color: white;
  padding: 0.25rem 0.75rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.manual-image-container {
  border: var(--border-width) solid black;
  background-color: #f5f5f5;
  background-image: linear-gradient(45deg, #e5e5e5 12.5%, transparent 12.5%, transparent 50%, #e5e5e5 50%, #e5e5e5 62.5%, transparent 62.5%, transparent 100%);
  background-size: 10px 10px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  margin-bottom: 1.5rem;
}

.manual-image {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
}

.manual-metadata {
  font-family: 'Public Sans', sans-serif;
  font-size: 0.875rem;
  border-top: var(--border-width) dashed black;
  /* Technical detail */
  padding-top: 1rem;
}

.manual-metadata-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.manual-label {
  font-weight: 700;
  text-transform: uppercase;
}

.manual-url-link {
  display: block;
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: black;
  word-break: break-all;
}

/* Print Styles */
.manuals-grid-print {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.manual-card-print {
  border: var(--border-width) solid black;
  background: white;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  page-break-inside: avoid;
}

.manual-card-print .manual-card-header {
  border-bottom: var(--border-width) solid black;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

@media print {
  @page {
    margin: 0.5cm;
    size: auto;
  }

  body {
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .print-page-container {
    width: 100%;
  }

  .print-grid {
    display: grid;
    /* Fixed width columns to ensure they touch if content matches width */
    /* 4 columns fits safely on A4/Letter with margins (150px * 4 ~= 160mm) */
    grid-template-columns: repeat(4, 150px);
    gap: 0;
    row-gap: 1rem;
    /* Keep some vertical space for labels */
    justify-content: start;
  }

  .print-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    width: 150px;
    /* Match grid column */
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Add right border to every 4th item (end of row) and the very last item */
  .print-item:nth-child(4n) .print-sticker,
  .print-item:last-child .print-sticker {
    border-right-width: 1px;
  }

  .print-label {
    text-align: center;
    margin-bottom: 0.125rem;
    font-family: 'Public Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.25rem;
  }

  .print-brand-text {
    margin-right: 0.25rem;
  }

  .print-sticker {
    padding: 1rem;
    /* Increased padding (was 0.5rem) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    width: 100%;
    box-sizing: border-box;
    aspect-ratio: 1/1;
  }

  .print-qr-container {
    margin-bottom: 0.25rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .print-advert {
    font-family: 'Archivo Black', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    width: 100%;

    color: #000;
  }
}

/* Screen styles for previewing the print layout */
.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  width: 100%;
}

.print-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  width: 150px;
}

.print-label {
  text-align: center;
  margin-bottom: 0.25rem;
  margin-top: 0.25rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-sticker {
  border-width: 1px 0px 1px 1px;
  border-style: dashed;
  border-color: #000;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 1/1;
}

.print-qr-container {
  margin-bottom: 0.5rem;
}

.print-sticker .print-advert {
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 96px;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
