/* TAC Comments. Phone first; fonts come from the theme. Colours are variables so they can be matched to the site. */
.tac-comments {
  --tac-accent: #1f6fb2;
  --tac-accent-soft: #e8f1f9;
  --tac-text: #1d2327;
  --tac-muted: #646970;
  --tac-line: #dcdcde;
  --tac-bg: #ffffff;
  --tac-bg-soft: #f6f7f7;
  --tac-daisy: #fff8e5;
  --tac-radius: 10px;
  color: var(--tac-text);
  margin: 2rem 0;
  font-size: 16px;
  line-height: 1.5;
}
.tac-comments *, .tac-comments *::before, .tac-comments *::after { box-sizing: border-box; }
.tac-comments .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.tac-comments-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.tac-comments-title { margin: 0; font-size: 1.35rem; }
.tac-link { background: none; border: 0; padding: .25rem 0; color: var(--tac-accent); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tac-link.is-on { color: var(--tac-muted); }

/* Form */
.tac-form { background: var(--tac-bg-soft); border: 1px solid var(--tac-line); border-radius: var(--tac-radius); padding: .75rem; margin: 0 0 1.5rem; }
.tac-comment .tac-form { margin: .75rem 0 0; background: var(--tac-bg); }
.tac-textarea-wrap { position: relative; }
.tac-text { display: block; width: 100%; min-height: 5.5em; resize: vertical; padding: .65rem .75rem; border: 1px solid var(--tac-line); border-radius: 8px; font: inherit; font-size: 16px; /* 16px stops iPhones zooming in */ line-height: 1.45; background: var(--tac-bg); color: var(--tac-text); }
.tac-text:focus { outline: 2px solid var(--tac-accent); outline-offset: 1px; border-color: transparent; }
.tac-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .6rem; }
.tac-attach { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; color: var(--tac-accent); font-size: .95rem; min-height: 44px; }
.tac-attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tac-attach:focus-within { outline: 2px solid var(--tac-accent); border-radius: 6px; }
.tac-notify { display: inline-flex; align-items: center; gap: .4rem; font-size: .95rem; min-height: 44px; }
.tac-notify input { width: 1.15em; height: 1.15em; }
.tac-form-buttons { margin-left: auto; display: inline-flex; gap: .5rem; }
.tac-submit, .tac-cancel, .tac-more { font: inherit; font-weight: 600; border-radius: 8px; padding: .6rem 1.2rem; min-height: 44px; cursor: pointer; }
.tac-submit { background: var(--tac-accent); color: #fff; border: 1px solid var(--tac-accent); }
.tac-submit:disabled { opacity: .6; cursor: wait; }
.tac-cancel { background: transparent; color: var(--tac-muted); border: 1px solid var(--tac-line); }
.tac-form-error { color: #b32d2e; margin: .5rem 0 0; font-size: .95rem; }
.tac-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.tac-file { display: inline-flex; align-items: center; gap: .4rem; background: var(--tac-bg); border: 1px solid var(--tac-line); border-radius: 999px; padding: .2rem .3rem .2rem .6rem; font-size: .85rem; max-width: 100%; }
.tac-file img { width: 28px; height: 28px; object-fit: cover; border-radius: 50%; margin-left: -.35rem; }
.tac-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.tac-file.is-uploading { opacity: .6; }
.tac-file.is-uploading .tac-file-name::after { content: ' · uploading'; }
.tac-file-remove { border: 0; background: var(--tac-bg-soft); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; line-height: 1; }

/* Mention list */
.tac-mention-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: .25rem 0 0; padding: .25rem; list-style: none; background: var(--tac-bg); border: 1px solid var(--tac-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 16rem; overflow-y: auto; }
.tac-mention-list li { display: flex; align-items: center; gap: .5rem; padding: .5rem; border-radius: 6px; cursor: pointer; min-height: 44px; }
.tac-mention-list li.is-active, .tac-mention-list li:hover { background: var(--tac-accent-soft); }
.tac-mention-list img { border-radius: 50%; }
.tac-m-name { font-weight: 600; }
.tac-m-handle { color: var(--tac-muted); font-size: .9rem; }

/* Comments */
.tac-pinned { margin-bottom: 1rem; }
.tac-comment { padding: .9rem 0 .25rem; border-top: 1px solid var(--tac-line); transition: background-color .6s; }
.tac-list > .tac-comment:first-child, .tac-pinned > .tac-comment:first-child { border-top: 0; }
.tac-comment.is-pinned { background: var(--tac-accent-soft); border: 1px solid #c5dbef; border-radius: var(--tac-radius); padding: .9rem; margin-bottom: .75rem; }
.tac-comment.is-pending > .tac-comment-body { opacity: .7; }
.tac-comment.is-new { background: #fff6d6; }
.tac-comment.is-gone { opacity: 0; transition: opacity .3s; }
.tac-comment-head { display: flex; align-items: center; gap: .6rem; }
.tac-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.tac-comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; min-width: 0; }
.tac-author { font-weight: 700; }
.by-daisy > .tac-comment-head .tac-author::after { content: 'Coach'; margin-left: .4rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--tac-accent); color: #fff; padding: .1rem .4rem; border-radius: 4px; vertical-align: .1em; }
.tac-time { color: var(--tac-muted); font-size: .85rem; text-decoration: none; }
.tac-edited { color: var(--tac-muted); font-size: .8rem; font-style: italic; }
.tac-badge { font-size: .75rem; font-weight: 700; color: var(--tac-accent); }
.tac-badge-pending { color: #996800; }
.tac-follow { font-size: .8rem; padding: 0; }
.tac-comment-body { margin: .4rem 0 0 calc(40px + .6rem); overflow-wrap: anywhere; }
.tac-comment-body p { margin: 0 0 .6rem; }
.tac-comment-body p:last-child { margin-bottom: 0; }
.tac-mention { color: var(--tac-accent); font-weight: 600; }

/* Video */
.tac-video { margin: .6rem 0; max-width: 560px; }
.tac-video-play { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.tac-video-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.tac-video-icon { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; background: rgba(0,0,0,.72); border-radius: 12px; }
.tac-video-icon::after { content: ''; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.tac-video-play:hover .tac-video-icon, .tac-video-play:focus .tac-video-icon { background: #c00; }
.tac-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.tac-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Attachments */
.tac-attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0 calc(40px + .6rem); }
.tac-attachment-img { display: block; max-width: 220px; max-height: 220px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--tac-line); }
.tac-attachment-file { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; overflow-wrap: anywhere; padding: .55rem .8rem; border: 1px solid var(--tac-line); border-radius: 8px; text-decoration: none; color: var(--tac-text); background: var(--tac-bg-soft); min-height: 44px; }

/* Actions */
.tac-actions { display: flex; flex-wrap: wrap; gap: .25rem; margin: .35rem 0 0 calc(40px + .6rem - .5rem); }
.tac-action { background: none; border: 0; font: inherit; font-size: .9rem; color: var(--tac-muted); padding: .5rem; min-height: 40px; min-width: 40px; border-radius: 6px; cursor: pointer; }
.tac-action:hover, .tac-action:focus-visible { background: var(--tac-bg-soft); color: var(--tac-text); }
.tac-like.is-on { color: #c0392b; }
.tac-delete:hover { color: #b32d2e; }

/* Threads: modest indent, capped so deep threads stay readable on a phone */
.tac-replies { margin-left: 1rem; padding-left: .75rem; border-left: 2px solid var(--tac-line); }
.tac-replies .tac-replies .tac-replies .tac-replies { margin-left: 0; padding-left: 0; border-left: 0; }
.tac-replies .tac-comment { border-top: 0; padding-top: .6rem; }

.tac-more { display: block; width: 100%; margin-top: 1rem; background: var(--tac-bg); color: var(--tac-accent); border: 1px solid var(--tac-line); }
.tac-closed, .tac-comments-guest p { color: var(--tac-muted); }

/* Computers: narrower than the lesson and centred, like wpDiscuz. Phones and tablets keep the full width. */
@media (min-width: 900px) {
  .tac-comments { max-width: var(--tac-desktop-width, 68%); margin-left: auto; margin-right: auto; }
}
.tac-attachments { max-width: 100%; }

@media (min-width: 700px) {
  .tac-replies { margin-left: calc(40px + .6rem); padding-left: 1rem; }
  .tac-replies .tac-replies .tac-replies .tac-replies { margin-left: 0; padding-left: 0; border-left: 0; }
}
@media (max-width: 480px) {
  .tac-comment-body, .tac-attachments { margin-left: 0; }
  .tac-actions { margin-left: -.5rem; }
  .tac-replies { margin-left: .25rem; padding-left: .6rem; }
  .tac-replies .tac-replies .tac-replies { margin-left: 0; padding-left: 0; border-left: 0; }
  .tac-form-buttons { width: 100%; }
  .tac-form-buttons .tac-submit { flex: 1; }
  .tac-attachment-img { max-width: 100%; }
}
