/* Sunny Knoll — light theme, built on the Sunny Knoll design system.
   Cream ground, deep green words, one orange sun for the main action, Georgia, square edges,
   and the hills running into the footer. (The library uses the darker version of this theme.) */
:root {
  /* brand palette */
  --sk-cream: #faf6ee; --sk-green: #2f3a2f; --sk-muted: #6b766b; --sk-sun: #e8a33d;
  --sk-hill: #8fae7e; --sk-hill-dark: #6f9160; --sk-on-hill: #eef3ea;
  /* shades derived for small text */
  --sk-green-ink: #4f6e42;   /* hill-dark, darkened: 5.3:1 on cream */
  --sk-green-deep: #232c23;

  --bg: var(--sk-cream);
  --card: #fffdf8;
  --ink: var(--sk-green);
  --muted: #5c675c;          /* 5.5:1 on cream */
  --line: #e4dfd2;
  --accent: var(--sk-green-ink);       /* links, chips */
  --accent-ink: var(--sk-cream);
  --accent-soft: var(--sk-on-hill);
  --leaf: var(--sk-green-ink);
  --danger: #a3262a;
  --brass: var(--sk-sun); --on-brass: var(--sk-green);
  --forest: var(--sk-green); --forest-deep: var(--sk-green-deep);
  --footer: var(--sk-green-ink); --footer-ink: var(--sk-cream);
  --ok-bg: var(--sk-on-hill);  --ok-ink: var(--sk-green);
  --warn-bg: #fbeed6;          --warn-ink: #7a5212;
  --err-bg: #f8e3e1;           --err-ink: #7a1d1f;   --err-line: #e2a7a4;
  --cover-shadow: rgba(35, 44, 35, .2);
  --radius: 0px; --radius-ctl: 2px;
  --shadow: 0 1px 0 rgba(35, 44, 35, .03), 0 8px 24px -16px rgba(35, 44, 35, .25);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e261e; --card: #263026; --ink: var(--sk-cream); --muted: #b8c2b2; --line: #3a463a;
    --accent: #a9c49a; --accent-ink: var(--sk-green); --accent-soft: #2f3a2f; --leaf: #a9c49a;
    --danger: #ef7b7f; --footer: #161c16; --forest-deep: #141914;
    --ok-bg: #2f3a2f; --ok-ink: #d6dfd0; --warn-bg: #3a3020; --warn-ink: #f1dca8;
    --err-bg: #3d2224; --err-ink: #f3c7c8; --err-line: #6a3a3a;
    --cover-shadow: rgba(0, 0, 0, .45); --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.65 "Source Sans 3", system-ui, -apple-system, Segoe UI, sans-serif;
}
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
body.narrow main { max-width: 460px; }
body.editor-page main { max-width: 760px; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.site-header nav { display: flex; align-items: center; gap: 16px; font-size: .95rem; }
.site-header nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.site-header nav a:not(.btn):hover { color: var(--accent); }
.site-footer { color: var(--muted); font-size: .85rem; padding: 40px 0; text-align: center; }

/* hero */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; font-size: 1.1rem; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
@media (max-width: 820px) { .layout { grid-template-columns: 1fr; } .sidebar { order: -1; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 10px 20px; font: 600 1rem/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-big { padding: 14px 28px; font-size: 1.08rem; }
.btn-small { padding: 7px 14px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }

/* posts */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.post h2 { margin: 2px 0 14px; font-size: 1.6rem; }
.post h2 a { color: var(--ink); text-decoration: none; }
.post h2 a:hover { color: var(--accent); }
.post.full h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 4px 0 12px; }
.meta { color: var(--muted); font-size: .88rem; margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.excerpt { margin: 14px 0; }
.body { margin: 18px 0; }
.body p { margin: 0 0 1em; }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.read { font-weight: 600; text-decoration: none; white-space: nowrap; }
.back { margin: 22px 0 10px; } .back a { text-decoration: none; }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent); border: 0;
  border-radius: 999px; padding: 3px 11px; font-size: .88rem; text-decoration: none; font-family: inherit; cursor: pointer;
}
.tag:hover, .tag.active { background: var(--accent); color: var(--accent-ink); }
.tag small { opacity: .7; }

/* gallery */
.gallery { display: grid; gap: 6px; border-radius: 10px; overflow: hidden; margin: 6px 0 4px; }
.gallery.count-1 { grid-template-columns: 1fr; }
.gallery.count-2 { grid-template-columns: 1fr 1fr; }
.gallery.count-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery.count-3 .photo:first-child { grid-row: span 2; }
.gallery.count-4 { grid-template-columns: 1fr 1fr; }
.post.full .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); grid-template-rows: none; }
.post.full .gallery .photo:first-child { grid-row: auto; }
.photo { position: relative; display: block; background: var(--line); aspect-ratio: 4 / 3; overflow: hidden; }
.gallery.count-1 .photo { aspect-ratio: 16 / 10; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo:hover img { transform: scale(1.03); }
.photo .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 1.8rem; font-weight: 600; }

