/* Innkaupalistinn — the family shopping list on the fridge door.
   Paper-white ground, ruled list lines, and a yellow sticky note for adding items. */

/* Self-hosted webfonts, latin + latin-ext subsets (same setup as whoacommunity). */

@font-face {
	font-family: "Space Grotesk";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-500-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Space Grotesk";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-500-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Space Grotesk";
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-600-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Space Grotesk";
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-600-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Space Grotesk";
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-700-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Space Grotesk";
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/space-grotesk-700-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Inter";
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-400-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Inter";
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-400-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Inter";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-500-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Inter";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-500-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Inter";
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-600-normal-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: "Inter";
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: url("/nr/app/fonts/inter-600-normal-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--paper: #f6f5f1;
	--ink: #20241f;
	--ink-soft: #6d7268;
	--rule: #dcdad0;
	--green: #2f6b4f;
	--green-deep: #24543e;
	--rust: #a44a3f;
	--note: #f7e9b0;
	--note-edge: #e4d089;
	--display: "Space Grotesk", "Avenir Next", sans-serif;
	--body: "Inter", -apple-system, sans-serif;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1rem;
	line-height: 1.45;
}

.page {
	max-width: 40rem;
	margin: 0 auto;
	padding: 1.25rem 1.1rem 2.5rem;
}

/* ---------- Masthead ---------- */

.masthead {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.masthead-title {
	font-family: var(--display);
	font-weight: 700;
	font-size: clamp(1.7rem, 6vw, 2.4rem);
	letter-spacing: -0.02em;
	line-height: 1.05;
}

.user-chip {
	font-family: var(--display);
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--green);
	white-space: nowrap;
}

.back-link {
	color: var(--ink-soft);
	font-size: 0.95rem;
	text-decoration: none;
	white-space: nowrap;
}

.back-link:hover {
	color: var(--ink);
}

/* ---------- The sticky note (add form) ---------- */

.note {
	background: var(--note);
	border-bottom: 2px solid var(--note-edge);
	border-radius: 2px;
	box-shadow: 0 6px 14px rgba(60, 55, 30, 0.14);
	transform: rotate(-0.6deg);
	padding: 1.1rem 1.1rem 1.2rem;
	margin: 0 0.15rem 2rem;
}

.note form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.note-label {
	font-family: var(--display);
	font-weight: 600;
	font-size: 1.05rem;
}

.note-input {
	font-family: var(--body);
	font-size: 1.05rem;
	color: var(--ink);
	background: rgba(255, 255, 255, 0.55);
	border: none;
	border-bottom: 1.5px solid var(--note-edge);
	border-radius: 2px;
	padding: 0.7rem 0.75rem;
	width: 100%;
}

.note-input::placeholder {
	color: #9a8f63;
}

.note-input:focus {
	outline: 2px solid var(--green);
	outline-offset: 1px;
	background: rgba(255, 255, 255, 0.85);
}

.note-input-secondary {
	font-size: 0.95rem;
	padding-block: 0.55rem;
}

.btn-primary {
	display: inline-block;
	align-self: flex-end;
	font-family: var(--display);
	font-weight: 600;
	font-size: 1rem;
	color: #fff;
	background: var(--green);
	border: none;
	border-radius: 999px;
	padding: 0.65rem 1.5rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.btn-primary:hover {
	background: var(--green-deep);
}

.btn-primary:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

/* ---------- List sections ---------- */

.list-section {
	margin-bottom: 2rem;
}

.section-title {
	font-family: var(--display);
	font-weight: 600;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--ink-soft);
	border-bottom: 1.5px solid var(--rule);
	padding-bottom: 0.4rem;
}

.items {
	list-style: none;
}

.items > li {
	border-bottom: 1px solid var(--rule);
	padding: 0.65rem 0.1rem;
}

.item {
	display: flex;
	align-items: center;
	gap: 0.8rem;
}

.item-body {
	flex: 1;
	min-width: 0;
}

.item-name {
	font-weight: 500;
	font-size: 1.1rem;
	color: var(--ink);
	text-decoration: none;
	overflow-wrap: anywhere;
}

.item-name:hover {
	text-decoration: underline;
	text-decoration-color: var(--rule);
}

.meta {
	font-size: 0.8rem;
	color: var(--ink-soft);
	margin-top: 0.1rem;
}

.empty {
	color: var(--ink-soft);
	padding: 1rem 0.1rem;
}

/* The round "bought it" button */

.check {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 2px solid var(--green);
	border-radius: 50%;
	background: transparent;
	text-decoration: none;
	transition: background 0.15s ease;
}

.check .tick {
	font-size: 1.3rem;
	line-height: 1;
	color: var(--green);
	opacity: 0.25;
	transition: opacity 0.15s ease;
}

.check:hover .tick,
.check:focus-visible .tick {
	opacity: 1;
}

.check:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.check.checked {
	background: var(--green);
	border-color: var(--green);
}

.check.checked .tick {
	color: #fff;
	opacity: 1;
}

.check.checked:hover {
	background: var(--green-deep);
}

/* The small "reject" button */

.reject {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	color: var(--ink-soft);
	font-size: 1.5rem;
	line-height: 1;
	text-decoration: none;
}

.reject:hover,
.reject:focus-visible {
	color: var(--rust);
	background: rgba(164, 74, 63, 0.08);
}

/* Completed items */

.completed .item-name {
	color: var(--ink-soft);
	text-decoration: line-through;
	text-decoration-color: var(--green);
	text-decoration-thickness: 1.5px;
}

/* ---------- History page ---------- */

.history > li {
	padding: 0.75rem 0.1rem;
}

.history-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.item-text {
	font-size: 0.9rem;
	color: var(--ink-soft);
	margin-top: 0.15rem;
}

.state-badge {
	flex: none;
	font-family: var(--display);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 999px;
	padding: 0.15rem 0.65rem;
}

.state-active .state-badge {
	color: var(--ink);
	background: var(--note);
}

.state-completed .state-badge {
	color: #fff;
	background: var(--green);
}

.state-rejected .state-badge {
	color: #fff;
	background: var(--rust);
}

.state-rejected .item-name {
	color: var(--ink-soft);
	text-decoration: line-through;
	text-decoration-color: var(--rust);
}

/* ---------- Item detail page ---------- */

.detail-card {
	background: #fff;
	border: 1px solid var(--rule);
	border-radius: 6px;
	box-shadow: 0 3px 10px rgba(60, 55, 30, 0.06);
	padding: 1.2rem 1.2rem 1.3rem;
	margin-bottom: 2rem;
}

.detail-state {
	margin-bottom: 0.9rem;
}

.detail-text {
	font-size: 1.05rem;
	margin-bottom: 0.9rem;
}

.detail-meta {
	font-size: 0.9rem;
	color: var(--ink-soft);
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin-bottom: 1.3rem;
}

.detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.detail-actions .btn-primary,
.btn-danger {
	display: inline-block;
	font-family: var(--display);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	border-radius: 999px;
	padding: 0.65rem 1.5rem;
	cursor: pointer;
}

.detail-actions .btn-primary {
	align-self: auto;
	color: #fff;
	background: var(--green);
}

.detail-actions .btn-primary:hover {
	background: var(--green-deep);
}

.btn-danger {
	color: var(--rust);
	background: transparent;
	border: 2px solid var(--rust);
	padding-block: calc(0.65rem - 2px);
}

.btn-danger:hover,
.btn-danger:focus-visible {
	color: #fff;
	background: var(--rust);
}

.detail-devtools {
	border-top: 1.5px dashed var(--rule);
	margin-top: 1.3rem;
	padding-top: 1rem;
}

.btn-delete {
	font-size: 0.85rem;
	color: var(--ink-soft);
	text-decoration: underline;
	text-decoration-style: dotted;
}

.btn-delete:hover {
	color: var(--rust);
}

/* ---------- Login ---------- */

.login {
	max-width: 24rem;
	margin: 12vh auto 0;
	text-align: center;
}

.login .masthead-title {
	margin-bottom: 1.5rem;
}

.login-note {
	text-align: left;
	transform: rotate(0.7deg);
}

.error {
	color: var(--rust);
	font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.page-footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1.5px solid var(--rule);
	padding-top: 0.9rem;
	font-size: 0.9rem;
}

.page-footer a {
	color: var(--ink-soft);
}

.page-footer a:hover {
	color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
