/*  ===================
    Author: Allison Lian
    Date: April 24, 2026
    Description: Main stylesheet for Meeting Minutes page CSE 110 Lab 3
    Meeting Minutes page 
    =================== */

/*  =================== 
    CSS Variables (Custom Properties)
    =================== */
:root {
  --color-primary: #3b5bdb;
  --color-bg: hsl(210, 20%, 97%);
  --font-main: "Inter", sans-serif;
  --max-width: 900px;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg, #f5f5f5);
  margin: 0;
  padding: 20px;
  color: var(--color-text, #2c3e50);
}

/*  =================== 
    Google Font + Typography
    =================== */

/* Apply Google Font to body */
body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
}

/*Selector list - shared styles for all headings */
h1,
h2,
h3 {
  font-weight: 700;
  text-align: left;
  margin-bottom: 8px;
}

/*rgb() color format */
h1 {
  font-size: 2rem;
  color: rgb(59, 91, 219); /* Primary color */
  margin-bottom: 20px;
}

/* hex color format */
h2 {
  font-size: 1.5rem;
  color: #3b5bdb; /* Primary color */
  margin-top: 30px;
}

/* hsl() color format */
h3 {
  font-size: 1.2rem;
  color: hsl(210, 20%, 40%); /* Darker shade of primary color */
  margin-top: 20px;
}

/* rgba() color format */
p {
  font-size: 1rem;
  color: rgba(44, 62, 80, 0.8); /* Text color with opacity */
  margin-bottom: 15px;
  line-height: 1.7;
}

/*text-decoration on links */
a {
  text-decoration: none;
  color: steelblue;
}

/* :hover pseudo-class re-adds underlines */
a:hover {
  text-decoration: underline;
}

/* table cell typography */
td,
th {
  font-size: 0.95rem;
  text-align: left;
}

th {
  font-weight: 600;
}

footer p {
  color: color(display-p3 0.2 0.3 0.5);
  font-size: 0.9rem;
  text-align: center;
}

caption {
  font-size: 1.1rem;
  font-weight: 600;
  color: color-mix(in srgb, #3b5bdb 60%, white);
  margin-bottom: 6px;
}

/*  =================== 
    Box Model
    =================== */

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

/* Margin */

/* Margin longhand on h2 */
h2 {
  margin-top: 16px;
  margin-bottom: 8px;
  margin-left: 0px;
  margin-right: 0px;
}

/* Margin shorthand + auto-centering on .container */
.container {
  max-width: 900px;
  margin: 0 auto; /* top/bottom 0, left/right auto */
  width: 90%;
  min-width: 320px;
}

/* Padding */

/* Padding longhand on header */
header {
  padding-top: 20px;
  padding-bottom: 20px;
  padding-left: 32px;
  padding-right: 32px;
}

/* Padding shorthand on td and th */
td,
th {
  padding: 10px 16px;
}

/* Border */

/* Border longhand on section */
section {
  border-style: solid;
  border-color: #dde3f0;
  border-width: 1px;
  border-radius: 8px;
  margin-bottom: 24px;
  padding: 20px;
}

/* Border shorthand on table */
table {
  border: 2px solid hsl(220, 30%, 80%);
  border-radius: 4px;
  border-collapse: collapse;
  width: 100%;
}

/*  =================== 
    Flexbox -- Nav
    =================== */

nav {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 0;
}

/*  =================== 
    CSS Grid -- Goals and Progress
    =================== */

.grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 20px;
  grid-template-areas: "goal1 goal2 goal3";
  margin-top: 16px;
}

.grid-item {
  background-color: rgba(60, 90, 220, 0.05);
  border: 1px solid #dde3f0;
  border-radius: 8px;
  padding: 16px;
}

.grid-item h3 {
  color: var(--color-primary, #3b5bdb);
  margin-bottom: 8px;
}

/* Tablet */
@media (max-width: 768px) {
  .grid-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "goal1 goal2" "goal3 goal3";
  }
}

/* Mobile */
@media (max-width: 480px) {
  .grid-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "goal1" "goal2" "goal3";
  }
}

/*  =================== 
    Sizing
    =================== */

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

/* Makes table scroll horizonatlly on small screens */
.table-wrapper {
  overflow-x: auto;
}

/*  =================== 
    Media Queries -- Additional Rules
    =================== */

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  nav {
    gap: 10px;
  }
}

/* Mobile/phone (max-width: 480px) */
@media (max-width: 480px) {
  nav {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  h1 {
    font-size: 1.4rem;
  }

  td,
  th {
    font-size: 0.9rem;
    padding: 6px 10px;
  }

  section {
    padding: 12px;
  }
}

/*  =================== 
    CSS Selectors
    =================== */

/* --- Class Selector (.class) --- */
.container {
  max-width: var(--max-width, 900px);
}

/* --- ID Selector (#id) --- */
#meeting-title {
  font-size: 2rem;
  letter-spacing: 0.05em;
}

/* --- Attribute Selector ([attr=value]) --- */
input[type="checkbox"] {
  margin-right: 8px;
}

a:hover {
  text-decoration: underline;
}

button:active {
  transform: scale(0.97);
}

h1,
h2,
h3 {
  font-weight: 700;
}

section p {
  color: #444;
}

ul > li {
  margin-bottom: 6px;
}

h2 ~ p {
  margin-top: 4px;
}

h2 + p {
  font-weight: 500;
}

table.goals-table {
  width: 100%;
  margin-top: 12px;
}

section:has(table) {
  background-color: hsl(220, 30%, 80%);
}

.grid-item {
  padding: 16px;

  & h3 {
    color: var(--color-primary, #3b5bdb);
    margin-bottom: 8px;
  }

  & p {
    font-size: 0.95rem;
    color: #555;
  }
  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.2s ease;
  }
}
