/* ========================================
   Apple Design System — Property Listings
   Tokens from Apple DESIGN.md
   ======================================== */

/* === Reset & Base === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  color: #1d1d1f;
  background: #f5f5f7;
}

/* === Container === */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 22px;
}

/* === Hero / Header === */
.hero {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 80px 0 64px;
}

.hero h1 {
  font-family: 'Inter Tight', 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 56px;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
  margin-bottom: 8px;
}

.hero p {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: 0.231px;
  color: #86868b;
}

/* === Light Section === */
.section-light {
  background: #f5f5f7;
  padding: 64px 0;
}

.section-white {
  background: #fff;
  padding: 64px 0;
}

/* === Section Heading === */
.section-heading {
  font-family: 'Inter Tight', 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.10;
  color: #1d1d1f;
  text-align: center;
  margin-bottom: 48px;
}

/* === Category Grid (Homepage) === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 833px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  padding: 40px 20px;
  text-decoration: none;
  color: #1d1d1f;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.2s ease;
  border: none;
}

.category-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.category-card:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

.category-card:active {
  transform: scale(0.97);
}

.category-card .icon {
  font-size: 40px;
  margin-bottom: 16px;
  line-height: 1;
}

.category-card h2 {
  font-family: 'Inter Tight', 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: 0.216px;
  margin-bottom: 4px;
}

.category-card .count {
  font-size: 14px;
  color: #6e6e73;
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: -0.224px;
}

/* === Breadcrumb === */
.breadcrumb {
  padding: 18px 0 10px;
  font-size: 14px;
  color: #6e6e73;
  letter-spacing: -0.224px;
}

.breadcrumb a {
  color: #0066cc;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb a:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
  border-radius: 2px;
}

.breadcrumb span {
  color: #6e6e73;
}

/* === Page Title Area === */
.page-title-area {
  padding: 8px 0 24px;
}

.page-title-area h1 {
  font-family: 'Inter Tight', 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.144px;
  color: #1d1d1f;
}

.page-title-area .subtitle {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.21;
  letter-spacing: 0.228px;
  color: #6e6e73;
  margin-top: 4px;
}

/* === Table === */
.table-wrapper {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 40px;
}

.table-inner {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e6e73;
  background: #f5f5f7;
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid #d2d2d7;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid #d2d2d7;
  font-size: 17px;
  color: #1d1d1f;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafafc;
}

.property-name-link {
  color: #0066cc;
  text-decoration: none;
  font-weight: 600;
}

.property-name-link:hover {
  text-decoration: underline;
}

.property-name-link:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
  border-radius: 2px;
}

.property-name-link.sold {
  text-decoration: line-through;
  color: #e94560;
}

.price-cell {
  font-weight: 600;
  color: #1d1d1f;
}

.unit-price-cell {
  color: #6e6e73;
  font-size: 14px;
}

/* === Map Button === */
.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  background: #0071e3;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: -0.224px;
  transition: background 0.15s;
  white-space: nowrap;
}

.map-btn:hover {
  background: #0077ed;
}

.map-btn:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

.map-btn:active {
  background: #006edb;
}

.map-btn-large {
  padding: 12px 24px;
  font-size: 17px;
  border-radius: 12px;
}

/* === Back Button === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  background: #1d1d1f;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
  transition: background 0.15s;
}

.back-btn:hover {
  background: #2d2d2f;
}

.back-btn:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

.back-btn:active {
  background: #111113;
}

/* === Detail Card === */
.detail-card {
  background: #fff;
  border-radius: 18px;
  padding: 48px;
  margin: 24px 0 40px;
}

.detail-header {
  margin-bottom: 40px;
}

.detail-header .category-tag {
  display: inline-block;
  padding: 6px 18px;
  background: #f5f5f7;
  color: #6e6e73;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.detail-header h1 {
  font-family: 'Inter Tight', 'SF Pro Display', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.10;
  color: #1d1d1f;
}

.sold-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #e94560;
  background: #fde8e8;
  padding: 4px 12px;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: 12px;
  letter-spacing: 0.3px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-card {
    padding: 24px;
  }
}

.detail-item {
  padding: 18px 20px;
  background: #f5f5f7;
  border-radius: 12px;
}

.detail-item .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e6e73;
  margin-bottom: 4px;
}

.detail-item .value {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.21;
  color: #1d1d1f;
}

.detail-item .value.price-value {
  color: #1d1d1f;
}

.detail-item .value.suggest-value {
  color: #1d1d1f;
}

/* === Owner Note === */
.owner-note {
  margin-top: 24px;
  padding: 18px 20px;
  background: #f5f5f7;
  border-radius: 12px;
  border-left: 4px solid #0071e3;
}

.owner-note .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e6e73;
  margin-bottom: 4px;
}

.owner-note .value {
  font-size: 17px;
  color: #1d1d1f;
  line-height: 1.47;
}

/* === Detail Contacts === */
.detail-contacts {
  margin-top: 24px;
}

.detail-contacts-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6e6e73;
  margin-bottom: 12px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .contacts-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  padding: 16px 18px;
  background: #f5f5f7;
  border-radius: 12px;
}

.contact-card .contact-name {
  font-size: 17px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 2px;
}

.contact-card .contact-phone {
  font-size: 15px;
  color: #6e6e73;
  letter-spacing: 0.2px;
}

