/* ===== Forum Styling (dark / matches petermacaulay.ca) ===== */

/* Use your site's pink theme */
:root {
  --forum-bg: rgba(0, 0, 0, 0);
  --forum-card-bg: rgba(0, 0, 0, 0.35);
  --forum-border: rgba(255, 222, 222, 0.25);
  --forum-text: var(--lp);
  --forum-muted: rgba(255, 222, 222, 0.55);
  --forum-strong: var(--dp);
}

/* Reset */
* {
  box-sizing: border-box;
}

body.forum-body {
  font-family: 'Times New Roman', Times, serif;
  color: var(--forum-text);
  background: none;
  margin: 0;
}

/* ===== Container ===== */

.forum-container {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 10px;
  text-align: left;
}

/* ===== Post Cards ===== */

.card {
  background: var(--forum-card-bg);
  border: 1px solid var(--forum-border);
  padding: 15px;
  margin: 18px 0;
  border-radius: 16px;
  backdrop-filter: blur(2px);
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  color: var(--forum-text);
}

.post-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}

.post-head > div {
  flex: 1;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--forum-border);
}

.post-meta {
  font-size: 13px;
  color: var(--forum-muted);
}

.post-content {
  margin-top: 8px;
  white-space: pre-wrap;
  color: var(--forum-text);
  font-size: 1rem;
  text-align: left;
}

.small {
  font-size: 13px;
  color: var(--forum-muted);
}

/* ===== Form Styling ===== */

form textarea,
form input[type=text],
form input[type=password] {
  width: 70%;
  padding: 10px;
  background: rgba(0,0,0,0.4);
  color: var(--forum-text);
  border: 1px solid var(--forum-border);
  border-radius: 14px;
  font-family: 'Times New Roman', Times, serif;
}

form textarea {
  min-height: 90px;
}

/* Buttons match your nav buttons */
button {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--lp);
  background: black;
  color: var(--lp);
  cursor: pointer;
  transition: 0.3s ease;
}

button:hover {
  background: var(--lp);
  color: black;
  transform: translateY(-2px);
}

/* ===== Header Styling (fixed & isolated) ===== */

/* 1) make sure .header-div never wraps items to next line */
.header-div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; /* <-- prevent wrapping */
}

/* 2) let the left group take only the space it needs,
   and push the right group to the far edge */
.header-left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 1 auto;   /* can shrink if needed */
  min-width: 0;     /* important so children can shrink properly */
}

/* Push the right block to the far right reliably */
.header-right {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto; /* <-- ensures it stays right */
  flex: 0 0 auto;
}

/* 3) make sure buttons/anchors inside don't force line breaks */
.header-left a,
.header-right a,
.header-left button,
.header-right button {
  white-space: nowrap; /* prevent internal wrapping */
}

/* 4) protect against very long username text breaking layout */
.header-left a button,
.header-left button {
  max-width: 300px; /* or choose appropriate max */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove top margin from header buttons */
.header-div button {
  margin-top: 0;
}

/* Profile menu container */
.profile-menu {
  position: relative;
  display: inline-block;
}

/* Hidden by default */
.header-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--forum-card-bg);
  border: 1px solid var(--forum-border);
  border-radius: 14px;
  padding: 10px;
  z-index: 9999;
  backdrop-filter: blur(4px);
  width: 180px;
}

/* CSS-only dropdown: open when the container (button or dropdown) is focused */
.profile-menu:focus-within .header-dropdown {
  display: block;
}

/* Ensure dropdown items are full-width */
.header-dropdown input[type=file],
.header-dropdown button {
  width: 100%;
  margin-top: 8px;
}


/* ===== Mobile ===== */

@media (max-width: 600px) {
  .post-head {
    flex-direction: row;
  }

  .avatar {
    width: 48px;
    height: 48px;
  }

  .header-div {
    flex-direction: column;
    gap: 10px;
  }

  .header-left,
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}
