/*
Theme Name: Tidypot
Text Domain: tidypot
Description: Block theme for tidypot.com, the weekly budget for UK families and couples. Colours, type and spacing come from the Tidypot design system through theme.json; every section is a block pattern.
Version: 1.0.4
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
WPVibe: yes
Update URI: false
*/

/* Component styles for the Tidypot patterns. Colours and type sizes come
   from theme.json presets, so they stay in step with the design system. */

:root {
	--tp-radius-sm: 8px;
	--tp-radius-md: 14px;
	--tp-radius-lg: 22px;
	--tp-section: clamp(3.5rem, 7vw, 6rem);
}

body { -webkit-font-smoothing: antialiased; }
.has-tabular-nums, .tp-money { font-variant-numeric: tabular-nums; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--teal);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Header */
.tp-header {
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: 0.9rem;
}
.tp-header__inner { gap: 1rem 2rem; }
.tp-logo { margin: 0; }
.tp-logo img { height: 30px; width: auto; display: block; }
.tp-header .wp-block-navigation { flex: 1 1 auto; gap: 0.5rem 1.75rem; }
.tp-header .wp-block-navigation a { text-decoration: none; color: var(--wp--preset--color--ink); }
.tp-header .wp-block-navigation a:hover { color: var(--wp--preset--color--teal-strong); }
.tp-header__actions { gap: 1.25rem; align-items: center; }
.tp-signin { margin: 0; font-weight: 600; }
.tp-signin a { color: var(--wp--preset--color--ink); text-decoration: none; }

/* Sections (block styles on Group) */
.is-style-tp-section,
.is-style-tp-section-white,
.is-style-tp-section-navy,
.is-style-tp-section-deep {
	padding-top: var(--tp-section);
	padding-bottom: var(--tp-section);
}
.is-style-tp-section-white {
	background: var(--wp--preset--color--white);
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.is-style-tp-section-navy { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }
.is-style-tp-section-deep { background: var(--wp--preset--color--deep); color: var(--wp--preset--color--mist); }
.is-style-tp-section-navy :where(h1, h2, h3, h4),
.is-style-tp-section-deep :where(h1, h2, h3, h4),
.is-style-tp-panel-navy :where(h1, h2, h3, h4) { color: var(--wp--preset--color--white); }
.is-style-tp-section-navy .tp-lead,
.is-style-tp-panel-navy .tp-lead,
.is-style-tp-panel-navy .tp-muted { color: var(--wp--preset--color--mist); }
.is-style-tp-section-navy a:not(.wp-element-button),
.is-style-tp-section-deep a:not(.wp-element-button),
.is-style-tp-panel-navy a:not(.wp-element-button) { color: var(--wp--preset--color--white); }

/* Cards and panels (block styles on Group) */
.is-style-tp-card,
.is-style-tp-card-surface,
.is-style-tp-panel-navy,
.is-style-tp-panel-tint,
.is-style-tp-panel-navy-light {
	border-radius: var(--tp-radius-lg);
	padding: clamp(1.5rem, 3vw, 2rem);
}
.is-style-tp-card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--border); }
.is-style-tp-card-surface { background: var(--wp--preset--color--surface); }
.is-style-tp-panel-navy { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }
.is-style-tp-panel-navy-light { background: var(--wp--preset--color--navy-light); color: #E3EBF0; }
.is-style-tp-panel-navy-light :where(h1, h2, h3, h4) { color: var(--wp--preset--color--white); }
.is-style-tp-panel-tint { background: var(--wp--preset--color--teal-tint); }
:where(.is-style-tp-card, .is-style-tp-card-surface, .is-style-tp-panel-navy, .is-style-tp-panel-tint, .is-style-tp-panel-navy-light) > :first-child { margin-top: 0; }
:where(.is-style-tp-card, .is-style-tp-card-surface, .is-style-tp-panel-navy, .is-style-tp-panel-tint, .is-style-tp-panel-navy-light) > :last-child { margin-bottom: 0; }

/* Text helpers */
.tp-eyebrow, .tp-label {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--teal-strong);
	margin-bottom: 0.75rem;
}
.tp-label a { color: inherit; text-decoration: none; }
.is-style-tp-section-navy .tp-eyebrow, .is-style-tp-panel-navy .tp-eyebrow, .is-style-tp-panel-navy .tp-label { color: var(--wp--preset--color--teal-light); }
.tp-lead { font-size: var(--wp--preset--font-size--large); line-height: 1.5; color: var(--wp--preset--color--muted); max-width: 40rem; }
.tp-muted { color: var(--wp--preset--color--muted); }
.tp-small { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.tp-strong { font-weight: 600; }
.tp-centre { text-align: center; margin-left: auto; margin-right: auto; }
.has-text-align-center.tp-lead { margin-left: auto; margin-right: auto; }
.tp-big-money { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0.25rem 0; }

/* Buttons */
.wp-block-button .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; }
.wp-block-button.is-style-outline > .wp-block-button__link { border: 1px solid var(--wp--preset--color--navy); color: var(--wp--preset--color--navy); background: transparent; }
.wp-block-button.is-style-tp-teal > .wp-block-button__link { background: var(--wp--preset--color--teal); color: var(--wp--preset--color--navy); }
.wp-block-button.is-style-tp-teal > .wp-block-button__link:hover { background: var(--wp--preset--color--teal-light); }