/* documents */
.docs { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.docs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.docs a:hover { border-color: var(--accent); }
.docs .icon { font-size: 1.5rem; }
.docs .dname { flex: 1; font-weight: 600; word-break: break-word; }
.docs .dsize { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* sidebar */
.sidebar { position: sticky; top: 80px; }
@media (max-width: 820px) { .sidebar { position: static; } }
.sidebar h3 { font-size: 1.1rem; margin: 22px 0 10px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.search input { width: 100%; }

/* forms */
input[type=text], input[type=password], input[type=search], input[type=datetime-local], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-top: 6px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 220px; line-height: 1.6; }
label, .field { display: block; margin-bottom: 22px; font-weight: 600; }
.label { display: block; }
label small, .label small { font-weight: 400; color: var(--muted); }
label.big input { font-size: 1.3rem; font-family: var(--serif); }
.sublabel { font-weight: 400; color: var(--muted); margin: 14px 0 8px; font-size: .95rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.login { margin-top: 48px; }
.login h1 { margin-top: 0; }
.login .btn { width: 100%; }
.hint { text-align: center; font-size: .95rem; }
.notice { background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.notice.error { background: var(--err-bg); color: var(--err-ink); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.filtering { color: var(--muted); }

/* editor */
.toolbar { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; font-weight: 400; }
.toolbar button { width: 36px; height: 34px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; cursor: pointer; font-size: 1rem; }
.toolbar .tip { color: var(--muted); font-size: .85rem; margin-left: 6px; }
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; text-align: center; margin-top: 8px; background: var(--bg); transition: .15s; font-weight: 400; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz-text span { color: var(--muted); font-size: .95rem; }
.previews, .existing { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.pv, .att { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); font-weight: 400; margin: 0; }
.pv img, .att img, .doc-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; }
.doc-thumb { display: grid; place-items: center; font-size: 2.6rem; background: var(--bg); }
.pv-name, .att-name { display: block; font-size: .78rem; padding: 6px 8px 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-remove { display: flex; align-items: center; gap: 6px; font-size: .85rem; padding: 2px 8px 8px; cursor: pointer; }
.pv-x { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; margin-top: 6px; background: var(--bg); cursor: text; }
.tag-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.tag-input input { border: 0; outline: 0 !important; margin: 0; padding: 6px; flex: 1; min-width: 160px; background: transparent; }
.chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: var(--accent-ink); padding: 4px 6px 4px 12px; border-radius: 999px; font-weight: 400; font-size: .92rem; }
.chip button { border: 0; background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; padding: 0 4px; }
.suggest { margin-top: 10px; font-weight: 400; font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.date-field { max-width: 300px; font-weight: 600; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.progress { margin-top: 16px; height: 34px; background: var(--bg); border-radius: 999px; position: relative; overflow: hidden; border: 1px solid var(--line); }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; line-height: 32px; font-size: .9rem; }
.danger { margin-top: 26px; text-align: right; }
.admin-bar { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }

/* dashboard */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.dash-head h1 { margin: 0; }
.dash-list { list-style: none; padding: 0; margin: 16px 0 30px; display: grid; gap: 10px; }
.dash-list li { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; }
.dash-list .thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: var(--bg); display: grid; place-items: center; font-size: 1.6rem; }
.dash-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-list .info { flex: 1; min-width: 0; }
.dash-list .t { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
.dash-list .m { display: block; color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings summary { cursor: pointer; font-weight: 600; }
.settings form { margin-top: 18px; max-width: 380px; }

/* pager */
.pager { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin: 10px 0 30px; }
.pager a { font-weight: 600; text-decoration: none; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(15,12,10,.92); display: none; align-items: center; justify-content: center; z-index: 50; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; font-size: 2.2rem; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; line-height: 1; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }

/* =====================================================================
   Sunny Knoll theme — light
   ===================================================================== */
body { font: 17px/1.65 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: .01em; }
a { color: var(--accent); text-decoration-color: var(--sk-hill); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

/* header: light, with the deep green wordmark on wide screens and the badge alone on phones */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { min-height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: auto; }
.brand-wordmark { width: 160px; }
.brand-badge { width: 40px; display: none !important; }
.brand-section { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--muted);
  padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.6; }
@media (max-width: 600px) {
  .brand-wordmark { display: none !important; }
  .brand-badge { display: block !important; }
  .brand-section { padding-left: 0; border-left: 0; }
}
.site-header nav { gap: 20px; }
.site-header nav a:not(.btn), .account-menu summary { color: var(--muted); font-size: .92rem; white-space: nowrap; }
.site-header nav a:not(.btn):hover, .account-menu summary:hover { color: var(--ink); }
.site-header .btn { white-space: nowrap; }
@media (max-width: 600px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; row-gap: 8px; min-height: 0; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 10px; font-size: .88rem; }
}

/* buttons: the sun is the main action; everything else is quiet */
.btn { background: var(--sk-sun); color: var(--sk-green); border-radius: var(--radius-ctl); letter-spacing: .02em; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--accent-soft); filter: none; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.badge { background: var(--sk-sun); color: var(--sk-green); }

/* fields */
input[type=text], input[type=password], input[type=search], input[type=datetime-local], input[type=date], input[type=url], textarea, select {
  border-radius: var(--radius-ctl); background: var(--card); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sk-hill-dark); outline-offset: 1px; border-color: transparent; }
@media (prefers-color-scheme: dark) { input:focus, textarea:focus, select:focus { outline-color: var(--sk-sun); } }

/* square edges; softness comes from the hills */
.card, .post, .notice, .account-menu .menu { border-radius: 0; }
.tag { border-radius: 1px; }
.notice { background: var(--ok-bg); color: var(--ok-ink); }
.notice.error { background: var(--err-bg); color: var(--err-ink); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }

/* hero: the sun over the title */
.hero h1 { font-weight: 400; letter-spacing: .02em; }
.hero h1::before { content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 22px; border-radius: 50%;
  background: var(--sk-sun); box-shadow: 0 0 0 10px rgba(232, 163, 61, .15), 0 0 0 22px rgba(232, 163, 61, .07); }
.hero p { font-family: var(--serif); font-style: italic; }

.empty-badge { width: 96px; height: 96px; margin: 0 auto 10px; display: block; }

/* hills along the bottom, running into the footer */
.hills { display: block; width: 100%; height: 72px; margin-top: 64px; color: var(--footer); }
@media (max-width: 600px) { .hills { height: 44px; } }
.site-footer { background: var(--footer); color: var(--footer-ink); padding: 22px 0 34px; margin-top: -1px; font-size: .88rem; }
.site-footer a { color: var(--footer-ink); text-decoration-color: var(--sk-sun); }
.site-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 8px; font-family: var(--serif); font-size: 1rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline; }
.site-footer small { opacity: .85; }