/* === Detail Actions === */
.detail-actions {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* === Loading & Error === */
.loading,
.error {
  text-align: center;
  padding: 80px 20px;
  font-size: 17px;
  color: #6e6e73;
}

.error {
  color: #1d1d1f;
}

/* === Footer === */
.site-footer {
  background: #f5f5f7;
  padding: 32px 0;
  text-align: center;
  font-size: 12px;
  color: #6e6e73;
  letter-spacing: -0.12px;
  border-top: 1px solid #d2d2d7;
}

.site-footer.dark {
  background: #000;
  color: #86868b;
  border-top: none;
}

.footer-admin-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: #86868b;
  text-decoration: none;
  letter-spacing: -0.12px;
}
.footer-admin-link:hover {
  color: #1d1d1f;
}

.footer-admin-link:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
  border-radius: 2px;
}

/* === Featured Section (Homepage) === */
.featured-section {
  background: #fff;
  padding: 64px 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 833px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.featured-card {
  display: block;
  background: #f5f5f7;
  border-radius: 18px;
  padding: 24px;
  text-decoration: none;
  color: #1d1d1f;
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.2s ease;
}

.featured-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.featured-card.sold .feat-name {
  color: #e94560;
  text-decoration: line-through;
}

.feat-sold {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #e94560;
  background: #fde8e8;
  padding: 2px 8px;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.2px;
}

.featured-card .feat-category {
  display: inline-block;
  padding: 2px 10px;
  background: #e8e8ed;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
  margin-bottom: 10px;
}

.featured-card .feat-name {
  font-family: 'Inter Tight', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 12px;
  color: #1d1d1f;
}

.featured-card .feat-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.featured-card .feat-area {
  font-size: 14px;
  color: #6e6e73;
}

.featured-card .feat-price {
  font-size: 18px;
  font-weight: 600;
  color: #1d1d1f;
}

/* === No Result === */
.no-result {
  text-align: center;
  padding: 60px 20px;
  color: #6e6e73;
  font-size: 17px;
}

/* === Back Wrap === */
.back-wrap {
  margin-top: 8px;
}

/* === Responsive: Tablet === */
@media (max-width: 833px) {
  .container {
    padding: 0 18px;
  }

  .hero {
    padding: 60px 0 48px;
  }
  .hero h1 {
    font-size: 40px;
    letter-spacing: -0.2px;
  }
  .hero p {
    font-size: 18px;
  }

  .section-heading {
    font-size: 32px;
    margin-bottom: 36px;
  }

  .page-title-area h1 {
    font-size: 36px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-card {
    padding: 36px;
  }
  .detail-header h1 {
    font-size: 32px;
  }
}

/* === Responsive: Mobile === */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 0 36px;
  }
  .hero h1 {
    font-size: 28px;
    letter-spacing: -0.14px;
  }
  .hero p {
    font-size: 16px;
  }

  .section-light,
  .section-white {
    padding: 40px 0;
  }

  .section-heading {
    font-size: 24px;
    margin-bottom: 28px;
  }

  .page-title-area {
    padding: 4px 0 16px;
  }
  .page-title-area h1 {
    font-size: 24px;
    letter-spacing: 0;
  }
  .page-title-area .subtitle {
    font-size: 16px;
  }

  .category-grid {
    gap: 12px;
  }

  .category-card {
    padding: 28px 16px;
    border-radius: 14px;
  }
  .category-card .icon {
    font-size: 32px;
    margin-bottom: 12px;
  }
  .category-card h2 {
    font-size: 20px;
  }

  /* Breadcrumb */
  .breadcrumb {
    padding: 14px 0 8px;
    font-size: 13px;
  }

  /* Table - compact on mobile */
  .table-wrapper {
    border-radius: 12px;
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
  }
  thead th {
    padding: 10px 14px;
    font-size: 11px;
  }
  td {
    padding: 12px 14px;
    font-size: 14px;
  }
  .unit-price-cell {
    font-size: 12px;
  }
  .property-name-link {
    font-size: 14px;
  }

  /* Map button - full width on mobile category table */
  .map-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Detail page mobile */
  .detail-card {
    padding: 20px;
    border-radius: 14px;
    margin: 16px 0 32px;
  }
  .detail-header {
    margin-bottom: 24px;
  }
  .detail-header h1 {
    font-size: 22px;
    line-height: 1.2;
  }
  .detail-header .category-tag {
    font-size: 12px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .detail-item {
    padding: 14px 16px;
  }
  .detail-item .value {
    font-size: 16px;
  }
  .owner-note {
    padding: 14px 16px;
    margin-top: 16px;
  }
  .owner-note .value {
    font-size: 14px;
  }

  /* Detail actions - full width on mobile */
  .detail-actions {
    flex-direction: column;
    gap: 10px;
  }
  .detail-actions .map-btn-large,
  .detail-actions .back-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Footer */
  .site-footer {
    padding: 24px 0;
  }
}

/* === Small mobile === */
@media (max-width: 374px) {
  .hero h1 {
    font-size: 24px;
  }
  .category-card {
    padding: 24px 12px;
  }
  td {
    padding: 10px 10px;
    font-size: 12px;
  }
  thead th {
    padding: 8px 10px;
    font-size: 10px;
  }
  .map-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .property-name-link {
    font-size: 12px;
  }
}

/* === State: no js fallback === */
@media (prefers-reduced-motion: reduce) {
  .category-card {
    transition: none;
  }
}
