/* Стилі сторінки й редактора проєкту: марки, аптайм, журнал, скриншоти. */
/* Project page, editor, screenshot manager, delete confirmation. Mobile first.
   Frames are .record (components.css); values to paste are .code-value; marks are .hallmark. */

/* ---------- Project page ---------- */
/* One column on phones, in this order: head, cover, marks, about, build log, facts, embed.
   The two columns are display: contents there, so every block is a grid item with its own order.
   From 64em: head across the top, then a main column (8) and a proof column (4). */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
}

.project__col { display: contents; }

.project__head { order: 0; }
.project__cover { order: 1; }
.proofs { order: 2; }
.project__about { order: 3; }
.build-log { order: 4; }
.checked { order: 5; }
.facts { order: 5; }
.embed { order: 6; }

@media (min-width: 64em) {
  .project {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--s-6);
    row-gap: var(--s-7);
    align-items: start;
  }

  .project__head { grid-column: 1 / -1; }

  .project__col {
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    min-width: 0;
  }

  .project__col--main { grid-column: 1 / span 8; }
  .project__col--side { grid-column: 9 / span 4; }
}

/* Head: by-line, name, tagline, actions. */

.project__by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  margin-bottom: var(--s-4);
  color: var(--muted);
  font-size: var(--fs--1);
}

.project__by a { color: var(--text); }

.project__title {
  max-width: 22ch;
  font-size: var(--fs-4);
  overflow-wrap: anywhere;
}

.project__tagline {
  margin-top: var(--s-4);
  overflow-wrap: anywhere;
}

@media (min-width: 48em) {
  .project__title { font-size: var(--fs-5); }
}

.project__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  margin-top: var(--s-5);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* A repository name can be 140 characters: let the button wrap instead of widening the page. */
.project__links li { min-width: 0; max-width: 100%; }
/* Under a repository button that has no Repo owner mark: the link is the author's claim, not a checked fact. */
.project__link-note { display: block; margin-top: var(--s-1); }

.project__links .with-icon {
  max-width: 100%;
  padding-block: var(--s-2);
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  justify-content: flex-start;
}

.project__social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

/* Cover and the other screenshots. */

.project__cover { margin: 0; }

.project__cover img,
.project__shots img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.project__shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: var(--s-3);
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
}

/* About: a mono label, then the author's text (markdown, sanitized). */

.project__about {
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.project__about .prose {
  margin-top: var(--s-4);
  overflow-wrap: anywhere;
}

.project__about .prose :is(h3, h4) { font-size: var(--fs-1); }
.project__about .prose :is(ul, ol) { padding-left: 1.4em; }
.project__about .prose blockquote { margin-left: 0; color: var(--muted); }

/* ---------- Marks and uptime (the proof column) ---------- */

.proofs .record__head { padding-bottom: 0; }
.proofs .record__body { padding-top: 0; }

/* Each large mark is a <details>: the panel opens in place under it, so nothing is clipped on phones. */
.project__hallmarks { display: grid; }

.hallmark-info + .hallmark-info { border-top: 1px solid var(--line); }

.hallmark-info__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: var(--control-h);
  padding-block: var(--s-4);
  list-style: none;
  cursor: pointer;
}

.hallmark-info__summary::-webkit-details-marker { display: none; }

.hallmark-info__summary .hallmark { min-width: 0; }
.hallmark-info__summary .hallmark__fact { overflow-wrap: anywhere; }

.hallmark-info__toggle {
  display: inline-flex;
  flex: none;
  padding-top: var(--s-1);
  color: var(--muted);
}

.hallmark-info__toggle .icon { width: var(--icon-s); height: var(--icon-s); transition: transform var(--t-base) var(--ease-out); }
.hallmark-info[open] .hallmark-info__toggle .icon { transform: rotate(180deg); }

@media (hover: hover) {
  .hallmark-info__summary:hover .hallmark-info__toggle { color: var(--text); }
}

.hallmark-info__panel {
  display: grid;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: var(--fs--1);
}

.hallmark-info__since { color: var(--muted); }

.uptime {
  margin-top: var(--s-2);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.uptime__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-1) var(--s-3);
  margin: var(--s-3) 0 0;
}

.uptime__percent {
  font-family: var(--font-display);
  font-size: var(--fs-3);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--track-display);
}

.uptime__of,
.uptime__last {
  color: var(--muted);
  font-size: var(--fs--1);
}

.uptime__last { margin: var(--s-1) 0 0; }

/* Built with, tags. */

.facts__group { padding: var(--s-4) var(--s-5) var(--s-5); }
.facts__group + .facts__group { border-top: 1px solid var(--line); }
.facts__group .chip-list { margin-top: var(--s-3); }

/* ---------- Owner strip above the page ---------- */

.owner-bar {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
}

.owner-bar__state {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0;
  font-weight: 500;
}

