/*
 Theme Name:  Smart Associates
 Theme URI:   https://smart-associates.biz
 Author:      Smart Associates
 Author URI:  https://smart-associates.biz
 Description: Custom lightweight theme for Smart Associates. No Elementor dependency. Uses brand.css design system with Gutenberg editor support.
 Version:     1.0.0
 License:     Proprietary
 License URI: https://smart-associates.biz/company/legal/
 Text Domain: smart-associates
*/

/* Theme-level overrides are minimal — brand.css does the heavy lifting */

/* WP admin bar offset for sticky header */
body.admin-bar .header { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .header { top: 46px; }
}

/* Gutenberg content alignment */
.entry-content { padding: 60px 0; }
.entry-content > * { max-width: 740px; margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 1100px; }
.entry-content > .alignfull { max-width: none; }

/* Gutenberg block typography */
.entry-content h1 { font-size: 38px; font-weight: 700; color: var(--charcoal); line-height: 1.15; margin-bottom: 20px; }
.entry-content h2 { font-size: 30px; font-weight: 700; color: var(--charcoal); line-height: 1.2; margin-bottom: 16px; }
.entry-content h3 { font-size: 22px; font-weight: 600; color: var(--charcoal); line-height: 1.3; margin-bottom: 12px; }
.entry-content h4 { font-size: 18px; font-weight: 600; color: var(--charcoal); line-height: 1.4; margin-bottom: 10px; }
.entry-content p { font-size: 16px; color: var(--body); line-height: 1.75; margin-bottom: 18px; }
.entry-content ul, .entry-content ol { font-size: 16px; color: var(--body); line-height: 1.75; margin-bottom: 18px; padding-left: 24px; }
.entry-content li { margin-bottom: 6px; }
.entry-content img { max-width: 100%; height: auto; border-radius: 8px; }
.entry-content blockquote {
  border-left: 4px solid var(--blue); margin: 28px 0;
  padding: 20px 28px; background: var(--light-bg); border-radius: 0 8px 8px 0;
}
.entry-content blockquote p { font-size: 17px; font-style: italic; color: var(--charcoal); margin-bottom: 0; }
.entry-content a { color: var(--blue); text-decoration: none; }
.entry-content a:hover { text-decoration: underline; }
.entry-content pre {
  background: var(--charcoal); color: #e0e0e0; padding: 20px 24px;
  border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.6; margin-bottom: 18px;
}
.entry-content code { font-size: 14px; background: var(--light-bg); padding: 2px 6px; border-radius: 4px; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 15px; }
.entry-content th { background: var(--dark-blue); color: #fff; font-weight: 600; padding: 12px 16px; text-align: left; }
.entry-content td { padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.entry-content tr:nth-child(even) td { background: var(--light-bg); }

/* Blog post meta */
.post-meta { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--grey); margin-bottom: 28px; }
.post-meta a { color: var(--blue); text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post-category {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--blue); background: rgba(0,153,204,0.08);
  padding: 4px 10px; border-radius: 4px;
}

/* Author box */
.author-box {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--light-bg); border-radius: 12px; padding: 28px; margin-top: 48px;
}
.author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.author-box .author-name { font-size: 16px; font-weight: 600; color: var(--charcoal); margin-bottom: 4px; }
.author-box .author-bio { font-size: 14px; color: var(--grey); line-height: 1.6; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 48px 0; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 6px; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background 0.2s;
}
.pagination a { color: var(--body); background: var(--light-bg); }
.pagination a:hover { background: var(--blue); color: #fff; }
.pagination .current { background: var(--blue); color: #fff; }

/* Search form */
.search-form { display: flex; gap: 12px; max-width: 500px; }
.search-form .form-input { flex: 1; }
.search-form .btn { flex-shrink: 0; }

/* 404 page */
.page-404 { text-align: center; padding: 100px 0; }
.page-404 h1 { font-size: 120px; font-weight: 700; color: var(--light-bg); line-height: 1; margin-bottom: 0; }
.page-404 h2 { font-size: 28px; font-weight: 700; color: var(--charcoal); margin-bottom: 12px; }
.page-404 p { font-size: 16px; color: var(--grey); margin-bottom: 32px; max-width: 440px; margin-left: auto; margin-right: auto; }

/* ── Elementor Accordion Compat ── */
/* Native <details>/<summary> from Elementor post_content */
.entry-content details {
  border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 8px;
  background: var(--white); overflow: hidden;
}
.entry-content details[open] { border-color: rgba(0,153,204,0.3); }
.entry-content summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; font-size: 16px; font-weight: 600; color: var(--charcoal);
  cursor: pointer; list-style: none; user-select: none;
  background: var(--light-bg); transition: background 0.2s;
}
.entry-content summary:hover { background: rgba(0,153,204,0.06); }
.entry-content summary::-webkit-details-marker { display: none; }
.entry-content summary::marker { display: none; content: ''; }
/* Hide Elementor's inline +/- SVGs, use CSS indicator instead */
.entry-content summary > svg { display: none; }
.entry-content summary::after {
  content: '+'; font-size: 20px; font-weight: 400; color: var(--blue);
  flex-shrink: 0; margin-left: 16px; transition: transform 0.2s;
}
.entry-content details[open] > summary::after { content: '\2212'; }
/* Content area inside accordion */
.entry-content details > *:not(summary) { padding: 0 20px; }
.entry-content details > p:first-of-type { padding-top: 16px; }
.entry-content details > *:last-child { padding-bottom: 16px; }
/* Nested accordions (inner items within a category) */
.entry-content details details {
  border: none; border-top: 1px solid var(--rule); border-radius: 0; margin-bottom: 0;
}
.entry-content details details summary {
  font-size: 15px; font-weight: 500; padding: 14px 20px; background: var(--white);
}
.entry-content details details summary::after { font-size: 18px; }

/* ── Elementor Tabs Compat ── */
.sa-tabs { margin-bottom: 28px; }
.sa-tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid var(--rule); margin-bottom: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.sa-tab-bar button[role="tab"] {
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; padding: 14px 24px; font-family: 'Montserrat', sans-serif;
  font-size: 15px; font-weight: 600; color: var(--grey); cursor: pointer;
  white-space: nowrap; transition: color 0.2s, border-color 0.2s;
}
.sa-tab-bar button[role="tab"]:hover { color: var(--charcoal); }
.sa-tab-bar button[role="tab"][aria-selected="true"] {
  color: var(--blue); border-bottom-color: var(--blue);
}
.sa-tab-panel { padding: 24px 0; }
.sa-tab-panel[hidden] { display: none; }

/* ── TablePress Compat ── */
.entry-content table caption { display: none; }

/* ── Formidable Forms Brand Styling ── */
.frm_forms .frm_form_field { margin-bottom: 18px; }
.frm_forms label.frm_primary_label {
  display: block; font-family: 'Montserrat', sans-serif; font-size: 13px;
  font-weight: 600; color: var(--charcoal); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.frm_forms .frm_required { color: var(--blue); }
.frm_forms input[type="text"],
.frm_forms input[type="email"],
.frm_forms input[type="tel"],
.frm_forms input[type="url"],
.frm_forms input[type="number"],
.frm_forms select,
.frm_forms textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--rule);
  border-radius: 8px; font-family: 'Montserrat', sans-serif; font-size: 15px;
  color: var(--body); background: var(--white); transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.frm_forms input:focus,
.frm_forms select:focus,
.frm_forms textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,153,204,0.1);
}
.frm_forms textarea { min-height: 120px; resize: vertical; }
.frm_forms select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }
/* Radio/checkbox styling */
.frm_forms .frm_radio label,
.frm_forms .frm_checkbox label {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--body); padding: 6px 0; cursor: pointer;
}
.frm_forms .frm_radio input[type="radio"],
.frm_forms .frm_checkbox input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--blue);
}
/* Submit button */
.frm_forms .frm_submit button,
.frm_forms .frm_submit input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; background: var(--blue); color: #fff; border: none;
  border-radius: 8px; font-family: 'Montserrat', sans-serif; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.frm_forms .frm_submit button:hover,
