/* ============================================================
   CARD CSS
   Physical: 4"×9", 1/4" margin, 1/8" col gap, 1/16" row gap
   Screen: 420px = 4" (105px per inch)
   Brand: #00305D blue, #C03936 red, #FFFFFF white, #E8E8E8 bg
   No borders. No dotted lines. White gutters only.
   ============================================================ */

:root {
  --card-width:  420px;
  --card-height: 945px;
  --margin:      26px;
  --col-gap:     13px;
  --row-gap:     7px;
  --col-width:   114px;
  --row-height:  43px;
  --blue:        #00305D;
  --red:         #C03936;
  --white:       #FFFFFF;
  --bg:          #E8E8E8;
  --font-display:'Antonio', sans-serif;
  --font-body:   'Archivo Narrow', sans-serif;
}

/* ============================================================
   CARD CONTAINER
   ============================================================ */

.card-wrapper {
  overflow-x: auto;
  padding: 24px;
  background: var(--bg);
}

.card-side {
  width: var(--card-width);
  height: var(--card-height);
  background: var(--white);
  position: relative;
  margin: 0 auto 48px;
  box-shadow: 0 2px 16px rgba(0,48,93,0.12);
  overflow: hidden;
  box-sizing: border-box;
}

/* ============================================================
   FIXED ZONES (header and footer image bands)
   Sit outside the CSS grid, inside card margin.
   ============================================================ */

.card-fixed-header {
  width: calc(var(--card-width) - (var(--margin) * 2));
  height: calc((var(--row-height) * 2) + var(--row-gap));
  margin: var(--margin) var(--margin) 0;
  overflow: hidden;
}

.card-fixed-footer {
  width: calc(var(--card-width) - (var(--margin) * 2));
  margin: 0 var(--margin) var(--margin);
  overflow: hidden;
}

.card-fixed-header img,
.card-fixed-footer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder-fixed {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 10px;
  color: #999;
}

/* ============================================================
   CARD GRID
   CSS Grid maps 1:1 to physical card slot structure.
   Background is white — gaps read as white gutters.
   ============================================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, var(--col-width));
  grid-template-rows: repeat(18, var(--row-height));
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
  padding: var(--margin);
  background: var(--white);
  box-sizing: border-box;
  width: var(--card-width);
}

/* ============================================================
   WIDGET BASE
   Fixed dimensions always. Content top-justified.
   No outer border except on reserved/confirmed (accent bar only).
   White row-gap and column-gap provide all separation.
   ============================================================ */

.widget {
  width: var(--col-width);
  height: var(--row-height);
  overflow: hidden;
  box-sizing: border-box;
  background: var(--white);
  position: relative;
  padding: 3px 4px;
  font-family: var(--font-body);
  font-size: 9px;
  line-height: 1.25;
  color: var(--blue);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

/* ============================================================
   CATEGORY HEADER WIDGET
   ============================================================ */

.widget-category-header {
  background: var(--red);
  padding: 0 6px;
  justify-content: center;
  align-items: flex-start;
}

.widget-category-header .cat-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* ============================================================
   LISTING TYPOGRAPHY
   ============================================================ */

.biz-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 9.5px;
  line-height: 1.15;
  color: var(--blue);
  display: block;
  margin-bottom: 1px;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
}

/* 23-44 char name: wraps to two lines, descriptor suppressed */
.biz-name--long {
  font-size: 8.5px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.descriptor {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 7.5px;
  color: #444;
  display: block;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.listing-phone {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 7.5px;
  color: var(--blue);
  display: block;
  margin-top: 1px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ============================================================
   WIDGET STATES
   Open: open-slot.jpg fills cell, cursor pointer.
   Reserved: left red accent bar.
   Confirmed: left blue accent bar.
   No full borders. No dotted lines. White gutters only.
   ============================================================ */

.widget-open {
  padding: 0;
  cursor: pointer;
  background: var(--white);
}

.widget-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-open:hover { opacity: 0.85; }

.widget-reserved {
  border-left: 3px solid var(--red);
  padding-left: 5px;
  background: var(--white);
}

.widget-confirmed {
  border-left: 3px solid var(--blue);
  padding-left: 5px;
  background: var(--white);
}

/* Proof mode: confirmed name is a link */
.widget-confirmed a.biz-name           { color: var(--blue); text-decoration: none; }
.widget-confirmed a.biz-name:hover     { color: var(--red);  text-decoration: underline; }

/* Status badges — small, top-right corner */
.badge {
  font-family: var(--font-body);
  font-size: 6px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 2px;
  position: absolute;
  top: 2px;
  right: 2px;
  line-height: 1;
  z-index: 1;
}

.badge-confirmed { background: var(--blue); color: var(--white); }
.badge-reserved  { background: var(--red);  color: var(--white); }

/* ============================================================
   IMAGE WIDGET
   ============================================================ */

.widget-image {
  padding: 0;
  background: var(--bg);
}

.widget-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 8px;
  color: #999;
  text-align: center;
  padding: 4px;
  box-sizing: border-box;
}

/* ============================================================
   EMPTY WIDGET
   ============================================================ */

.widget-empty { background: var(--white); }

/* ============================================================
   ADMIN OVERLAY
   Appears on hover in admin mode only.
   Suppressed in public and proof renders.
   ============================================================ */

.widget-admin-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,48,93,0.82);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 3px;
  font-size: 7px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.admin-widget:hover .widget-admin-bar { opacity: 1; }

.btn-move-up,
.btn-move-down {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 9px;
  padding: 0 2px;
  line-height: 1;
}

.btn-edit {
  color: #cde;
  text-decoration: none;
  font-size: 7px;
}

.empty-label {
  font-size: 7px;
  color: #bbb;
  margin: auto;
}
