/*
Theme Name: UKDecides
Text Domain: ukdecides
Description: A data-led UK polling, elections and political reference theme.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
WPVibe: yes
*/

/* This file holds the WordPress theme header (above) plus truly global
 * rules only. Tailwind handles everything else.
 *
 * - Design tokens live in theme.css's @theme block.
 * - Prose + form styles live in presets.css.
 * - Layout, color, typography utilities come from Tailwind v4.
 *
 * Do NOT add component classes here (.btn-primary, .card, etc.). Use
 * Tailwind utilities in templates instead.
 */

html {
	scroll-behavior: smooth;
}

/* Mobile: keep linked history stat aligned with the other band items. */
@media (max-width: 760px) {
	body .ukd-stat-grid > .ukd-stat-link {
		margin-left: 0 !important;
		padding-left: 0 !important;
		transform: none !important;
	}
}

	/* Mobile poll cards: keep all six party figures on one row. */
@media (max-width: 900px) {
	body .ukd-poll-table tr {
		display: grid !important;
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}
	body .ukd-poll-table td:nth-child(1),
	body .ukd-poll-table td:nth-child(2) {
		grid-column: 1 / -1 !important;
	}
	body .ukd-poll-table td:nth-child(3) { grid-column: 1 !important; grid-row: 3 !important; }
	body .ukd-poll-table td:nth-child(4) { grid-column: 2 !important; grid-row: 3 !important; }
	body .ukd-poll-table td:nth-child(5) { grid-column: 3 !important; grid-row: 3 !important; }
	body .ukd-poll-table td:nth-child(6) { grid-column: 4 !important; grid-row: 3 !important; }
	body .ukd-poll-table td:nth-child(7) { grid-column: 5 !important; grid-row: 3 !important; }
		body .ukd-poll-table td:nth-child(8) { grid-column: 6 !important; grid-row: 3 !important; border-top: 4px solid #4a4a4a !important; }
		body .ukd-poll-table td:nth-child(8)::before { content: "Restore" !important; }
		body .ukd-pop-table td:nth-child(9) { grid-column: 1 / -1 !important; grid-row: 4 !important; text-align: right !important; border-top: 1px solid #c6cecb !important; }
}

/* Desktop: align homepage band links to the main site grid. */
@media (min-width: 761px) {
	html body .ukd-stat-grid > .ukd-stat-link {
		margin-left: 0 !important;
		transform: none !important;
	}
	html body .ukd-stat-grid > .ukd-stat-link:first-child {
		padding-left: 0 !important;
	}
}

/* Elections explainer: readable measure and distinct paragraphs on small screens. */
body .ukd-election-explainer h2 {
	max-width: 18ch;
	text-wrap: balance;
}
body .ukd-election-explainer p {
	max-width: 78ch;
	line-height: 1.68;
	overflow-wrap: break-word;
}
body .ukd-election-explainer p + p {
	margin-top: 1rem;
}


/* Restore Britain polling colour. */
body .ukd-poll-table td:nth-child(8) { box-shadow: inset 0 -3px #4a4a4a !important; }
body .ukd-pop-rb .ukd-pop-bar i { background: #4a4a4a !important; }
body .ukd-range-rb { border-top: 5px solid #4a4a4a; }

/* Mobile polling grid: the unused bottom-right slot is plain white, not a grey block. */
@media (max-width:900px) {
  html body .ukd-main .ukd-expanded-poll-table tbody tr { background:#fff !important; }
}

/* Editorial refresh: white reading canvas and restrained headline casing. */
body, .ukd-header, .ukd-hero, .ukd-lookup-card, .ukd-feature-card {
  background-color: #fff !important;
}
.ukd-section-alt { background-color: #f7f8f9 !important; }
.ukd-hero::after { opacity: .18 !important; }
.ukd-nav-list, .ukd-hero h1, .ukd-section-head h2,
.ukd-principles h2, .ukd-content h1, .ukd-content h2,
.ukd-feature-card h3, .ukd-lookup-card h2,
.ukd-result-card strong, .ukd-stat-grid strong {
  text-transform: none !important;
}
.ukd-nav-list { letter-spacing: 0 !important; font-size: 13px !important; }
.ukd-hero h1 { line-height: .92 !important; }

/* Editorial headline case across all page, article and bespoke data templates.
   Keep uppercase only on compact metadata, table labels and site branding. */
main h1, main h2, main h3, main h4,
.ukd-data-hero h1, .ukd-mrp-card h2,
.ukd-mrp-results-head h2, .ukd-mrp-chart-head h2,
.ukd-mrp-outcome strong {
  text-transform: none !important;
}
/* Match constituency-page pale blue heroes on standard inner pages. */
body:not(.home) main.ukd-main .ukd-data-hero {
  background:#e2eef5 !important;
  border-bottom:1px solid #b6cbd9;
  position:relative;
  overflow:hidden;
  isolation:isolate;
}
body:not(.home) main.ukd-main .ukd-data-hero::before {
  content:"";
  position:absolute;
  inset:0 0 0 auto;
  width:46%;
  background-image:linear-gradient(#b9d3e3 1px,transparent 1px),linear-gradient(90deg,#b9d3e3 1px,transparent 1px);
  background-size:30px 30px;
  opacity:.72;
  z-index:-1;
  pointer-events:none;
}
@media(max-width:760px){body:not(.home) main.ukd-main .ukd-data-hero::before{width:100%;opacity:.28}}

.ukd-data-hero h1 { line-height: 1.02 !important; }

/* Primary navigation dropdowns */
body .ukd-nav-list > li { position: relative; }
body .ukd-nav-list > li > a { display: block; }
body .ukd-nav-list > .menu-item-has-children > a::after { content: "⌄"; display: inline-block; margin-left: 6px; }
body .ukd-nav-list .sub-menu { display: none; position: absolute; top: 100%; left: -14px; min-width: 210px; margin: 0; padding: 8px; list-style: none; background: #fff; border: 1px solid #d8dce0; box-shadow: 0 8px 20px rgba(16,24,32,.12); z-index: 1000; }
body .ukd-nav-list li:hover > .sub-menu,
body .ukd-nav-list li:focus-within > .sub-menu { display: block; }
body .ukd-nav-list .sub-menu a { display: block; padding: 12px; border: 0; white-space: nowrap; }
body .ukd-nav-list .sub-menu a:hover,
body .ukd-nav-list .sub-menu a:focus-visible { background: #f1f3f5; }
body .ukd-nav-list a:focus-visible { outline: 2px solid #185adb; outline-offset: 2px; }
@media (max-width: 900px) {
 body .ukd-nav { max-height: calc(100dvh - 76px); overflow-y: auto; }
 body .ukd-nav-list .sub-menu { display: block; position: static; min-width: 0; padding: 0 0 6px 16px; border: 0; box-shadow: none; background: transparent; }
 body .ukd-nav-list .sub-menu a { padding: 8px 0; white-space: normal; font-size: 12px; }
}
/* Pilot constituency editorial facts */
.ukd-local-highlights{margin-top:34px}
.ukd-local-highlights-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px}
.ukd-local-highlights-grid article{padding:23px 25px;background:#fff;border:1px solid #dce2e7;border-top:3px solid #163e61}
.ukd-local-tag{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#5b6b77;font-weight:700}
.ukd-local-highlights-grid h3{margin:10px 0;font-size:21px;line-height:1.3}
.ukd-local-highlights-grid p{font-size:15px;line-height:1.7;color:#384652}
.ukd-local-highlights-grid a{font-size:13px;font-weight:700;color:#155c91;text-decoration:underline;text-underline-offset:3px}
@media(max-width:700px){.ukd-local-highlights-grid{grid-template-columns:1fr}.ukd-local-highlights-grid article{padding:20px}}




