/**
 * Header and footer.
 *
 * These appear on every page, so their CSS lives in the theme and is cached
 * once — unlike page blocks, whose styles ship inline with the block itself.
 */

/* ==========================================================================
   Utility bar
   ========================================================================== */

.club-utility {
	background: var(--club-olive-deep);
	color: var(--club-cream-soft);
	font-family: var(--club-font-label);
	font-size: var(--club-size-label);
	letter-spacing: 0.06em;
}

.club-utility__inner {
	max-width: var(--club-container);
	margin-inline: auto;
	padding: 9px var(--club-gutter);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.club-utility__group {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}

.club-utility__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

/* The small gold marks beside each detail. */
.club-utility__mark {
	color: var(--club-brass);
	font-weight: 400;
	line-height: 1;
}

.club-utility a {
	color: var(--club-cream-soft);
	transition: color 0.2s ease;
}

.club-utility a:hover { color: var(--club-gold); }

/* Tenders and careers are public notices, not ways to reach the Club, so they
   sit a little apart from the telephone and the address. */
.club-utility__item--notice + .club-utility__item:not(.club-utility__item--notice) {
	padding-left: 22px;
	border-left: 1px solid rgba(250, 246, 238, 0.18);
}

@media (max-width: 680px) {
	.club-utility__inner { justify-content: center; gap: 8px 18px; }
	.club-utility__group--social { display: none; }
	.club-utility__item--notice + .club-utility__item:not(.club-utility__item--notice) {
		padding-left: 0;
		border-left: 0;
	}
}

/* ==========================================================================
   Header
   ========================================================================== */

.club-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--club-cream);
	border-bottom: 1px solid transparent;
	transition: padding 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* No line while the page is at the top: the bar and the page share a ground
   and there is nothing to separate. It appears once content scrolls under. */
.club-header.is-condensed {
	border-bottom-color: var(--club-line);
	box-shadow: 0 1px 16px rgba(34, 31, 26, 0.08);
}

.club-header__inner {
	max-width: var(--club-container);
	margin-inline: auto;
	padding: 14px var(--club-gutter);
	display: flex;
	align-items: center;
	gap: 26px;
	transition: padding 0.3s ease;
}

.club-header.is-condensed .club-header__inner { padding-block: 10px; }

/* ---- Brand ---- */

.club-brand {
	display: flex;
	align-items: center;
	gap: 13px;
	flex: none;
	margin-right: auto;
}

.club-brand__mark {
	width: 46px;
	height: auto;
	transition: width 0.3s ease;
}

.club-header.is-condensed .club-brand__mark { width: 42px; }

.club-brand__name {
	font-family: var(--club-font-display);
	font-weight: 600;
	font-size: 1.0625rem;
	line-height: 1.1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--club-olive);
	display: block;
}

.club-brand__est {
	display: block;
	font-family: var(--club-font-label);
	font-size: 0.5625rem;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--club-brass-text, var(--club-brass));
	margin-top: 4px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.club-nav .club-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 24px;
}

.club-nav .club-menu li { position: relative; }

.club-nav .club-menu > li > a {
	display: block;
	font-family: var(--club-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--club-ink);
	padding: 10px 0;
	transition: color 0.2s ease;
}

.club-nav .club-menu > li > a,
.club-header__actions .club-btn { white-space: nowrap; }

/* Laptop widths.

   The brand, seven menu items, the search and Enquire only just fit on a
   small laptop, and at 1025px the window is 1010px wide once the scrollbar
   has taken its share. Everything gives a little — the margins, the spaces
   between items, the crest and the name — so the menu stays on one line and
   nothing is dropped. Measured at 1025px: about 20px to spare. */
@media (min-width: 1025px) and (max-width: 1300px) {
	.club-header__inner { gap: 16px; padding-inline: 32px; }
	.club-nav .club-menu { gap: 13px; }
	.club-nav .club-menu > li > a { letter-spacing: 0.01em; }
	.club-nav .club-menu > li.menu-item-has-children > a { padding-right: 15px; }
	.club-utility__inner { padding-inline: 32px; }
}

