/* =====================================================================
   CGC Back Office - Hanging planks              assets/css/planks.css
   The lobby signs: six planks and the Bulletin Board sign (assets/js/planks.js).
   =====================================================================

   INDEX
   1. Lettering font ...... the painted-sign letters for the blank planks
   2. A plank ............. hangs from its cords at the top
   3. Swing ............... rocks back and forth when the mouse comes over
                           (left, right, or gently: the Bulletin Board sign)
   4. Words on blank planks
   5. Keyboard and reduced motion
   6. Area ................ the invisible part of the picture that swings a
                           sign too (the board under the Bulletin Board sign)
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. Lettering font (assets/fonts/cgc-plank.woff2)
   --------------------------------------------------------------------- */
@font-face {
  font-family: "CGC Plank";
  src: url("../fonts/cgc-plank.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}


/* ---------------------------------------------------------------------
   2. A plank
   --------------------------------------------------------------------- */
.cgc-plank {
  position: absolute;
  z-index: 3;
  display: block;
  container-type: inline-size;           /* lets the words size with the plank */
  transform-origin: 50% 0;               /* hangs from its cords at the top */
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, .3));
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.cgc-plank img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}


/* ---------------------------------------------------------------------
   3. Swing (right-sign planks swing the other way; the Bulletin Board
   sign, flat on its wall, only gently)
   --------------------------------------------------------------------- */
/* is-swinging is added by planks.js when the mouse comes over the sign or its area */
.cgc-plank.is-swinging,
.cgc-plank:focus-visible               { animation: cgc-plank-sway 1.8s ease-out; }
.cgc-plank--right.is-swinging,
.cgc-plank--right:focus-visible        { animation-name: cgc-plank-sway-r; }
.cgc-plank--gentle.is-swinging,
.cgc-plank--gentle:focus-visible       { animation-name: cgc-plank-sway-g; }

@keyframes cgc-plank-sway {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(5deg); }
  35%  { transform: rotate(-3.5deg); }
  55%  { transform: rotate(2deg); }
  75%  { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}
@keyframes cgc-plank-sway-g {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(2deg); }
  35%  { transform: rotate(-1.5deg); }
  55%  { transform: rotate(1deg); }
  75%  { transform: rotate(-.5deg); }
  100% { transform: rotate(0); }
}
@keyframes cgc-plank-sway-r {
  0%   { transform: rotate(0); }
  15%  { transform: rotate(-5deg); }
  35%  { transform: rotate(3.5deg); }
  55%  { transform: rotate(-2deg); }
  75%  { transform: rotate(1deg); }
  100% { transform: rotate(0); }
}


/* ---------------------------------------------------------------------
   4. Words on blank planks
   Same lettering and size as the painted planks; squeezed to 78% width
   and tilted to match each board (tilt: Appearance > Lobby Sign Positions).
   --------------------------------------------------------------------- */
.cgc-plank__text {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 103%;                           /* 80% of the plank once squeezed */
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scaleX(.78);
  color: #2d2116;
  font: 700 14.2cqw/1.13 "CGC Plank", "DejaVu Serif Condensed", Georgia, serif;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  user-select: none;
}


/* ---------------------------------------------------------------------
   5. Keyboard and reduced motion
   --------------------------------------------------------------------- */
.cgc-plank:focus-visible { filter: drop-shadow(0 0 4px #195D3B) drop-shadow(2px 3px 2px rgba(0, 0, 0, .3)); }

@media (prefers-reduced-motion: reduce) {
  .cgc-plank.is-swinging,
  .cgc-plank:focus-visible { animation: none; }
}


/* ---------------------------------------------------------------------
   6. Area
   --------------------------------------------------------------------- */
.cgc-plank-area {
  position: absolute;
  z-index: 2;                            /* under the signs */
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
