/* ===========================
   styles/m03_styles.css (UPDATED for responsive layout)
   =========================== */

/* CSS reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Google Font import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&display=swap');

/* Theme variables */
:root {
  --main-color: #046307; /* Deep emerald green */
  --accent-color: #D4AF37; /* Metallic gold */
  --text-color: #eaeaea; /* Light gray */
  --background-color: #121212; /* Dark background */
  --panel-bg: #1c1c1c;
  --max-content-width: 1100px;
  --gap: 20px;
}

/* Base page styles */
html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden; /* prevents horizontal scroll caused by elements */
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Playfair Display', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--main-color);
  margin-bottom: 12px;
}

/* Header */
header {
  text-align: center;
  padding: 20px 12px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-bottom: 2px solid var(--accent-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border-radius: 10px;
  width: 100%;
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
}

/* Small brand link */
.top-brand {
  margin-bottom: 8px;
}
.top-brand .brand-link {
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
}

/* Primary nav (visible above the fold). It wraps on small screens */
.primary-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}

/* Header images container */
.header-images {
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
  margin-top: 10px;
}

/* Image sizing helpers */
.header-images img {
  border-radius: 8px;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.6);
  object-fit: cover;
  display: block;
  max-width: 100%;
  height: auto;
}

/* Small and large variants */
.small-img {
  width: 240px;
  max-width: 35%;
}

.large-img {
  width: 380px;
  max-width: 60%;
}

/* Main content wrapper - now a responsive grid (two-column on larger screens) */
main {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 18px auto;
  padding-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 320px; /* main content + sidebar */
  gap: var(--gap);
  align-items: start;
}

/* Panels / trim sections */
section.trim, .panel {
  border: 3px solid var(--accent-color);
  border-radius: 8px;
  padding: 20px;
  margin: 0;
  background-color: var(--panel-bg);
  transition: all 0.2s ease;
}

section.trim:hover, .panel:hover {
  box-shadow: 0 0 12px var(--accent-color);
  transform: translateY(-2px);
}

/* Paragraphs */
p {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* Images (global) */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.6);
  object-fit: cover;
}

/* Nav container styling (used for several nav groups) */
nav {
  margin: 8px auto;
  border-radius: 8px;
}

/* Global link styling */
nav a,
aside a,
header a,
.primary-nav a,
.inline-links a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

/* Link hover */
nav a:hover,
aside a:hover,
header a:hover {
  color: var(--main-color);
  border: 1px solid var(--main-color);
  transform: translateY(-2px);
}

/* Section generic */
section {
  margin-bottom: 18px;
}

/* Aside styling */
aside {
  padding: 12px;
  background: transparent;
}

/* Make aside nav vertical and compact */
.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Footer */
footer {
  background-color: var(--panel-bg);
  color: var(--text-color);
  text-align: center;
  padding: 15px 10px;
  margin-top: 30px;
  border-top: 2px solid var(--accent-color);
  font-size: 0.9em;
  width: 100%;
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
}

footer small {
  display: block;
  margin-top: 6px;
  color: #ccc;
  font-size: 0.85em;
}

/* Utility: inline link group in panels */
.inline-links {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Hobby / photo gallery rows */
.hobby-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hobby-row figure {
  margin: 0;
  text-align: center;
}

.hobby-row img {
  border-radius: 8px;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.6);
  object-fit: cover;
}

/* responsive thumbnail targets (keeps layout stable) */
.hobby-row img[src*="team-vs"],
.hobby-row img[src*="fall25team"] {
  width: 350px;
}

.hobby-row img[src*="rugbyimage"],
.hobby-row img[src*="ahhh"] {
  width: 250px;
}

/* Responsive typography tweaks */
@media (max-width: 1024px) {
  :root {
    --max-content-width: 900px;
  }

  main {
    grid-template-columns: 1fr 300px;
    gap: 18px;
  }

  .large-img {
    width: 320px;
  }

  .small-img {
    width: 200px;
  }
}

/* Tablet breakpoint (portrait tablets) ~ 768px */
@media (max-width: 768px) {
  :root {
    --max-content-width: 720px;
  }

  header {
    padding: 18px 10px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  /* Stack to single column: aside becomes the second row */
  main {
    grid-template-columns: 1fr;
  }

  /* Make aside appear after main content but keep it full width */
  aside {
    order: 2;
    width: 100%;
  }

  .primary-nav a {
    padding: 8px 6px;
    font-size: 0.95rem;
  }

  .header-images {
    gap: 12px;
  }

  .large-img {
    width: 300px;
  }

  .small-img {
    width: 160px;
  }

  /* reduce hobby image sizes slightly */
  .hobby-row img[src*="team-vs"],
  .hobby-row img[src*="fall25team"] {
    width: 300px;
  }

  .hobby-row img[src*="rugbyimage"],
  .hobby-row img[src*="ahhh"] {
    width: 220px;
  }
}

/* Mobile phones (small screens) ~ 480px and below */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  header {
    border-radius: 8px;
    padding: 14px 8px;
  }

  header h1 {
    font-size: 1.25rem;
    margin-bottom: 8px;
  }

  .primary-nav {
    gap: 6px;
    justify-content: center;
  }

  .primary-nav a {
    font-size: 0.9rem;
    padding: 6px 8px;
  }

  .header-images {
    flex-direction: column;
    gap: 12px;
  }

  .small-img,
  .large-img {
    width: 90%;
    max-width: 420px;
  }

  /* Panels get slightly less padding on phones */
  section.trim, .panel {
    padding: 14px;
  }

  /* ensure hobby images scale down to full width */
  .hobby-row img {
    width: 90%;
  }

  footer {
    font-size: 0.85rem;
  }
}

/* Accessibility / contrast helpers */
a:focus {
  outline: 3px dashed var(--accent-color);
  outline-offset: 3px;
}

/* ensure large hero images never cause horizontal overflow */
.header-images img,
.hobby-row img,
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* small utility to avoid accidental horizontal scroll on long link lists */
.primary-nav,
.inline-links,
.aside-nav {
  width: 100%;
  overflow-wrap: anywhere;
}