/* ============================================================
   Edible Dosage Calculator — herbistry420.com
   Matches site palette: #83c439 green, #7f1333 red,
   Oswald headings, Open Sans body
   ============================================================ */

/* --- Wrapper ------------------------------------------------ */
.ec-wrap {
    max-width: 760px;
    margin: 0 auto 2em;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.5rem;
    color: #111111;
}

/* --- Hero header -------------------------------------------- */
.ec-hero {
    background: #83c439;
    border-radius: 8px 8px 0 0;
    padding: 24px 28px 20px;
    text-align: center;
}

.ec-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2.4rem;
    font-weight: 400;
    color: #ffffff;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ec-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

/* --- Table -------------------------------------------------- */
.ec-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e5e5;
    border-top: none;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* Clip overflow for border-radius on table */
.ec-table,
.ec-wrap .ec-table {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* --- Section header rows ------------------------------------ */
.ec-section-header th {
    background: #83c439;
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 14px 20px;
    text-align: left;
    border-top: 4px solid rgba(0, 0, 0, 0.08);
}

.ec-section-header--purple th {
    background: #7f1333;
    border-top: 4px solid rgba(0, 0, 0, 0.1);
}

/* --- Column header row ------------------------------------- */
.ec-col-header th {
    background: #f5fde8;
    color: #5a7a1e;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 20px;
    text-align: left;
    border-bottom: 2px solid #d4edaa;
}

.ec-col-header th:last-child {
    text-align: right;
}

.ec-col-header--purple th {
    background: #fae9ed;
    color: #7f1333;
    border-bottom-color: #e8c4cc;
}

/* --- Input rows -------------------------------------------- */
.ec-row-input {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.ec-row-input:hover {
    background: #fafff5;
}

/* --- Output rows ------------------------------------------- */
.ec-row-output {
    background: #f8fdf0;
    border-bottom: 1px solid #e8f5d0;
}

.ec-row-output--purple {
    background: #fdf0f3;
    border-bottom-color: #ecd5db;
}

/* Highlighted "per serving" rows */
.ec-row-highlight {
    background: #f5e2e7;
}

.ec-row-highlight .ec-label {
    font-weight: 600;
}

/* --- Divider rows ------------------------------------------ */
.ec-divider-row td {
    background: #edf7d5;
    padding: 8px 20px;
    text-align: center;
    border-top: 1px solid #d4edaa;
    border-bottom: 1px solid #d4edaa;
}

.ec-divider-row span {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #5a7a1e;
}

.ec-divider-row--purple td {
    background: #f5e2e7;
    border-top-color: #dcb5bf;
    border-bottom-color: #dcb5bf;
}

.ec-divider-row--purple span {
    color: #7f1333;
}

/* --- Cells ------------------------------------------------- */
.ec-label-cell {
    padding: 14px 20px;
    vertical-align: middle;
    width: 60%;
}

.ec-value-cell {
    padding: 10px 20px;
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}

/* --- Label text -------------------------------------------- */
.ec-label {
    display: block;
    font-size: 1.45rem;
    font-weight: 600;
    color: #111111;
    line-height: 1.3;
}

.ec-hint {
    display: block;
    font-size: 1.2rem;
    color: #8b97a3;
    margin-top: 2px;
    word-break: normal;
    hyphens: none;
    line-height: 1.4;
}

/* --- Input group (+/- buttons + number input) -------------- */
.ec-input-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(17, 17, 17, 0.15);
    border-radius: 9999px;
    overflow: hidden;
    background: #ffffff;
    vertical-align: middle;
}

.ec-adj {
    background: #83c439;
    color: #ffffff;
    border: none;
    width: 32px;
    height: 36px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ec-adj:hover {
    background: #6faa2b;
}

.ec-adj:active {
    background: #5a8f22;
}

/* Step 2 recipe section — red +/- buttons */
.ec-recipe-body .ec-adj {
    background: #7f1333;
}

.ec-recipe-body .ec-adj:hover {
    background: #6a0f2a;
}

.ec-recipe-body .ec-adj:active {
    background: #550c22;
}

.ec-input {
    width: 64px;
    border: none;
    border-left: 1px solid rgba(17, 17, 17, 0.1);
    border-right: 1px solid rgba(17, 17, 17, 0.1);
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.5rem;
    color: #111111;
    padding: 6px 4px;
    background: rgba(17, 17, 17, 0.02);
    -moz-appearance: textfield;
    height: 36px;
    box-sizing: border-box;
}

.ec-input::-webkit-outer-spin-button,
.ec-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ec-input:focus {
    outline: none;
    background: #ffffff;
    border-color: rgba(131, 196, 57, 0.5);
}

/* --- Unit label -------------------------------------------- */
.ec-unit {
    display: inline-block;
    font-size: 1.2rem;
    color: #8b97a3;
    margin-left: 6px;
    vertical-align: middle;
}

/* --- Output result values ---------------------------------- */
.ec-result {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: #5a7a1e;
    vertical-align: middle;
    transition: color 0.2s ease;
}

.ec-row-output--purple .ec-result {
    color: #7f1333;
}

.ec-result--large {
    font-size: 2.2rem;
    color: #83c439;
}

.ec-row-output--purple .ec-result--large {
    color: #7f1333;
}

/* Flash animation when values update */
@keyframes ec-flash {
    0%   { opacity: 0.3; }
    100% { opacity: 1; }
}

.ec-result.ec-updated {
    animation: ec-flash 0.3s ease-out;
}

/* --- Note row (tsp/tbsp instruction) ----------------------- */
.ec-note-row td {
    background: #fae9ed;
    border-top: 1px solid #e8c4cc;
    border-bottom: 1px solid #e8c4cc;
    padding: 10px 20px;
    font-size: 1.3rem;
    color: #601929;
    line-height: 1.6;
    text-align: center;
    word-break: normal;
    hyphens: none;
}

.ec-note-row strong {
    color: #7f1333;
}

/* --- Disabled measure row (tsp/tbsp mutual exclusion) ------ */
.ec-row-disabled {
    opacity: 0.42;
    pointer-events: none;
    background: #f5f5f5 !important;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.ec-row-disabled .ec-label {
    color: #999999;
}

.ec-row-disabled .ec-hint {
    color: #bbbbbb;
}

.ec-row-disabled .ec-input-group {
    border-color: rgba(17, 17, 17, 0.06);
}

.ec-row-disabled .ec-adj {
    background: #cccccc;
    cursor: not-allowed;
}

.ec-row-disabled .ec-input {
    color: #aaaaaa;
    background: rgba(17, 17, 17, 0.03);
}

.ec-row-disabled .ec-unit {
    color: #cccccc;
}

/* --- Disclaimer -------------------------------------------- */
.ec-disclaimer {
    font-size: 1.2rem;
    color: #8b97a3;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 14px 20px;
    margin: 0;
    line-height: 1.6;
}

.ec-disclaimer strong {
    color: #111111;
}

/* ============================================================
   Dosage reference table (page content)
   ============================================================ */
.ec-dosage-table-wrap {
    overflow-x: auto;
    margin: 1.5em 0 2em;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.ec-dosage-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.4rem;
}

.ec-dosage-table thead tr {
    background: #83c439;
}

.ec-dosage-table thead th {
    color: #ffffff;
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    text-align: left;
}

.ec-dosage-table tbody tr:nth-child(odd) {
    background: #f9fdf2;
}

.ec-dosage-table tbody tr:nth-child(even) {
    background: #ffffff;
}

.ec-dosage-table tbody tr:last-child td {
    border-bottom: none;
}

.ec-dosage-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #eef5e0;
    color: #111111;
    vertical-align: top;
    line-height: 1.5;
    word-break: normal;
    hyphens: none;
}

.ec-dosage-table td:nth-child(2) {
    white-space: nowrap;
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: #5a7a1e;
}

/* Page intro paragraph */
.ec-page-intro {
    font-size: 1.7rem;
    line-height: 1.7;
    color: #333333;
    border-left: 4px solid #83c439;
    padding-left: 18px;
    margin-bottom: 2em;
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 600px) {

    .ec-wrap {
        font-size: 1.4rem;
    }

    .ec-hero {
        padding: 18px 16px 14px;
        border-radius: 6px 6px 0 0;
    }

    .ec-title {
        font-size: 2rem;
    }

    .ec-subtitle {
        font-size: 1.3rem;
    }

    .ec-section-header th {
        font-size: 1.4rem;
        padding: 12px 14px;
    }

    .ec-label-cell {
        padding: 12px 14px;
        width: auto;
    }

    .ec-value-cell {
        padding: 10px 14px;
    }

    /* Stack label above value on small screens */
    .ec-row-input td,
    .ec-row-output td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .ec-value-cell {
        text-align: left;
        padding-top: 0;
        padding-bottom: 14px;
    }

    .ec-label-cell {
        padding-bottom: 6px;
    }

    .ec-input {
        width: 56px;
        font-size: 1.4rem;
    }

    .ec-result--large {
        font-size: 1.9rem;
    }

    .ec-disclaimer {
        padding: 12px 14px;
    }
}
