/* ===== SAU Shortcodes-Ultimate replacement styles =====
 * Network-wide, enqueued by mu-plugins/sau-su-replacement-styles.php
 * Demo: https://www.saumag.edu/sandbox/su-replacement-styles-demo/
 * Scoped with :is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) so plain
 * content HTML is unaffected. .elementor-widget-container is required because
 * pages rendered through an Elementor THEME TEMPLATE have no .entry-content
 * wrapper at all, and were rendering converted content unstyled. Both
 * .elementor-widget and .elementor-widget-container are listed because some
 * widgets (e.g. text-editor on /soar/) render without the inner container.
 * :is() takes the highest specificity of its arguments - all three are single
 * classes - so specificity is unchanged from the original selectors.
 */

/* Buttons — pill per SAU Elementor house style */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn {
  display: inline-block;
  background: #003da5;
  color: #fff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid #003da5;
  transition: background .2s, color .2s;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn:hover { background: #00286d; border-color: #00286d; color: #fff; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn--gold { background: #ffd200; border-color: #ffd200; color: #002d79; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn--gold:hover { background: #e6bd00; border-color: #e6bd00; color: #002d79; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn--outline { background: transparent; color: #003da5; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn--outline:hover { background: #003da5; color: #fff; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) a.sau-btn--small { padding: 6px 16px; font-size: 14px; }
/* Content buttons center in their container by default */
:is(.entry-content, .elementor-widget, .elementor-widget-container) a.sau-btn { display: table; margin: 0 auto 15px; text-align: center; }
/* Widget buttons stack vertically, left-aligned (SU rendered one per line in sidebars) */
.widget a.sau-btn { display: table; margin: 0 0 10px; }

/* Accordion / spoiler — native details */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) details.sau-spoiler {
  border: 1px solid #d9d9d9;
  border-radius: 15px;
  margin: 0 0 10px;
  overflow: hidden;
  background: #fbfbfb;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) details.sau-spoiler > summary {
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 800;
  color: #003da5;
  font-size: 17px;
  list-style-position: inside;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) details.sau-spoiler[open] > summary { border-bottom: 1px solid #e4e4e4; background: #f4f4f4; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) details.sau-spoiler > .sau-spoiler-body { padding: 14px 18px; }

/* Table */
.sau-table-wrap { overflow-x: auto; margin: 0 0 20px; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
  line-height: 1.45;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table th {
  background: #003da5; color: #fff; padding: 10px 14px; text-align: left; line-height: 1.45;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table td {
  padding: 10px 14px; border-bottom: 1px solid #e4e4e4; line-height: 1.45;
}
/* Legacy TinyMCE tables carry inline height= on the table, its rows and its
   cells (e.g. height:719px), forcing rows far taller than their content.
   Let the content decide the height instead. */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table tr,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table td,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table th { height: auto !important; }
/* Stacked lines within a cell are separate <p> elements; the theme's 16px
   paragraph margin reads as a large gap inside a table row. */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table td p { margin: 0 0 6px; line-height: inherit; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table td p:last-child { margin-bottom: 0; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) table.sau-table tbody tr:nth-child(even) { background: #f4f4f4; }

/* Note / callout */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-note {
  display: flow-root; /* contain floated children (e.g. floated video/image inside a note) */
  border-left: 5px solid #003da5;
  background: #eef3fb;
  border-radius: 0 15px 15px 0;
  padding: 14px 18px;
  margin: 0 0 20px;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-note--gold { border-left-color: #ffd200; background: #fff9e0; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-note p:last-child { margin-bottom: 0; }

/* Columns */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols { display: grid; gap: 24px; margin: 0 0 20px; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-2 { grid-template-columns: 1fr 1fr; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 720px) {
  :is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-2,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-3,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-cols-4 { grid-template-columns: 1fr; }
}

/* Icon list */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) ul.sau-list { list-style: none; padding-left: 0; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) ul.sau-list li { padding-left: 26px; position: relative; margin-bottom: 8px; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) ul.sau-list li::before { content: "\2714"; color: #003da5; position: absolute; left: 0; font-weight: 700; }

/* Divider — theme default hr is too faint */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) hr.sau-hr { border: 0; border-top: 2px solid #9b9b9b; margin: 24px 0; }

/* Spacer */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-spacer { display: block; }

/* Titled box (replaces su_box) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-box {
  border: 1px solid #d9d9d9;
  border-radius: 15px;
  overflow: hidden;
  margin: 0 0 20px;
  background: #fff;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-box-title {
  background: #003da5;
  color: #fff;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 17px;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-box-title a { color: #fff; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-box-body { padding: 14px 18px; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-box-body > :last-child { margin-bottom: 0; }

/* Photo panel (replaces su_photo_panel) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-photo-panel {
  margin: 0 0 20px;
  overflow: hidden;
  background: #fff;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-photo-panel img { display: block; width: 100%; height: auto; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-photo-panel-body { padding: 12px 15px; }

/* Document embed (replaces su_document) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-doc {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d9d9d9;
  border-radius: 15px;
  overflow: hidden;
  margin: 0 0 10px;
  background: #f4f4f4;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-doc iframe { width: 100%; height: 100%; border: 0; display: block; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-doc-link { margin: 0 0 20px; }

/* Progress pie (replaces su_progress_pie) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-pie {
  --sau-pie-pct: 0;
  --sau-pie-fill: #003da5;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px 15px 0;
  background:
    conic-gradient(var(--sau-pie-fill) calc(var(--sau-pie-pct) * 1%), #e4e4e4 0);
  line-height: 1;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-pie > span {
  background: #fff;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .5em;
  font-weight: 700;
  color: inherit;
}

/* Map embed (replaces su_gmap) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-map {
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  margin: 0 0 20px;
}
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-map iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Child-page and post lists (rendered by sau-su-compat.php) */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) ul.sau-subpages,
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) ul.sau-posts { padding-left: 20px; }

/* Responsive video embed */
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 0 0 20px; border-radius: 15px; overflow: hidden; }
:is(.entry-content, .widget, .elementor-widget, .elementor-widget-container) .sau-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