/* A square, not a dot: green = public, hollow = only you. Shape differs too, not only color. */
.owner-bar__state::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid var(--line-strong);
}

.owner-bar__state.is-published::before { background: var(--signal); border-color: var(--accent-text); }

.owner-bar__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Phones: one column, every button the same width (the forms around two of them are block elements). */
@media (max-width: 47.99em) {
  .owner-bar__actions { display: grid; }
  .owner-bar__actions .btn { width: 100%; }
}

@media (min-width: 48em) {
  .owner-bar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}

/* ---------- Build log ----------
   A record under the about text: a hairline on the left, a small square per entry.
   The launch entry gets a filled square, so it differs by shape and weight, not only color. */

.build-log__title:focus { outline: none; }
.build-log__title:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.log-form { display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
.log-form .check .field__hint { display: block; margin-top: var(--s-1); }
.log-form [hidden] { display: none; } /* .field sets display: grid, which would win over [hidden] */

.log {
  margin: 0 0 0 var(--s-1);
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line-strong);
}

.log-entry {
  position: relative;
  padding: 0 0 var(--s-5) var(--s-5);
}

.log-entry:last-child { padding-bottom: 0; }

.log-entry::before {
  content: "";
  position: absolute;
  top: 0.4em;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.log-entry--launch::before {
  left: -7px;
  top: 0.3em;
  width: 13px;
  height: 13px;
  background: var(--text);
  border-color: var(--text);
}

.log-entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.log-entry__kind { color: var(--accent-text); font-weight: 400; }

.log-entry__text { margin-top: var(--s-1); overflow-wrap: anywhere; }
.log-entry__text > * + * { margin-top: 0.5em; }
.log-entry__text code { padding: 0.1em 0.3em; background: var(--tint); }

.log-entry__delete { margin-top: var(--s-2); }
.log-entry__delete .btn { margin-left: calc(-1 * var(--s-3)); color: var(--muted); font-size: var(--fs--1); }

@media (forced-colors: active) {
  .log-entry--launch::before { background: CanvasText; }
}

/* ---------- Editor ---------- */
/* Layout is .sheet and .panel (components.css). */

.fieldset { border: 0; padding: 0; min-width: 0; } /* no margin reset: .stack spaces it */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  column-gap: var(--s-4);
}

.tool-grid .check { color: var(--text); }

.preview {
  max-width: none;
  padding: var(--s-4);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  overflow-wrap: anywhere;
}

.preview[hidden] { display: none; }

.shot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }

.shot {
  display: grid;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line);
}

.shot img {
  width: 100%;
  max-width: 14rem;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.shot__body { display: grid; gap: var(--s-2); min-width: 0; }

.shot__label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs--2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.shot__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Screenshots field inside the main project form. */
.shots { display: grid; gap: var(--s-3); }
.shots .shot-list { margin-block: var(--s-1); }
.field__label--sub { margin-top: var(--s-1); }

.shots__chosen[hidden] { display: none; }

@media (min-width: 48em) {
  .shot { grid-template-columns: 14rem minmax(0, 1fr); gap: var(--s-4); }
}

/* ---------- Delete confirmation ---------- */
/* A plate with a danger rule on top: danger color is only for destructive actions. */

.confirm {
  display: grid;
  gap: var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--danger);
}

.confirm h1 { font-size: var(--fs-3); }

@media (min-width: 48em) {
  .confirm { padding: var(--s-6); }
}

.confirm-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- Domain verification ---------- */

.domain-status {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  margin: 0;
  overflow-wrap: anywhere;
}

.domain-status .icon { flex: none; margin-top: 0.2em; }
.domain-status.is-ok .icon { color: var(--accent-text); }
.domain-status.is-error .icon { color: var(--danger); }

.method {
  margin: 0 0 var(--s-4) calc(1.25rem + var(--s-3));
  padding-left: var(--s-4);
  border-left: 1px solid var(--line-strong);
}

.method[hidden] { display: none; }

.method__steps { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s-3); }

/* The record to add at the DNS host: name and value, each with a copy button. */
.dns-record { display: grid; gap: var(--s-3); margin: var(--s-3) 0 0; }
.dns-record dt { color: var(--muted); font-size: var(--fs--1); }

.dns-record dd,
.dns-record--single {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.dns-record dd { margin: var(--s-1) 0 0; }
.dns-record--single { margin-top: var(--s-3); }

.method__help { margin-top: var(--s-4); }
.method__help summary { cursor: pointer; min-height: var(--control-h); display: flex; align-items: center; font-weight: 600; }
.method__help ul { margin: var(--s-2) 0 0; padding-left: 1.2em; display: grid; gap: var(--s-2); }

/* "What was checked": facts behind the marks, label above each line. */
.checked__list { display: grid; gap: var(--s-3); margin: 0; }
.checked__list dd { margin: 0; overflow-wrap: anywhere; }
.checked__note { margin-top: var(--s-4); font-size: var(--fs--1); }