@media (min-width: 1025px) and (max-width: 1140px) {
	.club-brand__mark { width: 40px; }
	.club-brand__name { font-size: 0.9375rem; }
	.club-nav .club-menu { gap: 11px; }
}

.club-nav .club-menu > li > a:hover,
.club-nav .club-menu > li.current-menu-item > a,
.club-nav .club-menu > li.current-menu-ancestor > a {
	color: var(--club-brass);
}

/* ---- Dropdown toggle ---- */

.club-nav__toggle {
	position: absolute;
	top: 50%;
	right: -2px;
	transform: translateY(-50%);
	background: none;
	border: 0;
	padding: 8px 6px;
	cursor: pointer;
	line-height: 0;
	color: inherit;
}

.club-nav__chevron {
	display: block;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid var(--club-taupe);
	border-bottom: 1.5px solid var(--club-taupe);
	transform: rotate(45deg) translate(-1px, -1px);
	transition: transform 0.25s ease, border-color 0.2s ease;
}

/* Room for the arrow beside the word.

   The selector deliberately mirrors the one above, element for element: a
   shorter selector loses to that rule's padding shorthand, and the arrow then
   sits on top of the last letters. */
.club-nav .club-menu > li.menu-item-has-children > a { padding-right: 18px; }

.club-nav .menu-item-has-children.is-open > .club-nav__toggle .club-nav__chevron {
	transform: rotate(-135deg) translate(-2px, -2px);
	border-color: var(--club-brass);
}

/* ---- Submenu ---- */

.club-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 10px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 248px;
	background: var(--club-cream);
	border: 1px solid var(--club-line);
	box-shadow: 0 12px 34px rgba(34, 31, 26, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

/* The last menu opens leftwards, so it never runs past the screen edge. */
.club-nav .club-menu > li:last-child > .sub-menu {
	left: auto;
	right: 0;
}

/*
 * Show instantly, hide late.
 *
 * Opening switches visibility at once (0s, no delay) so the panel is
 * focusable immediately — on a slow phone or in a background tab a
 * transitioning visibility can leave it unfocusable. Closing delays the
 * switch until the fade has finished, so it still fades out rather than
 * vanishing. The same pattern is used on the search panel and drawer.
 */
.club-nav .menu-item-has-children.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

.club-nav .sub-menu a {
	display: block;
	padding: 9px 22px;
	font-family: var(--club-font-body);
	font-size: 0.9375rem;
	color: var(--club-ink);
	transition: color 0.2s ease, background 0.2s ease;
}

.club-nav .sub-menu a:hover {
	color: var(--club-olive);
	background: rgba(176, 136, 63, 0.08);
}

/* ==========================================================================
   Search
   ========================================================================== */

/* Text meant only for screen readers — present, but not drawn. */
.club-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.club-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: none;
	padding: 0;
	background: none;
	border: 1px solid transparent;
	color: var(--club-olive);
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.club-search-toggle:hover { color: var(--club-brass); }

.club-search-toggle[aria-expanded="true"] {
	color: var(--club-brass);
	border-color: var(--club-line-strong);
}

/* ---- Panel ---- */

.club-search-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: var(--club-cream);
	border-bottom: 1px solid var(--club-line);
	box-shadow: 0 14px 30px rgba(34, 31, 26, 0.08);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.club-search-panel.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

.club-search-panel__inner {
	max-width: var(--club-container);
	margin-inline: auto;
	padding: 22px var(--club-gutter);
}

.club-search-panel__form {
	display: flex;
	gap: 12px;
	max-width: 720px;
	margin-left: auto;
}

.club-search-panel__form input[type="search"],
.club-drawer__search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 14px 18px;
	font-family: var(--club-font-body);
	font-size: 1rem;
	color: var(--club-ink);
	background: var(--club-white);
	border: 1px solid var(--club-line-strong);
	border-radius: var(--club-radius);
}

