:root {
  color-scheme: light;
  --ink: #20242c;
  --muted: #687385;
  --line: #dfe4ea;
  --paper: #ffffff;
  --wash: #f7f8f4;
  --brand: #07847f;
  --brand-dark: #045f5b;
  --accent: #de5f41;
  --gold: #f4bd45;
  --blue: #3366cc;
  --green: #348a5b;
  --shadow: 0 18px 60px rgba(25, 31, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[dir="rtl"] {
  font-family: Inter, Tahoma, Arial, sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 70px;
  padding: 12px clamp(16px, 4vw, 42px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  min-width: 0;
}

.brand-wordmark {
  aspect-ratio: 832 / 525;
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 58px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(7, 132, 127, 0.18);
  width: auto;
}

.brand small {
  display: block;
}

.brand-copy {
  min-width: 0;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  margin-top: 1px;
  max-width: 220px;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.top-actions > a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
}

.top-actions > a:hover {
  background: #f0f3f6;
  color: var(--ink);
}

.language-picker {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.language-picker span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.language-picker select {
  min-height: 38px;
  min-width: 142px;
  padding: 7px 10px;
}

.button,
.link-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
}

.button-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

.hero {
  display: grid;
  gap: clamp(24px, 4vw, 42px);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  min-height: calc(100vh - 70px);
  padding: clamp(34px, 5vw, 64px) clamp(16px, 4vw, 42px) 36px;
}

.hero-copy {
  align-self: center;
  min-width: 0;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 5.35rem);
  letter-spacing: 0;
  line-height: 0.96;
  margin-bottom: 24px;
  max-width: 980px;
}

.hero-copy > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.65;
  max-width: 700px;
}

.search-panel {
  align-items: end;
  background: #f3f8f7;
  border: 1px solid #d7e8e6;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 30px;
  max-width: 980px;
  padding: 12px;
  width: 100%;
}

.search-panel > * {
  min-width: 0;
}

.search-panel label:first-child,
.search-panel label:nth-of-type(5) {
  grid-column: span 2;
}

.search-panel .button {
  padding-inline: 14px;
  white-space: nowrap;
  width: 100%;
}

.hero-account-actions {
  display: flex;
  margin-top: 14px;
}

.hero-account-actions .button {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand-dark);
}

label span,
.filters span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

input[type="file"] {
  padding: 8px;
}

.input-help {
  color: var(--muted);
  display: block;
  font-size: 0.85rem;
  margin-top: 8px;
}

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

.photo-preview img {
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.16);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats span {
  align-items: baseline;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
}

.hero-stats strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.hero-stats small {
  color: var(--muted);
  font-weight: 700;
}

.hero-side {
  display: grid;
  gap: 16px;
  align-self: center;
  min-width: 0;
}

.hero-feature-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-feature-card {
  background:
    linear-gradient(145deg, rgba(7, 132, 127, 0.9), rgba(32, 36, 44, 0.82)),
    url("https://images.unsplash.com/photo-1494526585095-c41746248156?auto=format&fit=crop&w=1000&q=80");
  background-position: center;
  background-size: cover;
  color: #fff;
  min-height: 230px;
}

.hero-feature-card span,
.listing-category {
  background: rgba(7, 132, 127, 0.1);
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 14px;
  padding: 6px 10px;
}

.hero-feature-card span {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.hero-feature-card strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-feature-card small {
  color: inherit;
  opacity: 0.78;
}

.entertainment-card {
  background: #20242c;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fff;
  overflow: hidden;
  padding: 22px;
}

.entertainment-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entertainment-kicker {
  background: rgba(244, 189, 69, 0.18);
  border-radius: 999px;
  color: #ffe08c;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 9px;
  text-transform: uppercase;
}

.entertainment-header span:not(.entertainment-kicker) {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.entertainment-card h2 {
  font-size: 1.7rem;
  line-height: 1.05;
  margin-bottom: 10px;
}

.entertainment-card p {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  margin-bottom: 16px;
}

.entertainment-list {
  display: grid;
  gap: 10px;
}

.entertainment-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.entertainment-item strong {
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
}

.entertainment-item span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
}

.entertainment-item-muted {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
  line-height: 1.45;
}

.category-band,
.listings-section,
.safety-band {
  padding: 48px clamp(16px, 4vw, 42px);
}

.category-band,
.safety-band {
  background: var(--paper);
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 0;
}

.link-button {
  background: transparent;
  color: var(--brand-dark);
  font-weight: 800;
  padding: 8px 0;
}

.categories {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.category-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 88px;
  padding: 14px;
  text-align: left;
}

body[dir="rtl"] .category-button {
  text-align: right;
}

.category-button.is-active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(7, 132, 127, 0.16);
}

