/*
 * Peseschkian theme – styles that theme.json cannot express.
 * Colours and fonts always come from theme.json presets (var(--wp--preset--…)).
 */

:root {
	--ppf-radius-s: 0.75rem;
	--ppf-radius-m: 1.5rem;
	--ppf-radius-l: 2rem;
	--ppf-shadow-card: 0 30px 60px -30px rgba(15, 31, 58, 0.45);
	--ppf-ink: var(--wp--preset--color--ink);
	--ppf-crimson: var(--wp--preset--color--crimson);
	scroll-padding-top: 96px;
	-webkit-tap-highlight-color: rgba(193, 0, 54, 0.12);
}
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
a, button, input, select, textarea, label { touch-action: manipulation; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--wp--preset--color--crimson); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--wp--preset--color--rose); color: var(--wp--preset--color--ink); }
img { height: auto; }

/* ---------- Top bar and header ---------- */
.ppf-topbar { font-size: 0.8125rem; }
.ppf-topbar a { color: inherit; text-decoration: none; opacity: 0.75; }
.ppf-topbar a:hover { opacity: 1; }
.ppf-topbar .ppf-contact { opacity: 0.85; }
.ppf-topbar__links { display: flex; gap: 1.25rem; margin: 0; }
@media (max-width: 781px) { .ppf-topbar { display: none; } }

header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 0); }
.ppf-header {
	background: rgba(255, 255, 255, 0.88);
	-webkit-backdrop-filter: saturate(1.5) blur(16px);
	backdrop-filter: saturate(1.5) blur(16px);
	border-bottom: 1px solid transparent;
	transition: box-shadow 0.25s, border-color 0.25s, padding 0.25s;
}
.is-scrolled .ppf-header { border-bottom-color: var(--wp--preset--color--line); box-shadow: 0 10px 30px -22px rgba(15, 31, 58, 0.55); }
.ppf-header .wp-block-site-logo img { transition: width 0.25s; }
.is-scrolled .ppf-header { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }

/* Main menu */
.ppf-header .wp-block-navigation .wp-block-navigation-item__content { padding: 0.6rem 0.9rem; border-radius: 999px; transition: background-color 0.2s, color 0.2s; }
.ppf-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.ppf-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { background: var(--wp--preset--color--mist); color: var(--wp--preset--color--crimson); }
.ppf-header .wp-block-navigation .wp-block-navigation__submenu-container {
	min-width: 260px !important; padding: 0.5rem !important; border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 1.25rem; background: #fff !important; box-shadow: 0 30px 70px -30px rgba(15, 31, 58, 0.5);
}
.ppf-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.65rem 0.9rem; border-radius: 0.9rem; font-weight: 600; color: var(--wp--preset--color--ink); }
.ppf-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--ink) !important; color: #fff !important; padding: 1.5rem max(20px, env(safe-area-inset-left, 0px)) !important; }
.ppf-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #fff !important; font-family: var(--wp--preset--font-family--display); font-size: 1.5rem; font-weight: 600; padding: 0.5rem 0; background: none !important; }
.ppf-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { background: transparent !important; border: 0 !important; box-shadow: none; padding: 0 0 0.5rem 1rem !important; }
.ppf-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--body); font-size: 1.05rem; color: rgba(255, 255, 255, 0.8) !important; }
.ppf-header .wp-block-navigation__responsive-container-open { width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 999px; background: var(--wp--preset--color--mist); }
.ppf-header .wp-block-search__button { border-radius: 999px; }
.ppf-header .wp-block-search.wp-block-search__button-only .wp-block-search__button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: #fff; color: var(--wp--preset--color--ink-2); box-shadow: inset 0 0 0 1px var(--wp--preset--color--line); }
.ppf-header .wp-block-search.wp-block-search__button-only .wp-block-search__button:hover { color: var(--wp--preset--color--crimson); box-shadow: inset 0 0 0 1px var(--wp--preset--color--crimson); }
.ppf-header .wp-block-search__input { border-radius: 999px; border-color: var(--wp--preset--color--line); }
.ppf-header .wp-block-button__link { box-shadow: 0 10px 24px -12px rgba(193, 0, 54, 0.7); }
@media (max-width: 599px) { .ppf-header .ppf-header__search { display: none; } }

