/* CSS by Xuyuan Zheng */

/* Imported Fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,opsz,wdth,wght@0,18..144,87..112,300..900;1,18..144,87..112,300..900&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

/* ///ADD/// CSS Reset */
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}


/* Root Variables */
:root {
  --blue-bulletin: #1D3557;
  --news-flash: #E63946;
  --watchdog-white: #F1FAEE;
  --truth-text: #333;
  --story-subtitle: #457B9D;
  --font-body: "Source Sans 3", sans-serif;
  --font-heading: 'Merriweather', serif;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  --transition: all 0.5s ease;
}

/* Manual Light/Dark Mode Styles*/
body.light-mode {
  background-color: var(--watchdog-white);
  color: var(--truth-text);
}
body.dark-mode {
  background-color: var(--truth-text);
  color: var(--watchdog-white);
}
#theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--watchdog-white);
  border: 1px solid var(--blue-bulletin);
  border-radius: 1.5rem;
  cursor: pointer;
  z-index: 100;
}

/* ///ADD/// Skip Link Styles */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--blue-bulletin);
  color: var(--watchdog-white);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}
 
.skip-link:focus {
  top: 0;
}

/* ///ADD/// Navigation Styles */
#menu-toggle {
  display: none;
}
 
.menu-button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background-color: var(--news-flash);
  color: var(--watchdog-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
}
 
.menu {
  display: block;
  flex-direction: column;
  background-color: var(--news-flash);
  border-top: 2px solid var(--blue-bulletin);
}
 
.menu li a {
  border-bottom: 1px solid var(--blue-bulletin);
  display: flex;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: var(--watchdog-white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-transform: uppercase;
  text-decoration: none;
}

.menu-button:hover,
.menu li a:hover,
.menu li a:focus {
  background-color: var(--blue-bulletin);
  border: 1px solid var(--news-flash);
  text-decoration: none;
  text-align: center;
  color: var(--watchdog-white);
}

/* ///ADD/// Global Layout Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

 
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}
 
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
 
video {
  width: 100%;
  margin-top: 0.75rem;
}
 
header {
  background-color: var(--blue-bulletin);
  color: var(--watchdog-white);
  padding: 1rem 1rem;
}
 
header h1 {
  color: var(--watchdog-white);
  font-family: var(--font-heading);
  font-size: 3rem;
  padding-right: 3rem;
}
 
header .tagline {
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--watchdog-white);
}
 
main {
  padding: 2rem 1rem 1rem;
}
 
section {
  margin-bottom: 2rem;
}
 
footer {
  background-color: var(--blue-bulletin);
  color: var(--watchdog-white);
  padding: 3rem 1.5rem 1rem;
  text-align: left;
}
 
footer h2 {
  color: var(--watchdog-white);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
 
footer a {
  display: inline-block;
  background-color: var(--news-flash);
  color: var(--watchdog-white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem;
  margin: 0.5rem 0.5rem 0.5rem 0;

}
 
footer a:hover,
footer a:focus {
  background-color: var(--blue-bulletin);
  text-decoration: none;
  color: var(--watchdog-white);
  border: 1px solid var(--news-flash);
}
 
footer small {
  display: block;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--watchdog-white);
  text-align: center;
}

/* ///ADD/// Global Text Styles */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
}
 
h2 {
  font-size: 1.5rem;
}
 
h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
 
p {
  font-size: 1rem;
}
 
 
/* Welcome section */
#welcome {
  padding-bottom: 1em;
}

 
blockquote.tagline {
  font-family: var(--font-heading);
  font-weight: bold;
  text-align: center;
  color: var(--truth-text);
}
 
body.dark-mode blockquote.tagline {
  color: var(--watchdog-white);
}
 
/* Breaking News */
 
#breaking-news > div {
  width: 85%;
  background-color: var(--news-flash);
  border: 1px solid var(--blue-bulletin);
  box-shadow: var(--shadow);
  color: var(--watchdog-white);
  padding: 1rem;
  margin: 0.5rem auto;
  cursor: pointer;
  transition: transform 0.5s ease;
}

 
#breaking-news > div h3 {
  color: var(--watchdog-white);
  font-size: 1rem;
  border-bottom: 1px solid var(--watchdog-white);
  padding-bottom: 0.5rem;
}
 
#breaking-news > div p {
  color: var(--watchdog-white);
  font-size: 0.9rem;
}
 
/* Featured Articles */
article {
  width: 85%;
  border: 1px solid var(--story-subtitle);
  padding: 0.85rem;
  margin: 0.5rem auto;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.5s ease;
}
 
body.dark-mode article {
  border-color: var(--watchdog-white);
}
 
article h3 {
  font-size: 1rem;
  border-bottom: 1px solid var(--story-subtitle);
  padding-bottom: 0.4rem;
  margin-bottom: 0.4rem;
}
 
body.dark-mode article h3 {
  border-color: var(--watchdog-white);
}
 
article p {
  font-size: 0.85rem;
}

