/* 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 {
  --bg-color: #ffffff;
  --text-color: #222222;
  --accent-color: #0055cc;
  --border-color: #cccccc;
  --font: 100%/1.6 system-ui, sans-serif;
  --space: clamp(8px, 2vw, 20px);
  --container-width: 1100px;
}

/* ====== BASE STYLES ====== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font: var(--font);
  line-height: 1.6;
}

img {
  width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
}
a:hover,
a:focus {
  text-decoration: underline;
}

/* ====== HEADER ====== */
header {
  background-color: var(--accent-color);
  color: #fff;
  padding: var(--space);
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

header p {
  margin: 0.5rem 0 0;
}

/* ====== MAIN CONTENT ====== */
main {
  max-width: var(--container-width);
  margin: var(--space) auto calc(var(--space) * 5);
  padding: 0 var(--space);
}

.articles {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns for bottom row */
  grid-template-rows: auto; /* rows adjust based on content */
  gap: calc(var(--space) * 2);
}


/* ====== ARTICLE CARDS ====== */
article {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding-bottom: var(--space);
  background-color: #fafafa;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature {
  grid-column: 1 / 3; /* spans both columns */
}


article img {
  border-bottom: 1px solid var(--border-color);
}

article h3 {
  margin: var(--space);
  font-size: 1.2rem;
}

article p {
  margin: 0 var(--space) var(--space);
}

article a {
  align-self: flex-start;
  margin: 0 var(--space);
  background-color: var(--accent-color);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
}
article a:hover,
article a:focus {
  background-color: #003b99;
}
/* ====== FOOTER ====== */
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #f1f1f1;
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  color: #555;
  border-top: 1px solid var(--border-color);
}
/* ====== ACCESSIBILITY HELPERS ====== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}