/*
 * jj/site-header + jj/site-footer. PORT of the prototype's `.nav` / `.menu`
 * / `.foot` rules verbatim (assets-source/handoff/jj_handoff/src/template.html
 * lines 25-64 and 214-233; CLAUDE.md "PROTOTYPE v23 IS THE REFERENCE").
 * Values are the prototype's literal ones, not theme.json tokens, so a
 * side-by-side with the reference stays pixel/colour faithful; the two
 * happen to match (theme.json's palette was locked from this same
 * prototype in the port).
 */
:root {
	--jj-yellow: #D3912F;
	--jj-espresso: #2A1A12;
	--jj-ink: #2A1A12;
	--jj-cream: #F2E6CF;
	--jj-paper: #F3EAD8;
	--jj-dark: #1C110B;
	--jj-amber: #E9A93A;
	--jj-display: var(--wp--preset--font-family--big-shoulders-display, "Big Shoulders Display", "Arial Narrow", sans-serif);
	--jj-text: var(--wp--preset--font-family--barlow, "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif);
}

/* header / nav bar */
.nav {
	position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center;
	gap: clamp(18px,3vw,44px); padding: calc(env(safe-area-inset-top,0px) + 18px) clamp(18px,4vw,56px) 0;
	color: var(--jj-ink); pointer-events: none; transition: color .4s, background .3s;
}
.nav * { pointer-events: auto; }
/* The header logo (client, 5 Oct 2026): the original colour horizontal logo, not a one-colour mask.
   As tall as the old one (its width clamp(132px,12vw,180px) at 1092:300), its own width.
   Cream header: the logo as it is; dark grounds (film strip, menu, landscape layer): its
   dark-ground version. The footer keeps its own logo (.foot .f-brand .logo). */
.nav .logo, .menu .logo { display: block; height: calc(clamp(132px,12vw,180px) * 300 / 1092); width: auto; aspect-ratio: 316/200;
	background: var(--jj-logo-color) no-repeat left center/contain; -webkit-mask: none; mask: none; flex: none; border: 0; }
.nav .links { display: flex; gap: clamp(18px,2.2vw,36px); list-style: none; margin: 0 0 0 auto; padding: 0; align-items: center; }
.nav .links a, .navbtn { font: 600 12.5px/1 var(--jj-text); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: inherit;
	position: relative; padding: 0; height: 34px; display: inline-flex; align-items: center; background: none; border: 0; }
.nav .links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 7px; height: 1.5px; background: currentColor;
	transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.nav .links a:hover::after, .nav .links a:focus-visible::after, .nav .links a[aria-current="true"]::after { transform: scaleX(1); }
.navbtn { cursor: pointer; display: inline-flex; align-items: center; gap: 9px; }
.snd .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; margin-top: -2px; }
.snd .bars i { display: block; width: 2px; height: 3px; background: currentColor; transition: height .3s; }
/* Bars move only while music really plays (view.js .is-playing); before the
   first tap, with sound wanted, the button pulses to invite it (.is-invite). */