/* Text on dark or coloured backgrounds: headings follow the text colour, not the default navy. */
:is(.has-ink-background-color, .has-ink-soft-background-color, .has-crimson-background-color, .wp-block-cover, .is-style-band, .is-style-card-dark) :is(h1, h2, h3, h4, h5, h6) { color: #fff; }
:where(.has-ink-background-color, .has-ink-soft-background-color, .has-crimson-background-color, .wp-block-cover, .is-style-card-dark) { color: #fff; }
:where(.has-ink-background-color, .has-ink-soft-background-color, .is-style-card-dark) p:where(:not(.is-style-kicker):not(.is-style-pill)) { color: rgba(255, 255, 255, 0.82); }
.is-style-kicker a { color: inherit; text-decoration: none; }
.ppf-fact-number { margin: 0; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem); line-height: 1; color: var(--wp--preset--color--crimson); font-variant-numeric: tabular-nums; }
:where(.has-ink-background-color, .is-style-card-dark, .has-ink-soft-background-color) .ppf-fact-number { color: #fff; }
.ppf-fact-label { margin: 0.5rem 0 0; font-size: 0.95rem; line-height: 1.45; }
.wp-block-quote cite { display: block; margin-top: 1rem; font-family: var(--wp--preset--font-family--body); font-size: 0.9375rem; font-style: normal; color: var(--wp--preset--color--ink-3); }
.wp-block-quote cite a { color: var(--wp--preset--color--crimson); }
.ppf-cta :where(h2) { color: #fff; }
.wp-block-cover .ppf-next .ppf-next__title, .has-ink-background-color .ppf-next .ppf-next__title { color: var(--wp--preset--color--ink); }
.ppf-footer p a + a { margin-left: 1.25rem; }

/* ---------- Block styles ---------- */
.is-style-kicker {
	display: flex; align-items: center; gap: 0.6rem;
	font-size: 0.8125rem !important; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
	color: var(--wp--preset--color--crimson);
}
.is-style-kicker::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; flex-shrink: 0; }
.has-ink-background-color .is-style-kicker, .is-style-band .is-style-kicker, .is-style-card-dark .is-style-kicker, .wp-block-cover .is-style-kicker { color: var(--wp--preset--color--glow); }
.is-style-lead { font-size: var(--wp--preset--font-size--large) !important; line-height: 1.6; }
.is-style-pill {
	display: inline-flex !important; width: fit-content; padding: 0.3em 0.85em; border-radius: 999px;
	font-size: 0.78rem !important; font-weight: 600; line-height: 1.3; background: var(--wp--preset--color--rose); color: var(--wp--preset--color--crimson-deep);
}

.wp-block-button.is-style-light .wp-block-button__link { background: #fff; color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-light .wp-block-button__link:hover { background: var(--wp--preset--color--rose); color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-outline-light .wp-block-button__link { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }
.wp-block-button.is-style-outline-light .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.1); }
.wp-block-button.is-style-ghost .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); box-shadow: inset 0 0 0 1px rgba(15, 31, 58, 0.2); }
.wp-block-button.is-style-ghost .wp-block-button__link:hover { color: var(--wp--preset--color--crimson); box-shadow: inset 0 0 0 1px var(--wp--preset--color--crimson); }

