/* Social Posts (pages/social.js): four tiles and the clients' table; then one client: its status as five steps, its
   month as a calendar and the month's posts, or one post's form, beside it. The owner's mock sets the look. A hue
   class (h-<hue>) sets --tc, the colour of a status, on a pill, a tile's number, a calendar chip. */
.page[data-page="social"] { max-width: 1340px; padding: 24px 28px 80px; --orange: #a8480a; }
:root[data-theme="dark"] .page[data-page="social"] { --orange: #ff8a3d; }
.page[data-page="social"] :is(.h-green, .h-yellow, .h-red, .h-blue, .h-orange, .h-grey) { --tc: var(--text3); }
.page[data-page="social"] .h-green { --tc: var(--ok); } .page[data-page="social"] .h-yellow { --tc: var(--warn); } .page[data-page="social"] .h-red { --tc: var(--bad); }
.page[data-page="social"] .h-blue { --tc: var(--wait); } .page[data-page="social"] .h-orange { --tc: var(--orange); }

/* Add client: the head's button, with the select that picks the client laid over it */
.social-add { position: relative; } .social-add:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.social-add select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font: inherit; }
.social-add:has(select:disabled) { opacity: .55; }

.social-kpis { margin-bottom: 16px; }
.social-kpi .v { margin-top: 2px; }
.social-kpi .v[class*="h-"] { color: var(--tc); }

.social-card, .social-form { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.social-tw td { padding: 9px 12px; }
/* Next post: as much of its text as the column holds, cut at the column's edge; the whole text is the cell's title.
   The floor keeps the text readable where the table scrolls sideways (a narrow window; a phone hides the column). */
.social-tw td.social-next { max-width: 0; min-width: 280px; width: 40%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.social-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.social-name a { color: var(--head); text-decoration: none; } .social-name a:hover { text-decoration: underline; }
.social-pill, .social-pick { font: 600 11.5px/22px var(--sans); padding: 0 10px; border-radius: 999px; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); white-space: nowrap; }
.social-pick { appearance: none; height: 24px; padding-right: 22px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-size: 4px 4px; background-position: calc(100% - 12px) 10px, calc(100% - 8px) 10px; background-repeat: no-repeat; }
.social-pick option { color: var(--text); background: var(--raise); }

/* one client */
.social-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--text3); font-size: 13px; text-decoration: none; } .social-back:hover { color: var(--text); }
.social-steps { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding: 2px; }
.social-steps button { flex: 1; min-width: 150px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line); color: var(--text3); font-weight: 600; font-size: 13px; white-space: nowrap; transition: border-color var(--t-fast), color var(--t-fast); }
.social-steps button:hover { border-color: var(--line2); color: var(--text); }
.social-steps i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; background: var(--chip); flex: none; }
.social-steps i svg { width: 12px; height: 12px; stroke-width: 2.4; }
.social-steps .done i { background: var(--ok-bg); color: var(--ok); }
.social-steps .cur { border-color: var(--red); color: var(--text); } .social-steps .cur i { background: var(--red); color: #fff; }

.social-work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.social-card h3 { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--head); }
.social-card h3 > svg { color: var(--red); } .social-card h3 span { margin-left: auto; font-weight: 500; color: var(--text3); font-size: 12px; }
.social-card h3 .btn { width: 30px; height: 28px; padding: 0; justify-content: center; } .social-card h3 .fwd svg { rotate: 180deg; }
.social-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; padding: 12px; }
.social-cal .wd { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 4px 2px; }
.social-cal .day { min-height: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.social-cal .day.none { background: none; border-color: transparent; }
.social-cal .day.today { border-color: var(--red); }
.social-cal .add { display: flex; align-items: center; justify-content: space-between; padding: 1px 3px; border-radius: 6px; color: var(--text3); font-size: 12px; transition: background var(--t-fast), color var(--t-fast); }
.social-cal .add svg { width: 12px; height: 12px; color: var(--faint); } .social-cal .add:hover { background: var(--chip); color: var(--text); } .social-cal .add:hover svg { color: var(--text); }
.social-cal .today .add b { color: var(--red); }
.social-chip { display: flex; align-items: center; gap: 5px; text-align: left; font-size: 11.5px; line-height: 1.3; padding: 4px 6px; border-radius: 7px; border-left: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 11%, transparent); color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; transition: background var(--t-fast); }
.social-chip:hover { background: color-mix(in srgb, var(--tc) 20%, transparent); }
.social-chip i { font: 700 9.5px var(--mono); color: var(--tc); flex: none; }
.social-chip span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.social-side { display: grid; gap: 10px; }
.social-post .in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.social-post { display: block; width: 100%; text-align: left; padding: 12px 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 12px; transition: border-color var(--t-fast); }
.social-post:hover { border-color: var(--line2); }
.social-post .when { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .social-post .when b { font-size: 13px; color: var(--head); }
.social-post .t { color: var(--text3); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.social-post .img, .social-img { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); } .social-post .img svg, .social-img svg { width: 13px; height: 13px; }
.social-none { padding: 22px 16px; border: 1px dashed var(--line2); border-radius: 12px; color: var(--text3); text-align: center; }
.social-form { display: grid; gap: 12px; padding: 16px; }
.social-form h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--head); }
.social-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text3); min-width: 0; }
.social-form :is(input, select, textarea) { font: 400 14px var(--sans); color: var(--text); background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100%; outline: 0; }
.social-form :is(input, select, textarea):focus-visible { border-color: var(--red); }
.social-form textarea { resize: vertical; }
.social-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-form .acts { display: flex; gap: 8px; flex-wrap: wrap; } .social-form .del { margin-left: auto; color: var(--bad); }

@media (max-width: 1100px) { .social-work { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .page[data-page="social"] { padding: 20px 16px 40px; }
  /* A phone: the list keeps Client, Status and the month's posts; the row opens the rest. */
  .social-tw :is(th, td):is(:nth-child(4), :nth-child(5)) { display: none; }
  .social-tw :is(th, td) { padding-left: 6px; padding-right: 6px; }
  .social-tw :is(td:first-child, th.num) { white-space: normal; }
  .social-tw .social-av { display: none; }
  .social-cal { gap: 3px; padding: 8px; } .social-cal .day { min-height: 64px; padding: 3px; } .social-chip { font-size: 0; padding: 4px; } .social-chip i { font-size: 9.5px; }
}
