/*
Theme Name:  Matera Committee
Theme URI:   https://vote.matera.us
Author:      Chris Matera
Author URI:  https://matera.us
Description: Official site theme for Chris Matera, Sutton School Committee Member. Features a modular info strip, post category system, sidebar widgets, and a clean professional design in navy, red, and gold.
Version:     1.1.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: matera-committee
Tags:        blog, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, sticky-post, threaded-comments
*/

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #0D2545;
  --navy-mid:   #1B3A6B;
  --navy-light: #E8EEF7;
  --red:        #B5242A;
  --red-light:  #F9ECED;
  --gold:       #C49A1A;
  --gold-light: #FDF6E3;
  --cream:      #F8F6F1;
  --white:      #FFFFFF;
  --border:     #DDD8CE;
  --text:       #1A1A1A;
  --text-mid:   #3D4E60;
  --text-muted: #7A8899;
  --font-serif: 'Libre Baskerville', Georgia, serif;
  --font-sans:  'Source Sans 3', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.site-topbar {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.45rem 1rem;
  font-weight: 500;
}
.site-topbar span { color: rgba(255,255,255,0.85); }

/* ── HEADER ── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-branding {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}
.site-branding .site-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-branding .site-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
}
.header-rule {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 1.5rem;
  flex-shrink: 0;
}

/* ── PRIMARY NAVIGATION ── */
.main-navigation {
  display: flex;
  align-items: center;
  flex: 1;
}
.main-navigation ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.main-navigation ul li a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  display: block;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a {
  background: var(--navy-light);
  color: var(--navy);
}
.header-contact {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-left: 1rem;
  flex-shrink: 0;
}
.header-contact a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}
.header-contact a:hover { color: var(--red); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

/* ── MASTHEAD ── */
.site-masthead {
  background: var(--navy);
  padding: 3.5rem 2rem;
  position: relative;
  overflow: hidden;
}
.site-masthead::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, var(--gold) 100%);
}
.masthead-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.masthead-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.site-masthead h1,
.site-masthead .masthead-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.masthead-description {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.62);
  max-width: 580px;
  font-weight: 300;
  line-height: 1.65;
}

/* ── INFO STRIP ── */
.info-strip {
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  padding: 0 2rem;
}
.info-strip-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.strip-tile {
  padding: 1.1rem 1.25rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}
.strip-tile:last-child { border-right: none; }
.strip-tile-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.3rem;
}
.strip-tile.type-stat .strip-value {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}
.strip-tile.type-stat .strip-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.2rem;
}
.strip-tile.type-link .strip-headline {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.4;
  text-decoration: none;
  display: block;
}
.strip-tile.type-link .strip-headline:hover { color: var(--gold); }
.strip-tile.type-link .strip-source {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  margin-top: 0.25rem;
}
.strip-tile.type-meeting .strip-date-block {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.strip-tile.type-meeting .strip-date-day {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}
.strip-tile.type-meeting .strip-date-month {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.strip-tile.type-meeting .strip-meeting-info {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.25rem;
  line-height: 1.45;
}
.strip-tile.type-meeting a {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
}
.strip-tile.type-meeting a:hover { color: var(--white); }

/* ── LAYOUT — full width, no sidebar ── */
.site-content-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: block;
}

.site-main,
#main {
  width: 100%;
  max-width: 100%;
  display: block;
}

/* ── FEED LABEL ── */
.feed-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
.feed-label-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.feed-label-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── POST CARDS ── */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
  display: grid;
  grid-template-columns: 4px 1fr;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(13,37,69,0.08); }
.post-card-accent { background: var(--navy); }

