/* Lightworker Social – light blue & light green theme */
:root {
  --blue-50: #f0f8ff;
  --blue-100: #e1f2fd;
  --blue-200: #b8e1fa;
  --blue-400: #6ec1ef;
  --blue-600: #2b8cc4;
  --blue-800: #1c5f87;
  --green-50: #f1fbf3;
  --green-100: #ddf5e2;
  --green-200: #b6e8c0;
  --green-400: #7fd18f;
  --green-600: #3c9c52;
  --text: #22404f;
  --muted: #5d7a87;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(43, 140, 196, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--blue-50) 0%, var(--green-50) 100%) fixed;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.no-scroll { overflow: hidden; }
main { flex: 1; padding-block: 1.5rem 3rem; }
a { color: var(--blue-600); }
a:hover { color: var(--green-600); }

.container { width: min(1140px, 100% - 2rem); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.inline { display: inline; }

/* Header */
.site-header {
  background: linear-gradient(90deg, var(--blue-200), var(--green-200));
  box-shadow: var(--shadow);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding-block: .75rem; }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--blue-800); text-decoration: none; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-left: auto; }
.main-nav a { text-decoration: none; color: var(--blue-800); font-weight: 500; }
.lang-switch { display: flex; gap: .25rem; }
.lang {
  border: 1px solid var(--blue-400); background: #fff; color: var(--blue-800);
  border-radius: 999px; padding: .15rem .55rem; cursor: pointer; font-size: .8rem;
}
.lang.active { background: var(--green-400); border-color: var(--green-600); color: #fff; }
.link-button { background: none; border: 0; padding: 0; color: var(--blue-800); font: inherit; font-weight: 500; cursor: pointer; }

.site-footer { padding: 1rem 0; color: var(--muted); font-size: .9rem; background: var(--green-100); }

/* Buttons */
.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  padding: .6rem 1.2rem; font: inherit; font-weight: 600; text-decoration: none;
  background: linear-gradient(90deg, var(--blue-400), var(--green-400)); color: #fff !important;
  box-shadow: var(--shadow);
}
.btn:hover { filter: brightness(1.05); }
.btn-small { padding: .3rem .9rem; font-size: .9rem; }
.btn-secondary { background: #fff; color: var(--blue-800) !important; border: 1px solid var(--blue-200); }
.btn-danger { background: var(--danger); }

/* Cards & sections */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.hero { margin-bottom: 1.5rem; }
.hero h1 { margin: 0 0 .25rem; color: var(--blue-800); }
.section-title { color: var(--blue-800); margin-top: 2rem; }
.breadcrumbs { margin-bottom: .5rem; font-size: .95rem; }
.empty { padding: 2rem; text-align: center; background: #fff; border-radius: var(--radius); color: var(--muted); }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.message { padding: .75rem 1rem; border-radius: 10px; background: var(--green-100); border: 1px solid var(--green-200); margin-bottom: .5rem; }
.message.warning, .message.error { background: #fff4e5; border-color: #f5c27a; }

/* Profile */
.profile-card { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.profile-info { flex: 1; min-width: 220px; }
.profile-info h1 { margin: 0; color: var(--blue-800); }
.profile-actions { display: flex; flex-direction: column; gap: .5rem; }
.avatar {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-200), var(--green-200)); color: var(--blue-800);
  font-size: 2rem; font-weight: 700;
}
.avatar.small { width: 48px; height: 48px; font-size: 1.2rem; }
.profile-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.profile-list .card { display: flex; gap: 1rem; align-items: center; padding: 1rem; }

/* Tiles: 3 per row */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.tile {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; border-top: 4px solid var(--green-200);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(60, 156, 82, .18); }
.tile-open { color: inherit; text-decoration: none; display: block; flex: 1; }
.tile-open:hover { color: inherit; }
.tile-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--blue-100); }
.tile-thumb-empty { display: grid; place-items: center; font-size: 2.5rem; color: var(--blue-400); background: linear-gradient(135deg, var(--blue-100), var(--green-100)); }
.tile-excerpt { margin: 0; padding: 1rem; overflow-wrap: anywhere; }
.tile-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .6rem 1rem; background: var(--blue-50); font-size: .85rem; }
.category-link {
  display: inline-block; padding: .1rem .6rem; border-radius: 999px; text-decoration: none;
  background: var(--green-100); color: var(--green-600); font-weight: 600; border: 1px solid var(--green-200);
}
.tile-author a { color: var(--muted); }

@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

/* Forum */
.forum-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.forum-table thead tr { background: linear-gradient(90deg, var(--blue-200), var(--green-200)); }
.forum-table th { color: var(--blue-800); text-align: left; padding: .75rem 1rem; }
.forum-table td { padding: .9rem 1rem; border-top: 1px solid var(--blue-100); vertical-align: top; }
.forum-table tr:hover td { background: var(--green-50); }
.forum-table .num { text-align: center; font-weight: 600; }
.forum-table p { margin: .25rem 0 0; }
.topic-title { font-weight: 700; font-size: 1.1rem; text-decoration: none; }