.club-search-panel__form input[type="search"]::placeholder,
.club-drawer__search input[type="search"]::placeholder {
	color: var(--club-taupe);
}

.club-search-panel__form input[type="search"]:focus,
.club-drawer__search input[type="search"]:focus {
	border-color: var(--club-brass);
	outline: none;
}

/* ---- Drawer search ---- */

.club-drawer__search {
	display: flex;
	margin-bottom: 26px;
}

.club-drawer__search button {
	flex: none;
	width: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--club-olive);
	color: var(--club-cream);
	border: 1px solid var(--club-olive);
	border-left: 0;
	cursor: pointer;
}

/* The toggle and panel are desktop affordances; the drawer carries its own. */
@media (max-width: 1024px) {
	.club-search-toggle,
	.club-search-panel { display: none; }
}

/* ==========================================================================
   Burger and mobile drawer
   ========================================================================== */

.club-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 1px solid var(--club-line-strong);
	cursor: pointer;
	flex: none;
}

.club-burger span {
	display: block;
	width: 20px;
	height: 1.5px;
	margin-inline: auto;
	background: var(--club-olive);
	transition: transform 0.28s ease, opacity 0.2s ease;
}

.club-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.club-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.club-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.club-drawer {
	position: fixed;
	inset: 0;
	z-index: 99;
	background: var(--club-cream);
	padding: 104px var(--club-gutter) 40px;
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

.club-drawer.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
}

html.club-nav-locked { overflow: hidden; }

/* ---- Drawer menu ---- */

.club-drawer .club-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: block;
}

.club-drawer .club-menu > li {
	border-bottom: 1px solid var(--club-line);
	position: relative;
}

.club-drawer .club-menu > li > a {
	display: block;
	font-family: var(--club-font-display);
	font-size: 1.375rem;
	font-weight: 600;
	color: var(--club-olive);
	padding: 15px 44px 15px 0;
}

.club-drawer .club-nav__toggle {
	right: 0;
	padding: 14px 10px;
}

.club-drawer .club-nav__chevron {
	width: 8px;
	height: 8px;
	border-width: 2px;
}

.club-drawer .sub-menu {
	position: static;
	min-width: 0;
	border: 0;
	box-shadow: none;
	background: none;
	padding: 0 0 12px;
	display: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}

.club-drawer .menu-item-has-children.is-open > .sub-menu { display: block; }

.club-drawer .sub-menu a {
	padding: 8px 0 8px 16px;
	border-left: 1px solid var(--club-line);
	font-size: 1rem;
}

.club-drawer__actions { margin-top: 30px; }

/* The burger takes over from the menu, and Enquire stays beside it while
   there is room for it. */
@media (max-width: 1024px) {
	.club-header__nav { display: none; }
	.club-burger { display: flex; }
}

@media (min-width: 1025px) {
	.club-drawer { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.club-footer {
	border-top: 4px solid var(--club-terracotta);
	background: var(--club-olive-deep);
	color: var(--club-cream-soft);
	padding-top: 48px;
}

.club-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(4, 1fr);
	gap: 30px var(--club-gap);
	padding-bottom: 30px;
}

.club-footer__brand .club-brand__name { color: var(--club-cream); }

.club-footer__mark { width: 50px; margin-bottom: 12px; }

.club-footer__address {
	font-size: 0.875rem;
	line-height: 1.6;
	margin-top: 12px;
	color: var(--club-cream-soft);
	max-width: 32ch;
}

.club-footer h2 {
	font-family: var(--club-font-label);
	font-size: var(--club-size-label);
	font-weight: 500;
	letter-spacing: var(--club-tracking-label);
	text-transform: uppercase;
	color: var(--club-gold);
	margin: 0 0 12px;
}

.club-footer .club-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.club-footer .club-menu li { margin-bottom: 6px; }

.club-footer .club-menu a {
	font-size: 0.875rem;
	color: var(--club-cream-soft);
	transition: color 0.2s ease;
}

.club-footer .club-menu a:hover { color: var(--club-gold); }

/* The crest, stamped above the small print: the mark a club signs with. It
   comes from the photo slot, so replacing the artwork in the dashboard
   replaces it everywhere it appears. */
.club-crestmark {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	margin: 0 0 18px;
}

.club-crestmark::before,
.club-crestmark::after {
	content: "";
	flex: 1 1 0;
	max-width: 190px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(250, 246, 238, 0.28));
}

