/* Pergola price calculator in the new theme (layout from the current site's calculator; tokens from album.css). */
/* (both columns are minmax(0, …): the options' own width must never push the price column out of the frame, which
   clips it. The options stack and the price size follow the width of their own column, not the screen's.) */
.calc { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); margin: 1.5rem 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.calc-form { padding: clamp(1.25rem, 3.5vw, 2.5rem); container: calc-form / inline-size; }
.calc-group { border: 0; padding: 0; margin: 0 0 1.4rem; min-inline-size: 0; }
.calc-group legend, .field > span, .field-label { font-weight: 600; font-size: .9rem; margin-block-end: .6rem; padding: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--ink); border-radius: .5rem; overflow: hidden; }
.seg label, .chip { position: relative; }
.seg input, .chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: flex; block-size: 100%; box-sizing: border-box; align-items: center; justify-content: center; text-align: center; min-block-size: 48px; padding: .5rem .75rem; font-size: .9rem; }
.seg label + label span { border-inline-start: 1px solid var(--ink); }
.seg input:checked + span, .chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span, .chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -4px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip[hidden] { display: none; }
.chip span { display: inline-flex; align-items: center; min-block-size: 44px; padding: .5rem 1rem; border: 1px solid #cdc7bc; border-radius: 999px; font-size: .92rem; }
.chip input:hover + span { border-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: .35rem; margin-block-end: 1rem; flex: 1; }
.calc-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-block-end: .4rem; }
.range-row { display: flex; align-items: center; gap: .75rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--ink); }
.range-row output { min-inline-size: 3ch; font-weight: 600; font-size: 1.1rem; }
.calc-result { background: var(--ink); color: #d9d5cc; padding: clamp(1.5rem, 3.5vw, 2.5rem); display: flex; flex-direction: column; container-type: inline-size; }
.calc-result p { color: #d9d5cc; }
.calc-area strong { color: #fff; font-weight: 500; }
.calc-label { margin-block: 1.1rem .25rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: #d8b77f; }
:lang(ar) .calc-label { letter-spacing: 0; font-size: .95rem; }
.calc-price bdi { white-space: nowrap; }   /* a number is never split; a long range takes two lines */
.calc-price { font-size: clamp(1.5rem, 11cqi, 2.6rem); font-weight: 300; color: #fff; line-height: 1.2; margin-block-end: .5rem; direction: ltr; text-align: start; }
[dir="rtl"] .calc-price { text-align: right; }
.calc-cur { font-size: .5em; font-weight: 500; color: #d8b77f; vertical-align: .55em; }
.calc-min { font-size: .85rem; color: #d8b77f; }
.calc-note { font-size: .8rem; margin-block: .75rem 1.5rem; }
.calc-actions { display: flex; flex-direction: column; gap: .6rem; margin-block-start: auto; }
.calc-actions .al-btn { width: 100%; justify-content: center; text-align: center; white-space: normal; }
.calc-result .al-btn:not(.al-btn-primary) { color: #fff; border-color: rgb(255 255 255 / .35); }
.calc-result .al-btn-primary { background: var(--accent); color: var(--ink); }
@media (max-width: 860px) { .calc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .calc-dims { grid-template-columns: 1fr; } }
@container calc-form (max-width: 26rem) { .seg { grid-auto-flow: row; } .seg label + label span { border-inline-start: 0; border-block-start: 1px solid var(--ink); } }
/* more than four choices (the pergola types) never fit one row: always a list */
.seg:has(label:nth-child(5)) { grid-auto-flow: row; }
.seg:has(label:nth-child(5)) label + label span { border-inline-start: 0; border-block-start: 1px solid var(--ink); }
