/* =============================================
   Recipe Page — beer-recipe plugin
   Accent colour defined as custom property so
   the theme can override with one line.
   ============================================= */

/* ----- Page-level layout (injected via body_class filter) ----- */

body.single-recipe .overlay-page-title {
    display: none;
}

/* On recipe detail pages let the card fill the content column; the white
   background is kept because the site body is #f4f4f4 (not white). */
body.single-recipe .beerxml-recipe {
    max-width: none;
    margin: 0;
}

/* ----- Recipe card ----- */

.beerxml-recipe {
    --recipe-accent: #0077d3;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
    max-width: 960px;
    margin: 20px auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

/* ----- Header bar ----- */

.beerxml-header {
    background: var(--recipe-accent);
    padding: 14px 18px;
}

.beerxml-recipe-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.beerxml-recipe-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, .8);
    margin-top: 3px;
}

/* ----- Stats bar ----- */

.beerxml-details {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
}

.beerxml-stat {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    border-right: 1px solid #f0f0f0;
}

.beerxml-stat:last-child {
    border-right: none;
}

.beerxml-stat-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: #888;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.beerxml-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 3px;
}

/* ----- Section blocks ----- */

.beerxml-style,
.beerxml-fermentables,
.beerxml-hops,
.beerxml-miscs,
.beerxml-yeasts,
.beerxml-mash,
.beerxml-waters,
.beerxml-notes,
.beerxml-brewer-notes {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.beerxml-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--recipe-accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ----- Brewer's notes heading (generated by filter, uses h3) ----- */

.beerxml-brewer-notes h3 {
    font-size: 10px;
    font-weight: 700;
    color: var(--recipe-accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 8px;
}

/* ----- Notes paragraph ----- */

.beerxml-notes p {
    margin: 0;
    color: #57606a;
    font-size: 13px;
}

/* ----- Tables ----- */

.beerxml-recipe table {
    width: 100%;
    border-collapse: collapse;
}

.beerxml-recipe thead tr {
    background-color: #f6f8fa;
}

.beerxml-recipe th {
    padding: 4px 0;
    font-size: 11px;
    font-weight: 600;
    color: #57606a;
    text-align: left;
    border-bottom: 1px solid #e8eaed;
}

.beerxml-recipe th:not(:first-child) {
    text-align: right;
}

.beerxml-recipe td {
    padding: 6px 0;
    font-size: 13px;
    color: #57606a;
    border-bottom: 1px solid #f5f5f5;
}

.beerxml-recipe td:first-child {
    color: #1a1a1a;
}

.beerxml-recipe td:not(:first-child) {
    text-align: right;
}

.beerxml-recipe tbody tr:last-child td {
    border-bottom: none;
}

/* ----- Water profile header (title + calculator link) ----- */

.beerxml-waters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.beerxml-waters-header .beerxml-section-title {
    margin-bottom: 0;
}

.beerxml-wc-handoff {
    margin: 0;
}

.beerxml-wc-link {
    font-size: 10px;
    font-weight: 600;
    color: var(--recipe-accent);
    border: 1px solid var(--recipe-accent);
    border-radius: 3px;
    padding: 2px 8px;
    background: transparent;
    cursor: pointer;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.6;
}

.beerxml-wc-link:hover,
.beerxml-wc-link:focus {
    background: var(--recipe-accent);
    color: #fff;
}

/* ----- Download row ----- */

.beerxml-download {
    background: #f6f8fa;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.beerxml-download-hint {
    font-size: 12px;
    color: #57606a;
}

.beerxml-download-btn {
    background: var(--recipe-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.beerxml-download-btn:hover,
.beerxml-download-btn:focus {
    background: #005fa3;
    color: #fff;
    text-decoration: none;
}

/* ----- Responsive ----- */

@media (max-width: 480px) {
    .beerxml-details {
        flex-wrap: wrap;
    }

    .beerxml-stat {
        flex: 0 0 25%;
        border-bottom: 1px solid #f0f0f0;
    }

    /* 4+3 layout: last row of 3 stats centred */
    .beerxml-stat:nth-child(5),
    .beerxml-stat:nth-child(6),
    .beerxml-stat:nth-child(7) {
        flex: 0 0 33.333%;
    }

    .beerxml-download {
        flex-direction: column;
        align-items: flex-start;
    }

    .beerxml-download-btn {
        width: 100%;
        text-align: center;
    }
}
