/* GIMADA Calcolatore Fotografico v1.0.0 */

.gimada-calc {
	--gc-accent: #e0a43a;
	--gc-bg: #111114;
	--gc-card: #1a1a1f;
	--gc-card-2: #222228;
	--gc-line: #2e2e36;
	--gc-text: #ececf1;
	--gc-muted: #9b9ba8;
	--gc-svg-bg: #24242b;
	--gc-radius: 14px;
	--gc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	container-type: inline-size;
	box-sizing: border-box;
	font-family: var(--gc-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--gc-text);
	background: var(--gc-bg);
	border-radius: calc(var(--gc-radius) + 6px);
	padding: clamp(16px, 3vw, 32px);
	max-width: 1280px;
	margin: 0 auto;
	text-align: left;
}

.gimada-calc.gc-tema-chiaro {
	--gc-bg: #f6f5f2;
	--gc-card: #ffffff;
	--gc-card-2: #f1f0ec;
	--gc-line: #e2e0da;
	--gc-text: #1d1d22;
	--gc-muted: #6b6b76;
	--gc-svg-bg: #eeede8;
}

@media (prefers-color-scheme: light) {
	.gimada-calc.gc-tema-auto {
		--gc-bg: #f6f5f2;
		--gc-card: #ffffff;
		--gc-card-2: #f1f0ec;
		--gc-line: #e2e0da;
		--gc-text: #1d1d22;
		--gc-muted: #6b6b76;
		--gc-svg-bg: #eeede8;
	}
}

.gimada-calc *,
.gimada-calc *::before,
.gimada-calc *::after { box-sizing: border-box; }

.gimada-calc [hidden] { display: none !important; }

.gimada-calc .gc-loading { color: var(--gc-muted); padding: 40px; text-align: center; }

/* Intestazione */
.gimada-calc .gc-head { margin-bottom: 18px; }
.gimada-calc .gc-kicker {
	font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
	color: var(--gc-accent); font-weight: 600;
}
.gimada-calc .gc-title {
	margin: 4px 0 0; padding: 0;
	font-size: clamp(24px, 3.2vw, 36px); line-height: 1.15; font-weight: 700;
	color: var(--gc-text); letter-spacing: -.01em;
}

