/* ============================================================
   Guía de Trámites — frontend styles
   Embedded via [guia_tramites] shortcode inside Elementor.
   Palette aligned with the municipal brand (#0E4CA5).
   ============================================================ */

/* ---- Scoped reset — isolates shortcode from hello-elementor and other theme stylesheets ----
   Strategy:
   - :where(.gt-wrapper) gives zero specificity to the scope (0,0,x), so component class
     selectors like .gt-tab (0,1,0) always win over the reset without needing !important.
   - .gt-wrapper table/td/th kept without :where() so they beat the theme's compound
     element selectors like `table td` (0,0,2) and `table th` (0,0,2).
   - .gt-wrapper .gt-cost-table td (0,2,1) beats theme's stripe/hover selectors (0,1,4).
   - .gt-wrapper .gt-search-input:focus (0,3,0) beats theme's input[type=search]:focus (0,2,1).
   ---- */
.gt-wrapper,
.gt-wrapper * {
  box-sizing: border-box;
}

/* Headings: kill theme margin-block, font-size, and decoration */
:where(.gt-wrapper) h1,
:where(.gt-wrapper) h2,
:where(.gt-wrapper) h3,
:where(.gt-wrapper) h4,
:where(.gt-wrapper) h5,
:where(.gt-wrapper) h6 {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: normal;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
  text-transform: none;
  letter-spacing: normal;
}

/* Block elements */
:where(.gt-wrapper) p,
:where(.gt-wrapper) ul,
:where(.gt-wrapper) ol,
:where(.gt-wrapper) dl,
:where(.gt-wrapper) dt,
:where(.gt-wrapper) dd {
  margin: 0;
  padding: 0;
}

:where(.gt-wrapper) ul,
:where(.gt-wrapper) ol {
  list-style: none;
}

/* Tables — NOT :where() so we beat theme's `table td` (0,0,2) with our (0,1,1) */
.gt-wrapper table {
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0; /* theme: margin-block-end: 15px */
  font-size: inherit; /* theme: font-size: .9em */
}

.gt-wrapper th,
.gt-wrapper td {
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  vertical-align: top;
}

/* Buttons — :where() so .gt-tab/.gt-card-trigger (0,1,0) always override the reset (0,0,1) */
:where(.gt-wrapper) button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  cursor: pointer;
}

/* Inputs — :where() so .gt-search-input (0,1,0) overrides the reset (0,0,1) */
:where(.gt-wrapper) input,
:where(.gt-wrapper) textarea,
:where(.gt-wrapper) select {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* Links — :where() so nested link selectors (.gt-docs-list a etc.) always win */
:where(.gt-wrapper) a {
  background: transparent;
  color: #0e4ca5;
  text-decoration: underline;
}

/* SVG icons — explicit specificity (.gt-wrapper svg = 0,1,1) beats Elementor theme rules */
.gt-wrapper svg {
  display: inline-block !important;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: none !important;
  height: auto;
}

/* Prevent themes from injecting bullet pseudo-elements on list items */
.gt-wrapper li::before,
.gt-wrapper li::after {
  content: none !important;
  display: none !important;
}

.gt-wrapper {
  --gt-primary: #0e4ca5;
  --gt-primary-dk: #0a3a80;
  --gt-primary-lt: #ebf2fd;
  --gt-primary-mid: #3b7dd8;
  --gt-text: #141923;
  --gt-muted: #6b7280;
  --gt-border: #dde4ef;
  --gt-surface: #ffffff;
  --gt-free: #166534;
  --gt-free-bg: #dcfce7;
  --gt-radius: 10px;
  --gt-shadow:
    0 1px 3px rgba(14, 76, 165, 0.06), 0 1px 2px rgba(14, 76, 165, 0.04);
  --gt-shadow-md: 0 4px 14px rgba(14, 76, 165, 0.13);

  font-family: inherit;
  color: var(--gt-text);
  max-width: 860px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.5;
  /* FOUC fix: starts hidden via inline style, JS removes it with this transition */
  transition: opacity 0.25s ease;
}

/* ---- Search bar ---- */
.gt-toolbar {
  margin-bottom: 18px;
}

.gt-search-wrap {
  position: relative;
}

.gt-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--gt-muted);
  pointer-events: none;
}

