/* ---------- Design tokens ---------- */
:root {
  --bg: #e9f0f2;
  --surface: #ffffff;
  --ink: #12263a;
  --muted: #5b6b79;
  --line: #d3dde2;
  --ocean: #0f6b7a;
  --ocean-dark: #0b525e;
  --sun: #f2a33a;

  --font-head: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --font-body: "Public Sans", "Segoe UI", Arial, sans-serif;

  --radius: 10px;
  --radius-small: 6px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--ocean);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--ocean);
  color: #fff;
}

.logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff;
}

.logo:hover {
  text-decoration: none;
}

.search {
  flex: 1;
  max-width: 420px;
}

.search input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.search input:focus {
  background: #fff;
  color: var(--ink);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.topnav a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.topnav a.active {
  color: #fff;
  box-shadow: 0 3px 0 var(--sun);
}

.topnav a.btn {
  color: var(--ink);
}

/* ---------- Page layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 280px;
  gap: 1.5rem;
  max-width: 1160px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 5rem;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Shared pieces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card-title {
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--sun);
  border-radius: var(--radius-small);
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background: #e8921a;
  border-color: #e8921a;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--ocean);
  color: var(--ocean);
}

.btn-outline:hover {
  background: var(--ocean);
  border-color: var(--ocean);
  color: #fff;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ocean);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
}

.avatar-large {
  width: 76px;
  height: 76px;
  font-size: 2rem;
  margin: 0 auto 0.6rem;
}

/* ---------- Profile card ---------- */
.profile {
  text-align: center;
}

.profile-name {
  font-size: 1.3rem;
}

.profile-bio {
  color: var(--muted);
  margin: 0.25rem 0 1rem;
}

.profile-stats {
  display: flex;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stats dt {
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-stats dd {
  margin: 0;
  font-weight: 600;
}

/* ---------- Composer ---------- */
.composer-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.composer-form textarea,
.composer-form input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #f6f9fa;
}

.composer-form textarea {
  resize: vertical;
  min-height: 5rem;
}

.composer-form textarea:focus,
.composer-form input:focus {
  background: #fff;
  border-color: var(--ocean);
}

.composer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.composer-row input[type="text"] {
  flex: 1 1 200px;
}

/* ---------- Posts (the postcard look) ---------- */
.post {
  padding: 0;
  overflow: hidden;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
}

.post-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.3;
}

.post-author {
  font-weight: 600;
  color: var(--ink);
}

.post-time {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Replace these coloured blocks with <img> tags when you add real photos */
.post-photo {
  position: relative;
  height: 280px;
  background: var(--ocean);
}

.photo-1 { background: #3b6e8f; }
.photo-2 { background: #b5652f; }
.photo-3 { background: #2f8f83; }

.place-tag {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.35rem 0.8rem;
  border: 2px dashed var(--ink);
  border-radius: var(--radius-small);
  background: var(--sun);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  transform: rotate(-2deg);
}

.post-body {
  padding: 1rem 1.1rem 0.5rem;
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.post-body p {
  color: #2f4152;
  max-width: 65ch;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem 0.9rem;
}

.action {
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
}

.action:hover {
  background: #eef3f5;
  color: var(--ocean);
}

.action span {
  margin-left: 0.2rem;
  font-weight: 600;
}

/* ---------- Right column lists ---------- */
.people-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
}

.people-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.3;
  min-width: 0;
}

.people-info a {
  font-weight: 600;
}

.people-info span {
  font-size: 0.85rem;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list a {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f9fa;
  color: var(--ink);
  font-size: 0.9rem;
}

.tag-list a:hover {
  border-color: var(--ocean);
  color: var(--ocean);
  text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .sidebar-right {
    grid-column: 1 / -1;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-right .card {
    flex: 1 1 280px;
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
  }

  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .layout {
    grid-template-columns: 1fr;
    margin-top: 1rem;
  }

  .sidebar {
    position: static;
  }

  .sidebar-left {
    display: none;
  }

  .post-photo {
    height: 210px;
  }
}