.frm_forms .frm_submit input[type="submit"]:hover { background: var(--blue-hover); }
/* Section headings inside forms */
.frm_forms .frm_section_heading h3 {
  font-size: 20px; font-weight: 700; color: var(--charcoal);
  border-bottom: 2px solid var(--blue); padding-bottom: 10px; margin: 28px 0 16px;
}
/* Inline field groups (Formidable grid layout) */
.frm_forms .frm_grid,
.frm_forms .frm_grid_odd,
.frm_forms .frm_grid_first { font-size: 14px; }
/* Error styling */
.frm_forms .frm_error_style { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.frm_forms .frm_error { color: #991b1b; font-size: 12px; margin-top: 4px; }
/* Success message */
.frm_forms .frm_message {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 16px; font-size: 14px; line-height: 1.6;
}
/* Hide Formidable branding */
.frm_forms .frm_form_title { display: none; }
/* Repeater sections (quote form) */
.frm_forms .frm_repeat_sec {
  background: var(--light-bg); border-radius: 12px; padding: 24px;
  margin-bottom: 16px; border: 1px solid var(--rule);
}
.frm_forms .frm_repeat_buttons a {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none;
}
.frm_forms .frm_repeat_buttons a:hover { text-decoration: underline; }
/* Conditional fields - ensure hidden ones don't take space */
.frm_forms .frm_hidden_container { display: none !important; }