/* Hero */
.tp-hero { padding-top: clamp(3rem, 6vw, 4.5rem); padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.tp-hero h1 { max-width: 40rem; margin-top: 0; }
.tp-hero .wp-block-columns { gap: clamp(2rem, 5vw, 3.5rem); }

/* Phone mockup */
.tp-phone {
	width: 340px;
	max-width: 100%;
	margin-inline: auto;
	background: var(--wp--preset--color--surface);
	border: 10px solid var(--wp--preset--color--navy);
	border-radius: 48px;
	padding: 22px 16px 0;
	box-shadow: 0 30px 60px rgba(19, 45, 64, 0.18);
	overflow: hidden;
	box-sizing: border-box;
	font-size: 14px;
	line-height: 1.4;
}
.tp-phone p { margin: 0; }
.tp-phone__top { justify-content: space-between; margin-bottom: 14px; }
.tp-phone__top p { font-size: 22px; font-weight: 800; }
.tp-phone__top img { width: 28px; height: 28px; }
.tp-phone .tp-mini-label { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--wp--preset--color--muted); text-transform: uppercase; }
.tp-phone .tp-phone__amount { font-size: 44px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.tp-phone .tp-phone__card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--border); border-radius: var(--tp-radius-lg); padding: 18px; }
.tp-phone .tp-phone__list { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--border); border-radius: var(--tp-radius-lg); padding: 0 14px; margin-top: 8px; }
.tp-phone .tp-phone__tabs { margin: 16px -16px 0; padding: 12px 16px 16px; background: var(--wp--preset--color--white); border-top: 1px solid var(--wp--preset--color--border); justify-content: space-around; font-size: 11px; font-weight: 600; color: var(--wp--preset--color--muted); }
.tp-phone .tp-phone__tabs p:first-child { color: var(--wp--preset--color--teal-strong); }
.tp-phone .tp-mini-label + .tp-phone__list { margin-top: 8px; }
.tp-phone > .tp-mini-label { margin: 18px 4px 0; }

/* Rows used in mock UI and breakdowns */
.tp-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--wp--preset--color--border); margin: 0 !important; }
.tp-row:last-child { border-bottom: 0; }
.tp-row p { margin: 0; }
.tp-row .tp-row__amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-row .tp-row__sub { font-size: 0.875rem; color: var(--wp--preset--color--muted); }
.tp-row .tp-row__sub.is-alert { color: var(--wp--preset--color--alert); font-weight: 600; }
.tp-row .tp-row__amount.is-positive { color: var(--wp--preset--color--teal-strong); }
.tp-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.1rem !important; padding: 1.1rem 1.25rem; background: var(--wp--preset--color--teal-tint); border-radius: var(--tp-radius-md); }
.tp-total p { margin: 0; font-weight: 700; }
.tp-total .tp-total__amount { font-size: 2.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tp-phone .tp-row { padding: 12px 0; }

/* Avatars */
.tp-avatar { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }
.tp-avatar.is-teal { background: var(--wp--preset--color--teal-tint); color: var(--wp--preset--color--teal-strong); }
.tp-person { display: flex; align-items: center; gap: 0.75rem; }
.tp-person p { margin: 0; }

/* Progress bars for pots */
.tp-pot { margin: 0 0 1.4rem !important; }
.tp-pot:last-child { margin-bottom: 0 !important; }
.tp-pot__head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; margin: 0 0 0.5rem !important; }
.tp-pot__head span:last-child { font-variant-numeric: tabular-nums; }
.tp-bar { height: 10px; background: var(--wp--preset--color--teal-tint); border-radius: 999px; overflow: hidden; margin: 0 !important; }
.tp-bar > span { display: block; height: 100%; background: var(--wp--preset--color--teal); border-radius: 999px; }
.tp-pot .tp-small { margin-top: 0.4rem; }

/* Chips */
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.25rem !important; }
.tp-chips span { padding: 8px 14px; border-radius: 999px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); font-size: 14px; font-weight: 600; }
.tp-chips span.is-on { background: var(--wp--preset--color--navy); border-color: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }

/* Check lists */
.tp-check { list-style: none; padding-left: 0; }
.tp-check li { position: relative; padding-left: 2rem; margin-bottom: 0.75rem; }
.tp-check li::before {
	content: "";
	position: absolute; left: 0; top: 0.2rem;
	width: 1.25rem; height: 1.25rem;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230F7F77' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.is-style-tp-panel-navy .tp-check li::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2321AFA5' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.tp-check li.is-open::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23DCE3E8' stroke-width='2'/%3E%3C/svg%3E");
}

/* Numbered steps */
.tp-step-num { width: 40px; height: 40px; border-radius: 999px; background: var(--wp--preset--color--teal-tint); color: var(--wp--preset--color--teal-strong); font-weight: 800; display: inline-flex !important; align-items: center; justify-content: center; margin-bottom: 0.5rem !important; }

/* Feature rows */
.tp-feature { gap: clamp(2rem, 5vw, 3.5rem); margin-bottom: clamp(3.5rem, 7vw, 6rem) !important; }
.tp-feature:last-child { margin-bottom: 0 !important; }
.tp-feature h2 { font-size: clamp(1.625rem, 3vw, 2rem); }

/* Tool and guide cards */
.tp-link-card { display: flex; flex-direction: column; gap: 0.6rem; height: 100%; box-sizing: border-box; }
.tp-link-card h3 { margin: 0; }
.tp-link-card h3 a { color: inherit; text-decoration: none; }
.tp-link-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tp-link-card { position: relative; }
.tp-link-card:hover { box-shadow: 0 8px 24px rgba(19, 45, 64, 0.08); }
.tp-guide-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--tp-radius-lg);
	padding: 1.75rem;
	height: 100%;
	box-sizing: border-box;
	gap: 0.6rem;
	position: relative;
}
.tp-guide-card:hover { box-shadow: 0 8px 24px rgba(19, 45, 64, 0.08); }
.tp-guide-card .wp-block-post-title { font-size: 1.3rem; line-height: 1.35; font-weight: 700; letter-spacing: -0.005em; margin: 0; }
.tp-guide-card .wp-block-post-title a { color: inherit; text-decoration: none; }
.tp-guide-card .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.tp-guide-card .wp-block-post-terms { position: relative; z-index: 1; }
.tp-guide-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: 1rem; margin: 0; }
.tp-guide-card .wp-block-post-excerpt__more-text { display: none; }

/* FAQ */
.wp-block-details summary { font-size: 1.15rem; font-weight: 700; cursor: pointer; list-style-position: outside; }
.wp-block-details > :not(summary) { color: var(--wp--preset--color--muted); margin-top: 0.75rem; }

/* Pricing */
.tp-price { font-size: 3rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.tp-price small { font-size: 1.1rem; font-weight: 600; color: var(--wp--preset--color--muted); }
.is-style-tp-panel-navy .tp-price small { color: var(--wp--preset--color--mist); }
.tp-badge { display: inline-block; background: var(--wp--preset--color--teal); color: var(--wp--preset--color--navy); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; padding: 6px 12px; border-radius: 999px; }
.tp-plans { align-items: stretch !important; }
.tp-plans > .wp-block-column > .wp-block-group { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
.tp-plans .wp-block-buttons { margin-top: auto; }
.tp-plans .wp-block-button, .tp-plans .wp-block-button__link { width: 100%; justify-content: center; }

/* Article */
.tp-article-meta { gap: 0.5rem 1.5rem; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.tp-article-meta > * { margin: 0; }
.single .wp-block-post-content { font-size: 1.125rem; line-height: 1.7; }
.single .wp-block-post-content h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); margin-top: 2.5rem; }
.wp-block-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.wp-block-table th, .wp-block-table td { border: 0; border-bottom: 1px solid var(--wp--preset--color--border); padding: 0.75rem 0.5rem; text-align: left; }
.wp-block-table thead th { font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.wp-block-table.is-style-tp-table-card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--border); border-radius: var(--tp-radius-lg); padding: 0.5rem 1.5rem; overflow-x: auto; }
.tp-disclaimer { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }

/* Footer */
.tp-footer { background: var(--wp--preset--color--deep); color: var(--wp--preset--color--mist); padding-top: 4.5rem; padding-bottom: 2.5rem; font-size: 0.95rem; }
.tp-footer a { color: var(--wp--preset--color--mist); text-decoration: none; }
.tp-footer a:hover { color: var(--wp--preset--color--white); text-decoration: underline; }
.tp-footer .tp-logo img { height: 28px; }
.tp-footer h4 { color: var(--wp--preset--color--white); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.75rem; }
.tp-footer ul { list-style: none; padding: 0; margin: 0; }
.tp-footer li { margin-bottom: 0.6rem; }
.tp-footer__legal { border-top: 1px solid #2A4A60; padding-top: 1.5rem; margin-top: 3rem !important; font-size: 0.8125rem; color: #A9B8C2; }

/* Forms (waitlist block) */
.tp-waitlist { display: flex; flex-wrap: wrap; gap: 12px; max-width: 34rem; align-items: flex-end; }
.tp-waitlist label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 15rem; font-size: 0.875rem; font-weight: 600; }
.tp-waitlist input[type="email"] {
	font: inherit; font-size: 1rem; font-weight: 400;
	padding: 0.85rem 1rem; min-height: 52px; box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--border); border-radius: var(--tp-radius-md);
	background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink);
}
.tp-waitlist button {
	font: inherit; font-weight: 700; font-size: 1rem;
	background: var(--wp--preset--color--navy); color: var(--wp--preset--color--white);
	border: 0; border-radius: var(--tp-radius-md); padding: 0 1.5rem; min-height: 52px; cursor: pointer;
}
.tp-waitlist button:hover { background: var(--wp--preset--color--navy-light); }
.tp-waitlist.is-on-dark input[type="email"] { border-color: transparent; }
.tp-waitlist.is-on-dark button { background: var(--wp--preset--color--teal); color: var(--wp--preset--color--navy); }
.tp-waitlist__note { flex-basis: 100%; margin: 0; font-size: 0.875rem; }
.tp-waitlist__note[hidden] { display: none; }
.is-centred .tp-waitlist { margin-inline: auto; justify-content: center; text-align: left; }

/* Christmas calculator block */
.tp-calc { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: stretch; }
.tp-calc__inputs { flex: 1 1 30rem; min-width: 0; }
.tp-calc__result { flex: 1 1 22rem; min-width: 0; display: flex; flex-direction: column; }
.tp-calc__field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; font-size: 1.05rem; font-weight: 600; margin-bottom: 0.9rem; }
.tp-calc__money { display: flex; align-items: center; width: 11rem; border: 1px solid var(--wp--preset--color--border); border-radius: var(--tp-radius-sm); background: var(--wp--preset--color--surface); padding: 0 0.75rem; box-sizing: border-box; }
.tp-calc__money span { color: var(--wp--preset--color--muted); }
.tp-calc__money input { font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; border: 0; background: transparent; color: var(--wp--preset--color--ink); padding: 0.7rem 0.5rem; width: 100%; min-height: 46px; text-align: right; }
.tp-calc__total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 0.9rem; border-top: 1px solid var(--wp--preset--color--border); margin-bottom: 0.9rem; font-variant-numeric: tabular-nums; }
.tp-calc__result .tp-row { border-color: #2A4A60; }
.tp-calc__later { background: var(--wp--preset--color--navy-light); border-radius: var(--tp-radius-md); padding: 0.9rem 1rem; font-size: 0.95rem; color: #E3EBF0; margin: 1rem 0 1.5rem; }
.tp-calc__result .wp-block-button__link, .tp-calc__cta { margin-top: auto; text-align: center; justify-content: center; background: var(--wp--preset--color--teal); color: var(--wp--preset--color--navy); font-weight: 700; text-decoration: none; padding: 0.9rem 1.25rem; border-radius: var(--tp-radius-md); display: flex; align-items: center; min-height: 52px; }

/* Flex helpers used inside flow-layout groups */
.tp-row > *, .tp-total > *, .tp-person > *, .tp-phone__top > *, .tp-pot__head > * { margin-block: 0 !important; }
.tp-person .tp-row__sub { font-size: 0.875rem; color: var(--wp--preset--color--muted); }
.tp-grow { flex: 1 1 auto; }
.tp-note { background: var(--wp--preset--color--surface); border-radius: var(--tp-radius-md); padding: 1rem; font-size: 0.95rem; }

/* Category chips (Categories block with the tp-cat-chips class) */
.tp-cat-chips { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: flex; flex-wrap: wrap; gap: 10px; }
.tp-cat-chips li { margin: 0; }
.tp-cat-chips a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 0 16px; border-radius: 999px; border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.tp-cat-chips a:hover, .tp-cat-chips .current-cat a { background: var(--wp--preset--color--navy); border-color: var(--wp--preset--color--navy); color: var(--wp--preset--color--white); }

/* Author box on guides */
.wp-block-post-author { margin-top: 1.5rem; }
.wp-block-post-author__avatar img { border-radius: 999px; }
.wp-block-post-author__byline { font-size: 0.8rem; color: var(--wp--preset--color--muted); }
.wp-block-post-author__name { font-weight: 700; }
.wp-block-post-author__bio { color: var(--wp--preset--color--muted); font-size: 0.95rem; }

/* Mobile */
@media (max-width: 781px) {
	.tp-header .wp-block-navigation { flex: 0 0 auto; order: 3; }
	.tp-hero .tp-phone { margin-top: 1rem; }
	.tp-total .tp-total__amount { font-size: 1.75rem; }
}
