/* Here are some starter styles
You can edit these or replace them entirely 
It's showing you a common way to organise CSS 
And includes solutions to common problems 
As well as useful links to learn more */

/* ====== Design Palette ======
 This is our "design palette".
 It sets out the colours, fonts, styles etc to be used in this design 
 At work, a designer will give these to you based on the corporate brand, but while you are learning
 You can design it yourself if you like

 Inspect the starter design with Devtools

 Click on the colour swatches to see what is happening

 I've put some useful CSS you won't have learned yet
 For you to explore and play with if you are interested
 https://web.dev/articles/min-max-clamp
 https://scrimba.com/learn-css-variables-c026
====== Design Palette ====== */
:root {
  --paper: oklch(7 0 0);
  --ink: color-mix(in oklab, var(--color) 5%, black);
  --font: 100%/1.5 system-ui;
  --space: clamp(6px, 6px + 2vw, 15px);
  --line: 1px solid;
  --container: 1280px;
}
/* ====== Base Elements ======
 General rules for basic HTML elements in any context */
body {
  background: var(--paper);
  color: var(--ink);
  font: var(--font);
}
a {
  padding: var(--space);
  border: var(--line);
  max-width: fit-content;
}
img,
svg {
  width: 100%;
  object-fit: cover;
}

/* ====== Header Layout ====== */
header {
  padding: var(--space);
  text-align: center;
}
header h1 {
  font-size: 2rem;
  margin-bottom: var(--space);
}
header p {
  font-size: 1.2rem;
  color: gray;
}

/* ====== Site Layout ====== 
Setting the overall rules for page regions
https://www.w3.org/WAI/tutorials/page-structure/regions/
*/
main {
  max-width: var(--container);
  margin: 0 auto calc(var(--space) * 6) auto;
  padding-bottom: calc(var(--space) * 4);
}

  /* ====== Articles Grid Layout ====
  Setting the rules for how articles are placed in the main element.
  Inspect this in Devtools and click the "grid" button in the Elements view
  Play with the options that come up.
  https://developer.chrome.com/docs/devtools/css/grid
  https://gridbyexample.com/learn/
  */
section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space);
}

section > article:first-child {
    grid-column: span 2;
  }


/* added padding, width and border top to the footer*/
footer {
  position: fixed;
  bottom: 0;
  text-align: center;
  width: 100%;
  padding: var(--space);
  border-top: var(--line);
  background-color: var(--paper);
}

/* ====== Article Layout ====== 
Setting the rules for how elements are placed in the article. 
Now laying out just the INSIDE of the repeated card/article design.
Keeping things orderly and separate is the key to good, simple CSS.
*/
article {
  border: var(--line);
  padding-bottom: var(--space);
  text-align: left;
  display: grid;
  grid-template-columns: var(--space) 1fr var(--space);
  grid-template-rows: auto auto auto auto;
  margin-bottom: calc(var(--space) * 2);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

article > * {
    grid-column: 2/3;
  }

  /*  Force consistent image height */
article > img {
  aspect-ratio: 2 / 1;
  height: auto;
  width: 100%;
  object-fit: contain;
  display: block;
  background-color: white;
  box-sizing: border-box;
  margin-bottom: 0; /* no extra space */
  border-bottom: 1px solid var(--ink); /* 🪄 this is the key fix */
}

/* Make the <hr> look like your wireframe divider */
article hr {
  grid-column: 2 / 3;
  border: none;
  height: 1px;
  background-color: var(--ink);
  opacity: 0.4;
  margin: calc(var(--space) * 1.5) 0;
}
