:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #62615e;
  --line: #dedbd2;
  --paper: #f7f4ec;
  --panel: #fffdf7;
  --gold: #caa24a;
  --green: #245b4f;
  --red: #b53434;
  --blue: #355c9a;
  --shadow: 0 18px 50px rgba(20, 20, 18, 0.12);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

a {
  color: var(--blue);
}

.hidden {
  display: none !important;
}

.site-header {
  align-items: center;
  background: rgba(247, 244, 236, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 74px;
  padding: 12px clamp(16px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  font-family: Newsreader, serif;
  font-size: 1.15rem;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  margin-top: 2px;
  text-transform: uppercase;
}

.top-actions,
.form-actions,
.owner-actions,
.feed-filter {
  align-items: center;
  display: flex;
  gap: 10px;
}

.solid-button,
.ghost-button,
.danger-button,
.icon-button,
.filter-button {
  align-items: center;
  border: 1px solid transparent;
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.solid-button {
  background: var(--ink);
  color: #fff;
}

.ghost-button,
.filter-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: #fff3f0;
  border-color: #e5b6ad;
  color: var(--red);
}

.icon-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  min-width: 42px;
  padding: 0;
}

.solid-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.filter-button:hover {
  transform: translateY(-1px);
}

.filter-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

[data-icon] svg {
  height: 18px;
  stroke-width: 2.2;
  width: 18px;
}

.vote-button [data-icon],
.vote-button svg {
  display: inline-flex;
  height: 18px;
  width: 18px;
}

.vote-up [data-icon]:empty::before {
  content: "👍";
}

.vote-down [data-icon]:empty::before {
  content: "👎";
}

.hero {
  min-height: min(620px, calc(100vh - 74px));
  overflow: hidden;
  position: relative;
}

.hero-bg {
  background:
    linear-gradient(90deg, rgba(12, 12, 10, 0.82), rgba(12, 12, 10, 0.32)),
    url("assets/hero-background.jpg") center/cover;
  inset: 0;
  position: absolute;
}

.hero-content {
  color: #fff;
  max-width: 760px;
  padding: clamp(84px, 13vw, 170px) clamp(18px, 6vw, 76px) 130px;
  position: relative;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.owner-panel h2,
.login-card h2 {
  font-family: Newsreader, Georgia, serif;
  letter-spacing: 0;
  margin: 0;
}

.hero h1 {
  font-size: clamp(3.25rem, 9vw, 8.4rem);
  line-height: 0.88;
}

.hero-copy {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
  max-width: 560px;
}

.owner-panel,
.feed-section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 34px clamp(16px, 4vw, 28px);
}

.owner-panel {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  max-width: none;
}

.panel-heading,
.section-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto 22px;
  max-width: 1180px;
}

.owner-panel h2,
.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.post-form {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 240px);
  margin: 0 auto;
  max-width: 1180px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.9rem;
  font-weight: 700;
  gap: 7px;
}

input,
textarea,
select {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  outline: none;
  padding: 13px 14px;
  width: 100%;
}

textarea {
  line-height: 1.6;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(36, 91, 79, 0.14);
}

.wide {
  grid-column: 1 / -1;
}

.file-drop {
  align-items: center;
  border: 1px dashed #aaa38f;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 138px;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.file-drop input {
  display: none;
}

.file-drop small {
  color: var(--muted);
  font-weight: 500;
}

.media-preview {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.preview-item {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 88px;
  padding: 8px;
}

.preview-item img,
.preview-item video {
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: cover;
  width: 100%;
}

.form-actions {
  justify-content: space-between;
}

.form-status,
.login-message {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.feed-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(20, 20, 18, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.post-card:hover,
.post-card:focus-visible {
  border-color: #b8ad91;
  box-shadow: 0 16px 36px rgba(20, 20, 18, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.post-media {
  background: #e8e3d6;
  min-height: 210px;
}

.post-media img,
.post-media video {
  aspect-ratio: 16 / 11;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.post-media .media-stack {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-media .media-stack > * {
  aspect-ratio: 1 / 1;
}

.post-placeholder {
  align-items: center;
  color: #6b6658;
  display: flex;
  font-family: Newsreader, serif;
  font-size: 2rem;
  height: 100%;
  justify-content: center;
  min-height: 210px;
}

.post-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.post-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  gap: 12px;
  justify-content: space-between;
}

.post-category {
  background: #f0e7cf;
  color: #6b4f11;
  font-weight: 800;
  padding: 5px 9px;
  text-transform: uppercase;
}

.post-card h3 {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.75rem;
  line-height: 1.06;
  margin: 0;
}

.post-body {
  color: #343330;
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}

.post-body-preview {
  display: -webkit-box;
  line-clamp: 10;
  -webkit-line-clamp: 10;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-button {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: var(--blue);
  font-weight: 800;
  padding: 0;
  text-decoration: underline;
}

.post-link {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  margin-top: auto;
  overflow-wrap: anywhere;
}

.vote-actions {
  align-items: center;
  display: flex;
  gap: 9px;
  margin-top: 2px;
}

.vote-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  min-height: 38px;
  min-width: 72px;
  padding: 0 10px;
}

.vote-button.active,
.vote-button:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.owner-actions {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 14px;
}

.empty-state {
  align-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  margin: 30px auto 0;
  max-width: 560px;
  padding: 48px 20px;
  text-align: center;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 1.5rem;
  margin: 12px 0 4px;
}

.login-dialog {
  background: transparent;
  border: 0;
  max-width: min(92vw, 430px);
  padding: 0;
  width: 430px;
}

.post-dialog {
  background: transparent;
  border: 0;
  height: min(92vh, 920px);
  max-width: min(94vw, 1040px);
  padding: 0;
  width: 1040px;
}

.login-dialog::backdrop {
  background: rgba(12, 12, 10, 0.62);
  backdrop-filter: blur(8px);
}

.post-dialog::backdrop {
  background: rgba(12, 12, 10, 0.72);
  backdrop-filter: blur(8px);
}

.login-card {
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  padding: 28px;
  position: relative;
}

.login-card h2 {
  font-size: 2.35rem;
}

.post-fullscreen {
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
  min-height: 100%;
  overflow: hidden;
  position: relative;
}

.post-full-media {
  background: #e8e3d6;
  min-height: 360px;
}

.post-full-media img,
.post-full-media video {
  display: block;
  height: 100%;
  max-height: 92vh;
  object-fit: cover;
  width: 100%;
}

.post-full-media .media-stack {
  display: grid;
  gap: 3px;
}

.post-full-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 92vh;
  overflow: auto;
  padding: clamp(22px, 4vw, 42px);
}

.post-full-content h2 {
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.94;
  margin: 0;
}

.post-full-content .post-body {
  font-size: 1.05rem;
}

.close-button {
  position: absolute;
  right: 14px;
  top: 14px;
}

.full-button {
  width: 100%;
}

@media (max-width: 900px) {
  .feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header,
  .panel-heading,
  .section-heading,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .feed-filter {
    flex-wrap: wrap;
  }

  .post-form,
  .feed-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 560px;
  }

  .hero-content {
    padding-top: 92px;
  }

  .post-dialog {
    height: 94vh;
    max-width: 94vw;
  }

  .post-fullscreen {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .post-full-media {
    min-height: 230px;
  }

  .post-full-content {
    max-height: none;
  }
}
