/*
Theme Name: Nostalgia Realm
Theme URI: https://www.nostalgiarealm.com/
Author: Nostalgia Realm
Description: Block theme replicating the Nostalgia Realm JouwWeb design (dark, purple accent, red headings, Open Sans). Colours, fonts, header and footer are editable in Appearance > Editor.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.1
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: nostalgiarealm
*/

/* ---- Header ---- */
.nr-header { position: relative; z-index: 10; }
.nr-header .wp-block-site-logo img { display: block; }
.nr-menubar .wp-block-navigation-item__content { padding: 10px 6px; }
.nr-menubar .current-menu-item > .wp-block-navigation-item__content,
.nr-menubar .wp-block-navigation-item__content[aria-current="page"] { color: var(--wp--preset--color--nr-accent-hover); }
.nr-menubar .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--nr-link); }
.nr-menubar .wp-block-navigation__responsive-container.is-menu-open { background: #000; color: var(--wp--preset--color--nr-text); }
.nr-menubar .wp-block-search__button { background: transparent; color: var(--wp--preset--color--nr-text); padding: 6px; }
.nr-menubar .wp-block-search__input { background: #111; color: #fff; border: 1px solid #5c5c5c; }

/* ---- Banner ---- */
.nr-banner { min-height: 43vh; }
@media (min-height: 1200px) { .nr-banner { min-height: 516px; } }
.nr-banner .nr-tagline { text-shadow: 0 1px 6px rgba(0,0,0,.8); }

/* ---- Content strips (JouwWeb "strips") ---- */
.nr-strip { padding-top: 40px; padding-bottom: 40px; }
.nr-strip.has-nr-accent-background-color :where(h1,h2,h3,h4,h5,h6) { color: var(--wp--preset--color--nr-text); }
.nr-strip.has-nr-accent-background-color a:where(:not(.wp-element-button)) { color: #b8b0e8; }
.nr-strip--narrow > * { max-width: 760px; }
main > .wp-block-post-content { margin-block-start: 0; }
main .wp-block-post-content > .nr-strip { margin-block-start: 0; }

/* ---- Buttons ---- */
.wp-block-button.nr-btn-xl .wp-block-button__link { font-size: 22px; padding: 14px 28px; }
.wp-block-button .has-nr-red-background-color:hover { background-color: #d71c1c !important; }
.wp-block-button[class*="nr-icon-"] .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: .6em; }
.wp-block-button[class*="nr-icon-"] .wp-block-button__link::before {
	content: ""; width: 1.25em; height: 1.25em; flex: none; background: currentColor;
	-webkit-mask: var(--nr-icon) center / contain no-repeat; mask: var(--nr-icon) center / contain no-repeat;
}
.nr-icon-youtube { --nr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.6 12 3.6 12 3.6s-7.5 0-9.4.5A3 3 0 0 0 .5 6.2 31 31 0 0 0 0 12a31 31 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.5 9.4.5 9.4.5s7.5 0 9.4-.5a3 3 0 0 0 2.1-2.1A31 31 0 0 0 24 12a31 31 0 0 0-.5-5.8zM9.6 15.6V8.4l6.2 3.6-6.2 3.6z'/%3E%3C/svg%3E"); }
.nr-icon-download { --nr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 3h13l3 3v15H4z'/%3E%3Cpath d='M8 3v6h8V3M7 21v-7h10v7'/%3E%3C/svg%3E"); }
.nr-icon-mail { --nr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m2 6 10 7 10-7'/%3E%3C/svg%3E"); }

/* ---- Accordion (Details block) ---- */
.wp-block-details.nr-accordion summary { font-size: 19px; font-weight: 700; color: #fff; cursor: pointer; list-style: none; position: relative; padding-right: 1.6em; }
.wp-block-details.nr-accordion summary::-webkit-details-marker { display: none; }
.wp-block-details.nr-accordion summary::after { content: "+"; position: absolute; right: 0; top: 0; font-size: 1.2em; line-height: 1; }
.wp-block-details.nr-accordion[open] summary::after { content: "\2212"; }

/* ---- Images ---- */
.wp-block-image.is-style-rounded img { border-radius: 9999px; }

/* ---- Footer ---- */
.nr-footer { font-size: 14px; }

@media (max-width: 781px) {
	.nr-strip { padding-top: 24px; padding-bottom: 24px; }
	.wp-block-site-title { font-size: 26px !important; }
}

/* ---- Layout fixes ---- */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > * { margin-block-start: 0 !important; }
.wp-site-blocks > main { flex: 1 0 auto; }
.nr-hero { position: relative; }
.nr-hero > header { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.nr-hero .nr-header { background: transparent !important; }
.nr-banner { min-height: 43vh !important; }
.nr-hero > * { margin-block-start: 0 !important; }
@media (min-height: 1200px) { .nr-banner { min-height: 516px !important; } }
.wp-block-cover.nr-strip { min-height: 0; }
.nr-menubar .wp-block-navigation-item__content { border-bottom: 2px solid transparent; }
.nr-menubar .current-menu-item > .wp-block-navigation-item__content,
.nr-menubar .wp-block-navigation-item__content[aria-current="page"] { color: #4e3bc4; border-bottom-color: #4e3bc4; }
.nr-menubar .wp-block-search__button svg { width: 28px; height: 28px; }
.wp-block-details.nr-accordion summary { font-size: 24px; padding-right: 44px; }
.wp-block-details.nr-accordion summary::after {
	content: "+"; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
	background: #fff; color: var(--wp--preset--color--nr-accent); font-size: 26px; line-height: 31px; text-align: center; font-weight: 400;
}
.wp-block-separator.wp-block-separator:not(.is-style-dots) { width: 100%; max-width: none; border: 0; border-top: 1px solid currentColor; opacity: 1; }

/* ---- Phone layout (matches JouwWeb's mobile template) ----
   JouwWeb switches below 800px; the Navigation block would only switch below 600px, so it is forced here. */
@media (max-width: 799px) {
	/* search left, hamburger right, both inside the header bar */
	.wp-site-blocks { position: relative; }
	.wp-site-blocks > nav.wp-block-template-part { position: absolute; top: 0; left: 0; right: 0; height: 75px; z-index: 20; pointer-events: none; }
	.nr-menubar { background: transparent !important; height: 75px; flex-direction: row-reverse; justify-content: space-between !important; align-items: center; padding: 0 8px !important; flex-wrap: nowrap !important; }
	.nr-menubar > * { pointer-events: auto; }
	.nr-menubar .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
	.nr-menubar .wp-block-search__button svg { width: 24px; height: 24px; }
	.nr-header:not(.nr-hero .nr-header) { background-color: #000 !important; }
	.nr-header { padding-left: 48px !important; padding-right: 48px !important; flex-wrap: nowrap !important; }
	.nr-header .wp-block-site-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 30px !important; }
	.nr-header .wp-block-site-logo { flex: none; }
	.nr-header .wp-block-site-logo img { width: 50px !important; }
}
@media (max-width: 799px) {
	body { --wp--style--root--padding-left: 39px; --wp--style--root--padding-right: 39px; }
	:root :where(h1), :root .has-x-large-font-size { font-size: 26px !important; }
	:root :where(h2) { font-size: 21px; }
	:root :where(h3) { font-size: 19px; }
	:root :where(h4) { font-size: 17px; }
	.wp-block-details.nr-accordion summary { font-size: 19px; }
	.nr-banner .nr-tagline { font-size: 18px !important; }
	.wp-site-blocks .nr-header .wp-block-site-title { font-size: 30px; }
}

/* Expanded search field in the menu bar (the button-only search has no width of its own) */
.nr-menubar .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input { width: 200px !important; min-width: 200px !important; flex: 0 0 auto !important; padding: 6px 10px; }
@media (max-width: 799px) {
	.nr-menubar .wp-block-search:not(.wp-block-search__searchfield-hidden) { background: #000; position: relative; z-index: 2; }
	.nr-menubar .wp-block-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input { width: 220px !important; min-width: 220px !important; }
}
@media (max-width: 799px) {
	.nr-menubar .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex !important; }
	.nr-menubar .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none !important; }
	.nr-menubar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex !important; }
}
@media (min-width: 800px) {
	.nr-menubar > .wp-block-navigation { flex: 0 0 auto; }
	.nr-menubar .wp-block-navigation__container { flex-wrap: nowrap; }
}
