/* =============================================================================
 * Clipboard surface — paper-on-corkboard aesthetic
 * =============================================================================
 * Self-contained: ships its own token block to avoid a load-order dependency
 * on companion.css. Values match companion.css 1:1 for visual consistency.
 *
 * Phase 6 polish (animations + micro-interactions) lives in polish.css and is
 * appended via @import so every page that loads clipboard.css gets it for free.
 */
@import url('./polish.css');

:root {
  --black: #000000;
  --white: #FFFFFF;
  --cream: #F4EBD9;
  --gray50: #FAFAFA;
  --gray100: #F5F5F5;
  --gray200: #E5E5E5;
  --gray300: #D4D4D4;
  --gray500: #737373;
  --gray700: #404040;
  --red: #CC0000;
  --green: #15803D;

  --shadow:    4px 4px 0 var(--black);
  --shadow-lg: 8px 8px 0 var(--black);
  --shadow-sm: 2px 2px 0 var(--black);

  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--black);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--black); }
button { font-family: inherit; cursor: pointer; }

/* ---- Page chrome --------------------------------------------------------- */

.page-header {
  border-bottom: 2px solid var(--black);
  background: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.page-header h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header h1 .header-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
}
.page-header .crumbs {
  font-size: 14px;
  color: var(--gray500);
}
.page-header .crumbs a { text-decoration: none; border-bottom: 1px dotted var(--gray500); }

.page-body {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.section { margin-bottom: 48px; }
.section h2 {
  font-size: 20px;
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.section .section-help {
  font-size: 14px;
  color: var(--gray500);
  margin: -8px 0 16px;
}

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.05s linear, box-shadow 0.05s linear;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn-primary { background: var(--black); color: var(--white); }
.btn-danger  { color: var(--red); }
.btn-ghost   { background: transparent; box-shadow: none; }
.btn-ghost:hover { box-shadow: var(--shadow-sm); }
.btn-block { display: flex; width: 100%; }

/* ---- Clipboard tiles (index sections) ----------------------------------- */

.clipboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.clipboard-tile {
  display: block;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--black);
  box-shadow: var(--shadow-sm);
  transition: transform 0.05s linear, box-shadow 0.05s linear;
}
.clipboard-tile:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.clipboard-tile .tile-name { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.clipboard-tile .tile-meta { font-size: 13px; color: var(--gray500); }
.clipboard-tile.pinned { background: var(--black); color: var(--white); }
.clipboard-tile.pinned .tile-meta { color: var(--gray300); }

/* ---- Post cards (board view) -------------------------------------------- */

.post-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px 20px;
  padding: 8px;
}
.post-card {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  transform-origin: center top;
  /* rotation is set inline per-card via style attribute */
}
.post-card::before {
  /* push pin */
  content: '';
  display: block;
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  background: var(--red);
  border: 2px solid var(--black);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.post-card .post-title {
  font-size: 18px;
  margin: 8px 0 8px;
  font-weight: 700;
  line-height: 1.25;
}
.post-card .post-blurb {
  font-size: 14px;
  color: var(--gray700);
  margin: 0 0 16px;
  line-height: 1.4;
}
.post-card .post-meta {
  font-size: 12px;
  color: var(--gray500);
  margin-top: 12px;
}
.post-card .post-link {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.post-card .post-link.secondary {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
}

/* ---- Composer form ------------------------------------------------------ */

.composer {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}
.composer h2 { margin: 0 0 8px; }
.composer .sub { color: var(--gray500); font-size: 14px; margin: 0 0 24px; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="url"],
.field input[type="tel"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--black);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
}
.field textarea { resize: vertical; min-height: 88px; }
.field .field-hint {
  font-size: 12px;
  color: var(--gray500);
  margin-top: 4px;
}
.field-error { color: var(--red); font-size: 13px; margin-top: 6px; }

.radio-row { display: flex; gap: 12px; }
.radio-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid var(--black);
  border-radius: 8px;
  cursor: pointer;
  background: var(--white);
  text-transform: none;
  font-weight: 500;
  letter-spacing: normal;
  font-size: 14px;
}
.radio-row input[type="radio"] { margin: 0; }
.radio-row label:has(input:checked) { background: var(--black); color: var(--white); }

/* ---- Modal (OTP gate) --------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
}
.modal h3 { margin: 0 0 12px; font-size: 22px; }
.modal p { margin: 0 0 20px; color: var(--gray700); font-size: 14px; line-height: 1.4; }
.modal .tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.modal .tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--white);
  font-weight: 600;
  font-size: 14px;
}
.modal .tab.active { background: var(--black); color: var(--white); }
.modal .actions { display: flex; gap: 8px; margin-top: 16px; }
.modal .error-msg { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 18px; }
.modal .verify-step { display: none; }
.modal .verify-step.active { display: block; }

/* ---- Toast (success/error transient) ----------------------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  display: none;
  box-shadow: var(--shadow-sm);
}
.toast.open { display: block; }
.toast.error { background: var(--red); }
