/*
Theme Name: Local
Theme URI: https://localbh.com
Description: Shared magazine theme for the Local city network (KSA, Bahrain, Dubai). City colours come from style variations.
Version: 0.2.7
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: local-theme
License: GPL-2.0-or-later
*/

/* Section heading: heavy top rule, as in the approved mockups. */
.is-style-section-heading {
	border-top: 4px solid var(--wp--preset--color--ink);
	padding-top: 0.875rem;
}

/* Small uppercase kicker label above section lists ("Trending now"). */
.is-style-kicker {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	border-bottom: 4px solid var(--wp--preset--color--ink);
	padding-bottom: 0.625rem;
	margin-bottom: 0.25rem;
}

/* Category label as a solid pill (lead story, article header). */
.is-style-pill a {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--paper) !important;
	padding: 0.25rem 0.625rem;
	display: inline-block;
}
.is-style-pill .wp-block-post-terms__separator { display: none; }
.is-style-pill a:not(:first-child) { display: none; }

/* Numbered list of posts ("Trending now"). */
.is-style-numbered { counter-reset: local-rank; }
.is-style-numbered > li {
	counter-increment: local-rank;
	display: flex;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.is-style-numbered > li::before {
	content: counter(local-rank);
	font-size: 2.5rem;
	font-weight: 800;
	line-height: 1;
	min-width: 2rem;
	color: var(--wp--preset--color--accent);
}

/* Fixed-size square thumbnails in section side lists. */
.local-thumb {
	flex: 0 0 120px;
	width: 120px;
}
.local-thumb img { width: 120px; height: 120px; object-fit: cover; }


/* Round, outlined search button as in the mockups. */
.wp-block-search__button-only .wp-block-search__button {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 1px solid #D0D0D0;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Image placeholders keep their box before load: no layout shift. */
.wp-block-post-featured-image img { background: var(--wp--preset--color--sand); }

/* Nothing may push the page wider than the screen (Google's mobile check). */
.wp-site-blocks { overflow-x: clip; }

/* Phones and small tablets: compact two-row header and swipeable menus. */
@media (max-width: 781px) {
	/* Logo | search | subscribe on row 1; swipeable menu | city menu on row 2. */
	.local-masthead {
		display: grid !important;
		grid-template-columns: 1fr auto auto;
		align-items: center;
		gap: 0.625rem !important;
	}
	.local-masthead .local-header-actions { display: contents; }
	.local-masthead .wp-block-site-logo { grid-column: 1; grid-row: 1; }
	.local-masthead .wp-block-search { grid-column: 2; grid-row: 1; }
	.local-masthead .wp-block-buttons { grid-column: 3; grid-row: 1; }
	.local-masthead .local-city-switcher { grid-column: 3; grid-row: 2; justify-self: end; }
	.local-masthead .local-city-switcher summary { font-size: 0.75rem; }
	.local-masthead > .local-scroll-nav {
		grid-column: 1 / 3;
		grid-row: 2;
		min-width: 0;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.local-scroll-nav .wp-block-navigation__container { flex-wrap: nowrap !important; }
	.local-scroll-nav .wp-block-navigation-item { white-space: nowrap; }
	.local-header-social { display: none !important; }
	.local-header-actions .wp-block-button__link { padding: 0.625rem 1rem; }
	.wp-block-site-logo img { width: 130px; }


	/* Less empty space above the lead story. */
	main.wp-block-group { padding-top: 1rem !important; }
	.wp-block-columns { margin-top: 0 !important; }
}

/* Visually hidden but readable by screen readers and Google. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Yoast breadcrumbs above article titles. */
.yoast-breadcrumbs {
	font-size: var(--wp--preset--font-size--s);
	color: var(--wp--preset--color--muted);
}
.yoast-breadcrumbs a { color: var(--wp--preset--color--muted); }

/* Arabic version of an article (local-core): yellow jump link at the top, right-to-left section at the end. */
html { scroll-behavior: smooth; }
.local-arabic-link a {
	display: inline-block;
	padding: 0.6em 1em;
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	text-decoration: none;
}
.local-arabic {
	margin-top: var(--wp--preset--spacing--50, 2.5rem);
	padding-top: var(--wp--preset--spacing--40, 2rem);
	border-top: 4px solid var(--wp--preset--color--ink);
	scroll-margin-top: 1.5rem;
	font-family: "Noto Naskh Arabic", "Geeza Pro", Tahoma, var(--wp--preset--font-family--serif);
	line-height: 1.9;
	text-align: right;
}

/* SVG logos have no built-in size; keep every city's logo the same width. */
.wp-block-site-logo img {
	width: 170px;
	max-width: 42vw;
	height: auto;
}

/* Forms (contact form, comments, newsletter): clean full-width fields and the brand button. */
.wpcf7 form,
.wp-block-post-comments-form form {
	display: grid;
	gap: 1.25rem;
	max-width: 640px;
	font-family: var(--wp--preset--font-family--display);
}
.wpcf7 form p,
.wp-block-post-comments-form p { margin: 0; }
.wpcf7 label,
.wp-block-post-comments-form label {
	display: block;
	font-size: var(--wp--preset--font-size--s);
	font-weight: 700;
	margin-bottom: 0.375rem;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 select,
.wpcf7 textarea,
.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 52px;
	padding: 0.75rem 1rem;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	border: 1.5px solid #CFCFCF;
	border-radius: 0;
	transition: border-color 0.15s;
}
.wpcf7 textarea,
.wp-block-post-comments-form textarea { min-height: 160px; resize: vertical; }
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus,
.wp-block-post-comments-form input:focus,
.wp-block-post-comments-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 20%, transparent);
}
.wpcf7 input[type="submit"],
.wp-block-post-comments-form input[type="submit"] {
	justify-self: start;
	min-height: 52px;
	padding: 0 2rem;
	font: inherit;
	font-weight: 800;
	font-size: 1rem;
	color: var(--wp--preset--color--paper);
	background: var(--wp--preset--color--ink);
	border: 0;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover,
.wp-block-post-comments-form input[type="submit"]:hover { background: var(--wp--preset--color--accent); }
.wpcf7 .wpcf7-not-valid { border-color: #B3261E; }
.wpcf7 .wpcf7-not-valid-tip { color: #B3261E; font-size: var(--wp--preset--font-size--s); margin-top: 0.375rem; }
.wpcf7 .wpcf7-response-output {
	margin: 0 !important;
	padding: 0.875rem 1rem !important;
	border: 0 !important;
	background: var(--wp--preset--color--sand);
	font-size: var(--wp--preset--font-size--s);
}
.wpcf7 form.sent .wpcf7-response-output { background: #E6F4EA; }
.wpcf7 .wpcf7-spinner { margin-inline-start: 0.75rem; }
.comment-notes,
.logged-in-as { font-size: var(--wp--preset--font-size--s); color: var(--wp--preset--color--muted); }

/* Plugin forms (member log-in and sign-up, page-builder contact form): same fields and buttons as above. */
.um.um-login,
.um.um-register,
.um.um-password {
	max-width: 640px !important;
	margin-inline: 0 !important;
	font-family: var(--wp--preset--font-family--display);
}
.um .um-field-label label,
.wp-block-post-content .so-widget-sow-contact-form .sow-form-field label {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--s);
	font-weight: 700;
	color: var(--wp--preset--color--ink);
	text-align: start;
}
.um .um-form input[type="text"],
.um .um-form input[type="email"],
.um .um-form input[type="password"],
.um .um-form textarea,
.wp-block-post-content .so-widget-sow-contact-form .sow-text-field,
.wp-block-post-content .so-widget-sow-contact-form textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 52px;
	padding: 0.75rem 1rem !important;
	font: inherit;
	font-size: 1rem !important;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper) !important;
	border: 1.5px solid #CFCFCF !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
.um .um-form input:focus,
.wp-block-post-content .so-widget-sow-contact-form .sow-text-field:focus,
.wp-block-post-content .so-widget-sow-contact-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent) !important;
}
.um input[type="submit"].um-button,
.um a.um-button,
.wp-block-post-content .so-widget-sow-contact-form .sow-submit {
	min-height: 52px;
	padding: 0 2rem !important;
	font-family: var(--wp--preset--font-family--display) !important;
	font-size: 1rem !important;
	font-weight: 800 !important;
	color: var(--wp--preset--color--paper) !important;
	background: var(--wp--preset--color--ink) !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	cursor: pointer;
}
.um a.um-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
}
.um a.um-button.um-alt {
	color: var(--wp--preset--color--ink) !important;
	background: var(--wp--preset--color--paper) !important;
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--ink) !important;
}
.um input[type="submit"].um-button:hover,
.um a.um-button:hover,
.wp-block-post-content .so-widget-sow-contact-form .sow-submit:hover {
	color: var(--wp--preset--color--paper) !important;
	background: var(--wp--preset--color--accent) !important;
}
.um a.um-link-alt { color: var(--wp--preset--color--muted) !important; }
.wp-block-post-content .so-widget-sow-contact-form .sow-contact-form {
	max-width: 640px;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	font-family: var(--wp--preset--font-family--display);
}
.wp-block-post-content .so-widget-sow-contact-form .sow-form-field { margin-bottom: 1.25rem !important; }