.wp-block-group.is-style-card { background: #fff; border: 1px solid var(--wp--preset--color--line); border-radius: var(--ppf-radius-m); padding: clamp(1.25rem, 1rem + 1vw, 2rem); }
.wp-block-group.is-style-card-dark { background: var(--wp--preset--color--ink-soft); color: rgba(255, 255, 255, 0.8); border-radius: var(--ppf-radius-m); padding: clamp(1.25rem, 1rem + 1vw, 2rem); }
.wp-block-group.is-style-card-dark :where(h1, h2, h3, h4) { color: #fff; }
.wp-block-group.is-style-band { background: var(--wp--preset--color--ink); color: rgba(255, 255, 255, 0.78); }
.wp-block-group.is-style-band :where(h1, h2, h3, h4) { color: #fff; }
.wp-block-group.is-style-band a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--glow); }

.wp-block-list.is-style-diamonds { list-style: none; padding-left: 0; display: grid; gap: 0.75rem; }
.wp-block-list.is-style-diamonds li { position: relative; padding-left: 1.6rem; }
.wp-block-list.is-style-diamonds li::before { content: ""; position: absolute; left: 0.2rem; top: 0.62em; width: 0.5rem; height: 0.5rem; background: var(--wp--preset--color--crimson); transform: rotate(45deg); }

.wp-block-image.is-style-arch img { border-radius: var(--ppf-radius-l); }

.wp-block-columns.is-style-facts { gap: 0 !important; border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-columns.is-style-facts > .wp-block-column { padding: 1.75rem 1.25rem; margin: 0 !important; }
.wp-block-columns.is-style-facts > .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--line); }
.wp-block-columns.is-style-facts .ppf-fact-number { margin: 0; font-family: var(--wp--preset--font-family--display); font-weight: 600; font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem); line-height: 1; color: var(--wp--preset--color--crimson); font-variant-numeric: tabular-nums; }
.wp-block-columns.is-style-facts .ppf-fact-label { margin: 0.6rem 0 0; font-size: 0.95rem; line-height: 1.45; }
@media (max-width: 781px) {
	.wp-block-columns.is-style-facts { display: grid !important; grid-template-columns: 1fr 1fr; }
	.wp-block-columns.is-style-facts > .wp-block-column { padding: 1.25rem 0.75rem; }
	.wp-block-columns.is-style-facts > .wp-block-column:nth-child(3) { border-left: 0; }
	.wp-block-columns.is-style-facts > .wp-block-column:nth-child(n+3) { border-top: 1px solid var(--wp--preset--color--line); }
}

