/*
  Backpacking Baristas — Shared Styles
  Mobile-first. Colors come from colors.css — do not hardcode hex here.
*/

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.2;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--color-accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Top Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-nav-bg);
  color: var(--color-nav-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-brand img.logo-long {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1); /* renders the black logo in cream on the dark nav bar */
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-links a {
  display: block;
  color: var(--color-nav-text);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
}

@media (min-width: 400px) {
  .nav-brand img.logo-long {
    height: 36px;
  }

  .nav-links {
    gap: 1.1rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }
}

@media (min-width: 640px) {
  .nav-bar {
    padding: 0.75rem 1.25rem;
  }

  .nav-brand img.logo-long {
    height: 46px;
  }

  .nav-links {
    gap: 1.75rem;
  }

  .nav-links a {
    font-size: 1rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
  background-color: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.hero img.hero-logo {
  width: 150px;
  margin: 0 auto 1.25rem;
}

.hero h1 {
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  max-width: 40ch;
  margin: 0 auto;
}

.page-hero {
  padding: 2.25rem 0 1.75rem;
  background-color: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.page-hero h1 {
  font-size: 1.7rem;
  margin-bottom: 0.4rem;
}

.page-hero p {
  color: var(--color-text-muted);
}

/* ---------- Main content spacing ---------- */

main {
  flex: 1;
}

section {
  padding: 2rem 0;
}

/* ---------- Cards / nav tiles on the homepage ---------- */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tile {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59, 36, 25, 0.12);
}

.tile-icon {
  font-size: 2rem;
}

.tile h2 {
  font-size: 1.15rem;
}

.tile p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex: 1;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---------- Cards (generic) ---------- */

.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

/* ---------- Placeholder / empty states ---------- */

.placeholder-box {
  background-color: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
}

.placeholder-box h2 {
  color: var(--color-heading);
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  background-color: var(--color-accent-secondary);
  color: var(--color-white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Forms ---------- */

.form-group {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.help-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* ---------- Stay in the loop (events page) ---------- */

.contact-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-link-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.contact-link-row:hover,
.contact-link-row:focus {
  background-color: var(--color-bg-alt);
  color: inherit;
}

.contact-link-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.contact-link-title {
  font-weight: 600;
  color: var(--color-heading);
}

/* ---------- Events ---------- */

.featured-event {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-surface);
  text-decoration: none;
  color: inherit;
}

.featured-event img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.featured-event-body {
  padding: 1.25rem 1.5rem;
}

.featured-event-body h2 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.3rem;
}

@media (min-width: 640px) {
  .featured-event {
    flex-direction: row;
  }

  .featured-event img {
    width: 50%;
    aspect-ratio: auto;
    height: auto;
  }

  .featured-event-body {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* Always 2 columns — this site is built phone-first, and a long scrolling
   grid of two reads better on a phone than reflowing wider at desktop
   widths. */
.event-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.event-grid-item {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

.event-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-date-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.6rem;
  background: linear-gradient(to top, rgba(9, 8, 14, 0.8), transparent);
  color: var(--color-white);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- Event detail page ---------- */

.event-eyebrow {
  margin-bottom: 0.5rem;
}

.event-eyebrow a {
  font-size: 0.85rem;
  font-weight: 600;
}

.event-detail {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 640px;
  margin: 0 auto;
}

.event-detail-img {
  width: 100%;
  border-radius: var(--radius-lg);
  display: block;
}

/* ---------- Story / About page ---------- */

.story-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.story-block h2 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
}

.story-block p {
  margin-bottom: 0.75rem;
}

.story-block p:last-child {
  margin-bottom: 0;
}

.quote-card {
  background-color: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.quote-card p {
  font-style: italic;
  color: var(--color-heading);
}

.story-closer {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-heading);
  margin-top: 0.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background-color: var(--color-espresso);
  color: var(--color-cream);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-cream);
  text-decoration: underline;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
