/* Success stories: stories.html, story.html, the section on index.html and the editor in admin.html */

/* Cards (list and home section) */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.story-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .25s, transform .25s, border-color .25s;
}
.story-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: transparent; }
.story-img { aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--blue-soft), #dbe7f6); overflow: hidden; }
.story-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.story-card:hover .story-img img { transform: scale(1.04); }
.story-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 24px; }
.story-body .product-cat { margin-bottom: 4px; }
.story-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.story-body h3 { font-size: 19px; line-height: 1.3; margin-bottom: 8px; }
.story-body p { font-size: 15px; color: var(--muted); margin-bottom: 18px; flex: 1; }
.story-empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 16px; }
.section-foot { text-align: center; margin-top: 40px; }

/* stories.html */
.stories-hero { padding-bottom: 72px; }
.stories-page { padding-top: 40px; }
.story-filters { margin-bottom: 32px; }
.story-filters:empty { display: none; }
.stories-page .more-btn { margin-top: 32px; }

/* story.html */
.story-hero { padding: 36px 0 120px; }
.story-hero .back-link { display: table; margin-bottom: 18px; }
.story-hero h1 { max-width: 860px; margin-top: 10px; }
.story-hero > .container > p { font-size: 18px; max-width: 760px; color: #c5cdd8; }
.story-hero .eyebrow:empty { display: none; }
.story-draft {
  display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px;
  background: #fff4e5; color: #b45309; font-size: 13px; font-weight: 700;
}
.story-wrap { padding-bottom: 96px; }
.story-cover {
  display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin-top: -80px;
  border-radius: 16px; box-shadow: var(--shadow); background: var(--bg-soft);
}
#s-cover[hidden] + .story-stats { margin-top: -80px; }
.story-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 28px;
}
.story-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.story-stat strong { display: block; font-size: 34px; font-weight: 800; color: var(--blue); line-height: 1.1; margin-bottom: 6px; }
.story-stat span { font-size: 14px; color: var(--muted); }
.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; margin-top: 56px; align-items: start; }
.story-main section + section { margin-top: 44px; }
.story-main h2 { font-size: 26px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.story-main h2::before { content: ""; width: 6px; height: 26px; border-radius: 3px; background: var(--orange); }
.story-text { font-size: 17px; line-height: 1.75; color: var(--text); }
.story-text p + p, .story-text p + ul, .story-text ul + p { margin-top: 14px; }
.story-text ul { list-style: none; display: grid; gap: 8px; }
.story-text li { position: relative; padding-left: 26px; }
.story-text li::before { content: ""; position: absolute; left: 6px; top: .7em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.story-aside { position: sticky; top: 96px; display: grid; gap: 20px; }
.story-facts { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.story-facts h3, .story-contact h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.story-facts dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.story-facts dl > div[hidden] { display: none; }
.story-facts dt { color: var(--muted); }
.story-facts dd { color: var(--ink); font-weight: 600; text-align: right; }
#s-products-wrap { margin-top: 22px; }
.story-products { display: grid; gap: 6px; }
.story-products a { display: block; padding: 8px 12px; border-radius: 8px; background: var(--bg-soft); color: var(--ink); font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.story-products a:hover { background: var(--blue-soft); color: var(--blue); }
.story-contact { background: var(--navy); color: #c5cdd8; border-radius: var(--radius); padding: 24px; }
.story-contact h3 { color: #5fb0ff; }
.story-contact p { font-size: 15px; margin-bottom: 16px; }
main > .loading { padding: 120px 0; }

/* admin.html */
.admin-link { color: #5fb0ff; font-weight: 600; }
.admin-list { margin-top: 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 12px; }
.admin-list td { vertical-align: middle; white-space: normal; }
.admin-list td small { color: var(--muted); }
.admin-list .thumb { width: 84px; }
.admin-list .thumb img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg-soft); }
.row-actions { white-space: nowrap; text-align: right; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-soft); color: var(--muted); white-space: nowrap; }
.pill.is-live { background: #e8f8ee; color: #15803d; }
.editor { margin-top: 24px; }
.editor-bar {
  position: sticky; top: 72px; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: rgba(245, 247, 250, .96); padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.back-btn { background: none; border: 0; font: inherit; font-weight: 600; color: var(--blue); cursor: pointer; padding: 0; }
.editor-saved { font-size: 14px; color: var(--muted); }
.editor-actions { display: flex; gap: 10px; margin-left: auto; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 16px; }
.editor-main, .editor-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.editor-side { display: grid; gap: 16px; }
.box-title { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.box-title small { font-weight: 500; color: var(--muted); }
.editor-hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.editor .field textarea, .editor .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--ink); line-height: 1.6; transition: border-color .2s, box-shadow .2s;
}
.editor .field textarea { resize: vertical; min-height: 80px; }
.editor .field textarea:focus, .editor .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.lang-tabs { display: inline-flex; gap: 2px; padding: 4px; margin-bottom: 18px; background: var(--bg-soft); border-radius: 999px; }
.lang-tabs button { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 7px 18px; border-radius: 999px; cursor: pointer; }
.lang-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }
.cover-drop {
  display: grid; place-items: center; aspect-ratio: 16 / 9; border: 1px dashed #c5cfdb; border-radius: 8px;
  background: var(--bg-soft); overflow: hidden; margin-bottom: 12px; text-align: center; padding: 12px;
}
.cover-drop img { object-fit: cover; margin: -12px; width: calc(100% + 24px); height: calc(100% + 24px); }
.cover-drop span { font-size: 13px; color: var(--muted); }
.cover-buttons { display: flex; gap: 8px; }
.cover-buttons .btn { cursor: pointer; }
.hl-row { display: grid; grid-template-columns: 76px 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.hl-row input {
  min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink);
}
.hl-row input:focus { outline: none; border-color: var(--blue); }
.hl-row .hl-value { font-weight: 700; color: var(--blue); }
.hl-row input::placeholder { font-weight: 400; color: #9aa4b2; }
.product-checks { display: grid; gap: 6px; font-size: 14px; color: var(--ink); }
.product-checks label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.product-checks input { width: 16px; height: 16px; accent-color: var(--blue); }
.delete-btn { color: #b42318; border-color: #f3b5b0; justify-self: start; }
.delete-btn:hover { background: #fdecec; color: #b42318; }

@media (max-width: 1100px) {
  .story-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; }
}
@media (max-width: 960px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); }
  .story-layout, .editor-grid { grid-template-columns: 1fr; }
  .story-aside { position: static; }
  .editor-bar { top: 72px; }
}
@media (max-width: 600px) {
  .story-grid { grid-template-columns: 1fr; gap: 16px; }
  .story-hero { padding-bottom: 88px; }
  .story-hero > .container > p { font-size: 16px; }
  .story-cover { aspect-ratio: 4 / 3; margin-top: -56px; border-radius: 12px; }
  #s-cover[hidden] + .story-stats { margin-top: -56px; }
  .story-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .story-stat { padding: 16px; }
  .story-stat strong { font-size: 26px; }
  .story-layout { margin-top: 36px; }
  .story-text { font-size: 16px; }
  .editor-main, .editor-box { padding: 18px 16px; }
  .editor-actions { width: 100%; }
  .editor-actions .btn { flex: 1; justify-content: center; }
  .admin-list { padding: 4px 8px; }
}
