/* ============================================================
   Awards — trophy wall (reuses the reading-journal scrapbook look)
   Depends on books.css for .journal, .entries, .entry, .modal__*,
   .cozy-form and the journal form skin — this file only adds the
   award-specific pieces (filter tabs, place/kind badges, blank
   tiles, notes textarea) and extends the shared bits to c-awards.
   ============================================================ */

/* Same architectural background + paper veil as the books/wallets pages. */
body.c-awards {
  background-color: #ece0c6;
  background-image:
    linear-gradient(180deg, rgba(238, 228, 205, 0.85) 0%, rgba(238, 228, 205, 0.71) 26%, rgba(238, 228, 205, 0.71) 100%),
    url("/background2.png");
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}
body.c-awards .site-footer {
  color: var(--j-ink-soft);
  text-shadow: 0 0 8px rgba(240, 231, 209, 0.92), 0 1px 2px rgba(240, 231, 209, 0.85);
}

/* ---------- Filter tabs (усі / медалі / кубки / …) ---------- */
.award-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 22px auto 4px;
}
.award-filter {
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.02rem;
  color: #4a4235;
  background: rgba(241, 233, 214, 0.72);
  border: 1.5px solid rgba(138, 125, 99, 0.5);
  border-radius: 999px;
  padding: 5px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
              color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.award-filter i { font-size: 0.92em; opacity: 0.85; }
.award-filter:hover {
  transform: translateY(-1px);
  border-color: #9c3b2e;
  color: #23201a;
}
.award-filter.is-active {
  background: #23201a;
  border-color: #23201a;
  color: #efe4c8;
  box-shadow: 0 3px 8px rgba(35, 32, 26, 0.24);
}
.award-filter.is-active i { opacity: 1; }

/* ============================================================
   The wall — awards hang as framed pictures rather than the taped
   polaroids used for books.

   Every frame fills its column, so an upright one is as large as the grid
   allows; the orientation changes its height instead. Rows would go ragged
   from mixing the two heights, so the controller hands them over already
   grouped — landscape first, then upright — and each run of equal-height
   frames then lines up on its own.
   ============================================================ */
.award-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: start;
  gap: 40px 24px;
  margin-top: 26px;
}

.frame {
  display: block;
  position: relative;
  padding-top: 26px; /* room for the nail + wire above the moulding */
  text-align: center;
  text-decoration: none;
}

/* ---------- Nail + wire ---------- */
.frame__hanger {
  position: absolute;
  top: 2px; left: 50%;
  z-index: 0;
  width: 9px; height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #e2ce97, #8a6f38 72%);
  box-shadow: 0 1px 2px rgba(60, 45, 25, 0.45);
}
.frame__hanger::before,
.frame__hanger::after {
  content: "";
  position: absolute;
  top: 6px; left: 3.5px;
  width: 1.5px; height: 24px;
  background: rgba(92, 76, 50, 0.5);
  transform-origin: top center;
}
.frame__hanger::before { transform: rotate(34deg); }
.frame__hanger::after  { transform: rotate(-34deg); }

/* ---------- Moulding ---------- */
/* Sits above the wire so the strands tuck in behind the frame. */
.frame__link { position: relative; z-index: 1; display: block; text-decoration: none; }