/* Prefixed with .gt-wrapper to beat [type=search] (0,1,0) and input[type=search]:focus (0,2,1) */
.gt-wrapper .gt-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 20px 13px 50px;
  border: 1.5px solid var(--gt-border);
  border-radius: 50px;
  font-size: 15px;
  color: var(--gt-text);
  background: var(--gt-surface);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.gt-wrapper .gt-search-input:focus {
  outline: none;
  border-color: var(--gt-primary);
  box-shadow: 0 0 0 4px rgba(14, 76, 165, 0.11);
}

.gt-wrapper .gt-search-input::placeholder {
  color: var(--gt-muted);
}

/* ---- Category tabs ---- */
.gt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 26px;
}

.gt-tab {
  padding: 7px 17px;
  border: 1.5px solid var(--gt-border);
  border-radius: 50px;
  background: var(--gt-surface);
  color: var(--gt-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s;
  line-height: 1.4;
  white-space: nowrap;
}

.gt-tab:hover {
  border-color: var(--gt-primary-mid);
  color: var(--gt-primary);
  background: var(--gt-primary-lt);
}

.gt-tab.active {
  background: var(--gt-primary);
  border-color: var(--gt-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 76, 165, 0.28);
}

/* ---- Group headings ---- */
.gt-group + .gt-group {
  margin-top: 40px;
}

.gt-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gt-primary-dk);
  margin: 0 0 14px;
  padding: 11px 14px 11px 16px;
  background: var(--gt-primary-lt);
  border-radius: 10px;
  border-left: 4px solid var(--gt-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gt-group-title::before {
  display: none;
}

.gt-group-count {
  background: var(--gt-primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.7;
  flex-shrink: 0;
}

/* ---- Cards ---- */
.gt-card {
  background: var(--gt-surface);
  border: 1.5px solid var(--gt-border);
  border-radius: var(--gt-radius);
  /* inset provides left accent without layout shift */
  box-shadow:
    var(--gt-shadow),
    inset 3px 0 0 transparent;
  margin-bottom: 8px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.gt-card:hover {
  border-color: #c5d5ec;
  box-shadow:
    var(--gt-shadow-md),
    inset 3px 0 0 var(--gt-primary-mid);
}

.gt-card.is-expanded {
  border-color: var(--gt-primary-mid);
  box-shadow:
    var(--gt-shadow-md),
    inset 3px 0 0 var(--gt-primary);
}

.gt-card[data-hidden] {
  display: none;
}

/* ---- Trigger (accordion button) ---- */
.gt-card-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.18s;
}

.gt-card-trigger:hover {
  background: #f7faff;
}

.gt-card-trigger:focus {
  outline: none;
  background: #f7faff;
}

.gt-card-trigger:focus-visible {
  outline: 2px solid var(--gt-primary);
  outline-offset: -2px;
  border-radius: calc(var(--gt-radius) - 2px);
}

.gt-card-trigger[aria-expanded="true"] {
  background: var(--gt-primary-lt);
}

.gt-card-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.gt-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gt-text);
  line-height: 1.35;
  transition: color 0.15s;
}

.gt-card-trigger:hover .gt-card-title,
.gt-card-trigger[aria-expanded="true"] .gt-card-title {
  color: var(--gt-primary);
}

.gt-card-excerpt {
  font-size: 13px;
  color: var(--gt-muted);
  line-height: 1.5;
}

.gt-chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 3px;
  color: var(--gt-muted);
  border-radius: 50%;
  transition:
    transform 0.25s ease,
    color 0.18s,
    background 0.18s;
}

.gt-card-trigger:hover .gt-chevron {
  background: var(--gt-border);
  color: var(--gt-primary);
}

