/* ==========================================================
   Shared stylesheet for all pages
   Change the colors and fonts here, in one place.
   ========================================================== */

:root {
  --color-bg: #f4efe6;          /* fallback behind the texture */
  --color-panel: rgba(255, 255, 255, 0.92); /* content panels over texture */
  --color-text: #222222;
  --color-primary: #1f3a5f;     /* header, buttons */
  --color-primary-dark: #14263f;
  --color-accent: #c8102e;      /* highlights, button hover */
  --color-on-primary: #ffffff;

  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: "Helvetica Neue", Arial, sans-serif;

  --max-width: 960px;
  --gutter: 1rem;
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* The texture: a 512x512 seamless tile repeated across the page. */
  background-image: url("images/texture-tile.png");
  background-repeat: repeat;
  background-size: 512px 512px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
}

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

a {
  color: var(--color-primary);
}

/* ---------- Header and navigation ---------- */

.site-header {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-on-primary);
  text-decoration: none;
}

.nav-toggle {
  display: inline-block;
  background: transparent;
  color: var(--color-on-primary);
  border: 2px solid var(--color-on-primary);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
}

.site-nav {
  display: none;
  width: 100%;
}

.site-nav.open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-on-primary);
  text-decoration: none;
  font-family: var(--font-heading);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
}

/* ---------- Page content ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}

.panel {
  background: var(--color-panel);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel.panel-clear {
  background: transparent;
  box-shadow: none;   /* only if your .panel has a shadow or border you want gone */
}

.hero {
  text-align: center;
  padding: 1.5rem .75rem;
}

.hero h1 {
  font-size: 2rem;
  margin-top: 0;
}

.button {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-heading);
  font-weight: bold;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
}

.button:hover,
.button:focus {
  background: var(--color-accent);
}

/* Cards: one column on phones, more on wider screens */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  background: var(--color-panel);
  border-radius: var(--radius);
  padding: 1.25rem;
}

/* ---------- Three-column feature layout ---------- */
/* On phones: graphic first, then the left text, then the right text,
   all in one column. On wide screens: three columns, graphic in the middle. */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "graphic"
    "left"
    "right";
  gap: 1.5rem;
  align-items: start;
}

.feature-left    { grid-area: left; }
.feature-graphic { grid-area: graphic; text-align: center; }
.feature-right   { grid-area: right; }

.feature-graphic img {
  display: block;
  margin: 0 auto;
}

/* ---------- Image with text links overlaid ---------- */
/* Phones: the links sit under the image as full-width blocks.
   700px and up: they are positioned over the image and scale with it. */

.overlay-image {
  max-width: 800px;
  margin: 1rem auto;
}

.overlay-image img {
  display: block;
  width: 100%;
  height: auto;
}

.overlay-link {
  display: block;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  text-decoration: none;
}

.overlay-link .cta {
  color: #7cfc8a;
  font-weight: bold;
  text-decoration: underline;
}

.overlay-link:focus-visible {
  outline: 3px solid var(--color-accent);
}

@media (min-width: 700px) {
  .overlay-image {
    position: relative;
    container-type: inline-size;
  }

  .overlay-link {
    position: absolute;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    font-size: 0.8rem;       /* fallback for older browsers */
    font-size: 2.2cqw;       /* scales with the image width */
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  }

  /* Starting positions (percent of the image). Adjust to taste. */
  .overlay-link-senate { left: 54%; top: 48%; width: 44%; height: 17%; }
  .overlay-link-about  { left: 33%; top: 66%; width: 22%; height: 22%; }
}

/* ---------- Wide poster-style page (t-shirt) ---------- */
/* The image fills a wider, edge-to-edge panel so the artwork text stays legible. */

main.wide {
  max-width: 1400px;
}

.panel.panel-flush {
  padding: 0;
  overflow: hidden;
}

.panel-flush .overlay-image {
  max-width: none;
  margin: 0;
}

/* Phones: keep the stacked link blocks off the panel edges */
@media (max-width: 699.98px) {
  .panel-flush .overlay-link {
    margin: 0.75rem;
  }
}

@media (min-width: 700px) {
  .tshirt-overlay .overlay-link {
    font-size: 0.8rem;     /* fallback for older browsers */
    font-size: 1.9cqw;     /* scales with the image width */
    font-weight: bold;
  }

  /* Positions are percent of the image. Adjust to taste. */
  .overlay-link-left  { left: 6.4%;  top: 88%; width: 24.7%; height: 8%; }
  .overlay-link-right { left: 68.5%; top: 88%; width: 25%;   height: 8%; }
}

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

.site-footer {
  background: var(--color-primary-dark);
  color: var(--color-on-primary);
  text-align: center;
  padding: 1rem var(--gutter);
  font-size: 0.9rem;
}

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

/* ---------- Three-column prize layout ---------- */
.prize-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.prize {
  border: 1px solid rgba(31, 58, 95, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.prize h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.prize img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

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

/* ---------- Tablets and up ---------- */

@media (min-width: 700px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    width: auto;
  }

  .site-nav ul {
    display: flex;
    gap: 1.5rem;
  }

  .site-nav a {
    border-top: none;
    padding: 0.25rem 0;
  }

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

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Wide tablets and laptops: three columns ---------- */

@media (min-width: 900px) {
  .feature {
    grid-template-columns: 1fr 2fr 1fr;  /* middle column twice as wide */
    grid-template-areas: "left graphic right";
    align-items: center;
  }
}

/* ---------- Large screens ---------- */

@media (min-width: 1000px) {
  .panel,
  .card {
    padding: 1.75rem;
  }
}