.category-icon {
  align-items: center;
  background: #eef6f3;
  border-radius: 8px;
  color: var(--brand-dark);
  display: grid;
  flex: 0 0 42px;
  font-weight: 800;
  height: 42px;
  place-items: center;
}

.category-button strong,
.category-button small {
  display: block;
}

.category-button small {
  color: var(--muted);
  margin-top: 3px;
}

.listings-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: 280px minmax(0, 1fr);
}

.filters {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  box-shadow: 0 12px 30px rgba(25, 31, 40, 0.06);
  padding: 16px;
  position: sticky;
  top: 92px;
}

.filter-summary {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  min-height: 18px;
  width: 18px;
}

.checkbox-row span {
  margin: 0;
}

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

.listing-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(25, 31, 40, 0.07);
  min-width: 0;
  overflow: hidden;
}

.listing-image {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(7, 132, 127, 0.82), rgba(222, 95, 65, 0.72)),
    var(--image, url("https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&w=900&q=80"));
  background-position: center;
  background-size: cover;
}

.listing-body {
  padding: 16px;
}

.listing-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.listing-date {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.listing-card h3 {
  font-size: 1.08rem;
  line-height: 1.28;
  margin-bottom: 8px;
}

.listing-description {
  color: var(--muted);
  display: -webkit-box;
  line-height: 1.5;
  margin-bottom: 16px;
  min-height: 48px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.listing-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.listing-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
}

.listing-expiry {
  color: var(--muted);
  font-size: 0.82rem;
}

.listing-action-buttons {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}

.manage-button,
.flag-public-button {
  flex: 0 0 auto;
}

.flag-public-button {
  color: #9a3412;
}

.listing-price {
  color: var(--brand-dark);
}

.listing-location {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

body[dir="rtl"] .listing-location {
  text-align: left;
}

.result-count {
  color: var(--muted);
  margin: 0;
}

.safety-band {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: 0.9fr 1.1fr;
}

.safety-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.safety-list p {
  border-left: 4px solid var(--gold);
  color: var(--muted);
  margin: 0;
  padding: 4px 0 4px 14px;
}

body[dir="rtl"] .safety-list p {
  border-left: 0;
  border-right: 4px solid var(--gold);
  padding: 4px 14px 4px 0;
}

.post-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 760px;
  padding: 0;
  width: calc(100% - 28px);
}

.post-dialog::backdrop {
  background: rgba(31, 41, 51, 0.48);
}

.post-form {
  padding: 24px;
}

.dialog-header,
.dialog-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.icon-button {
  align-items: center;
  background: #eef3f3;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  font-size: 1.4rem;
  height: 40px;
  place-items: center;
  width: 40px;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 20px 0 24px;
}

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

.form-section {
  background: #fff7ed;
  border: 2px solid #fed7aa;
  border-radius: 8px;
  padding: 16px;
}

.form-section h3 {
  color: #9a3412;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.form-section p {
  color: #7c2d12;
  font-size: 0.92rem;
  font-weight: 600;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.dialog-actions {
  gap: 10px;
  justify-content: flex-end;
}

.auth-mode {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 24px;
}

.social-auth {
  display: grid;
  gap: 10px;
  padding: 16px 24px 0;
}

.social-auth-button {
  background: #fff;
  justify-content: flex-start;
}

.account-results {
  border-top: 1px solid var(--line);
  padding: 0 24px 24px;
}

.account-posts {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.account-post {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.account-post p,
.account-post small {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  margin-top: 6px;
}

.account-post-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
}

@media (max-width: 980px) {
  .hero,
  .listings-layout,
  .safety-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .categories,
  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar,
  .top-actions,
  .section-heading,
  .search-panel,
  .hero-side,
  .categories,
  .listing-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-heading {
    align-items: start;
    display: grid;
  }

  .top-actions {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  .top-actions > a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    padding: 12px;
    text-align: center;
  }

  .language-picker {
    align-items: start;
    display: grid;
    order: 3;
    width: 100%;
  }

  #openPostButton {
    background: #fff;
    color: var(--brand-dark);
    order: 5;
  }

  .sign-in-button {
    order: 3;
  }

  .top-actions .button {
    width: 100%;
  }

  .brand {
    align-items: start;
  }

  .brand-wordmark {
    height: 52px;
  }

  .account-post,
  .account-post-actions {
    grid-template-columns: 1fr;
  }

  .account-post-actions {
    display: grid;
  }

  h1 {
    font-size: clamp(2.5rem, 14vw, 4.5rem);
  }

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

  .search-panel label:first-child,
  .search-panel label:nth-of-type(5) {
    grid-column: 1 / -1;
  }
}
