/*
Theme Name: Site Factory Theme
Version: 1.0.0
Text Domain: site-factory
Description: Минималистичная тема блога о наблюдении за комнатными растениями с локальными заметками.
*/

:root {
  --text: #1f2a1f;
  --muted: #566156;
  --bg: #fbfcf8;
  --surface: #fff;
  --line: #d7dfd2;
  --accent: #2f6b3a;
  --accent-dark: #234f2b;
  --danger: #a3312a;
  --focus: #1a57c7;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* Text fields always show focus; date inputs focus inner segments, so :focus alone misses them. */
:focus-visible, input:focus, input:focus-within, textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

img, video, iframe { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  padding: .5rem 1rem;
  background: var(--surface);
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
.site-title {
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
}
.site-tagline { margin: .25rem 0 0; color: var(--muted); }

.site-main { padding-top: 1.5rem; padding-bottom: 2rem; }
.site-main:focus { outline: none; }

h1 { font-size: clamp(1.5rem, 4vw + .5rem, 2.1rem); line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; line-height: 1.3; }
h3 { font-size: 1.1rem; line-height: 1.3; }

.hint { color: var(--muted); font-size: .95rem; }
.entry-meta { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }

/* Search and post list */
.search { margin-bottom: 1.5rem; }
.search label { display: block; font-weight: 600; margin-bottom: .25rem; }
.search-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.search-row input { flex: 1 1 12rem; min-width: 0; }
.search .hint { margin: .25rem 0 0; }
.search .hint:empty { display: none; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-card { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.post-card-title { margin: 0 0 .25rem; }
.post-card-excerpt p { margin: 0; }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Article */
.back { margin: 0 0 1rem; }
.entry-lead { font-size: 1.1rem; color: var(--muted); }
.entry-cover { margin: 1rem 0 1.5rem; }
.entry-cover img { display: block; width: 100%; border-radius: 8px; }
.entry-content figure { margin: 1.5rem 0; }
.entry-content .alignwide, .entry-content .alignfull { max-width: 100%; margin-left: 0; margin-right: 0; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content pre, .entry-content table { display: block; max-width: 100%; overflow-x: auto; }
.entry-content figcaption { color: var(--muted); font-size: .9rem; }
.entry .back:last-child { margin-top: 2rem; }

/* Controls */
input, textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .6rem;
  border: 1px solid #879487;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: var(--surface);
}
textarea { resize: vertical; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font: inherit;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}
.button:hover { background: var(--accent-dark); }
.button-secondary { color: var(--accent); background: transparent; }
.button-secondary:hover { color: #fff; }
.button-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.button-danger:hover { color: #fff; background: var(--danger); }
.button:disabled { opacity: .5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

/* Local notes */
.notes { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 2px solid var(--line); }
.notice {
  padding: .75rem 1rem;
  border-left: 4px solid var(--accent);
  background: #eef4ea;
}
.notice p { margin: .25rem 0; }

.notes-status { margin: 1rem 0; font-weight: 600; }
.notes-status:empty { display: none; }
.notes-status.is-error, .form-error { color: var(--danger); }
.form-error:empty { display: none; }

.note-form, .notes-io { margin: 1.5rem 0; }
.field { margin-top: .75rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }

.note-list { list-style: none; margin: 0; padding: 0; }
.note {
  margin-bottom: .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.note-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.note-head time { color: var(--muted); font-size: .9rem; }
.note-text { margin: .25rem 0 0; white-space: pre-wrap; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
