* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Verdana, Arial, sans-serif;
  background: #d4d0dc;
  color: #1c1c1c;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main.wrap {
  flex: 1;
}

.wrap {
  width: min(920px, calc(100% - 1rem));
  margin: 0 auto;
}

.topbar {
  background: #fdfdfd;
  border-bottom: 1px solid #e5e5e5;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  height: 72px;
  padding: 2px 0.25rem 0;
}

.logo-link {
  display: block;
  flex-shrink: 0;
}

.logo-img {
  height: 60px;
  width: auto;
  display: block;
}

.logo-link:hover .logo-img {
  opacity: 0.75;
}

.title-gif {
  width: min(240px, 38vw);
  height: 64px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  display: block;
}

.latest-title {
  margin: 0.65rem 0 0.45rem;
  font-size: 1.1rem;
}

.tabs {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.tab-link {
  display: inline-block;
  text-decoration: none;
  color: #4a4751;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.25rem 0.1rem 0.45rem;
  border-bottom: 2px solid transparent;
}

.tab-link.active {
  color: #1f1d23;
  border-bottom-color: #4a4751;
}

.post-list {
  margin: 0.75rem 0 2rem;
}

.post-card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0.75rem;
}

.post-card + .post-card {
  margin-top: 0.75rem;
}

.post-meta {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.4rem;
}

.dot {
  margin: 0 0.25rem;
}

.badge {
  background: #4a4751;
  color: white;
  border: 1px solid #3a3740;
  border-radius: 2px;
  padding: 0.05rem 0.35rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.post-title {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}

.post-body p {
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.page-note {
  margin-top: auto;
  margin-bottom: 1.35rem;
}

.page-note p {
  margin: 0;
  font-size: 0.82rem;
  text-align: center;
  background: linear-gradient(90deg, #4a4751, #1f1d23, #4a4751);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cork board - pinned notes on home page */
.cork-board {
  background: #c4956a url('cork-texture.jpg') center / cover;
  border-image: url('wood-frame.jpg') 12 stretch;
  border-width: 10px;
  border-style: solid;
  border-radius: 2px;
  box-shadow:
    inset 0 3px 12px rgba(0,0,0,0.3),
    inset 0 -3px 8px rgba(0,0,0,0.15),
    0 4px 12px rgba(0,0,0,0.25),
    0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem 1.2rem;
  margin: 0.75rem 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  position: relative;
}

.cork-note {
  background: linear-gradient(135deg, #fefadc 0%, #f8f3c8 40%, #fefadc 100%);
  padding: 0.85rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #333;
  box-shadow:
    2px 3px 6px rgba(0,0,0,0.2),
    0 1px 2px rgba(0,0,0,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.04);
  position: relative;
  font-family: 'Comic Sans MS', 'Segoe Print', cursive;
}

/* Pushpin */
.cork-note::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    0 2px 3px rgba(0,0,0,0.35),
    inset 0 -2px 3px rgba(0,0,0,0.2),
    inset 0 2px 2px rgba(255,255,255,0.4);
}

/* Pin point shadow on the note */
.cork-note::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
}

.note-1 { transform: rotate(-1.5deg); }
.note-2 { transform: rotate(1deg); }
.note-3 { transform: rotate(0.5deg); }
.note-4 { transform: rotate(-0.8deg); }

.note-1::before { background: #e74c3c; }
.note-2::before { background: #3498db; }
.note-3::before { background: #2ecc71; }
.note-4::before { background: #f39c12; }

.cork-note strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #1c1c1c;
}

.cork-note a {
  color: #4a4751;
  text-decoration: none;
  font-weight: 600;
}

.cork-note a:hover {
  text-decoration: underline;
}

/* Tablet */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 0.5rem;
    gap: 0.6rem;
  }

  .logo-link {
    order: 1;
  }

  .title-gif {
    order: 2;
    width: 140px;
    height: 55px;
  }

  .tabs {
    order: 3;
    width: 100%;
    gap: 1rem;
    padding: 0.4rem 0 0;
    border-top: 1px solid #e5e5e5;
  }

  .cork-board {
    padding: 1.2rem 1rem;
    gap: 0.8rem;
  }
}

/* Phone */
@media (max-width: 480px) {
  .wrap {
    width: calc(100% - 0.75rem);
  }

  .topbar-inner {
    padding: 6px 0.4rem;
    gap: 0.4rem;
  }

  .logo-img {
    height: 40px;
  }

  .title-gif {
    width: 100px;
    height: 42px;
  }

  .tabs {
    gap: 0.6rem;
    justify-content: center;
  }

  .tab-link {
    font-size: 0.88rem;
    padding: 0.4rem 0.3rem;
  }

  .cork-board {
    grid-template-columns: 1fr;
    padding: 0.8rem 0.7rem;
    border-width: 5px;
    margin: 0.5rem 0 1rem;
  }

  .cork-note {
    font-size: 0.82rem;
    padding: 0.65rem 0.7rem;
  }

  .post-card {
    padding: 0.65rem;
  }

  .post-meta {
    font-size: 0.72rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .post-meta .dot {
    display: none;
  }

  .post-meta .badge {
    display: block;
    margin-top: 0.25rem;
  }

  .post-title {
    font-size: 1.05rem;
  }

  .post-body p {
    font-size: 0.9rem;
  }

  .page-note p {
    font-size: 0.72rem;
  }
}