.snd.is-playing .bars i { animation: jj-eq 1s ease-in-out infinite; }
.snd.is-playing .bars i:nth-child(2) { animation-delay: .2s; }
.snd.is-playing .bars i:nth-child(3) { animation-delay: .4s; }
.snd.is-invite .bars { animation: jj-invite 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes jj-invite { 0%, 100% { opacity: .55; transform: scale( 1 ); } 50% { opacity: 1; transform: scale( 1.25 ); } }
@media ( prefers-reduced-motion: reduce ) { .snd.is-invite .bars { animation: none; } }
@keyframes jj-eq { 0%,100% { height: 3px; } 50% { height: 11px; } }
.cart { gap: 7px; display: inline-flex; align-items: center; }
/* The count badge: a pill in the header's ink with the number cut out in the
   page colour (5 Oct 2026: the prototype's transparent badge left only a
   cream number, invisible on the cream inner pages). */
.cart b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: currentColor; font: 700 11px/1 var(--jj-text); letter-spacing: 0; position: relative; }
.cart b::after { content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center; color: var(--jj-paper, #F3EAD8); }
html.jj-film-on .nav .cart b::after { color: var(--jj-dark, #1C110B); }
.burger { display: none; }
.burger .ln { display: inline-block; width: 22px; height: 9px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
@media (max-width: 1023px) { .nav .links { display: none; } .burger { display: inline-flex; } .snd { margin-left: auto; }
	/* with sales on, the cart badge leads the right-hand group (it would otherwise follow the logo);
	   while it is hidden (empty cart) the sound button keeps pushing the group right (1.4.27) */
	.nav .cart { margin-left: auto; } .nav:has( .cart:not( [style*="none"] ) ) .snd { margin-left: 0; } }
@media (max-width: 480px) { .cart span { display: none; } .snd .lbl { display: none; } }

/* full screen menu */
.menu { position: fixed; inset: 0; z-index: 30; background: var(--jj-dark); color: var(--jj-cream); display: flex; flex-direction: column;
	justify-content: flex-start; gap: clamp(28px,6vh,64px); overflow-y: auto;
	padding: calc(env(safe-area-inset-top,0px) + 18px) clamp(18px,4vw,56px) calc(env(safe-area-inset-bottom,0px) + 28px);
	clip-path: inset(0 0 100% 0); transition: clip-path .6s cubic-bezier(.7,0,.2,1); visibility: hidden; }
.menu.open { clip-path: inset(0 0 0 0); visibility: visible; }
.menu .top { display: flex; justify-content: space-between; align-items: center; }
.menu .logo { color: var(--jj-cream); background-image: var(--jj-logo-dark); }
.menu ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(4px,1.2vh,14px); }
.menu ol a { display: inline-flex; align-items: baseline; gap: 14px; text-decoration: none; color: inherit; font-family: var(--jj-display);
	font-weight: 800; text-transform: uppercase; font-size: clamp(40px,9vw,88px); line-height: 1.05; letter-spacing: .01em;
	transform: translateY(24px); opacity: 0; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .6s, color .25s; }
.menu.open ol a { transform: none; opacity: 1; }
.menu ol li:nth-child(2) a { transition-delay: .05s; }
.menu ol li:nth-child(3) a { transition-delay: .1s; }
.menu ol li:nth-child(4) a { transition-delay: .15s; }
.menu ol li:nth-child(5) a { transition-delay: .2s; }
.menu ol li:nth-child(6) a { transition-delay: .25s; }
.menu ol a:hover, .menu ol a:focus-visible { color: var(--jj-amber); }
.menu ol small { font: 600 11px/1 var(--jj-text); letter-spacing: .14em; text-transform: uppercase; color: var(--jj-amber); }
.menu .mfoot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid rgba(242,230,207,.25); padding-top: 22px; font: 500 15px/1.4 var(--jj-text); }
.menu .mfoot span { font: 600 11px/1 var(--jj-text); letter-spacing: .14em; text-transform: uppercase; color: var(--jj-amber); margin-bottom: 4px; }
.menu .mfoot a { color: var(--jj-cream); text-decoration: none; }

/* nav gets a solid, frosted bar once the story is over (or on pages with no story) */
.nav.solid { background: rgba(243,234,216,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	color: var(--jj-dark) !important; padding-bottom: 12px; border-bottom: 1px solid rgba(28,17,11,.12); }
/* (the solid bar's logo is the colour logo: nothing to repaint) */

/* footer */
.foot { background: var(--jj-paper); color: var(--jj-espresso); display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px;
	padding: clamp(56px,9vh,96px) clamp(20px,5vw,80px) calc(env(safe-area-inset-bottom,0px) + 28px); }
.foot .f-brand img { width: clamp(120px,11vw,170px); height: auto; display: block; }
/* "Roasted The John Way." centred under the logo (client, 1 Oct 2026): logo and line share one centred column */
.foot .f-brand { display: flex; flex-direction: column; align-items: center; justify-self: start; width: max-content; max-width: 100%; text-align: center; }
.foot .f-brand .logo { width: clamp(120px,11vw,170px); aspect-ratio: 1092/300; background: currentColor;
	-webkit-mask: var(--logo) no-repeat left center/contain; mask: var(--logo) no-repeat left center/contain; display: block; }
.foot .f-brand p { font-family: var(--jj-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 0; font-size: 15px; }
.foot .f-col { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.foot .f-col h3 { font: 600 11px/1 var(--jj-text); letter-spacing: .14em; text-transform: uppercase; opacity: .72; /* prototype .6; .72 reaches 4.5:1 contrast (port step 5) */ margin: 0 0 6px; }
.foot .f-col a, .foot .f-col span { color: inherit; text-decoration: none; }
.foot .f-col a:hover, .foot .f-col a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.foot .f-bottom { grid-column: 1/-1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
	border-top: 1px solid rgba(28,17,11,.2); padding-top: 18px; font-size: 12.5px; opacity: .7; }
@media (max-width: 900px) { .foot { grid-template-columns: 1fr 1fr; } .foot .f-brand { grid-column: 1/-1; } }

/* Prototype has no body line-height (browser "normal"); theme.json sets 1.5
   for page copy, so pin the prototype value on the ported chrome. */
.nav, .menu, .foot { line-height: normal; }

/* WordPress's root block gap (24px) sat on <main> and, because the header
   template part is empty in the flow (the nav is fixed), collapsed through
   it to the very top of the page: a 24px paper strip above the header on
   every page, for every visitor (client, iPhone test 26 Sep 2026). The
   prototype has no gap between header, content and footer. */
.wp-site-blocks > main,
.wp-site-blocks > footer { margin-block-start: 0; }

/* The logo is a link, so WordPress's global link colour used to win over
   the nav's colour: on the dark story stops the words turned cream but the
   logo stayed dark (client, iPhone test 28 Sep 2026). */
.nav .logo { color: inherit; }

/* The front page letter follows the story straight on, no paper gap. */
.wp-site-blocks .jj-bean-story + * { margin-block-start: 0; }

/* Landscape iPhone (viewport-fit=cover, functions.php): backgrounds run
   edge to edge under the notch; text and buttons keep clear of it. */
:root {
	--jj-sl: env(safe-area-inset-left, 0px);
	--jj-sr: env(safe-area-inset-right, 0px);
}
.nav {
	padding-left: calc(clamp(18px,4vw,56px) + var(--jj-sl));
	padding-right: calc(clamp(18px,4vw,56px) + var(--jj-sr));
}
/* Never on a section box (its background must reach the edges): only the
   content inside gets the part of the inset its own gutter does not cover. */
.menu > * {
	padding-left: max(0px, var(--jj-sl) - clamp(18px,4vw,56px));
	padding-right: max(0px, var(--jj-sr) - clamp(18px,4vw,56px));
}
.foot > * {
	padding-left: max(0px, var(--jj-sl) - clamp(20px,5vw,80px));
	padding-right: max(0px, var(--jj-sr) - clamp(20px,5vw,80px));
}

/* Footer bottom band (rehber, 28 Sep 2026): the company's details. */
.foot .f-bottom p { margin: 0; }
.foot .f-legal { line-height: 1.6; }
/* The asterisk note (rehber, 30 Sep 2026): its own line right above the © line. */
.foot .f-note { flex-basis: 100%; line-height: 1.6; }
.foot .f-links a { color: inherit; }
/* e-mail addresses (jj-core JJ_Eposta_Kirma, 8 Oct 2026): a line may end only after "@" or "." (the <wbr>s), never inside a word */
.jj-eposta { overflow-wrap: normal; word-break: normal; }
/* iyzico's logo band (8 Oct 2026): under the links, its own colours (the band's opacity is lifted back
   to full), never wider than the screen: it scales down on a phone, never cut */
.foot .f-pay { flex-basis: 100%; display: flex; justify-content: flex-end; }
.foot .f-pay img { display: block; width: 429px; max-width: 100%; height: auto; }
.foot .f-bottom:has( .f-pay ) { opacity: 1; }
.foot .f-bottom:has( .f-pay ) > :not( .f-pay ) { opacity: .7; }
@media (max-width: 900px) { .foot .f-pay { justify-content: flex-start; } }
/* The Kurumsal column is gone (legal links only in the bottom band). */
@media (min-width: 901px) { .foot { grid-template-columns: 1.3fr 1fr 1fr; } }
/* Units stay small in uppercase lines (rehber, 10 Oct 2026: "250 g · 1 kg", never "250 G · 1 KG");
   jj-core JJ_Gramaj::units_html and the theme put "<number> g/kg" in this span */
.jj-birim { text-transform: none; white-space: nowrap; }
