/*
 * components.css — Mantle Realty Child Theme
 *
 * Purpose: reusable UI components shared across multiple template families.
 * Contains: agent contact card, agent hero image, Google Maps widget.
 * Loaded globally via functions.php (both agent + map can appear on any page).
 * Depends on: tokens.css, base.css.
 *
 * Why global?
 *   - Agent cards can appear in headers, footers, or sidebar widgets sitewide.
 *   - Maps appear on contact, location, neighborhood, and CPT detail pages.
 *   Scoping either to a single post type would require duplication.
 *
 * WHAT DOES NOT BELONG HERE:
 *   Blog-specific components (reading wrap, sidebar, share bar, related posts)
 *   live in blog.css because they are blog-template-only.
 */

/* ==============================
   Agent Components
   ============================== */

.agent-contact-card{
  max-width:360px;
  width:100%;
  padding:1.25rem;

  border-radius:var(--mantle-radius-lg);
  background:var(--mantle-surface);
  color:var(--mantle-text);

  border:1px solid rgba(247,147,32,.25);
  box-shadow:var(--mantle-shadow);
  margin:0 auto;
}

.agent-contact-card h2{
  font-size:1.5rem;
  font-weight:800;
  margin:0 0 .75rem;
  text-align:center;
}

.agent-contact-card .contact-info{
  display:flex;
  flex-direction:column;
  gap:.65rem;
  align-items:center;
}

.agent-contact-card span{
  font-size:1rem;
  margin:0;
  color:rgba(245,245,245,.78);
}

.agent-contact-card a{
  color:var(--mantle-light-blue);
  font-weight:600;
  text-decoration:none;
  border-bottom:2px solid transparent;
  transition:color .2s ease, border-color .2s ease;
}

.agent-contact-card a:hover,
.agent-contact-card a:focus-visible{
  color:var(--mantle-orange);
  border-bottom-color:currentColor;
}

.agent-hero img{
  max-width:120px;
  border-radius:50%;
  box-shadow:var(--mantle-shadow);
  margin:0 0 1rem;
}

/* ==============================
   Google Maps (Elementor widget, standard JS map)
   Add class "mantle-map" to the Elementor section/container
   that holds the map.
   ============================== */

.mantle-map .elementor-widget-google_maps{
  width:100%;
}

/* Seatbelt: stable Elementor wrapper gets height & styling */
.mantle-map .elementor-widget-google_maps .elementor-widget-container{
  min-height:400px;

  border-radius:var(--mantle-radius-md);
  overflow:hidden;
  box-shadow:var(--mantle-shadow);
  background:var(--mantle-surface);
}

/* Also set on Google's injected root */
.mantle-map .elementor-widget-google_maps .gm-style{
  width:100%;
  min-height:400px;
}

/* ==============================
   MTL Subdivision Grid System
   Rendered by [mtl_post_object] and [mtl_subdivision_list] shortcodes.
   These appear on county, suburb, city, and standard page templates.
   Inline CSS from the Code Snippets plugin targets the same selectors;
   these rules load later in the cascade so they win on colour.
   ============================== */

/* Outer wrapper that the collapse-grid snippet wraps around the grid */
.mtl-grid-wrapper {
  margin: 8px 0;
}

/* Grid layout */
.mtl-grid {
  display: grid;
  gap: 12px;
  margin: 8px 0;
}

.mtl-grid.two-cols   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mtl-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mtl-grid.four-cols  { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Mini card (dark skin) */
.mtl-mini-card {
  background: var(--mantle-surface);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--mantle-radius-sm);
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transition: border-color .2s ease;
}

.mtl-mini-card:hover {
  border-color: rgba(10, 118, 182, .5);
}

.mtl-mini-card h4 {
  margin: 0;
  font-size: .95rem;
  line-height: 1.3;
  color: var(--mantle-text);
}

.mtl-mini-card a {
  text-decoration: none;
  color: var(--mantle-light-blue);
  transition: color .2s ease;
}

.mtl-mini-card a:hover,
.mtl-mini-card a:focus-visible {
  color: var(--mantle-orange);
}

/* Empty state */
.mtl-empty {
  color: #cfcfcf;
  font-size: .9rem;
  padding: .5rem 0;
}

/* Pagination */
.mtl-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 16px 0 8px;
}

.mtl-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--mantle-radius-sm);
  text-decoration: none;
  color: var(--mantle-light-blue);
  font-size: .875rem;
  transition: background-color .2s ease, border-color .2s ease;
}

.mtl-pagination .page-numbers:hover,
.mtl-pagination .page-numbers:focus-visible {
  background-color: rgba(10, 118, 182, .15);
  border-color: var(--mantle-blue);
}

.mtl-pagination .current {
  background: var(--mantle-blue);
  color: #fff;
  border-color: var(--mantle-blue);
}

/* Collapse toggle button (injected by Collapse Subdivision Grid snippet) */
.mtl-toggle-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 1rem auto;
  padding: 14px 28px;
  background: var(--mantle-blue);
  color: #fff;
  border: none;
  border-radius: var(--mantle-radius-sm);
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(10, 118, 182, .3);
}

.mtl-toggle-btn:hover,
.mtl-toggle-btn:focus-visible {
  background: #085a8f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(10, 118, 182, .4);
}

.mtl-toggle-btn.open {
  background: var(--mantle-orange);
}

.mtl-toggle-btn.open:hover,
.mtl-toggle-btn.open:focus-visible {
  background: #d67a0d;
}

@media (prefers-reduced-motion: reduce) {
  .mtl-toggle-btn {
    transition: none;
  }
  .mtl-toggle-btn:hover,
  .mtl-toggle-btn:focus-visible {
    transform: none;
  }
}

/* ==============================
   Responsive — Components only
   ============================== */

@media (max-width:1024px){
  .agent-contact-card{
    max-width:100%;
    padding:1.05rem;
  }

  .agent-contact-card h2{
    font-size:1.4rem;
  }

  .mantle-map .elementor-widget-google_maps .elementor-widget-container,
  .mantle-map .elementor-widget-google_maps .gm-style{
    min-height:320px;
  }

  .mtl-grid.four-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width:900px){
  .mtl-grid.three-cols,
  .mtl-grid.four-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:767px){
  .agent-contact-card{
    max-width:100%;
    border:1px solid rgba(247,147,32,.2);
    box-shadow:none;
  }

  .agent-hero img{
    max-width:100px;
  }

  .agent-contact-card h2{
    font-size:1.3rem;
  }

  .mantle-map .elementor-widget-google_maps .elementor-widget-container,
  .mantle-map .elementor-widget-google_maps .gm-style{
    min-height:260px;
  }

  .mtl-grid {
    grid-template-columns: 1fr !important;
  }

  .mtl-toggle-btn {
    max-width: 100%;
    padding: 12px 20px;
  }
}