/* Category accent colors */
.post-card.cat-meeting-recap .post-card-accent,
.post-card.cat-meeting-recaps .post-card-accent { background: var(--red); }
.post-card.cat-budget-finance .post-card-accent,
.post-card.cat-budget .post-card-accent         { background: var(--gold); }
.post-card.cat-policy-positions .post-card-accent,
.post-card.cat-policy .post-card-accent         { background: var(--navy); }
.post-card.cat-community .post-card-accent      { background: #2E7D32; }
.post-card.cat-press .post-card-accent          { background: #6A1B9A; }

.post-card-body { padding: 1.5rem 1.75rem; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.post-cat {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}
.cat-meeting-recap  .post-cat,
.cat-meeting-recaps .post-cat { background: var(--red-light);  color: var(--red); }
.cat-budget-finance .post-cat,
.cat-budget         .post-cat { background: var(--gold-light); color: #7A5E00; }
.cat-policy-positions .post-cat,
.cat-policy         .post-cat { background: var(--navy-light); color: var(--navy); }
.cat-community      .post-cat { background: #E8F5E9; color: #1B5E20; }
.cat-press          .post-cat { background: #F3E5F5; color: #4A148C; }

.post-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.post-card h2, .post-card .entry-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 0.5rem;
}
.post-card h2 a, .post-card .entry-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.post-card h2 a:hover, .post-card .entry-title a:hover { color: var(--red); }
.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 1rem;
}
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}
.read-more::after { content: ' →'; }
.read-more:hover { color: var(--red); }
.post-read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Featured/sticky post */
.post-card.sticky,
.post-card.featured {
  grid-template-columns: 1fr;
  border-top: 4px solid var(--navy);
  border-left: 1px solid var(--border);
}
.post-card.sticky .post-card-body,
.post-card.featured .post-card-body { padding: 2rem 2rem 1.75rem; }
.post-card.sticky h2,
.post-card.featured h2 { font-size: 1.55rem; }
.featured-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--navy);
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
}

/* Pagination */
.posts-navigation,
.pagination {
  margin-top: 2rem;
  text-align: center;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}
.posts-navigation .nav-links,
.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.posts-navigation a,
.posts-navigation span,
.pagination a,
.pagination span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 3px;
  background: var(--white);
  transition: background 0.15s;
}
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.posts-navigation a:hover, .pagination a:hover { background: var(--navy-light); }

/* ── SINGLE POST ── */
.single-post-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}
.single-post-wrap .entry-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.single-post-wrap .entry-title { font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; color: var(--navy); line-height: 1.25; margin-bottom: 0.75rem; }
.single-post-wrap .entry-content { font-size: 1rem; color: var(--text); line-height: 1.75; }
.single-post-wrap .entry-content h2 { font-family: var(--font-serif); font-size: 1.4rem; color: var(--navy); margin: 2rem 0 0.75rem; }
.single-post-wrap .entry-content h3 { font-family: var(--font-serif); font-size: 1.15rem; color: var(--navy); margin: 1.5rem 0 0.5rem; }
.single-post-wrap .entry-content p { margin-bottom: 1.25rem; }
.single-post-wrap .entry-content ul,
.single-post-wrap .entry-content ol { margin: 0 0 1.25rem 1.5rem; }
.single-post-wrap .entry-content li { margin-bottom: 0.35rem; }
.single-post-wrap .entry-content a { color: var(--navy); text-decoration: underline; }
.single-post-wrap .entry-content a:hover { color: var(--red); }
.single-post-wrap .entry-content blockquote { border-left: 4px solid var(--red); margin: 1.5rem 0; padding: 0.75rem 1.5rem; font-style: italic; color: var(--text-mid); background: var(--cream); }
.single-post-wrap .entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
.single-post-wrap .entry-content table th { background: var(--navy); color: var(--white); padding: 0.6rem 1rem; text-align: left; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.single-post-wrap .entry-content table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); }
.single-post-wrap .entry-content table tr:nth-child(even) td { background: var(--cream); }

