/*
  style.css — the look of the whole Hoffer Warehouses site.

  Every page links to this one file, so a change here changes every page.
  Every CSS rule has this shape:

    selector {
      property: value;
    }

  Read lessons/03-css-basics.md alongside this file.
*/

/* ---------- Variables ----------
   Define each color once, reuse it everywhere with var(--name).
   The colors are taken from the old brewery's brick. */
:root {
  --brick: #8b3a2b;        /* main brand color */
  --brick-dark: #5e261c;   /* darker version, for hover effects */
  --charcoal: #2b2b2b;     /* header and footer background */
  --cream: #f7f3ee;        /* page background */
  --text: #222222;
  --muted: #666666;        /* softer grey text */
  --max-width: 1000px;     /* the widest the content gets on big screens */
}

/* ---------- Whole page ---------- */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  /* These three lines keep the footer at the bottom of the screen,
     even on a page with very little content. */
  min-height: 100vh;      /* at least as tall as the screen */
  display: flex;
  flex-direction: column; /* stack header, main, footer top to bottom */
}

h1, h2, h3 {
  line-height: 1.2;
}

/* Links that are inside normal text */
a {
  color: var(--brick);
}

/* Images never get wider than their container (important on phones). */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Header and menu ---------- */
.site-header {
  background: var(--charcoal);
  color: white;
}

/* .header-inner is a box that keeps the header content centered.
   "display: flex" lines its children up side by side. */
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;               /* let items drop to a new line on small screens */
  align-items: center;           /* line them up vertically in the middle */
  justify-content: space-between;/* push the logo left and the menu right */
  gap: 0.5rem 1.5rem;            /* space between items: rows, then columns */
}

.logo {
  color: white;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: 0.05em;
}

/* The small "Toledo, OH" after the name */
.logo span {
  display: block;
  font-size: 0.8rem;
  font-weight: normal;
  color: #cccccc;
  letter-spacing: 0.1em;
}

nav a {
  color: white;
  text-decoration: none;
  margin-right: 1.25rem;
  padding-bottom: 0.2rem;
}

nav a:last-child {
  margin-right: 0;
}

nav a:hover {
  border-bottom: 2px solid white;
}

/* class="current" marks the menu link for the page you are on.
   Each page puts it on a different link. */
nav a.current {
  border-bottom: 2px solid var(--brick);
}

/* ---------- Main content area ---------- */
main {
  flex: 1;          /* grow to fill spare space, pushing the footer down */
  width: 100%;
  box-sizing: border-box; /* count the padding inside the width */
  max-width: calc(var(--max-width) + 2rem); /* + the padding, to line up with the header */
  margin: 0 auto;   /* "auto" left and right margins center the box */
  padding: 1rem;
}

section {
  margin: 2.5rem 0;
}

/* ---------- Hero: the big photo banner at the top of a page ---------- */
.hero {
  /* Two backgrounds stacked: a dark see-through layer on top so the
     white text is readable, and the photo underneath. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)),
    url("../images/building-exterior.jpg") center / cover;
  color: white;
  text-align: center;
  padding: 6rem 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
}

.hero p {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
}

/* A smaller hero for the inner pages */
.hero.small {
  padding: 3.5rem 1rem;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  background: var(--brick);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
}

.button:hover {
  background: var(--brick-dark);
}

/* ---------- Cards: boxes laid out in a grid ---------- */
/* "display: grid" makes a grid. This line says: make as many columns as
   fit, each at least 220px wide. On a phone you get 1 column, on a
   computer 3 or 4, with no extra code. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  padding: 1.5rem;
  border-top: 4px solid var(--brick);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.card h3 {
  margin-top: 0;
  color: var(--brick);
}

/* ---------- Two columns: text beside a photo ---------- */
.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

/* ---------- Photo gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.gallery img {
  width: 100%;
  height: 300px;
  object-fit: cover;   /* fill the box and crop the edges, instead of squashing */
}

/* ---------- Contact details ---------- */
.contact-list {
  list-style: none;   /* remove the bullet points */
  padding: 0;
  font-size: 1.15rem;
}

.contact-list li {
  margin-bottom: 1rem;
}

.contact-list strong {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.map {
  width: 100%;
  height: 350px;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: #cccccc;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: white;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* ---------- Small screens ----------
   A "media query": these rules only apply when the screen is
   600px wide or less (most phones). */
@media (max-width: 600px) {
  .hero {
    padding: 4rem 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  nav a {
    margin-right: 0.9rem;
  }
}
