/* ==========================================================================
   DAAMRI Deals — Reusable components
   Buttons, cards, badges, forms, tables, accordion, widgets, CTA
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  font-family: var(--ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 14px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--forest);
  border-color: var(--forest);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-text {
  border: none;
  padding: 8px 0;
  color: var(--oxblood);
  position: relative;
}

.btn-text::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: var(--oxblood);
}

.btn-text:hover {
  color: var(--ink);
}

.btn-text:hover::after {
  background: var(--ink);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 12px;
}

.btn[disabled],
.btn-disabled {
  opacity: .35;
  pointer-events: none;
}

/* Reset native <button> chrome so JS-triggered CTAs match link-styled buttons */
button.btn {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* On-ink inversion (CTA block) */
.on-ink .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.on-ink .btn-primary:hover {
  background: var(--paper-2);
  border-color: var(--paper-2);
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.badge-forest  { background: var(--forest-tint);  color: var(--forest); }
.badge-ox      { background: var(--oxblood-tint); color: var(--oxblood); }
.badge-ink     { background: var(--ink-tint);     color: var(--ink); }
.badge-outline { border: 1px solid var(--ink);    background: none; }

/* --------------------------------------------------------------------------
   Generic card
   -------------------------------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--stone);
}

.card .cimg {
  height: 150px;
  overflow: hidden;
}

.card .cimg img {
  width: 100%;
  height: 100%;
  filter: var(--img-filter);
}

.card .cbody {
  padding: 22px 22px 26px;
}

.card .cbody h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.card .cbody p {
  font-size: 14px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Property card
   -------------------------------------------------------------------------- */

.prop-card {
  background: var(--white);
  border: 1px solid var(--stone);
  display: flex;
  flex-direction: column;
  transition: var(--ease);
}

.prop-card:hover {
  box-shadow: var(--shadow-md);
}

.prop-card .cimg {
  height: 220px;
  position: relative;
  overflow: hidden;
}

.prop-card .cimg img {
  width: 100%;
  height: 100%;
  filter: var(--img-filter);
}

.prop-card .badge-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--forest);
  color: var(--white);
  font-family: var(--ui);
  font-size: 10.5px;
  padding: 5px 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.prop-card .cbody {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prop-card h3 {
  font-size: 22px;
}

.prop-card h3 a {
  text-decoration: none;
}

.prop-card h3 a:hover {
  color: var(--oxblood);
}

.prop-card .loc {
  font-family: var(--ui);
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.prop-card .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--stone);
}

.prop-card .cbody .foot {
  margin-top: 18px;
}

.prop-card .price {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 19px;
}

.prop-card .yield {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--forest);
}

/* --------------------------------------------------------------------------
   Blog card
   -------------------------------------------------------------------------- */

.blog-card {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--stone);
  padding: 24px 0;
  align-items: flex-start;
}

.blog-card .cimg {
  width: 160px;
  height: 110px;
  flex-shrink: 0;
  overflow: hidden;
}

.blog-card .cimg img {
  width: 100%;
  height: 100%;
  filter: var(--img-filter);
}

.blog-card .meta {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 8px;
}

.blog-card h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.blog-card h3 a {
  text-decoration: none;
}

.blog-card h3 a:hover {
  color: var(--oxblood);
}

.blog-card p {
  font-size: 13.5px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Blog grid card (archive) — vertical, equal heights
   -------------------------------------------------------------------------- */

.blog-grid-card {
  background: var(--white);
  border: 1px solid var(--stone);
  display: flex;
  flex-direction: column;
  transition: var(--ease);
}

.blog-grid-card:hover {
  box-shadow: var(--shadow-md);
}

.blog-grid-card .cimg {
  display: block;
  height: 210px;
  overflow: hidden;
}

.blog-grid-card .cimg img {
  width: 100%;
  height: 100%;
  filter: var(--img-filter);
  transition: transform .5s ease;
}

.blog-grid-card:hover .cimg img {
  transform: scale(1.03);
}

.blog-grid-card .cbody {
  padding: 24px 24px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-grid-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.blog-grid-card .meta .cat {
  color: var(--oxblood);
  font-weight: 600;
}

.blog-grid-card .meta time,
.blog-grid-card .meta .dot {
  color: var(--muted);
}

.blog-grid-card h3 {
  font-size: 19px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.blog-grid-card h3 a {
  text-decoration: none;
}

.blog-grid-card h3 a:hover {
  color: var(--oxblood);
}

.blog-grid-card p {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-grid-card .cbody p {
  margin-bottom: 18px;
}

.blog-grid-card .more {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  border-top: 1px solid var(--stone);
}

.blog-grid-card .by {
  font-family: var(--ui);
  font-size: 11.5px;
  color: var(--muted);
}

.blog-grid-card .btn-text {
  font-size: 12px;
  padding: 4px 0;
}

/* Filter chips */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  font-family: var(--ui);
  font-size: 11.5px;
  letter-spacing: .04em;
  border: 1px solid var(--stone);
  background: var(--white);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--ease);
}

.filter-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.field label {
  display: block;
  font-family: var(--ui);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--stone);
  background: var(--white);
  border-radius: var(--radius-lg);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--oxblood);
}