.club-crestmark::after { transform: scaleX(-1); }

/* The mark itself. A khatam star stands in until the Club supplies crest
   artwork that is not an AI redraw with a checkerboard baked into it. */
.club-crestmark::before,
.club-crestmark::after { flex: 1 1 0; }

.club-crestmark {
	background: url('jali-mark.svg') center / 26px 26px no-repeat;
	min-height: 26px;
}

.club-crestmark img {
	width: 40px;
	height: auto;
	flex: none;
	opacity: 0.85;
}

.club-footer__bottom {
	border-top: 1px solid var(--club-line-on-dark);
	padding-block: 15px 17px;
	display: flex;
	justify-content: space-between;
	gap: 12px 26px;
	flex-wrap: wrap;
	font-family: var(--club-font-label);
	font-size: var(--club-size-label);
	letter-spacing: 0.06em;
	color: rgba(250, 246, 238, 0.5);
}

@media (max-width: 1024px) {
	.club-footer__grid { grid-template-columns: 1fr 1fr; gap: 36px var(--club-gap); }
	.club-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
	.club-footer__grid { grid-template-columns: 1fr; }
	.club-footer__bottom { justify-content: flex-start; }
}

/* ==========================================================================
   Header buttons

   The homepage design's pill, used across the whole site so one navigation
   bar serves every page. A second, outlined pill sits beside it when the Club
   has a members' portal to point at.
   ========================================================================== */

.club-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
}

