/*
 * Meditronik components (DESIGN.md "Components contract").
 * Portable to the next theme unchanged. Rules: single-class .mt-* selectors (plus states),
 * no Flatsome/WooCommerce selectors, no !important, no raw colour values (tokens only).
 * Flatsome/Woo markup is mapped onto these looks in flatsome-bridge.css.
 */

/* ---------- Button ---------- */
.mt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--mt-space-2);
    min-height: var(--mt-control-h);
    margin: 0;
    padding: 0 20px;
    border: 1px solid var(--mt-green-text);
    border-radius: var(--mt-radius-control);
    background: var(--mt-green-text);
    box-shadow: none;
    color: var(--mt-surface);
    font-family: var(--mt-font);
    font-size: var(--mt-text-15);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.mt-btn:hover {
    border-color: var(--mt-green-deep);
    background: var(--mt-green-deep);
    color: var(--mt-surface);
}

.mt-btn:focus-visible {
    outline: none;
    box-shadow: var(--mt-focus);
}

.mt-btn:disabled,
.mt-btn.is-disabled {
    opacity: .5;
    cursor: not-allowed;
}

.mt-btn--secondary {
    border-color: var(--mt-green-text);
    background: var(--mt-surface);
    color: var(--mt-green-text);
}

.mt-btn--secondary:hover {
    border-color: var(--mt-green-deep);
    background: var(--mt-green-soft);
    color: var(--mt-green-deep);
}

.mt-btn--on-dark {
    border-color: var(--mt-surface);
    background: transparent;
    color: var(--mt-surface);
}

.mt-btn--sm {
    min-height: var(--mt-control-h-sm);
    padding: 0 14px;
    font-size: var(--mt-text-14);
}

.mt-btn--block {
    display: flex;
    width: 100%;
}

/* text action */
.mt-link {
    color: var(--mt-green-text);
    font-weight: 700;
    text-decoration: none;
}

.mt-link:hover {
    color: var(--mt-green-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Chip (only for things you can click) ---------- */
.mt-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-pill);
    background: var(--mt-surface);
    color: var(--mt-green-text);
    font-size: var(--mt-text-13);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

.mt-chip:hover,
.mt-chip.is-active {
    border-color: var(--mt-green-text);
    background: var(--mt-green-soft);
}

/* ---------- Card / panel ---------- */
.mt-card {
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
}

.mt-card--link:hover {
    box-shadow: var(--mt-shadow-raised);
}

/* ---------- Field ---------- */
.mt-field {
    width: 100%;
    min-height: var(--mt-control-h);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--mt-line-strong);
    border-radius: var(--mt-radius-control);
    background: var(--mt-surface);
    box-shadow: none;
    color: var(--mt-ink);
    font-family: var(--mt-font);
    font-size: var(--mt-text-15);
}

.mt-field:focus {
    border-color: var(--mt-green-text);
    outline: none;
    box-shadow: 0 0 0 3px var(--mt-green-soft);
}

.mt-field--search {
    border-radius: var(--mt-radius-pill);
    padding: 0 16px;
}

/* ---------- Headings ---------- */
.mt-h1 {
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-h1);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.12;
    text-transform: none;
    text-wrap: balance;
}

.mt-h2 {
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-ink);
    font-size: var(--mt-text-h2);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    text-wrap: balance;
}

.mt-h3 {
    margin: 0 0 var(--mt-space-2);
    color: var(--mt-ink);
    font-size: var(--mt-text-18);
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
}

.mt-label {
    color: var(--mt-muted);
    font-size: var(--mt-text-12);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

@media (max-width: 549px) {
    .mt-field {
        font-size: 16px; /* stops iOS zoom on focus */
    }
}

/* ======================================================================
   Content pages: hubs and articles (portable).
   ====================================================================== */
.mt-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--mt-space-5) var(--mt-space-4) var(--mt-space-section);
    color: var(--mt-ink);
}

.mt-page-head {
    max-width: 860px;
    margin: 0 0 var(--mt-space-6);
}

.mt-page-head__lead {
    max-width: 68ch;
    margin: 0 0 var(--mt-space-4);
    color: var(--mt-muted);
    font-size: var(--mt-text-17);
    line-height: 1.55;
}

.mt-page-head__actions,
.mt-contact-line__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--mt-space-3) var(--mt-space-4);
}

.mt-section {
    margin: 0 0 var(--mt-space-section);
}

/* tiles: category entries with a product photo */
.mt-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--mt-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mt-tiles > li {
    margin: 0;
}

.mt-tile {
    display: flex;
    align-items: center;
    gap: var(--mt-space-4);
    height: 100%;
    padding: var(--mt-space-3);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
    color: var(--mt-ink);
    text-decoration: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.mt-tile:hover {
    border-color: var(--mt-line-strong);
    box-shadow: var(--mt-shadow-raised);
}

.mt-tile:focus-visible {
    outline: none;
    box-shadow: var(--mt-focus);
}

.mt-tile__media {
    display: flex;
    flex: 0 0 72px;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
}

.mt-tile__media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mt-tile__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mt-tile__title {
    color: var(--mt-green-text);
    font-size: var(--mt-text-15);
    font-weight: 700;
    line-height: 1.3;
}

.mt-tile__text {
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    line-height: 1.45;
}

/* table: hairlines, sentence-case headers, scrolls sideways on phones */
.mt-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
}

.mt-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: var(--mt-text-14);
    font-variant-numeric: tabular-nums;
}

