/* =========================================================
   pubsni.com — assets/style.css
   Clean, readable, mobile-first styling for:
   - index + county pages
   - event cards rendered by app.js
   - consistent nav with icon top-right
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root{
  --bg:#f7f9fc;
  --card:#ffffff;
  --muted:#64748b;
  --text:#0f172a;

  --accent:#e11d48;      /* red */
  --accent2:#2563eb;     /* blue */
  --good:#16a34a;        /* green */
  --warn:#f59e0b;        /* amber */

  --border:#e5e7eb;
  --shadow: 0 10px 30px rgba(2,6,23,0.06);
  --radius: 16px;
}

/* ---------- Base Reset ---------- */
*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
  color:var(--text);
  line-height:1.4;

  /* subtle faded pint background */
  background:
    linear-gradient(rgba(247,249,252,0.94), rgba(247,249,252,0.94)),
    url("../images/pint.png");
  background-repeat: no-repeat;
  background-position: right 28px top 120px;
  background-size: 560px auto;

  /* required for faded logo overlay */
  position: relative;
  min-height: 100vh;
}

/* Faded logo overlay (does NOT affect content opacity) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background-image: url("../images/pubsniicon.PNG");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 520px auto;  /* tweak if you want bigger/smaller */
  opacity: 0.06;               /* tweak fade */
  pointer-events: none;
  z-index: 0;
}

/* keep all content above the faded logo */
body > *{
  position: relative;
  z-index: 1;
}

img{ max-width:100%; display:block; }
a{ color:inherit; }
button, input, select{ font:inherit; }

/* ---------- Accessibility Helpers ---------- */
.sr-only{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}

/* ---------- Layout ---------- */
.container{
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
}

.muted{ color:var(--muted); }

/* =========================================================
   Header / Nav
   ========================================================= */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 14px;
  align-items: center;
  padding: 12px 0;
}

.brand{
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  line-height: 1.1;
}

.brand b{
  font-size: 28px;              /* was 18px */
  font-weight: 900;
  letter-spacing: -0.6px;
  color: var(--accent2);        /* blue brand emphasis */
  line-height: 1.05; 
  position: relative;
}

/* subtle underline accent */
.brand b::after{
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--accent);
  border-radius: 3px;
  margin-top: 6px;
}

.brand-subtitle{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
}

.nav-icon-link{
  justify-self: end;
  display: inline-flex;
  align-items: center;
  text-decoration:none;
}

.nav-icon{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}

.nav-links{
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;          /* keeps spacing tight */
  align-items: center;
  padding-top: 2px;
}

.nav-home{
  text-decoration: none;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.nav-counties{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-counties a{
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.nav-counties a:hover,
.nav-home:hover{
  border-color: rgba(15,23,42,0.25);
}

.nav-counties a[aria-current="page"]{
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.nav-actions{
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
  flex-wrap: nowrap;      /* keeps Submit + Contact together */
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.btn-ghost{
  background: #fff;
  color: var(--text);
}

.btn-primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover{ filter: brightness(0.98); }
.btn-ghost:hover{ border-color: rgba(15,23,42,0.25); }

/* =========================================================
   Page Head / Filters
   ========================================================= */
.page-head{
  padding: 18px 0 10px;
}

.page-head h1{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.2px;
}

.page-head p{
  margin: 6px 0 0;
  color: var(--muted);
}

.filters{
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 10px;
  align-items: center;
  padding: 10px 0 14px;
}

/* Desktop tweak:
   Move "All dates" (2nd select) BELOW "All categories" (1st select).
   Assumes the children are in this order:
   1) .search
   2) .select (category)
   3) .select (date)
*/
@media (min-width: 900px){
  .filters{
    grid-template-columns: 1fr 260px;
    grid-template-rows: auto auto;
    gap: 12px;
    align-items: start;
  }

  .filters .search{
    grid-column: 1;
    grid-row: 1 / span 2;   /* search spans both rows */
  }

  .filters .select:nth-of-type(1){
    grid-column: 2;
    grid-row: 1;            /* All categories */
  }

  .filters .select:nth-of-type(2){
    grid-column: 2;
    grid-row: 2;            /* All dates under categories */
  }
}

.search input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
}

.search input:focus{
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.select select{
  width: 100%;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
}

.select select:focus{
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* =========================================================
   Cards / Event UI (app.js output)
   ========================================================= */
.cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 10px 0 18px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
}

.card h3{
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.1px;
}

.card .meta{
  display:flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items:center;
  color: var(--muted);
  font-size: 13px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 800;
  font-size: 12px;
}

.badge.good{
  border-color: rgba(22,163,74,0.25);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.10);
}

.badge.warn{
  border-color: rgba(245,158,11,0.30);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.10);
}

.card .desc{
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.card a{
  color: var(--accent2);
  font-weight: 800;
  text-decoration: none;
}

.card a:hover{ text-decoration: underline; }

/* Small CTA row inside cards (if you add it later) */
.card .actions{
  margin-top: auto;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   Browse Counties (chips)
   ========================================================= */
.browse{
  padding: 12px 0 6px;
}

.browse h2{
  margin: 10px 0 10px;
  font-size: 16px;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.chip{
  display:inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  text-decoration:none;
  font-weight: 800;
  font-size: 13px;
}

.chip:hover{
  border-color: rgba(15,23,42,0.25);
}

.chip[aria-current="page"]{
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* =========================================================
   Footer
   ========================================================= */
.footer{
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 20px;
}

.footer-inner{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:center;
  justify-content: space-between;
}

.footer a{
  color: var(--accent2);
  text-decoration:none;
  font-weight: 800;
}
.footer a:hover{ text-decoration: underline; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px){
  body{
    background-position: center, right -60px top 140px;
    background-size: cover, 440px auto;
  }

  .filters{
    grid-template-columns: 1fr;
  }

  .nav-actions{
    width: 100%;
    justify-content: flex-start;
  }

  .cards{
    grid-template-columns: 1fr;
  }

  .footer-inner{
    justify-content: flex-start;
  }
}

/* =========================================================
   Optional: reduce motion
   ========================================================= */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
}