/* Events (The Events Calendar): brand colours and fonts instead of the plugin's blue. */
body {
	--tec-color-accent-primary: var(--wp--preset--color--ink);
	--tec-color-accent-primary-hover: var(--wp--preset--color--accent);
	--tec-color-accent-primary-active: var(--wp--preset--color--accent);
	--tec-color-button-primary: var(--wp--preset--color--ink);
	--tec-color-button-primary-hover: var(--wp--preset--color--accent);
	--tec-color-link-accent: var(--wp--preset--color--ink);
	--tec-color-link-accent-hover: var(--wp--preset--color--accent);
	--tec-color-border-active: var(--wp--preset--color--ink);
	--tec-font-family-sans-serif: var(--wp--preset--font-family--display);
	--tec-font-family-base: var(--wp--preset--font-family--display);
}
.tribe-common .tribe-common-c-btn,
.tribe-events .tribe-events-c-search__button,
.tribe-block__events-link .tribe-block__btn--link,
.tribe-events-c-subscribe-dropdown__button { border-radius: 0 !important; }
.single-tribe_events .tribe-events-single a:not(.tribe-common-c-btn) { color: var(--wp--preset--color--ink); text-decoration: underline; }

/* Footer: city account links on the dark background. */
.local-follow a { color: var(--wp--preset--color--paper); text-decoration: underline; text-underline-offset: 3px; }

