/* =========================
   RESET
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   VARIABLES
========================= */

:root {
  --green: #7a9e2e;
  --green-dark: #5f7d1f;

  --cream: #fdf3e7;
  --cream-dark: #f0e0c8;

  --text: #2b2b2b;
  --muted: #777;
}

/* =========================
   BASE
========================= */

body {
  font-family: 'Lato', sans-serif;
  background: var(--cream);
  color: var(--text);

  min-height: 100vh;
  overflow-x: hidden;

  background-image: radial-gradient(var(--cream-dark) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* =========================
   LAYOUT
========================= */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;

  width: 190px;

  background: #fff;

  padding: 24px 16px;

  display: flex;
  flex-direction: column;
  gap: 10px;

  border-right: 1px solid var(--cream-dark);

  z-index: 10;
}

.main {
  margin-left: 190px;
  width: calc(100% - 190px);

  min-height: 100vh;

  padding: 36px 40px;
}

/* =========================
   SIDEBAR
========================= */

.sidebar-logo img {
  width: 160px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;

  border-radius: 50%;

  background: var(--green);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 800;
  font-size: 14px;
}

.nav-link,
.logout-link {
  text-decoration: none;

  padding: 10px;

  border-radius: 10px;

  color: var(--text);

  font-size: 14px;
  font-weight: 600;

  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--green);
  color: #fff;
}

/* =========================
   HEADER
========================= */

.main-header h1 {
  font-size: 28px;
  margin-bottom: 16px;
}

/* =========================
   FILTERS
========================= */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  margin-bottom: 28px;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 12px;

  border: 1px solid var(--cream-dark);
  border-radius: 10px;

  background: #fff;

  font-family: inherit;
}

.filter-bar button {
  border: none;

  background: var(--green);
  color: #fff;

  padding: 10px 14px;

  border-radius: 10px;

  cursor: pointer;

  font-weight: 700;
}

.filter-bar button:hover {
  background: var(--green-dark);
}

/* =========================
   GRID
========================= */

.grid {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));

  gap: 24px;
}

/* =========================
   POSTS
========================= */

.card {
  position: relative;

  display: block;
  text-decoration: none;
  color: var(--text);

  padding: 18px;

  border-radius: 14px;

  background: linear-gradient(145deg, #fff8c6, #fff3a1);

  min-height: 220px;

  border: 1px solid rgba(0,0,0,0.06);

  box-shadow: 0 10px 18px rgba(0,0,0,0.10);

  transition: all 0.25s ease;

  overflow: hidden;
}

.card:nth-child(4n+1) { transform: rotate(-1.2deg); }
.card:nth-child(4n+2) { transform: rotate(1deg); }
.card:nth-child(4n+3) { transform: rotate(-0.6deg); }
.card:nth-child(4n+4) { transform: rotate(1.2deg); }

.card:hover {
  transform: scale(1.05) rotate(0deg);

  z-index: 3;

  box-shadow: 0 18px 35px rgba(0,0,0,0.16);
}

.card::before {
  content: "📌";

  position: absolute;
  top: 10px;
  left: 12px;

  font-size: 15px;

  opacity: 0.65;

  transform: rotate(-12deg);

  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}

.card h3 {
  margin-top: 18px;
  margin-bottom: 8px;

  font-size: 17px;
  font-weight: 800;
}

.city {
  margin-bottom: 10px;

  color: var(--muted);
  font-size: 13px;
}

.card p {
  line-height: 1.5;
  font-size: 14px;
}

.meta {
  margin-top: 14px;

  display: flex;
  justify-content: space-between;

  font-size: 11px;

  color: var(--muted);
}

/* =========================
   ADS
========================= */

.ad-polaroid {
  position: relative;

  background: #fff;

  border-radius: 6px;

  padding-bottom: 18px;

  overflow: hidden;

  box-shadow:
    0 12px 24px rgba(0,0,0,0.12);

  transition: all 0.25s ease;

  transform: rotate(0deg);
}

/* slight hover lift */
.ad-polaroid:hover {
  transform: scale(1.03);
  box-shadow:
    0 18px 35px rgba(0,0,0,0.16);
}

/* image fills top like a polaroid photo */
.ad-image {
  width: 100%;
  height: 180px;

  object-fit: cover;

  display: block;
}

/* text sits inside polaroid white area */
.ad-polaroid h3 {
  margin-top: 12px;
  padding: 0 14px;

  font-size: 15px;
  font-weight: 800;
}

.ad-polaroid p {
  padding: 6px 14px 0 14px;

  font-size: 13px;
  line-height: 1.4;

  color: var(--text);
}

.ad-polaroid .meta {
  padding: 10px 14px 0 14px;

  display: flex;
  justify-content: space-between;

  font-size: 11px;
  color: var(--muted);
}

/* polaroid bottom padding effect */
.ad-polaroid::after {
  content: "";

  position: absolute;

  bottom: 0;
  left: 0;
  right: 0;

  height: 18px;

  background: #fff;
}
/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}