.field .hint {
  font-family: var(--ui);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ui);
  font-size: 13.5px;
}

.field--full {
  grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

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

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ui);
  font-size: 13.5px;
}

th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--stone);
}

tbody tr:hover td {
  background: var(--paper-2);
}

/* --------------------------------------------------------------------------
   Accordion
   -------------------------------------------------------------------------- */

.acc-item {
  border-bottom: 1px solid var(--stone);
}

.acc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 20px 4px;
  cursor: pointer;
  font-family: var(--disp);
  font-size: 18px;
  font-weight: 500;
  background: none;
  border: none;
  text-align: left;
  color: var(--ink);
  gap: var(--sp-4);
}

.acc-head i {
  transition: transform .3s ease;
  color: var(--oxblood);
  flex-shrink: 0;
}

.acc-item.open .acc-head i {
  transform: rotate(45deg);
}

.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.acc-item.open .acc-body {
  max-height: 240px;
}

.acc-body p {
  padding: 0 4px 20px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 560px;
}

/* --------------------------------------------------------------------------
   Stat widgets
   -------------------------------------------------------------------------- */

.widget {
  background: var(--white);
  border: 1px solid var(--stone);
  padding: 22px;
}

.widget .wl {
  font-family: var(--ui);
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.widget .wn {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 32px;
  margin-top: 10px;
}

.widget .wd {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--forest);
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   CTA block
   -------------------------------------------------------------------------- */

.cta-block {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.cta-block h2 {
  font-size: 32px;
  max-width: 420px;
  font-weight: 500;
}

.cta-block p {
  font-family: var(--body);
  font-style: italic;
  color: var(--stone);
  margin-top: 10px;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Property Finder — reusable editorial brief component
   Submits GET params (category, location, budget, purpose) that map 1:1
   to future WP REST query args on the `project` post type.
   -------------------------------------------------------------------------- */

.finder {
  padding: 0 0 76px;
}

.finder-card {
  background: var(--forest);
  color: var(--paper);
  border-radius: 8px;
  padding: 56px 56px 48px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-top: -40px; /* overlaps the hero's bottom edge */
  position: relative;
  z-index: 2;
}

.finder-card .doc-label {
  color: var(--paper-2);
  margin-bottom: 14px;
}

.finder-card h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 500;
  max-width: 720px;
  margin: 0 auto 40px;
  color: var(--white);
}

.finder-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: left;
}

.finder-field label {
  display: block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(243, 238, 226, .75);
  margin-bottom: 8px;
}

.finder-select {
  position: relative;
}

.finder-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: var(--radius-lg);
  padding: 13px 38px 13px 16px;
  cursor: pointer;
  transition: var(--ease);
}

.finder-select::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: 22px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
  transition: var(--ease);
}

.finder-select:hover select {
  border-color: var(--muted);
  box-shadow: var(--shadow);
}

.finder-select select:focus {
  outline: none;
  border-color: var(--oxblood);
  box-shadow: 0 0 0 3px rgba(122, 46, 46, .15);
}

.finder-select:focus-within::after {
  border-color: var(--oxblood);
  bottom: 24px;
}

/* Actions */
.finder-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-top: 36px;
}

.finder-card .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.finder-card .btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
}

.finder-card .btn-primary i {
  font-size: 11px;
  transition: transform .25s ease;
}

.finder-card .btn-primary:hover i {
  transform: translateX(4px);
}

.finder-card .btn-text {
  color: var(--paper-2);
}

.finder-card .btn-text::after {
  background: var(--paper-2);
}

.finder-card .btn-text:hover {
  color: var(--white);
}

.finder-card .btn-text:hover::after {
  background: var(--white);
}

.finder-note {
  font-family: var(--body);
  font-style: italic;
  font-size: 15px;
  color: rgba(243, 238, 226, .8);
  margin-top: 24px;
}

@media (max-width: 1000px) {
  .finder-fields {
    grid-template-columns: 1fr 1fr;
  }

  .finder-card {
    padding: 44px 36px 40px;
  }
}

@media (max-width: 640px) {
  .finder {
    padding-bottom: 56px;
  }

  .finder-card {
    padding: 36px 22px 32px;
    border-radius: 6px;
  }

  .finder-fields {
    grid-template-columns: 1fr;
  }

  .finder-actions .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Grids
   -------------------------------------------------------------------------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

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

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

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

  .cta-block {
    flex-direction: column;
    align-items: flex-start;
    padding: 48px 28px;
  }

  .blog-card .cimg {
    width: 110px;
    height: 84px;
  }
}
