/* =========================================================
   Ingila360 Smart Tools
   Matches the ingila360 theme: yellow #f9c80e, ink #16181d,
   cream #fdf7e3, radius 1rem/1.5rem, Inter + Hind Siliguri.
   ========================================================= */

.i360-tool,
.i360-tools-grid {
	--t-yellow: var(--i360-yellow, #f9c80e);
	--t-yellow-deep: var(--i360-yellow-deep, #edb007);
	--t-yellow-soft: var(--i360-yellow-soft, #fdf3cf);
	--t-cream: var(--i360-cream, #fdf7e3);
	--t-ink: var(--i360-ink, #16181d);
	--t-text: var(--i360-text, #1f252b);
	--t-muted: var(--i360-muted, #5c6873);
	--t-line: var(--i360-line, #e7e2d4);
	--t-white: #fff;
	--t-radius: var(--i360-radius, 1rem);
	--t-radius-lg: var(--i360-radius-lg, 1.5rem);
	--t-shadow: var(--i360-shadow, 0 10px 30px rgba(22, 24, 29, 0.08));
	--t-shadow-lg: var(--i360-shadow-lg, 0 24px 60px rgba(22, 24, 29, 0.14));
	--t-font: var(--i360-font, "Inter", "Hind Siliguri", system-ui, sans-serif);
	--t-font-display: var(--i360-font-display, "Inter", "Baloo Da 2", system-ui, sans-serif);
}

/* ---------- Calculator shell ---------- */

.i360-tool {
	margin: 1.75rem 0 2.5rem;
	font-family: var(--t-font);
	color: var(--t-text);
}

.i360-tool__form {
	background:
		radial-gradient(900px 340px at 88% -20%, var(--t-yellow-soft) 0%, transparent 60%),
		linear-gradient(180deg, var(--t-cream) 0%, #fffdf7 100%);
	border: 1px solid var(--t-line);
	border-radius: var(--t-radius-lg);
	/* Deliberately lighter than --t-shadow: at full width a heavy shadow reads
	   as a floating slab against the page. */
	box-shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 4px 12px rgba(22, 24, 29, 0.05);
	padding: clamp(1.1rem, 1rem + 1vw, 1.9rem);
}

.i360-tool__fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
	gap: 1rem 1.15rem;
}

/* Row-based fields span the full width */
.i360-tool__fields > .i360-rows {
	grid-column: 1 / -1;
}

/* ---------- Field ---------- */

.i360-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.i360-field__label {
	display: inline-flex;
	align-items: baseline;
	gap: 0.2rem;
	margin-bottom: 0.45rem;
	font-family: var(--t-font-display);
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--t-ink);
}

.i360-field__req {
	color: #e11d48;
	font-weight: 700;
}

.i360-field__control {
	position: relative;
	display: flex;
	align-items: center;
}

.i360-field__control > svg {
	position: absolute;
	right: 0.7rem;
	color: var(--t-muted);
	pointer-events: none;
}

.i360-input {
	width: 100%;
	font-family: var(--t-font);
	font-size: 0.97rem;
	font-weight: 500;
	color: var(--t-ink);
	background: var(--t-white);
	border: 1.5px solid var(--t-line);
	border-radius: 0.7rem;
	padding: 0.62rem 0.8rem;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.i360-input:hover {
	border-color: #d8d0bb;
}

.i360-input:focus {
	outline: none;
	border-color: var(--t-yellow-deep);
	box-shadow: 0 0 0 3px rgba(249, 200, 14, 0.25);
}

.i360-input[aria-invalid="true"] {
	border-color: #e11d48;
	box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

select.i360-input {
	padding-right: 2.2rem;
	cursor: pointer;
	background-image: none;
}

.i360-field__error {
	margin: 0.35rem 0 0;
	font-size: 0.78rem;
	font-weight: 600;
	color: #c0192f;
}

/* ---------- Repeatable rows ---------- */

.i360-rows {
	border: 1.5px dashed var(--t-line);
	border-radius: var(--t-radius);
	background: rgba(255, 255, 255, 0.65);
	padding: 0.85rem;
}

.i360-rows__head {
	display: grid;
	grid-template-columns: 1.6fr 0.8fr 0.9fr 2.1rem;
	gap: 0.6rem;
	padding: 0 0.15rem 0.5rem;
	border-bottom: 1px solid var(--t-line);
	margin-bottom: 0.6rem;
}

.i360-rows__th {
	font-family: var(--t-font-display);
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--t-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.i360-rows__body {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.i360-row {
	display: grid;
	grid-template-columns: 1.6fr 0.8fr 0.9fr 2.1rem;
	gap: 0.6rem;
	align-items: center;
}

.i360-row__cell {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.i360-row__label {
	display: none;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--t-muted);
	margin-bottom: 0.2rem;
}

.i360-row .i360-input {
	padding: 0.5rem 0.7rem;
	font-size: 0.9rem;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.i360-row__del {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	padding: 0;
	font-size: 1.15rem;
	line-height: 1;
	color: var(--t-muted);
	background: transparent;
	border: 1.5px solid var(--t-line);
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.i360-row__del:hover,
.i360-row__del:focus-visible {
	color: #e11d48;
	border-color: #e11d48;
	background: #fff1f3;
}

.i360-rows__add {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.75rem;
	padding: 0.4rem 0.95rem;
	font-family: var(--t-font-display);
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--t-ink);
	background: var(--t-yellow-soft);
	border: 1.5px solid transparent;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.12s ease;
}

.i360-rows__add:hover,
.i360-rows__add:focus-visible {
	background: var(--t-yellow);
}

.i360-rows__add:active {
	transform: translateY(1px);
}

/* ---------- Actions ---------- */

.i360-tool__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1.35rem;
	padding-top: 1.15rem;
	border-top: 1px solid var(--t-line);
}

.i360-tool__submit,
.i360-tool__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-family: var(--t-font-display);
	font-size: 0.94rem;
	font-weight: 800;
	line-height: 1;
	padding: 0.78rem 1.6rem;
	border-radius: 999px;
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.i360-tool__submit {
	color: var(--t-ink);
	background: var(--t-yellow);
	box-shadow: 0 6px 18px rgba(249, 200, 14, 0.35);
}

.i360-tool__submit:hover,
.i360-tool__submit:focus-visible {
	background: var(--t-yellow-deep);
}

.i360-tool__submit:active {
	transform: translateY(1px);
	box-shadow: 0 3px 10px rgba(249, 200, 14, 0.3);
}

.i360-tool__reset {
	color: var(--t-ink);
	background: var(--t-white);
	border-color: var(--t-ink);
}

.i360-tool__reset:hover,
.i360-tool__reset:focus-visible {
	background: var(--t-ink);
	color: var(--t-white);
}

/* ---------- Output ---------- */

.i360-tool__output {
	margin-top: 1.15rem;
	animation: i360-tool-in 0.25s ease both;
}

@keyframes i360-tool-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.i360-tool__output[hidden] {
	display: none;
}

.i360-result {
	background: var(--t-ink);
	color: #fff;
	border-radius: var(--t-radius-lg);
	padding: clamp(1rem, 0.9rem + 0.9vw, 1.6rem);
	box-shadow: var(--t-shadow-lg);
}

.i360-result__hero {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-bottom: 0.85rem;
	margin-bottom: 0.9rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.i360-result__label {
	font-family: var(--t-font-display);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--t-yellow);
}

.i360-result__value {
	font-family: var(--t-font-display);
	font-size: clamp(1.65rem, 1.3rem + 1.6vw, 2.4rem);
	font-weight: 800;
	line-height: 1.15;
	color: #fff;
	margin: 0;
	word-break: break-word;
}

.i360-result__unit {
	font-size: 0.95rem;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.65);
}

.i360-result__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
	gap: 0.65rem;
}

.i360-result__item {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 0.8rem;
	padding: 0.7rem 0.85rem;
}

.i360-result__item-label {
	display: block;
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.62);
	margin-bottom: 0.22rem;
}

.i360-result__item-value {
	display: block;
	font-family: var(--t-font-display);
	font-size: 1.06rem;
	font-weight: 800;
	color: #fff;
	word-break: break-word;
}

.i360-result__note {
	margin: 0.9rem 0 0;
	font-size: 0.78rem;
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.55);
}

.i360-result__bar {
	margin-top: 0.9rem;
}

.i360-result__bar-track {
	height: 0.55rem;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	overflow: hidden;
}

.i360-result__bar-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--t-yellow), #ffdd66);
	transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.i360-result__errors {
	margin: 0;
	padding-left: 1.1rem;
	font-size: 0.88rem;
	color: #ffd7dc;
}

/* ---------- Tool grid / cards ---------- */

.i360-tools__heading {
	font-family: var(--t-font-display);
	font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
	font-weight: 800;
	color: var(--t-ink);
	margin: 0 0 1rem;
}

.i360-tools-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
	gap: 0.9rem;
	margin: 1.5rem 0 2.5rem;
	font-family: var(--t-font);
	/* Equal card heights across a row — mixed heights look unpolished. */
	align-items: stretch;
}

.i360-tools-grid[data-columns="2"] { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.i360-tools-grid[data-columns="4"] { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }

.i360-tool-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	padding: 1rem 1.05rem;
	height: 100%;
	background: var(--t-white);
	border: 1.5px solid var(--t-line);
	border-radius: var(--t-radius);
	text-decoration: none;
	color: var(--t-text);
	box-sizing: border-box;
	transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.i360-tool-card:hover,
.i360-tool-card:focus-visible {
	border-color: var(--t-yellow);
	box-shadow: 0 12px 28px rgba(22, 24, 29, 0.1);
	transform: translateY(-2px);
	outline: none;
}

.i360-tool-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 2.6rem;
	height: 2.6rem;
	color: var(--t-ink);
	background: var(--t-yellow);
	border-radius: 50%;
}

.i360-tool-card__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.i360-tool-card__title {
	font-family: var(--t-font-display);
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1.35;
	color: var(--t-ink);
	margin-bottom: 0.15rem;
}

.i360-tool-card__desc {
	font-size: 0.79rem;
	line-height: 1.5;
	color: var(--t-muted);
}

.i360-tool-card__arrow {
	position: absolute;
	right: 0.9rem;
	bottom: 0.8rem;
	font-size: 0.95rem;
	color: var(--t-muted);
	opacity: 0;
	transform: translateX(-4px);
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.i360-tool-card:hover .i360-tool-card__arrow,
.i360-tool-card:focus-visible .i360-tool-card__arrow {
	opacity: 1;
	transform: translateX(0);
}

.i360-tools__notice {
	padding: 0.9rem 1.1rem;
	background: var(--t-yellow-soft, #fdf3cf);
	border-left: 4px solid #e11d48;
	border-radius: 0.5rem;
	font-size: 0.9rem;
}

/* ---------- Page-level tweaks so tools breathe on a WP page ---------- */

/* The calculator card fills the content column — a capped card left visible
   empty gutters on wide screens and made the form look detached from its
   own article below it. */
.i360-page .i360-tool {
	max-width: none;
	margin-inline: 0;
}

.i360-page .i360-tools-grid {
	max-width: 62rem;
	margin-inline: auto;
}

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

@media (max-width: 640px) {
	.i360-rows__head {
		display: none;
	}

	.i360-row {
		grid-template-columns: 1fr 1fr 2.1rem;
		grid-template-areas:
			"label label del"
			"credits grade grade";
		gap: 0.45rem;
		padding-bottom: 0.7rem;
		border-bottom: 1px solid var(--t-line);
	}

	.i360-row:last-child {
		border-bottom: 0;
		padding-bottom: 0;
	}

	.i360-row__cell--label { grid-area: label; }
	.i360-row__cell--credits { grid-area: credits; }
	.i360-row__cell--grade { grid-area: grade; }
	.i360-row__del { grid-area: del; justify-self: end; align-self: start; }

	.i360-row__label {
		display: block;
	}

	.i360-tool__actions {
		flex-direction: column;
	}

	.i360-tool__submit,
	.i360-tool__reset {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.i360-tool__output,
	.i360-result__bar-fill {
		animation: none;
		transition: none;
	}

	.i360-tool-card:hover,
	.i360-tool-card:focus-visible {
		transform: none;
	}
}

/* ---------- Content tables inside tool articles ---------- */
.i360-tool-article table,
.entry-content .i360-tool-article table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.4rem 0 1.8rem;
	font-size: 0.95rem;
	background: #fff;
	border: 1px solid var(--t-line, #e7e2d4);
	border-radius: 0.75rem;
	overflow: hidden;
}

.i360-tool-article thead th {
	background: var(--t-yellow-soft, #fdf3cf);
	color: var(--t-ink, #16181d);
	font-weight: 700;
	text-align: left;
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid var(--t-line, #e7e2d4);
}

.i360-tool-article td {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--t-line, #e7e2d4);
	color: var(--t-text, #1f252b);
	vertical-align: top;
}

.i360-tool-article tbody tr:last-child td {
	border-bottom: 0;
}

.i360-tool-article tbody tr:nth-child(even) {
	background: #fdfcf7;
}

@media (max-width: 640px) {
	.i360-tool-article table {
		display: block;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		font-size: 0.88rem;
		white-space: normal;
	}
	.i360-tool-article thead th,
	.i360-tool-article td {
		padding: 0.55rem 0.6rem;
		white-space: nowrap;
	}
}

/* ---------------------------------------------------------------
 * Related tools block (end of every tool page)
 * ------------------------------------------------------------ */
.i360-related {
  margin: 2.5rem 0 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--i360-line, #e7e2d4);
}

.i360-related__head {
  margin: 0 0 1.25rem;
}

.i360-related__eyebrow {
  margin: 0 0 .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--i360-yellow-deep, #edb007);
}

.i360-related__title {
  margin: 0 0 .4rem;
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--i360-ink, #16181d);
}

.i360-related__sub {
  margin: 0;
  font-size: .92rem;
  color: var(--i360-muted, #5c6873);
}

.i360-related__all {
  color: var(--i360-ink, #16181d);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--i360-yellow, #f9c80e);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.i360-related__all:hover,
.i360-related__all:focus-visible {
  color: var(--i360-yellow-deep, #edb007);
}

.i360-related .i360-tools-grid {
  margin: 0;
  /* Narrower than the hub grid: fit 3 per row here so 5 cards don't
     leave a lonely orphan in the last row. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 780px) {
  .i360-related .i360-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .i360-related .i360-tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .i360-related {
    margin-top: 2rem;
    padding-top: 1.35rem;
  }

  .i360-related__title {
    font-size: 1.15rem;
  }
}
