/* com_afcomments: block under the articles of alfogon (likes, sharing, ratings and comments) */
.afc {
    --afc-line: var(--af-line, #cbcbcb); --afc-soft: #f5f5f3; --afc-muted: #6f6c62;
    /* colour of the section (articles blue; recipes, wines and restaurants below): every state of the block uses it */
    --afc-c: var(--af-blue, #2d5988); --afc-c-soft: #eaf0f6;
    --afc-gold: #f2a516;
    clear: both; margin: 1.5rem 0 1rem; padding-top: .75rem; border-top: 1px solid var(--afc-line); font-size: .95rem;
}
.afc svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

/* one line of buttons */
.afc-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.afc-pill {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 2.25rem; padding: .3rem .8rem;
    border: 1px solid var(--afc-line); border-radius: 2rem; background: #fff; color: var(--af-text, #4a4a2e);
    font: inherit; font-size: .9rem; line-height: 1.2; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.afc-pill:hover { border-color: #9a978e; }
.afc-pill:active { transform: scale(.96); }
.afc-pill:focus-visible { outline: 2px solid var(--afc-c); outline-offset: 2px; }
.afc-vote.is-on { color: var(--afc-c); background: var(--afc-c-soft); border-color: var(--afc-c); }
.afc-vote[aria-busy="true"] { opacity: .6; pointer-events: none; }
.afc-n { font-variant-numeric: tabular-nums; min-width: .6em; }
.afc-share.is-done { color: var(--afc-c); border-color: var(--afc-c); background: var(--afc-c-soft); }
.afc-sum { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: .1rem .6rem; color: var(--afc-muted); font-size: .9rem; text-decoration: none; }
.afc-sum:hover { color: var(--afc-c); }
.afc-sum__stars { color: #8a6100; font-weight: 600; }
.afc-sum__stars small { font-weight: 400; color: var(--afc-muted); }
.afc-toast {
    position: absolute; left: 50%; bottom: calc(100% + .4rem); transform: translate(-50%, .3rem); padding: .3rem .75rem; border-radius: 2rem;
    background: #2d2d2d; color: #fff; font-size: .85rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.afc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* comments */
.afc-list { list-style: none; margin: .75rem 0 0; padding: 0; }
.afc-item { padding: .55rem 0; border-top: 1px solid #eceae5; }
.afc-item:first-child { border-top: 0; }
.afc-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; font-size: .88rem; color: var(--afc-muted); }
.afc-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.afc-avatar--none { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; font-weight: 700; }
.afc-item__name { font-weight: 700; color: var(--af-heading, #2d2d2d); text-decoration: none; }
a.afc-item__name:hover { text-decoration: underline; }
.afc-item__date { margin-left: auto; font-size: .8rem; }
.afc-stars { color: var(--afc-gold); letter-spacing: .05em; font-size: .85rem; }
.afc-stars__off { color: #ddd6c9; }
.afc-item__text { margin: .3rem 0 0 calc(28px + .5rem); line-height: 1.45; overflow-wrap: anywhere; }
.afc-more { display: block; margin: .25rem 0 0 calc(28px + .5rem); padding: .2rem 0; border: 0; background: none; color: var(--afc-c); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.afc-more:hover { text-decoration: underline; }

/* form */
.afc-login { margin: .75rem 0 0; padding: .55rem .8rem; border-radius: .5rem; background: var(--afc-soft); font-size: .9rem; }
.afc-form { margin-top: .75rem; }
.afc-rate { display: flex; align-items: center; gap: .5rem; margin: 0 0 .35rem; padding: 0; border: 0; min-width: 0; }
.afc-rate__label { float: left; width: auto; margin: 0; padding: 0; font-size: .88rem; color: var(--afc-muted); }
.afc-rate__stars { display: inline-flex; flex-direction: row-reverse; line-height: 1; }
.afc-rate__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.afc-rate__stars label { padding: .1rem .12rem; font-size: 1.55rem; color: #ddd6c9; cursor: pointer; transition: color .1s, transform .1s; -webkit-tap-highlight-color: transparent; }
.afc-rate__stars input:checked ~ label, .afc-rate__stars label:hover, .afc-rate__stars label:hover ~ label { color: var(--afc-gold); }
.afc-rate__stars label:active { transform: scale(1.2); }
.afc-rate__stars input:focus-visible + label { outline: 2px solid var(--afc-c); outline-offset: 1px; border-radius: 4px; }

.afc-box { position: relative; border: 1px solid var(--afc-line); border-radius: .9rem; background: #fff; transition: border-color .15s, box-shadow .15s; }
.afc-box:focus-within { border-color: var(--afc-c); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--afc-c) 15%, transparent); }
.afc-box__text {
    display: block; width: 100%; min-height: 2.6rem; max-height: 14rem; padding: .6rem .8rem .2rem; border: 0; border-radius: .9rem .9rem 0 0;
    background: transparent; color: inherit; font: inherit; font-size: 1rem; /* 16px: no zoom on iPhone */ line-height: 1.4; resize: none; overflow-y: auto;
}
.afc-box__text:focus { outline: 0; }
.afc-box__tools { display: flex; align-items: center; gap: .5rem; padding: .15rem .4rem .4rem; }
.afc-emoji-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: none; color: var(--afc-muted); cursor: pointer; }
.afc-emoji-btn svg { width: 1.35rem; height: 1.35rem; }
.afc-emoji-btn:hover, .afc-emoji-btn[aria-expanded="true"] { background: var(--afc-soft); color: var(--afc-c); }
.afc-count { margin-left: auto; font-size: .8rem; color: var(--afc-muted); font-variant-numeric: tabular-nums; }
.afc-count.is-over { color: #b3261e; font-weight: 700; }
.afc-send { display: inline-flex; align-items: center; gap: .3rem; border-radius: 2rem; padding-inline: .85rem; }
.afc-send svg { width: 1rem; height: 1rem; }
.afc-emojis {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .1rem; max-height: 11rem; overflow-y: auto;
    margin: 0 .4rem .45rem; padding: .35rem; border-radius: .6rem; background: var(--afc-soft); overscroll-behavior: contain;
}
.afc-emojis[hidden] { display: none; }
.afc-emojis button { height: 2.4rem; border: 0; border-radius: .45rem; background: none; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.afc-emojis button:hover, .afc-emojis button:focus-visible { background: #fff; }
.afc-hint { margin: .3rem .2rem 0; font-size: .8rem; color: var(--afc-muted); }
.afc-hint.is-error { color: #b3261e; font-weight: 600; }
.afc-form .afc-hint + * { margin-top: .5rem; }

/* listings (blog of a category): "★ 4,5 · 3 comentarios" under the title */
.afc-count-line { margin: -.25rem 0 .5rem; font-size: .85rem; color: var(--afc-muted, #6f6c62); }
.afc-count-line .afc-sum__stars { color: #8a6100; font-weight: 600; }

@media (max-width: 575.98px) {
    .afc-share__txt { display: none; }          /* only the icon: the four buttons stay on one line */
    .afc-pill { padding: .3rem .7rem; }
    .afc-sum { margin-left: 0; width: 100%; }
    .afc-item__text, .afc-more { margin-left: 0; }
    .afc-send span { display: none; }
    .afc-send { padding-inline: .65rem; }
}
@media (prefers-reduced-motion: reduce) { .afc * { transition: none !important; } }

/* Section colours (palette of the template): recipes orange, wines wine red, restaurants green */
.afc[data-context="com_jcookbook.recipe"]  { --afc-c: var(--af-btn, #D54215); --afc-c-soft: var(--af-c-recipes-soft, #FEEEE8); }
.afc[data-context="com_jvino.wine"]        { --afc-c: var(--af-c-wines, #9c2150); --afc-c-soft: var(--af-c-wines-soft, #f9ecf1); }
.afc[data-context="com_jpages.restaurant"] { --afc-c: var(--jp-accent, #4f8a22); --afc-c-soft: var(--jp-soft, #eef6e6); }
.afc .afc-login a, .afc .afc-sum { --link: var(--afc-c); }
.afc .afc-login a { color: var(--afc-c); }
.afc .btn-primary.afc-send { --bs-btn-bg: var(--afc-c); --bs-btn-border-color: var(--afc-c); --bs-btn-hover-bg: color-mix(in srgb, var(--afc-c) 85%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--afc-c) 85%, #000); background-color: var(--afc-c); border-color: var(--afc-c); }
.afc .btn-primary.afc-send:hover { background-color: color-mix(in srgb, var(--afc-c) 85%, #000); }