/* City menu ("SAUDI ARABIA ⌄"), like Time Out's. No JavaScript: a native <details>. */
.local-city-switcher { position: relative; }
.local-city-switcher summary {
	list-style: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	min-height: 44px;
	padding: 0 0.25rem;
	font-weight: 800;
	font-size: 0.875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}
.local-city-switcher summary::-webkit-details-marker { display: none; }
.local-city-switcher[open] summary svg { transform: rotate(180deg); }
.local-city-switcher ul {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 0.5rem);
	z-index: 50;
	min-width: 200px;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}
.local-city-switcher li > * {
	display: block;
	padding: 0.625rem 1.25rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.local-city-switcher li > span { color: var(--wp--preset--color--muted); }
.local-city-switcher li > a:hover { background: var(--wp--preset--color--sand); }
.local-city-switcher li.is-current > * { color: var(--wp--preset--color--accent); }

/* Footer. */
.local-footer-heading {
	font-size: var(--wp--preset--font-size--xs) !important;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #9A9A9A;
	margin-bottom: 1rem;
}
.local-footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; font-size: var(--wp--preset--font-size--s); }
.local-footer-list span { color: #9A9A9A; }
footer .wp-block-navigation a { font-weight: 600; }

/* Newsletter sign-up. */
.local-newsletter__row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.local-newsletter input[type="email"] {
	flex: 1 1 200px;
	min-height: 48px;
	padding: 0 1rem;
	font: inherit;
	font-size: 1rem;
	border: 0;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
}
.local-newsletter button {
	min-height: 48px;
	padding: 0 1.25rem;
	font: inherit;
	font-weight: 800;
	border: 0;
	cursor: pointer;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--yellow);
}
.local-newsletter__note { margin-top: 0.75rem; font-size: var(--wp--preset--font-size--xs); color: #9A9A9A; }
.local-newsletter__note a { color: inherit; text-decoration: underline; }
.local-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer, v2: yellow newsletter band + calm black footer. */
.local-nl-band .local-newsletter__row { margin-top: 0; }
.local-nl-band .local-newsletter input[type="email"] { min-height: 60px; font-size: 1.125rem; border: 2px solid var(--wp--preset--color--ink); }
.local-nl-band .local-newsletter button { min-height: 60px; padding: 0 2rem; font-size: 1.0625rem; color: var(--wp--preset--color--paper); background: var(--wp--preset--color--ink); }
.local-nl-band .local-newsletter button:hover { background: var(--wp--preset--color--accent); }
.local-nl-band .local-newsletter__note { color: var(--wp--preset--color--ink); opacity: 0.75; }
.local-footer .local-footer-heading { color: var(--wp--preset--color--yellow); }
.local-footer-nav a, .local-footer .local-footer-list a { font-weight: 600; font-size: 1rem; }
.local-footer .local-footer-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem 1.5rem; font-size: 1rem; }
.local-footer .local-footer-list a:hover, .local-footer-nav a:hover { color: var(--wp--preset--color--yellow); text-decoration: none; }
.local-footer-email a { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.local-footer-cta .wp-block-button__link:hover { background: var(--wp--preset--color--yellow) !important; color: var(--wp--preset--color--ink) !important; }
.local-footer-logo img { width: 180px; }
.local-footer .local-follow { margin-top: 1rem; }
.local-footer-bottom a { color: #9A9A9A !important; }
.local-footer-bottom a:hover { color: var(--wp--preset--color--paper) !important; }