.club-header__actions .club-btn {
	min-height: 36px;
	padding: 7px 19px;
	border-radius: 4px;
	font-family: var(--club-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: none;
}

/* Phones.

   The bar carries the crest, the name and the burger, and nothing else: both
   buttons are waiting at the foot of the drawer, where there is room to read
   them. The name and the crest come down a size too, so the bar still fits a
   360px phone with room to spare rather than running off the edge. */
@media (max-width: 680px) {
	.club-header__actions { display: none; }
	.club-header__inner { gap: 16px; }
	.club-brand { gap: 10px; }
	.club-brand__mark { width: 38px; }
	.club-header.is-condensed .club-brand__mark { width: 35px; }
	.club-brand__name { font-size: 0.875rem; }
	.club-brand__est { font-size: 0.5rem; letter-spacing: 0.2em; margin-top: 3px; }
}

/* Keep native theme button states within the club palette. */
:is(.club-nav__toggle,.club-search-toggle):is(:hover,:focus,:active,[aria-expanded="true"]){background:transparent;color:var(--club-brass);box-shadow:none}
.club-nav__toggle:is(:hover,:focus,:active) .club-nav__chevron{border-color:var(--club-brass)}
:is(.club-nav__toggle,.club-search-toggle):focus-visible{outline:2px solid var(--club-brass);outline-offset:3px}
:is(.club-search-panel__form,.club-drawer__search) button:is(:hover,:focus,:active){background:var(--club-olive-deep);border-color:var(--club-olive-deep);color:var(--club-cream)}
:is(.club-search-panel__form,.club-drawer__search) input[type="search"]:focus{border-color:var(--club-brass);box-shadow:0 0 0 1px var(--club-brass);outline:none}

/* Compact single-line utility strip. */
.club-utility{font-size:11px;line-height:1.4;letter-spacing:.025em}
.club-utility__inner{padding-block:6px;flex-wrap:nowrap;gap:16px}
.club-utility__group{flex-wrap:nowrap;gap:18px;min-width:0}
.club-utility__item{white-space:nowrap}
.club-utility__group--right{flex-shrink:0}
@media(max-width:1024px){.club-utility__group--right .club-utility__item:last-child{display:none}}
@media(max-width:680px){
 .club-utility{font-size:10px}
 .club-utility__inner{padding-block:5px}
 .club-utility__group--right{display:none}
 .club-utility__item{display:block;overflow:hidden;text-overflow:ellipsis}
 .club-utility__mark{margin-right:5px}
}

/* ---- International Associate Clubs panel ------------------------------ */

.club-iac {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 40px;
	align-items: center;
	margin-top: 48px;
	padding: 36px 40px;
	border: 1px solid rgba(17, 27, 15, 0.14);
	background: #fff;
}

.club-iac__eyebrow {
	margin: 0 0 6px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8C6A2F;
}

.club-iac__title {
	margin: 0 0 12px;
	font-size: 1.5rem;
	line-height: 1.2;
}

.club-iac__body {
	margin: 0 0 18px;
	max-width: 58ch;
	line-height: 1.65;
}

.club-iac__link {
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}

.club-iac__link span {
	margin-left: 4px;
}

.club-iac__code {
	text-align: center;
}

.club-iac__code img {
	display: block;
	width: 150px;
	height: 150px;
}

.club-iac__scan {
	margin: 10px 0 0;
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.65;
}

/* On a phone the square goes under the words, and keeps its size: a code
   scaled down to fit a column is a code that will not read. */
@media (max-width: 720px) {

	.club-iac {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 28px 24px;
	}

	.club-iac__code {
		justify-self: start;
	}
}

/* ---- From the kitchen: the dishes, running under the dining rooms -------
   Same movement as the reciprocal clubs: one track printed twice, slid by
   exactly half its width so the join cannot be seen. */

.club-food {
	margin-top: 56px;
	padding-top: 44px;
	border-top: 1px solid rgba(17, 27, 15, 0.12);
}

.club-food__head {
	max-width: 62ch;
}

.club-food__eyebrow {
	margin: 0 0 6px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8C6A2F;
}

.club-food__title {
	margin: 0 0 12px;
	font-size: 1.75rem;
	line-height: 1.15;
}

.club-food__lede {
	margin: 0;
	line-height: 1.65;
}

.club-food__rail {
	position: relative;
	margin-top: 32px;
	/* Out of the content column and across the whole screen, so a dish comes
	   in from off-stage rather than from behind a margin. */
	width: 100vw;
	margin-inline: calc(50% - 50vw);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* 100vw counts the scrollbar's width, which would otherwise show up as a
   horizontal scrollbar of the page's own. Clip, not hidden: hidden would make
   this a scroll container and trap anything sticky inside it. */
.club-section:has(.club-food) {
	overflow-x: clip;
}

.club-food__track {
	display: flex;
	gap: 74px;
	width: max-content;
	animation: club-food-run 104s linear infinite;
}

.club-food__rail:hover .club-food__track,
.club-food__rail:focus-within .club-food__track {
	animation-play-state: paused;
}

@keyframes club-food-run {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

.club-food__card {
	flex: 0 0 auto;
	width: 310px;
	margin: 0;
	background: #fff;
	border: 1px solid rgba(178, 154, 98, 0.15);
}

.club-food__card img {
	display: block;
	width: 100%;
	height: 350px;
	object-fit: cover;
}

.club-food__card figcaption {
	padding: 16px 20px 18px;
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 1.0625rem;
	color: #111b0f;
}

.club-food__credit {
	margin: 18px 0 0;
	font-size: 0.6875rem;
	line-height: 1.6;
	color: rgba(17, 27, 15, 0.55);
}

@media (max-width: 767px) {

	.club-food__track {
		gap: 40px;
	}

	.club-food__card {
		width: 240px;
	}

	.club-food__card img {
		height: 272px;
	}
}

/* Asked for less motion: the strip holds still and is scrolled by hand,
   exactly as the reciprocal clubs do. */
@media (prefers-reduced-motion: reduce) {

	.club-food__rail {
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.club-food__rail::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}

	.club-food__track {
		animation: none;
	}
}