/* Schede */
.gimada-calc .gc-tabs {
	display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
	padding: 4px 2px 12px; margin: 0 0 8px;
	border-bottom: 1px solid var(--gc-line);
}
.gimada-calc .gc-tabs::-webkit-scrollbar { display: none; }
.gimada-calc .gc-tab {
	all: unset; box-sizing: border-box; cursor: pointer;
	display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
	padding: 9px 14px; border-radius: 999px;
	font: 500 14px/1.2 var(--gc-font); color: var(--gc-muted);
	background: var(--gc-card); border: 1px solid var(--gc-line);
	transition: color .2s, background .2s, border-color .2s;
}
.gimada-calc .gc-tab svg {
	color: inherit; width: 18px; height: 18px; fill: none; stroke: currentColor;
	stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.gimada-calc .gc-tab:hover { color: var(--gc-text); border-color: var(--gc-muted); }
.gimada-calc .gc-tab.is-on {
	color: #111; background: var(--gc-accent); border-color: var(--gc-accent); font-weight: 600;
}
.gimada-calc .gc-tab:focus-visible { outline: 2px solid var(--gc-accent); outline-offset: 2px; }

.gimada-calc .gc-panel { animation: gc-in .35s ease; }
@keyframes gc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.gimada-calc .gc-intro { color: var(--gc-muted); margin: 14px 0 18px; max-width: 75ch; font-size: 15px; }

/* Layout */
.gimada-calc .gc-body { display: grid; gap: 18px; grid-template-columns: 1fr; }
@container (min-width: 860px) {
	.gimada-calc .gc-body { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
	.gimada-calc .gc-controls { position: sticky; top: 90px; }
}
.gimada-calc .gc-controls, .gimada-calc .gc-output { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Card */
.gimada-calc .gc-card {
	background: var(--gc-card); border: 1px solid var(--gc-line);
	border-radius: var(--gc-radius); padding: 16px 18px;
}
.gimada-calc .gc-card-title { font-size: 13px; font-weight: 600; color: var(--gc-muted); margin-bottom: 12px; letter-spacing: .02em; }
.gimada-calc .gc-step-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; margin: 4px 0 12px; }
.gimada-calc .gc-step-title:not(:first-child) { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--gc-line); }
.gimada-calc .gc-step-n {
	display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
	background: var(--gc-accent); color: #111; font-size: 12px; font-weight: 700;
}

/* Campi */
.gimada-calc .gc-field { margin-bottom: 14px; }
.gimada-calc .gc-field:last-child { margin-bottom: 0; }
.gimada-calc .gc-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.gimada-calc .gc-field-head label, .gimada-calc .gc-label { font-size: 13px; color: var(--gc-muted); font-weight: 500; margin: 0; padding: 0; }
.gimada-calc .gc-val { font-weight: 700; font-size: 16px; color: var(--gc-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gimada-calc .gc-hint { font-size: 12px; color: var(--gc-muted); margin-top: 6px; }

.gimada-calc .gc-slider { display: flex; align-items: center; gap: 8px; }
.gimada-calc .gc-step {
	all: unset; box-sizing: border-box; cursor: pointer; flex: 0 0 auto;
	width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
	background: var(--gc-card-2); border: 1px solid var(--gc-line); color: var(--gc-text);
	font: 600 17px/1 var(--gc-font); transition: border-color .15s, background .15s;
}
.gimada-calc .gc-step:hover { border-color: var(--gc-accent); }
.gimada-calc .gc-step:active { background: var(--gc-accent); color: #111; }
.gimada-calc .gc-step:focus-visible { outline: 2px solid var(--gc-accent); outline-offset: 2px; }

.gimada-calc .gc-range {
	-webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0;
	height: 6px; border-radius: 6px; margin: 0; padding: 0; border: 0; cursor: pointer;
	background: linear-gradient(to right, var(--gc-accent) 0 var(--gc-p, 50%), var(--gc-line) var(--gc-p, 50%) 100%);
}
.gimada-calc .gc-range::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
	background: #fff; border: 3px solid var(--gc-accent); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.gimada-calc .gc-range::-moz-range-thumb {
	width: 16px; height: 16px; border-radius: 50%;
	background: #fff; border: 3px solid var(--gc-accent); box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.gimada-calc .gc-range:focus-visible { outline: 2px solid var(--gc-accent); outline-offset: 4px; }

.gimada-calc .gc-seg {
	display: flex; flex-wrap: wrap; gap: 4px; padding: 4px;
	background: var(--gc-card-2); border: 1px solid var(--gc-line); border-radius: 11px;
}
.gimada-calc .gc-seg-btn {
	all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 auto; text-align: center;
	padding: 7px 10px; border-radius: 8px; font: 500 13px/1.2 var(--gc-font); color: var(--gc-muted);
	transition: background .15s, color .15s;
}
.gimada-calc .gc-seg-btn:hover { color: var(--gc-text); }
.gimada-calc .gc-seg-btn.is-on { background: var(--gc-accent); color: #111; font-weight: 600; }
.gimada-calc .gc-seg-btn:focus-visible { outline: 2px solid var(--gc-accent); outline-offset: 1px; }

.gimada-calc .gc-select {
	width: 100%; padding: 10px 12px; margin: 0; border-radius: 10px; height: auto;
	background: var(--gc-card-2); color: var(--gc-text); border: 1px solid var(--gc-line);
	font: 500 14px/1.3 var(--gc-font);
}
.gimada-calc .gc-select:focus { outline: 2px solid var(--gc-accent); outline-offset: 1px; }

/* Risultati */
.gimada-calc .gc-results { display: flex; flex-wrap: wrap; gap: 12px; }
.gimada-calc .gc-results > .gc-tile { flex: 1 1 170px; }
.gimada-calc .gc-results > .gc-tile--main { flex-basis: 100%; }
.gimada-calc .gc-tile {
	background: var(--gc-card); border: 1px solid var(--gc-line); border-radius: var(--gc-radius);
	padding: 14px 16px; min-width: 0;
}
.gimada-calc .gc-tile-label { font-size: 12px; color: var(--gc-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.gimada-calc .gc-tile-val { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.gimada-calc .gc-tile-sub { font-size: 12.5px; color: var(--gc-muted); margin-top: 4px; }
.gimada-calc .gc-tile--main {
	background: linear-gradient(135deg, color-mix(in srgb, var(--gc-accent) 22%, var(--gc-card)), var(--gc-card) 70%);
	border-color: color-mix(in srgb, var(--gc-accent) 45%, var(--gc-line));
}
.gimada-calc .gc-tile--main .gc-tile-label { color: var(--gc-accent); }
.gimada-calc .gc-tile--main .gc-tile-val { font-size: clamp(32px, 5cqi, 48px); letter-spacing: -.02em; }

.gimada-calc .gc-alerts { display: flex; flex-direction: column; gap: 8px; }
.gimada-calc .gc-alerts:empty { display: none; }
.gimada-calc .gc-alert {
	display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px;
	padding: 10px 14px; border-radius: 11px;
	background: color-mix(in srgb, #e06a3a 14%, var(--gc-card)); border: 1px solid color-mix(in srgb, #e06a3a 40%, var(--gc-line));
}
.gimada-calc .gc-alert-ico {
	flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
	background: #e06a3a; color: #fff; font-weight: 700; font-size: 12px;
}

/* Visual */
.gimada-calc .gc-visual { display: flex; flex-direction: column; gap: 14px; }
.gimada-calc .gc-svgbox svg { display: block; width: 100%; height: auto; }
.gimada-calc svg { color: var(--gc-accent); overflow: visible; }
.gimada-calc .gc-svg-bg { fill: var(--gc-svg-bg); }
.gimada-calc .gc-svg-line { stroke: var(--gc-muted); stroke-width: 1.5; opacity: .5; }
.gimada-calc .gc-svg-axis { stroke: var(--gc-muted); stroke-width: 1.5; }
.gimada-calc .gc-svg-tick { fill: var(--gc-muted); font: 500 11.5px var(--gc-font); }
.gimada-calc .gc-svg-label { fill: var(--gc-text); font: 600 12.5px var(--gc-font); }
.gimada-calc .gc-svg-label.is-strong { fill: var(--gc-accent); }
.gimada-calc .gc-svg-inf { fill: var(--gc-muted); font: 600 18px var(--gc-font); }
.gimada-calc .gc-svg-marker { stroke: var(--gc-muted); stroke-width: 1.2; stroke-dasharray: 3 4; }
.gimada-calc .gc-svg-marker.is-strong { stroke: var(--gc-accent); stroke-dasharray: none; stroke-width: 1.6; }
.gimada-calc .gc-svg-arrow { stroke: var(--gc-accent); stroke-width: 2; }
.gimada-calc .gc-svg-ray { stroke: var(--gc-accent); stroke-width: 1.3; stroke-dasharray: 5 5; opacity: .7; }
.gimada-calc .gc-band { fill: color-mix(in srgb, var(--gc-accent) 30%, transparent); stroke: var(--gc-accent); stroke-width: 1.5; }
.gimada-calc .gc-band--muted { fill: color-mix(in srgb, var(--gc-muted) 18%, transparent); stroke: var(--gc-muted); stroke-dasharray: 4 3; }
.gimada-calc .gc-svg-band-label { fill: var(--gc-text); font: 600 12px var(--gc-font); }
.gimada-calc .gc-cam rect, .gimada-calc .gc-cam { fill: var(--gc-muted); }
.gimada-calc .gc-cam-lens { fill: var(--gc-card); stroke: var(--gc-text); stroke-width: 1.5; }
.gimada-calc .gc-flash-head { fill: #fff; }
.gimada-calc .gc-person { fill: var(--gc-text); }
.gimada-calc .gc-person--lit { fill: var(--gc-text); opacity: .9; }
.gimada-calc .gc-plane { fill: var(--gc-accent); stroke: var(--gc-accent); stroke-width: 1.5; }
.gimada-calc .gc-plane-grid { stroke: var(--gc-bg); stroke-width: 1; opacity: .7; }
.gimada-calc .gc-bulb { fill: #fff; }
.gimada-calc .gc-bulb-glow { fill: var(--gc-accent); opacity: .3; }
.gimada-calc .gc-ladder-sep { stroke: var(--gc-bg); stroke-width: 1.5; }
.gimada-calc .gc-mark { fill: var(--gc-muted); }
.gimada-calc .gc-mark-strong { fill: var(--gc-accent); }

.gimada-calc .gc-scene-box svg { border-radius: 10px; }
.gimada-calc .gc-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.gimada-calc .gc-legend li { display: block; color: var(--gc-muted); margin: 0; padding: 0 0 0 17px; position: relative; }
.gimada-calc .gc-legend li::before { display: none; }
.gimada-calc .gc-legend b { color: var(--gc-text); font-weight: 600; }
.gimada-calc .gc-dot { position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--gc-muted); }
.gimada-calc .is-sharp .gc-dot { background: #4cc38a; box-shadow: 0 0 0 3px color-mix(in srgb, #4cc38a 25%, transparent); }
.gimada-calc .is-blur .gc-dot { background: var(--gc-accent); }

/* Confronto esposizione */
.gimada-calc .gc-cmp-row { padding: 12px 0; border-top: 1px solid var(--gc-line); }
.gimada-calc .gc-cmp-row:first-of-type { border-top: 0; padding-top: 0; }
.gimada-calc .gc-cmp-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.gimada-calc .gc-cmp-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.gimada-calc .gc-cmp-arrow { color: var(--gc-accent); font-size: 22px; font-weight: 700; }
.gimada-calc .gc-cmp-fig, .gimada-calc .gc-burst-fig, .gimada-calc .gc-portrait { margin: 0; text-align: center; }
.gimada-calc .gc-cmp-fig > div:first-child { display: grid; place-items: center; min-height: 96px; }
.gimada-calc .gc-cmp-fig figcaption, .gimada-calc .gc-burst-fig figcaption, .gimada-calc .gc-portrait figcaption {
	font-size: 12.5px; color: var(--gc-muted); margin-top: 6px;
}
.gimada-calc .gc-cmp-fig figcaption span { color: var(--gc-text); font-weight: 700; }
.gimada-calc .gc-cmp-cap { font-size: 13px; color: var(--gc-muted); margin-top: 8px; }
.gimada-calc .gc-iris { width: 100%; max-width: 110px; height: auto; display: block; margin: 0 auto; }
.gimada-calc .gc-motion { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto; }
.gimada-calc .gc-noise {
	display: block; width: 100%; max-width: 220px; aspect-ratio: 3 / 2; height: auto; margin: 0 auto;
	border-radius: 8px; image-rendering: pixelated;
}

.gimada-calc .gc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gimada-calc .gc-chip {
	font-size: 13px; padding: 6px 11px; border-radius: 999px;
	background: var(--gc-card-2); border: 1px solid var(--gc-line); color: var(--gc-muted);
	font-variant-numeric: tabular-nums;
}
.gimada-calc .gc-chip b { color: var(--gc-text); font-weight: 600; }
.gimada-calc .gc-chip.is-on { border-color: var(--gc-accent); background: color-mix(in srgb, var(--gc-accent) 18%, var(--gc-card)); }

/* Barre */
.gimada-calc .gc-bars { display: grid; gap: 7px; }
.gimada-calc .gc-bar { display: grid; grid-template-columns: 52px 1fr 78px; gap: 10px; align-items: center; font-size: 13px; color: var(--gc-muted); font-variant-numeric: tabular-nums; }
.gimada-calc .gc-bar-track { height: 10px; border-radius: 6px; background: var(--gc-card-2); overflow: hidden; }
.gimada-calc .gc-bar-fill { display: block; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--gc-accent) 45%, var(--gc-line)); transition: width .3s ease; }
.gimada-calc .gc-bar-v { text-align: right; }
.gimada-calc .gc-bar.is-on { color: var(--gc-text); font-weight: 700; }
.gimada-calc .gc-bar.is-on .gc-bar-fill { background: var(--gc-accent); }

/* Inverso del quadrato */
.gimada-calc .gc-twin { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gimada-calc .gc-portrait svg { width: 100%; height: auto; display: block; }

/* Potenza */
.gimada-calc .gc-pair { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.gimada-calc .gc-burst-pair { display: flex; gap: 8px; align-items: center; }
.gimada-calc .gc-burst-pair > div { width: 96px; }
.gimada-calc .gc-burst, .gimada-calc .gc-burst-pair .gc-iris { width: 96px; height: auto; display: block; }

/* Come funziona */
.gimada-calc .gc-info {
	margin-top: 18px; background: var(--gc-card); border: 1px solid var(--gc-line);
	border-radius: var(--gc-radius); padding: 0 18px;
}
.gimada-calc .gc-info summary {
	cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14px; list-style: none;
	display: flex; align-items: center; gap: 8px;
}
.gimada-calc .gc-info summary::-webkit-details-marker { display: none; }
.gimada-calc .gc-info summary::before {
	content: "i"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
	border: 1.5px solid var(--gc-accent); color: var(--gc-accent); font-size: 12px; font-style: italic; font-weight: 700;
}
.gimada-calc .gc-info-body { padding-bottom: 14px; color: var(--gc-muted); font-size: 14px; }
.gimada-calc .gc-info-body p { margin: 0 0 10px; padding: 0; }
.gimada-calc .gc-info-body b { color: var(--gc-text); }
.gimada-calc .gc-info-body code {
	background: var(--gc-card-2); color: var(--gc-text); padding: 1px 6px; border-radius: 5px;
	font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.gimada-calc .gc-foot { margin-top: 20px; font-size: 12.5px; color: var(--gc-muted); text-align: center; }
.gimada-calc .gc-foot a { color: var(--gc-accent); text-decoration: none; font-weight: 600; }

@container (max-width: 520px) {
	.gimada-calc .gc-results > .gc-tile { flex-basis: 130px; }
	.gimada-calc .gc-svg-tick { font-size: 19px; }
	.gimada-calc .gc-svg-label, .gimada-calc .gc-svg-band-label { font-size: 20px; }
	.gimada-calc .gc-svg-inf { font-size: 30px; }
	.gimada-calc .gc-cmp-pair { gap: 6px; }
	.gimada-calc .gc-twin { grid-template-columns: 1fr; }
	.gimada-calc .gc-bar { grid-template-columns: 44px 1fr 66px; }
	.gimada-calc .gc-tile-val { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.gimada-calc .gc-panel { animation: none; }
	.gimada-calc .gc-bar-fill { transition: none; }
}