/*animation for breaking news and articles on hover*/
#breaking-news > div:hover,
article:hover {
  transform: scale(1.1);
}
 
/* Alerts / Form */
 
form {
  background-color: var(--news-flash);
  padding: 1.25rem;
  color: var(--watchdog-white);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--blue-bulletin);
  box-shadow: var(--shadow);
}
 
form label {
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--watchdog-white);
}
 
form input[type="text"],
form input[type="tel"] {
  padding: 0.5rem 0.75rem;
  border: none;
  background-color: var(--watchdog-white);
  color: var(--truth-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  width: 100%;
  border: 1px solid var(--blue-bulletin);
}
 
form input[type="text"]:focus,
form input[type="tel"]:focus {
  outline: 2px solid var(--blue-bulletin);
}
 
fieldset {
  border: 1px solid var(--blue-bulletin);
  padding: 0.75rem 1rem;
  margin-top: 0.25rem;
}
 
legend {
  font-family: var(--font-body);
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--watchdog-white);
  padding: 0 0.4rem;
}
 
fieldset > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
 
fieldset > div label {
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--watchdog-white);
}
 
input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue-bulletin);
  cursor: pointer;
}
 
form button[type="submit"] {
  background-color: var(--blue-bulletin);
  color: var(--watchdog-white);
  border: 2px solid var(--truth-text);
  box-shadow: var(--shadow);
  padding: 0.6rem;
  font-family: var(--font-body);
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  margin-top: 0.5rem;
  transition: var(--transition);
}
 
form button[type="submit"]:hover {
  background-color: var(--watchdog-white);
  color: var(--blue-bulletin);
  border: 1px solid var(--blue-bulletin);
}


/* ///ADD/// medium styles 620px */
@media (min-width: 620px) {

  .menu-button {
    display: none;
  }
 
  .menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    background-color: transparent;
    padding: 0.5rem 0;
    gap: 0.5rem;
  }
 
  .menu li a {
    display: inline-block;
    background-color: var(--news-flash);
    color: var(--watchdog-white);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
  }
 
  .menu li a:hover,
  .menu li a:focus {
    background-color: var(--blue-bulletin);
    text-decoration: none;
  }
 
  main {
    padding: 1.5rem;
  }
 
  /* Two-column breaking news */
  #breaking-news {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
 
  #breaking-news > h2 {
    grid-column: 1 / -1;
  }
 
  /* Two-column articles */
  #featured-articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
 
  #featured-articles > h2 {
    grid-column: 1 / -1;
  }
 
 
  /* Form: name + mobile side by side */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
  }

  .form-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
 
  /* Checkbox fieldset: 3 columns */
  fieldset {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
  }
 
  legend {
    grid-column: 1 / -1;
  }
 
  footer {
    padding: 1.75rem 1.5rem;
  }
}
 


/* ///ADD/// large styles 920px */
@media (min-width: 920px) {
 
  header {
    padding: 1.5rem 2rem 0;
  }
 
  header h1 {
    font-size: 3rem;
  }
 
  main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }
 
  /* Three-column articles */

  #featured-articles {
    grid-template-columns: repeat(3, 1fr);
  }

  fieldset {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
  }
 
  footer {
    padding: 2rem;
  }
}
 


/* ///ADD/// x-large styles 1024px */
@media (min-width: 1024px) {
 
  header {
    padding: 1.5rem 2.5rem 0;
  }
 
  header h1 {
    font-size: 3.5rem;
  }
 
  main {
    padding: 2rem 2.5rem;
  }
}


/* ///ADD/// Interaction Queries for color scheme light and dark and motion preference */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode):not(.dark-mode) {
    background-color: var(--truth-text);
    color: var(--watchdog-white);
  }
 
  body:not(.light-mode):not(.dark-mode) blockquote.tagline {
    color: var(--watchdog-white);
  }
 
  body:not(.light-mode):not(.dark-mode) article {
    border-color: #555;
  }
 
  body:not(.light-mode):not(.dark-mode) article h3 {
    border-color: #555;
  }
}
 
@media (prefers-color-scheme: light) {
  body:not(.light-mode):not(.dark-mode) {
    background-color: var(--watchdog-white);
    color: var(--truth-text);
  }
}
 
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none;
    animation: none;
  }
 
  html {
    scroll-behavior: auto;
  }
}
 
 
/* ///ADD///  Feature Query for :has() that checks if the #menu-toggle is checked */
@supports (selector(:has(*))) {

  .mobile-nav:has(#menu-toggle:not(:checked)) .menu {
    display: none;
  }
 
  .mobile-nav:has(#menu-toggle:checked) .menu {
    display: flex;
    flex-direction: column;
  }
 
  @media (min-width: 620px) {
    .mobile-nav:has(#menu-toggle:not(:checked)) .menu,
    .mobile-nav:has(#menu-toggle:checked) .menu {
      display: flex;
      flex-direction: row;
    }
  }
 
}