/* One moulding for every kind — dark wood, hanging straight. */
.frame__body {
  position: relative;
  display: block;
  padding: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, #7a5636 0%, #4e341f 30%, #6b4a2c 52%, #3f2a1a 78%, #5c3f27 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 0 7px rgba(0, 0, 0, 0.3),
    0 13px 24px -13px rgba(50, 36, 20, 0.8),
    0 2px 4px rgba(50, 36, 20, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.frame:hover .frame__body {
  transform: translateY(-5px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 0 7px rgba(0, 0, 0, 0.3),
    0 20px 30px -14px rgba(50, 36, 20, 0.7),
    0 2px 4px rgba(50, 36, 20, 0.22);
}

/* ---------- Mat + opening ---------- */
.frame__mat {
  display: block;
  padding: 11px;
  background: linear-gradient(160deg, #f8f1de, #eae0c5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 0 0 1px rgba(60, 45, 25, 0.35);
}
.frame__opening {
  position: relative;
  display: block;
  overflow: hidden;
  /* Same paper as the mat: a scan that isn't exactly the opening's proportion
     letterboxes onto more mat rather than into a visibly empty recess. */
  background: #f5eeda;
  box-shadow:
    inset 0 0 0 1px rgba(120, 100, 62, 0.55),
    inset 0 2px 7px rgba(60, 45, 25, 0.18);
}
.frame__art { display: block; width: 100%; height: 100%; }
/* Medals and cups are shot tight, so they crop to fill the opening; diplomas
   and certificates letterbox onto the mat instead — the whole scan stays
   readable and an off-orientation scan still looks deliberately framed. */
.frame__opening--cover .frame__art { object-fit: cover; }
.frame__opening--contain .frame__art { object-fit: contain; }

/* ---------- Shape ---------- */
/* The frame spans its column either way; the orientation only sets how tall the
   opening is. 5/7 is within a hair of A4, so a diploma scan fills the opening
   edge to edge instead of floating with mat above and below it. */
.frame--portrait  .frame__opening { aspect-ratio: 5 / 7; }
.frame--landscape .frame__opening { aspect-ratio: 4 / 3; }

/* At the full column width an upright frame stands about 70% taller than a wide
   one, so it dominates the wall. Hold it back to keep the two comparable in
   mass; on phones the column is already narrower than this, so it does nothing
   there. Capping the width rather than the height keeps the opening at A4, which
   is what stops a diploma scan letterboxing. */
.frame--portrait,
.frame--ghost { max-width: 180px; margin-inline: auto; }

/* ---------- Engraved brass plate ---------- */
.frame__caption { margin-top: 13px; }
.frame__plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 17px;
  font-family: var(--font-display), Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #3a2c12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  text-decoration: none;
  background: linear-gradient(180deg, #e4cda4 0%, #c5a663 45%, #a98a45 55%, #d5bb85 100%);
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(90, 70, 30, 0.4),
    0 2px 5px rgba(60, 45, 25, 0.3);
  transition: filter 0.18s var(--ease), transform 0.18s var(--ease);
}
.frame__plate i { font-size: 0.85em; opacity: 0.7; }
/* The two screws holding the plate to the wall. */
.frame__plate::before,
.frame__plate::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px; height: 3px;
  margin-top: -1.5px;
  border-radius: 50%;
  background: rgba(90, 70, 30, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}
.frame__plate::before { left: 6px; }
.frame__plate::after  { right: 6px; }
.frame:hover .frame__plate { filter: brightness(1.06); transform: translateY(-1px); }

/* Placement reads as a medal wafer set into the plate, after an engraved
   groove — on the wall a badge stuck to the moulding was the one thing not
   made of wood or brass. The modal keeps the plain .award-place disc. */
.frame__place {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  margin-left: 2px;
  border-radius: 50%;
  font-family: var(--font-display), Georgia, serif;
  font-weight: 700;
  font-size: 0.74rem;
  line-height: 1;
  color: #3c2a12;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    inset 0 -1px 1px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(90, 70, 30, 0.5);
}
.frame__place::before {
  content: "";
  position: absolute;
  left: -5px; top: 50%;
  width: 1px; height: 11px;
  margin-top: -5.5px;
  background: linear-gradient(180deg, rgba(90, 70, 30, 0.45), rgba(255, 255, 255, 0.45));
}
.frame__place--1 { background: radial-gradient(circle at 34% 30%, #ffe79a, #d4af37 70%); }
.frame__place--2 { background: radial-gradient(circle at 34% 30%, #f4f4f8, #b8b8c0 70%); }
.frame__place--3 { background: radial-gradient(circle at 34% 30%, #f0c39a, #cd7f32 70%); color: #4a2c12; }

/* The only place the kind is spelled out, so it has to hold its own against the
   illustrated background — ink-faint measured 3.2:1 here, under the 4.5:1 small
   text needs. ink-soft takes it to ~7.8:1. */
.frame__kind {
  display: block;
  margin-top: 7px;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--j-ink-soft);
  text-shadow: 0 0 8px rgba(240, 231, 209, 0.95), 0 1px 2px rgba(240, 231, 209, 0.9);
}
.frame__kind i { opacity: 0.75; }

/* ---------- Empty frame waiting for the next award ---------- */
.frame--ghost .frame__body {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 7; /* same shape as the upright frames it sits among */
  padding: 0;
  background: rgba(241, 233, 214, 0.5);
  border: 2px dashed var(--j-ink-soft);
  box-shadow: none;
}
.frame--ghost:hover .frame__body {
  transform: translateY(-4px);
  border-color: var(--j-ink);
  background: rgba(243, 236, 220, 0.72);
  box-shadow: none;
}
.frame__ghost-label {
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--j-ink-soft);
}
.frame--ghost:hover .frame__ghost-label { color: var(--j-ink); }

/* Blank (no-photo) art — a coloured field per kind with a big glyph. */
.award-blank { color: #f3ead4; }
.award-blank__icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  color: #f6efdd;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.award-blank--medal       { background: linear-gradient(150deg, #b5893f, #6f5220); }
.award-blank--cup         { background: linear-gradient(150deg, #a86a3c, #6a3d1e); }
.award-blank--diploma     { background: linear-gradient(150deg, #7d795a, #4d4a34); }
.award-blank--certificate { background: linear-gradient(150deg, #5f7050, #3f4d34); }
/* Inside a frame the glyph is alone in the opening, so it needs no gap below. */
.frame__art--blank {
  display: flex;
  align-items: center;
  justify-content: center;
}
.frame__art--blank .award-blank__icon { margin-bottom: 0; }

/* ---------- Place badge (gold / silver / bronze) ---------- */
.award-place {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  font-family: var(--font-display), Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #3c2a12;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 2px 6px rgba(60, 45, 25, 0.4);
}
.award-place--1 { background: radial-gradient(circle at 34% 30%, #ffe79a, #d4af37 70%); }
.award-place--2 { background: radial-gradient(circle at 34% 30%, #f4f4f8, #b8b8c0 70%); }
.award-place--3 { background: radial-gradient(circle at 34% 30%, #f0c39a, #cd7f32 70%); color: #4a2c12; }


/* ============================================================
   Modal additions (rendered in a body-level portal → literal colours)
   ============================================================ */
.modal__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
}
.modal__genre {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modal__place {
  align-self: flex-start;
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3c2a12;
  border-radius: 999px;
  padding: 2px 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
/* The place pill reuses the medal colours from the badge classes above. */
.modal__note { white-space: pre-wrap; }

/* Place badge inside the modal polaroid sits on the photo corner. */
.modal__polaroid { position: relative; }
.modal__polaroid .award-place { top: 2px; right: 2px; }

/* ============================================================
   Form additions — award form reuses .cozy-form; give c-awards the
   same journal skin as c-books, plus a notes textarea.
   ============================================================ */
body.c-awards .cozy-form {
  --accent: #9c3b2e;
  --accent-deep: #7d2f24;
  position: relative;
  max-width: 560px;
  background: #f6efdd;
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 14px 32px -16px rgba(60, 45, 25, 0.55);
}
body.c-awards .cozy-form::before {
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 128px; height: 26px;
  background: rgba(228, 214, 170, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
body.c-awards .cf-field input,
body.c-awards .cf-field textarea,
body.c-awards .cf-chip,
body.c-awards .cf-cover__drop {
  background: #fbf7ec;
  border-color: #cdbf9e;
}
body.c-awards .cf-field input,
body.c-awards .cf-field textarea {
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.05rem;
}
body.c-awards .cf-field > label,
body.c-awards .cf-chip,
body.c-awards .cf-cover__hint { font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif; }
body.c-awards .cf-genres__label,
body.c-awards .cf-cover__label {
  font-family: "Kalam", ui-rounded, "Segoe UI", sans-serif;
  color: #7d2f24;
}
body.c-awards .cf-field input:focus,
body.c-awards .cf-field textarea:focus,
body.c-awards .cf-cover__drop:hover {
  border-color: #9c3b2e;
  box-shadow: 0 0 0 3px rgba(156, 59, 46, 0.15);
}
body.c-awards .cf-chip.is-selected {
  background: #9c3b2e;
  border-color: #9c3b2e;
  color: #fff7ef;
}
body.c-awards .cf-submit.btn-primary {
  background: #23201a;
  color: #efe4c8;
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
}
body.c-awards .cf-submit.btn-primary:hover { background: #171410; color: #efe4c8; }
body.c-awards .cf-submit--success { background: var(--sage); }
body.c-awards .cf-actions .btn-ghost {
  font-family: "Caveat", ui-rounded, "Segoe UI", sans-serif;
  font-size: 1.25rem;
}

/* Notes textarea — same look as the floating-label inputs, multi-line. */
.cf-field--area textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  padding: 23px 14px 9px;
  background: #fffdf8;
  border: 1px solid #e0d4bd;
  border-radius: var(--radius-sm);
  resize: vertical;
  min-height: 92px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cf-field--area textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 106, 77, 0.15);
}
/* Floating label that lifts when focused or filled (placeholder is a single space). */
.cf-field--area > label {
  position: absolute;
  left: 15px;
  top: 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-faint);
  pointer-events: none;
  transform-origin: left center;
  transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.cf-field--area textarea:focus + label,
.cf-field--area textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(0.74);
  color: var(--accent-deep);
  font-weight: 600;
}
.cf-field--area textarea:focus ~ .cf-underline { left: 8px; right: 8px; }

/* Blank tile on the no-JS award show page. */
.award__photo--blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  aspect-ratio: 3 / 4;
  padding: 22px;
  color: #f3ead4;
  background: linear-gradient(150deg, #b5893f, #6f5220);
  border-radius: 3px 7px 7px 3px;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 640px) {
  /* Two frames per row; thinner moulding and mat so the artwork still gets
     most of the much narrower column. */
  .award-wall {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 14px;
  }
  .frame__body { padding: 6px; }
  .frame__mat { padding: 8px; }
  .frame__plate { padding: 3px 13px; font-size: 0.78rem; gap: 5px; }
  .frame__kind { font-size: 0.82rem; }
}

@media (max-width: 500px) {
  .award-filters { gap: 8px; }
  .award-filter { font-size: 0.95rem; padding: 4px 12px; }
}
