/* CSS Custom Properties */
:root {
  --color-primary: #c62828;
  --color-primary-dark: #8e0000;
  --color-accent: #2196F3;
  --color-accent-dark: #1976D2;
  --color-success: #4CAF50;
  --color-success-dark: #388E3C;
  --color-text: #333;
  --color-text-light: #555;
  --color-background: #fff;
  --color-background-alt: #f5f5f5;
  --color-border: #ddd;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.3);
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --transition-fast: 0.2s ease;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 var(--border-radius-sm) 0;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Base Styles */
.center {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 50%;
}

/* Scoped image border - only for property listings */
.property-img-65,
.property-img-100,
.property-img-35,
.award-img-80,
.award-img-75 {
  border: 1px solid rgb(12, 0, 0);
}

/* Float columns side by side */
.column {
  float: left;
  width: 33.33%;
  padding: 0 10px;
}

/* Remove extra left and right margins, due to padding */
.row {
  margin: 0 -5px;
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}

/* Responsive columns */
@media screen and (max-width: 600px) {
  .column {
    width: 100%;
    display: block;
    margin-bottom: 20px;
  }
}

/* Style the counter cards */
.card {
  box-shadow: var(--shadow-sm);
  padding: 16px;
  text-align: center;
  background-color: #f1f1f1;
}

/* Header section */
#home {
  max-width: 1500px;
}

/* Property images - various widths */
.property-img-65 {
  width: 65%;
}

.property-img-100 {
  width: 100%;
}

.property-img-35 {
  width: 35%;
}

/* Award images */
.award-img-80 {
  width: 80%;
}

.award-img-75 {
  width: 75%;
}

/* Google Maps iframe */
.map-iframe {
  width: 100%;
}

/* Property Cards Grid */
.property-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 20px;
  justify-content: center;
}

.property-card {
  width: calc(33.33% - 20px);
  min-width: 280px;
  max-width: 400px;
  background: var(--color-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.property-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  background-color: var(--color-background-alt);
  border: none;
}

.property-card-content {
  padding: 15px;
}

.property-card-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.property-card-content .price {
  color: var(--color-accent);
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.property-card-content .btn-more-info {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  text-transform: uppercase;
  font-weight: bold;
  transition: background var(--transition-fast);
}

.property-card-content .btn-more-info:hover {
  background: var(--color-primary-dark);
}

.property-card-content .btn-more-info:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Modal Styles */
.property-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

.modal-content {
  background-color: var(--color-background);
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 900px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-header {
  background: var(--color-primary);
  color: white;
  padding: 20px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h2 {
  margin: 0 0 5px 0;
  font-size: 1.4rem;
}

.modal-header .price {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Modal close button - now a proper button element */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  background: transparent;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  color: #ddd;
  background: rgba(255, 255, 255, 0.1);
}

.modal-close:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.modal-body {
  padding: 20px;
}

.modal-images {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-images img {
  flex: 1;
  min-width: 200px;
  max-width: calc(33.33% - 10px);
  height: 180px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
}

.modal-description {
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-links a {
  display: inline-block;
  padding: 10px 15px;
  background: var(--color-text);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.modal-links a:hover {
  background: var(--color-text-light);
}

.modal-links a:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.modal-links a.link-gallery {
  background: var(--color-accent);
}

.modal-links a.link-gallery:hover {
  background: var(--color-accent-dark);
}

.modal-links a.link-realtor {
  background: var(--color-success);
}

.modal-links a.link-realtor:hover {
  background: var(--color-success-dark);
}

/* Two-column modal layout for auctions */
.modal-two-column {
  display: flex;
  gap: 20px;
}

.modal-two-column .modal-left {
  flex: 0 0 40%;
  max-width: 40%;
}

.modal-two-column .modal-left img {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--color-border);
  object-fit: cover;
}

.modal-two-column .modal-right {
  flex: 1;
}

.modal-two-column .modal-description {
  margin-bottom: 20px;
}

.modal-two-column .modal-links {
  margin-top: auto;
}

/* Responsive adjustments */
@media screen and (max-width: 900px) {
  .property-card {
    width: calc(50% - 20px);
  }

  .modal-images img {
    max-width: calc(50% - 10px);
  }
}

@media screen and (max-width: 600px) {
  .property-card {
    width: 100%;
    max-width: none;
  }

  .modal-content {
    margin: 2% auto;
    width: 95%;
  }

  .modal-images img {
    max-width: 100%;
    height: 150px;
  }

  .modal-links {
    flex-direction: column;
  }

  .modal-links a {
    text-align: center;
  }

  /* Two-column modal stacks on mobile */
  .modal-two-column {
    flex-direction: column;
  }

  .modal-two-column .modal-left {
    flex: none;
    max-width: 100%;
  }
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .property-card,
  .btn-more-info,
  .modal-close,
  .modal-links a {
    transition: none;
  }

  .property-card:hover {
    transform: none;
  }
}
