:root {
  /* Variable definition */
  --main-accent: #2a5d9a; 
}

h2 {
  /* Using the variable with 'darkblue' as a fallback */
  color: var(--main-accent, darkblue); 
}
/* 1. Color Name */
h3 {
  color: orange;
}

/* 2. Hex Code */
section {
  background-color: #f9f9f9;
}

/* 3. RGB/RGBA (Alpha controls transparency) */
header {
  border-color: rgba(42, 93, 154, 0.8);
}

/* 4. HSL (Hue, Saturation, Lightness) */
footer {
  color: hsl(0, 0%, 30%);
}

/* 5. Wider-gamut color used below with grid display on main */


/* 6. Color-mix */
h1 {
  /* Mixes 40% blue with white */
  background-color: color-mix(in srgb, blue 40%, white);
}
/*absolute units*/
header {
  border-width: 2px;          /* Unit 1: px */
}
h2 {
  margin-bottom: 12pt;        /* Unit 2: pt */
}
img {
  max-width: 15cm;            /* Unit 3: cm */
}
/*relative units*/
body {
  font-size: 1.2rem;          /* Unit 1: rem */
}

main {
  width: 90%;                 /* Unit 2: % */
}

section {
  min-height: 20vh;           /* Unit 3: vh  */
}
CSS
/*longhand margin*/
header {
    margin-top: 20px;
    margin-bottom: 15px;
    margin-left: 10px;
    margin-right: 10px;
}
/* shorthand margin*/
section {
    margin: 20px 10px 20px 10px; 
}

/* auto margin*/
main {
    margin: auto;
    width: 80%; 
}
/* longhand padding */
ul {
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 40px;
    padding-right: 0px;
}

/* shorthand padding */
div {
    
    padding: 15px 30px; 
}
header {
    border-width: 5px;
    border-style: double;  
    border-color: #2a5d9a;
}
section {
    border: 2px dashed orange; 
}
img {
    border: 3px solid black;
    border-radius: 15px; 
}
p {
  color: #333333; /*dark gray*/
}
/* Removing underlines from links */
nav a {
  text-decoration: none;
}

/* Adding a custom underline to section headers */
h2 {
  text-decoration: underline wavy orange; 
}
footer {
  text-align: right; /*align footer right*/
}
/* makes span behave like block*/
span {
    display: block; 
    background-color: #eee;
    margin-bottom: 10px;
}
/* display inline */
li {
    display: inline;
    margin-right: 15px;
}
header {
  height: 300px; /* Absolute unit */
  width: 100%;   /* Relative unit - fills the screen */
}
section {
  min-width: 300px; 
  background-color: white;
}
h1 {
    position: relative;
    left: 20px; 
    top: -5px;  
}
video, img {
    max-width: 100%;        /* Never wider than the screen */
    height: auto;           /* Keep aspect ratio */
    display: block;
    margin: 0 auto;         
}
header {
    position: sticky;
    top: 0;
    z-index: 100;           /* Keeps header on top */
    background-color: white; /* Prevents text from showing through */
    width: 100%;
    max-height: 40vh; 
    overflow-y: auto;  
    
    border-bottom: 3px solid var(--main-accent);
    padding: 10px;
}
video {
    max-width: 100%; 
    max-height: 200px; 
    width: auto;
    display: block;
    margin: 0 auto;
}
nav {
    position: fixed;
    bottom: 20px;
    right: 20px;
}
nav a:hover {
    color: orange;
    text-decoration: underline;
}
/* Make the button look "pressed" */
button:active {
    background-color: black;
    transform: scale(0.95); 
}
button:hover {
    background-color: #2a5d9a;
    cursor: pointer;
}
header {
    display: flex;             
    flex-direction: column;    
    align-items: center;      
    justify-content: center;  
    gap: 1.5rem;               
}
main {
    display: grid;                       
    grid-template-columns: 1fr;           
    grid-row-gap: 30px;                  
    justify-items: stretch;               
    padding: 2rem;
    background-color: color(display-p3 0.9 0.9 0.9);
}
body {
    font-family: 'Inter', sans-serif; 
}
@media (max-width: 768px) {
    main {
        /* Change your grid to a single column for small screens */
        grid-template-columns: 1fr; 
        padding: 10px;
    }

    header {
        /* Ensure media elements don't overflow */
        padding: 5px;
    }

    h1 {
        font-size: 1.5rem; 
    }
}
/* Universal Selector (*) */
* {
    box-sizing: border-box;
}

/* Attribute Selector ([attribute=foo]) */
input[type="date"] {
    border: 2px solid var(--main-accent);
}

/* Selector List (element, element) */
h1, h2, h3 {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}



/* Descendant Combinator (element element) */
main p strong {
    color: var(--main-accent);
}

/* Child Combinator (element > element) */
ul > li {
    list-style-type: "🍉 "; /* Custom bullet for Team Watermelon */
}

/* General Sibling Combinator (element ~ element) */
ul ~ p {
    font-weight: bold;
}

/* Adjacent Sibling Combinator (element + element) */
section + hr {
    border-top: 5px dotted var(--main-accent);
}


/* :has() Selector: Styles a section ONLY if it contains a <details> tag */
section:has(details) {
    border: 3px solid orange;
    background-color: #fffbe6;
}


footer {
    background-color: #f1f1f1;
    padding: 20px;
    
    & p {
        margin: 10px 0;
        
    }
    
    & nav a {
        color: #d35400;
        font-weight: 700;
        
        &:hover {
            color: #e67e22;
        }
    }
}