.gt-card-trigger[aria-expanded="true"] .gt-chevron {
  transform: rotate(180deg);
  color: var(--gt-primary);
  background: rgba(14, 76, 165, 0.12);
}

/* ---- Card body (accordion) ---- */
.gt-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.gt-card-body.is-open {
  max-height: 4000px;
  transition: max-height 0.5s cubic-bezier(0, 0, 0.2, 1);
}

.gt-card-body-inner {
  padding: 20px 22px 24px;
  border-top: 1px solid var(--gt-border);
  background: #fafcff;
}

/* ---- Sections ---- */
.gt-section {
  margin-bottom: 20px;
}

.gt-section:last-child {
  margin-bottom: 0;
}

.gt-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gt-primary);
  margin: 0 0 10px;
}

.gt-section-label::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 11px;
  background: currentColor;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.75;
}

.gt-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--gt-text);
}

/* ---- Requirements ---- */
.gt-req-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gt-req-list li {
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 12px 8px 14px;
  color: var(--gt-text);
  background: var(--gt-primary-lt);
  border-radius: 7px;
  border-left: 3px solid var(--gt-primary-mid);
}

/* ---- Cost table ---- */
.gt-cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gt-primary-lt);
}

.gt-cost-table tr + tr td {
  border-top: 1px solid var(--gt-border);
}

/* .gt-wrapper prefix (0,2,1) beats theme's stripe selector table tbody>tr:nth-child(odd)>td (0,1,4)
   and hover selector table tbody tr:hover>td (0,1,4) — both would otherwise apply gray backgrounds */
.gt-wrapper .gt-cost-table td {
  padding: 10px 14px;
  background: transparent;
}

.gt-cost-table td:first-child {
  color: var(--gt-text);
}

.gt-cost-amount {
  font-weight: 600;
  color: var(--gt-text);
  white-space: nowrap;
  text-align: right;
}

.gt-cost-amount.is-free {
  color: var(--gt-free);
  background: var(--gt-free-bg);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ---- Contact section ---- */
.gt-contact {
  background: #f4f8ff;
  border: 1px solid #cfdaf5;
  border-radius: 10px;
  padding: 16px 18px;
}

.gt-contact > .gt-section-label {
  margin-bottom: 12px;
}

.gt-contact-dept {
  font-weight: 700;
  font-size: 14px;
  margin: 0 0 14px;
  color: var(--gt-primary-dk);
}

.gt-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 0;
}

.gt-contact-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gt-contact-grid dt {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gt-muted);
}

.gt-contact-grid dt svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--gt-primary);
}

.gt-contact-grid dd {
  font-size: 13.5px;
  color: var(--gt-text);
  margin: 0;
}

.gt-contact-grid dd a {
  color: var(--gt-primary);
  text-decoration: none;
  font-weight: 500;
}

.gt-contact-grid dd a:hover {
  text-decoration: underline;
}

/* ---- Documents ---- */
.gt-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gt-docs-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gt-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 14px;
  border: 1.5px solid var(--gt-primary);
  border-radius: 8px;
  transition:
    background 0.18s,
    color 0.18s;
  background: transparent;
}

.gt-docs-list a:hover {
  background: var(--gt-primary);
  color: #fff;
}

.gt-docs-list svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---- No results / empty ---- */
.gt-no-results,
.gt-empty {
  padding: 28px;
  text-align: center;
  color: var(--gt-muted);
  font-size: 15px;
  background: var(--gt-primary-lt);
  border-radius: var(--gt-radius);
  margin: 16px 0;
  border: 1px dashed var(--gt-border);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .gt-card-trigger {
    padding: 13px 15px;
  }
  .gt-card-body-inner {
    padding: 14px 15px 18px;
  }
  .gt-contact {
    padding: 14px;
  }
  .gt-contact-grid {
    grid-template-columns: 1fr;
  }
  .gt-cost-amount {
    text-align: left;
  }
  .gt-docs-list {
    flex-direction: column;
  }
}