/* Post content */
.post-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.markdown { overflow-wrap: anywhere; }
.markdown pre { background: var(--blue-50); padding: .75rem; border-radius: 8px; overflow-x: auto; }
.markdown code { background: var(--blue-50); padding: 0 .25rem; border-radius: 4px; }
.markdown blockquote { margin: 0; padding-left: 1rem; border-left: 4px solid var(--green-200); color: var(--muted); }
.hashtag { color: var(--green-600); font-weight: 600; text-decoration: none; }
.hashtag:hover { text-decoration: underline; }
.tag-list .hashtag { margin-right: .5rem; }
.post-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-top: 1rem; }
.post-gallery img { width: 100%; border-radius: 10px; display: block; }
.post-links { margin-top: 1rem; font-size: .9rem; }

/* Forms */
.form-card { max-width: 760px; margin-inline: auto; }
.form-card.narrow { max-width: 440px; }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.field label { font-weight: 600; color: var(--blue-800); }
.field input[type=text], .field input[type=email], .field input[type=password], .field select, .field textarea {
  font: inherit; padding: .6rem .75rem; border-radius: 10px; border: 1px solid var(--blue-200); background: var(--blue-50);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green-400); background: #fff; }
.help { color: var(--muted); }
.help ul { margin: .25rem 0; padding-left: 1.2rem; }
.errorlist { color: var(--danger); margin: 0; padding-left: 1.2rem; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.char-counter { color: var(--muted); text-align: right; margin-top: -.5rem; }
.char-counter.over { color: var(--danger); font-weight: 700; }
.markdown-help { margin-top: 1.25rem; }

/* Lightbox */
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1rem; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(28, 95, 135, .55); backdrop-filter: blur(3px); }
.lightbox-panel {
  position: relative; background: #fff; border-radius: var(--radius); width: min(860px, 100%);
  max-height: 90vh; overflow-y: auto; padding: 2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  border-top: 6px solid var(--green-400); outline: none;
}
.lightbox-close {
  position: absolute; top: .5rem; right: .75rem; border: 0; background: var(--blue-100); color: var(--blue-800);
  width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}

/* Likes & comment counters (under tiles, posts and comments) */
.post-stats { display: flex; align-items: center; gap: .6rem; padding: .45rem 1rem; border-top: 1px solid var(--blue-100); }
.post-full .post-stats, .forum-post > .post-stats, .card > .post-stats { padding: .5rem 0; border-top: 0; }
.like-form { display: inline; margin: 0; }
.like-button, .comment-count {
  display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .88rem; line-height: 1;
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--blue-200);
  background: #fff; color: var(--blue-800); text-decoration: none; cursor: pointer;
}
.like-button:hover, .comment-count:hover { background: var(--green-50); color: var(--green-600); border-color: var(--green-200); }
.like-heart { color: var(--blue-400); font-size: 1rem; transition: transform .15s ease; }
.like-button.liked { background: var(--green-100); border-color: var(--green-400); color: var(--green-600); font-weight: 700; }
.like-button.liked .like-heart { color: var(--green-600); transform: scale(1.15); }
.like-button:disabled { opacity: .6; cursor: progress; }

/* Forum topic: one post per row, comments in the rows below */
.forum-posts { display: flex; flex-direction: column; gap: 1.25rem; }
.forum-post { border-top: 4px solid var(--green-200); }
.forum-post .post-gallery { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* Comments */
.comments { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--blue-100); }
.comment-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.comment { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem .8rem; border-radius: 12px; background: var(--blue-50); }
.comment:target { outline: 2px solid var(--green-400); }
.comment .avatar.small { width: 36px; height: 36px; font-size: .95rem; flex: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: .82rem; color: var(--muted); }
.comment-meta .author { font-weight: 600; text-decoration: none; }
.comment-text { margin: .2rem 0 .35rem; overflow-wrap: anywhere; }
.comment-actions { display: flex; align-items: center; gap: .6rem; }
.comment-actions .like-button { padding: .2rem .55rem; font-size: .8rem; }
.comment-empty { padding: .25rem 0; }
.comment-form { display: flex; gap: .5rem; align-items: flex-end; }
.comment-form textarea {
  flex: 1; font: inherit; padding: .5rem .75rem; border-radius: 12px; resize: vertical;
  border: 1px solid var(--blue-200); background: var(--blue-50); min-height: 2.6rem;
}
.comment-form textarea:focus { outline: 2px solid var(--green-400); background: #fff; }
.link-button.danger { color: var(--danger); font-size: .8rem; }
