/* =============================================================================
   sections.css - Instagram-galleri och kommentarsfält.
   ============================================================================= */

/* --- Galleri "Från @cykelcarbonara" -------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 700px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

.gallery a {
  position: relative;
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  background: #000;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gallery a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery a:hover img { transform: scale(1.04); }

/* Texten ligger som en mjuk toning över bildens nederkant. */
.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 13px 12px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

.ig-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink);
}
.ig-link:hover { color: var(--green-dark); }

/* --- Kommentarsformulär --------------------------------------------------- */
.comment-form {
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}
.comment-form .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Kommentarslista ------------------------------------------------------ */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

/* Rund bricka med första bokstaven i namnet. */
.comment .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  background: var(--c, var(--ink));
  flex: none;
}
.comment .head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.comment .name {
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
}
.comment .when {
  font-size: 0.76rem;
  color: var(--muted);
}
.comment .text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.reply-btn {
  background: none;
  border: none;
  padding: 8px 0 0;
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.reply-btn:hover { color: var(--green-dark); }

/* Svar ligger indragna under sin kommentar (bara en nivå). */
.replies {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 10px;
}
.replies .comment {
  background: #fafbfc;
  box-shadow: none;
  padding: 13px 14px;
}

/* Svarsformuläret fälls ut under kommentaren. */
.reply-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.reply-form .row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-error {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 500;
}
.form-error:empty { display: none; }

.empty-state {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

/* --- Bjud på en öl -------------------------------------------------------- */
.beer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}

.beer-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.beer-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fbfbfc;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.beer-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #dfe3e9;
  background: #fff;
}
.beer-btn .beer-icon { font-size: 1.9rem; line-height: 1.3; }
.beer-btn .beer-label { font-weight: 600; font-size: 0.92rem; }
.beer-btn .beer-amount {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--green-dark);
}

/* Huvudvalet (första i listan) lyfts fram med en grön ton. */
.beer-btn.is-main {
  background: linear-gradient(180deg, #f3fbf7, #e9f6ef);
  border-color: rgba(0, 146, 70, 0.35);
}
.beer-btn.is-main:hover { background: linear-gradient(180deg, #eefaf3, #e2f3ea); }

.beer-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}