.mt-table th,
.mt-table td {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--mt-line);
    color: var(--mt-ink);
    text-align: left;
    vertical-align: top;
}

.mt-table thead th {
    background: var(--mt-bg);
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.mt-table tbody tr:last-child > * {
    border-bottom: 0;
}

.mt-table tbody th {
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.mt-table__links a {
    color: var(--mt-green-text);
    font-weight: 700;
}

/* ordered steps: a plain numbered list */
.mt-steps {
    max-width: 75ch;
    margin: 0;
    padding-left: 1.4em;
    line-height: 1.6;
}

.mt-steps > li {
    margin: 0 0 var(--mt-space-2);
    padding-left: 4px;
}

/* FAQ as native disclosures */
.mt-faq {
    max-width: 860px;
    border-top: 1px solid var(--mt-line);
}

.mt-faq details {
    border-bottom: 1px solid var(--mt-line);
}

.mt-faq summary {
    padding: 14px 0;
    color: var(--mt-ink);
    font-size: var(--mt-text-15);
    font-weight: 700;
    cursor: pointer;
}

.mt-faq summary:focus-visible {
    outline: none;
    box-shadow: var(--mt-focus);
}

.mt-faq details > p {
    max-width: 68ch;
    margin: 0 0 14px;
    color: var(--mt-ink);
    line-height: 1.6;
}

/* prose: articles and longer guide copy */
.mt-prose {
    max-width: 64ch; /* ~75 characters of Lato at 17px */
    color: var(--mt-ink);
    font-size: var(--mt-text-17);
    line-height: 1.65;
}

.mt-prose p,
.mt-prose ul,
.mt-prose ol {
    margin: 0 0 1em;
}

.mt-prose ul,
.mt-prose ol {
    padding-left: 1.3em;
}

.mt-prose li {
    margin: 0 0 .35em;
}

.mt-prose h2 {
    margin: 2.2em 0 .5em;
    color: var(--mt-ink);
    font-size: var(--mt-text-h2);
    font-weight: 700;
    line-height: 1.2;
}

.mt-prose h3 {
    margin: 1.6em 0 .4em;
    color: var(--mt-ink);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.mt-prose a {
    color: var(--mt-green-text);
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mt-prose strong {
    color: var(--mt-ink);
    font-weight: 700;
}

.mt-contact-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--mt-space-4);
    padding: var(--mt-space-5);
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
}

.mt-contact-line p {
    max-width: 68ch;
    margin: 0;
}

@media (max-width: 549px) {
    .mt-page-head__lead,
    .mt-prose {
        font-size: 16px;
    }

    .mt-tiles {
        grid-template-columns: 1fr;
    }
}

/* blog archive: cards with photo (if any), date, title, excerpt */
.mt-post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--mt-space-4);
    margin: 0 0 var(--mt-space-6);
    padding: 0;
    list-style: none;
}

.mt-post-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--mt-line);
    border-radius: var(--mt-radius-card);
    background: var(--mt-surface);
    box-shadow: var(--mt-shadow-low);
}

.mt-post-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--mt-bg);
}

.mt-post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mt-post-card__body {
    display: grid;
    gap: var(--mt-space-2);
    padding: var(--mt-space-4) var(--mt-space-5) var(--mt-space-5);
}

.mt-post-card__meta {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-13);
}

.mt-post-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.mt-post-card__title a {
    color: var(--mt-ink);
    text-decoration: none;
}

.mt-post-card__title a:hover {
    color: var(--mt-green-text);
}

.mt-post-card__excerpt {
    margin: 0;
    color: var(--mt-muted);
    font-size: var(--mt-text-15);
    line-height: 1.55;
}

/* article header */
.mt-article-head {
    max-width: 820px;
    padding-bottom: var(--mt-space-4);
}

.mt-article-head__back {
    margin: 0 0 var(--mt-space-3);
    font-size: var(--mt-text-14);
}

.mt-article-head__meta {
    margin: 0 0 var(--mt-space-5);
    color: var(--mt-muted);
    font-size: var(--mt-text-14);
}

.mt-article-head__media {
    margin: 0;
    overflow: hidden;
    border-radius: var(--mt-radius-card);
}

.mt-article-head__media img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

/* colour reference marks: wire in a T568 table, fibre jacket colour */
.mt-wire,
.mt-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 1px solid var(--mt-line-strong);
    border-radius: 3px;
    vertical-align: -2px;
    background: var(--mt-swatch-color, var(--mt-line));
}
.mt-wire--stripe {
    background: repeating-linear-gradient(135deg, var(--mt-surface) 0 3px, var(--mt-swatch-color) 3px 6px);
}
.mt-wire--green { --mt-swatch-color: var(--mt-wire-green); }
.mt-wire--orange { --mt-swatch-color: var(--mt-wire-orange); }
.mt-wire--blue { --mt-swatch-color: var(--mt-wire-blue); }
.mt-wire--brown { --mt-swatch-color: var(--mt-wire-brown); }
.mt-swatch--os2 { --mt-swatch-color: var(--mt-fiber-os2); }
.mt-swatch--om2 { --mt-swatch-color: var(--mt-fiber-om2); }
.mt-swatch--om3 { --mt-swatch-color: var(--mt-fiber-om3); }
.mt-swatch--om4 { --mt-swatch-color: var(--mt-fiber-om4); }
.mt-swatch--om5 { --mt-swatch-color: var(--mt-fiber-om5); }