/* ---------- Hero ---------- */
.ppf-hero.wp-block-cover { padding-top: clamp(3.5rem, 2rem + 5vw, 6.5rem); padding-bottom: 0; align-items: flex-end; }
.ppf-hero .wp-block-cover__image-background { animation: ppf-settle 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; object-position: 60% 45%; }
.wp-block-cover.ppf-hero .wp-block-cover__inner-container { width: 100% !important; max-width: none !important; margin: 0 !important; }
.ppf-hero .wp-block-cover__inner-container > .wp-block-columns { width: 100%; max-width: 1200px; margin-left: auto !important; margin-right: auto !important; animation: ppf-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.ppf-hero h1 { color: #fff; }
.ppf-hero .peseschkian-next, .ppf-hero .ppf-next { animation: ppf-rise 0.9s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.ppf-credentials { border-top: 1px solid rgba(255, 255, 255, 0.12); background: rgba(15, 31, 58, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ppf-credentials .wp-block-column { display: flex; gap: 0.75rem; align-items: flex-start; }
.ppf-credentials p { margin: 0; font-size: 0.8rem; line-height: 1.4; color: rgba(255, 255, 255, 0.65); }
.ppf-credentials p strong { display: block; font-size: 0.875rem; color: #fff; }
.ppf-credentials .ppf-badge { flex-shrink: 0; width: 10px; height: 10px; margin-top: 0.3rem; transform: rotate(45deg); background: var(--wp--preset--color--glow); }
@media (max-width: 781px) { .ppf-credentials .wp-block-columns { display: grid !important; grid-template-columns: 1fr 1fr; gap: 1.25rem !important; } }

/* Page title band */
.ppf-page-hero { position: relative; overflow: hidden; }
.ppf-page-hero::after {
	content: ""; position: absolute; right: -6rem; top: -6rem; width: 28rem; height: 28rem; pointer-events: none;
	background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.07' stroke-width='1.5'%3E%3Cpath d='M50 2 98 50 50 98 2 50Z'/%3E%3Cpath d='M50 18 82 50 50 82 18 50Z'/%3E%3Cpath d='M50 34 66 50 50 66 34 50Z'/%3E%3C/g%3E%3C/svg%3E");
}
.ppf-page-hero > * { position: relative; z-index: 1; }
.ppf-page-hero .wp-block-post-title, .ppf-page-hero h1 { color: #fff; }
.ppf-page-hero .wp-block-post-excerpt { color: rgba(255, 255, 255, 0.78); font-size: var(--wp--preset--font-size--large); }
.ppf-page-hero .wp-block-post-excerpt__excerpt, .ppf-page-hero .is-style-lead { max-width: 60ch; }
.ppf-page-hero .wp-block-post-excerpt__more-text { display: none; }

/* ---------- Cards ---------- */
.ppf-card-grid .wp-block-post { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--wp--preset--color--line); border-radius: var(--ppf-radius-m); background: #fff; transition: transform 0.3s, box-shadow 0.3s; }
.ppf-card-grid .wp-block-post:hover { transform: translateY(-4px); box-shadow: var(--ppf-shadow-card); }
.ppf-card-grid .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.ppf-card-grid .wp-block-post-featured-image img { transition: transform 0.7s; }
.ppf-card-grid .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.ppf-card-grid .ppf-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
.ppf-card-grid .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.ppf-card-grid .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.ppf-card-grid .wp-block-post { position: relative; }
.ppf-card-grid .wp-block-post-excerpt { margin: 0; }
.ppf-card-grid .wp-block-post-excerpt__more-text { display: none; }

.ppf-photo-card { position: relative; overflow: hidden; border-radius: var(--ppf-radius-m); }
.ppf-photo-card a { color: #fff; }

/* Downloads */
.ppf-downloads a { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border-radius: 1rem; background: #fff; border: 1px solid var(--wp--preset--color--line); text-decoration: none; color: var(--wp--preset--color--ink); font-weight: 600; transition: border-color 0.2s; }
.ppf-downloads a::before { content: "PDF"; display: grid; place-items: center; width: 40px; height: 48px; border-radius: 6px 14px 6px 6px; background: var(--wp--preset--color--rose); color: var(--wp--preset--color--crimson); font-size: 0.68rem; font-weight: 700; flex-shrink: 0; }
.ppf-downloads a:hover { border-color: var(--wp--preset--color--crimson); }
.ppf-downloads ul { list-style: none; padding: 0; display: grid; gap: 0.75rem; }

/* Language list on the glossary page */
.ppf-langs ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.ppf-langs a { display: flex; justify-content: space-between; padding: 0.75rem 1rem; border: 1px solid var(--wp--preset--color--line); border-radius: 0.9rem; text-decoration: none; color: var(--wp--preset--color--ink); font-weight: 500; }
.ppf-langs a::after { content: "PDF"; font-size: 0.68rem; font-weight: 700; color: var(--wp--preset--color--ink-3); }
.ppf-langs a:hover { border-color: var(--wp--preset--color--crimson); color: var(--wp--preset--color--crimson); }

/* Tables */
.wp-block-table { overflow-x: auto; }
.wp-block-table table { border-collapse: collapse; min-width: 520px; }
.wp-block-table th { background: var(--wp--preset--color--mist); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--wp--preset--color--ink-3); }
.wp-block-table td, .wp-block-table th { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 0.9rem 1rem; text-align: left; vertical-align: top; }

/* Details (accordion) */
.wp-block-details { border-top: 1px solid var(--wp--preset--color--line); padding: 0.75rem 0; }
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--crimson); }

/* Footer */
.ppf-footer a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.ppf-footer a:hover { color: #fff; text-decoration: underline; }
.ppf-footer .wp-block-site-logo img { background: #fff; padding: 6px 10px; border-radius: 10px; }
.ppf-footer .ppf-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; font-size: 0.95rem; }
.ppf-footer .ppf-footer__col h2 { font-family: var(--wp--preset--font-family--body); font-size: 0.875rem; color: #fff; margin: 0 0 1rem; letter-spacing: 0; }

/* Back to top */
.ppf-top {
	position: fixed; z-index: 40; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 999px; cursor: pointer;
	background: var(--wp--preset--color--ink); color: #fff; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
	opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.25s, transform 0.25s, background-color 0.2s;
}
.ppf-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ppf-top:hover { background: var(--wp--preset--color--crimson); }

/* Search results and blog */
.ppf-list .wp-block-post { padding: 1.5rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.ppf-list .wp-block-post-title a { color: var(--wp--preset--color--ink); text-decoration: none; }

/* Motion */
@keyframes ppf-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ppf-settle { from { transform: scale(1.06); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