/* ── SIDEBAR (kept for widget admin, hidden from layout) ── */
.widget-area { display: none; }
.sidebar-card { background: var(--white); border: 1px solid var(--border); border-radius: 2px; overflow: hidden; }
.sidebar-card-header { background: var(--navy); padding: 0.75rem 1.25rem; }
.sidebar-card-header h3,
.sidebar-card-header .widget-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.85); margin: 0; }
.sidebar-card-body { padding: 1.25rem; }
.about-name { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 0.2rem; }
.about-role  { font-size: 0.75rem; color: var(--red); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.85rem; }
.about-bio   { font-size: 0.85rem; color: var(--text-mid); line-height: 1.65; margin-bottom: 1rem; }
.about-contact { font-size: 0.82rem; color: var(--text-mid); display: flex; flex-direction: column; gap: 0.35rem; }
.about-contact a { color: var(--navy); font-weight: 600; text-decoration: none; }
.about-contact a:hover { color: var(--red); }
.cat-list { list-style: none; }
.cat-list li { display: flex; align-items: center; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.cat-list li:last-child { border-bottom: none; }
.cat-list a { color: var(--navy); text-decoration: none; font-weight: 500; }
.cat-list a:hover { color: var(--red); }
.cat-count { font-size: 0.75rem; color: var(--text-muted); background: var(--cream); padding: 0.1rem 0.5rem; border-radius: 10px; font-weight: 500; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.5rem; vertical-align: middle; }
.meeting-block { background: var(--navy-light); border-radius: 3px; padding: 1rem; margin-bottom: 0.75rem; }
.meeting-block .month-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.2rem; }
.meeting-block .day-number { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--navy); line-height: 1; }
.meeting-block .meeting-info { font-size: 0.82rem; color: var(--text-mid); margin-top: 0.5rem; line-height: 1.5; }
.meeting-block .agenda-link { display: inline-block; margin-top: 0.5rem; font-size: 0.78rem; font-weight: 600; color: var(--navy); text-decoration: none; }
.meeting-block .agenda-link:hover { color: var(--red); }
.resource-list { list-style: none; }
.resource-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.resource-list li:last-child { border-bottom: none; }
.resource-list a { font-size: 0.85rem; color: var(--navy); text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.resource-list a::before { content: '↗'; font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; }
.resource-list a:hover { color: var(--red); }
.widget-area .widget { margin-bottom: 0; }
.widget-area .widget ul { list-style: none; }
.widget-area .widget ul li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.widget-area .widget ul li:last-child { border-bottom: none; }
.widget-area .widget ul li a { color: var(--navy); text-decoration: none; }
.widget-area .widget ul li a:hover { color: var(--red); }

/* ── SITE FOOTER ── */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .brand-name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.footer-brand .brand-role { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--red); margin-bottom: 0.6rem; }
.footer-brand p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.footer-col h4 { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul a { font-size: 0.85rem; color: var(--text-mid); text-decoration: none; }
.footer-col ul a:hover { color: var(--navy); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-bottom p { font-size: 0.72rem; color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--navy); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .header-inner { padding: 0 1.25rem; flex-wrap: wrap; height: auto; padding-top: 0.75rem; padding-bottom: 0.75rem; gap: 0.5rem; }
  .header-rule { display: none; }
  .main-navigation { display: none; width: 100%; order: 3; }
  .main-navigation.toggled { display: flex; }
  .main-navigation ul { flex-direction: column; width: 100%; padding-bottom: 0.5rem; }
  .main-navigation ul li a { padding: 0.5rem 0; }
  .menu-toggle { display: block; }
  .header-contact { display: none; }
  .site-masthead { padding: 2.5rem 1.25rem; }
  .info-strip { padding: 0 1.25rem; }
  .strip-tile { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .strip-tile:last-child { border-bottom: none; }
  .site-content-wrap { padding: 2rem 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; padding: 2rem 1.25rem; }
  .footer-bottom { padding: 1rem 1.25rem; flex-direction: column; align-items: flex-start; }
}

/* ── WP ADMIN BAR OFFSET ── */
@media screen and (min-width: 601px) { .admin-bar .site-topbar { margin-top: 32px; } }
@media screen and (max-width: 600px) { .admin-bar .site-topbar { margin-top: 46px; } }

/* ── WP ALIGNMENT HELPERS ── */
.alignleft  { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1.5rem; }
img { max-width: 100%; height: auto; }

/* ── ELEMENTOR COMPATIBILITY ── */
.elementor-section.elementor-section-boxed > .elementor-container,
.elementor-container {
  max-width: 1400px !important;
  width: 100% !important;
}
.elementor-fullwidth-wrap,
.elementor-fullwidth-wrap .site-main {
  width: 100%;
  max-width: 100%;
}
.elementor-widget-heading .elementor-heading-title {
  font-family: var(--font-serif);
  color: var(--navy);
}
.elementor-widget-text-editor {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.7;
}
.elementor-button {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.admin-bar .elementor-editor-active .elementor-section {
  scroll-margin-top: 32px;
}

/* ── WIDGET CARD STRUCTURE FIX ── */
.sidebar-card .sidebar-card-body:empty { display: none; padding: 0; }
.sidebar-card .sidebar-card-body:first-child:empty + .sidebar-card-header { margin-top: 0; }
.sidebar-card.widget { margin-bottom: 0; border-radius: 0; }
.sidebar-card.widget + .sidebar-card.widget { border-top: none; }