/* CSS by Benoit Hayek */

/* 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');

/* CSS Reset */
*,
*::before,
*::after{
  box-sizing: border-box;
}

html, body{
  height: 100%;
}

body{
  margin: 0;
}

img, picture, video, canvas, svg{
  display: block;
  max-width: 100%;
}

input, button, textarea, select{
  font: inherit;
}

p, h1, h2, h3, blockquote{
  margin: 0;
}

ul{
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 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 6px 14px rgba(0, 0, 0, 0.55);
  --transition: all 0.5s ease;
}

/* Manual Light/Dark Mode Styles*/
body{
  background-color: var(--truth-text);
  color: var(--watchdog-white);
  font-family: var(--font-body);
  line-height: 1.55;
}

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: 1.25rem;
  right: 1.25rem;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--watchdog-white);
  border: 2px solid rgba(0,0,0,0.25);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

#theme-toggle:focus-visible{
  outline: 3px solid var(--news-flash);
  outline-offset: 3px;
}

#theme-toggle svg{
  width: 22px;
  height: 22px;
}

/* Skip Link Styles */
#skip{
  position: absolute;
  left: -999px;
  top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--news-flash);
  color: var(--watchdog-white);
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  z-index: 9999;
}

#skip:focus,
#skip:focus-visible{
  left: 0.75rem;
  outline: 3px solid var(--blue-bulletin);
  outline-offset: 3px;
}

/* Navigation Styles */
header{
  background: var(--blue-bulletin);
  color: var(--watchdog-white);
  padding: 3rem 1.25rem 1.25rem 3rem;
  position: relative;
}

.site-branding{
  max-width: 1100px;
  margin: 0 auto;
  padding-right: 4rem;
}

h1{
  font-family: var(--font-heading);
  font-size: 2.8rem;
  line-height: 1.1;
}

.tagline{
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.9;
}

.mobile-nav{
  max-width: 1100px;
  margin: 1.25rem auto 0 auto;
}

.menu-button{
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--news-flash);
  color: var(--watchdog-white);
  font-weight: 800;
  border-radius: 0.25rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  user-select: none;
}

.menu{
  display: none;
  margin-top: 0.75rem;
  gap: 0.75rem;
}

/* fallback toggle without :has */
#menu-toggle:checked + .menu-button + .menu{
  display: grid;
}

.menu a{
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--news-flash);
  color: var(--watchdog-white);
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 0.15rem;
  box-shadow: var(--shadow);
}

.menu a:hover,
.menu a:focus-visible{
  filter: brightness(1.15);
  outline: none;
}

/* Global Layout Styles */
main{
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem 1.25rem;
  padding-bottom: 0;
}

section{
  margin-top: 2.25rem;
}

h2{
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

h3{
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

p{
  margin-top: 0.35rem;
}

/* Welcome blockquote */
blockquote.tagline{
  margin-top: 1rem;
  text-align: center;
  font-weight: 900;
  font-style: italic;
  opacity: 0.95;
}

blockquote.tagline p{
  margin: 0;
}

/* Breaking News cards */
#breaking-news article{
  background: var(--news-flash);
  color: var(--watchdog-white);
  padding: 1.25rem;
  border-radius: 0.2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.25);
}

#breaking-news article + article{
  margin-top: 1.25rem;
}

#breaking-news p{
  font-size: 0.95rem;
  opacity: 0.95;
}

video{
  width: 100%;
  margin-top: 0.85rem;
  border-radius: 0.2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.35);
  background: #000;
}
 #breaking-news video,
.menu a,
#social a,
button[type="submit"]{
  transition: transform 0.25s ease, filter 0.25s ease, background-color 0.25s ease;
}

/* Video zoom on hover */
#breaking-news article video:hover{
  transform: scale(1.03);
}

#breaking-news article{
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#breaking-news article:hover{
  transform: translateY(-3px);
}
/* Featured Articles grid */
.articles-list{
  display: grid;
  gap: 1.25rem;
  margin-top: 1.25rem;
   align-items: stretch;
}

.articles-list > li{
  height: 100%;
}

.articles-list article{
  background: rgba(0,0,0,0.12);
  border: 2px solid var(--story-subtitle);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  height: 100%;
  min-height: 170px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.articles-list h3{
  font-size: 1.15rem;
}

.articles-list p{
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Alerts (big red panel) */
#alerts{
  background: var(--news-flash);
  color: var(--watchdog-white);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

#alerts p{
  opacity: 0.95;
}
#alerts{
  background: transparent;
  box-shadow: none;
  padding: 0;
}

#alerts h2,
#alerts > p{
  color: inherit;
  margin-left: 0;
}

#alerts form{
  background: var(--news-flash);
  color: var(--watchdog-white);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

form{
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

label{
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="tel"]{
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(0,0,0,0.2);
  background: #fff;
  color: #111;
}

input:focus-visible{
  outline: 3px solid var(--blue-bulletin);
  outline-offset: 2px;
}

fieldset{
  border: 2px solid rgba(0,0,0,0.25);
  padding: 1rem;
}

legend{
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 0 0.5rem;
}

fieldset div{
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
}

fieldset input[type="checkbox"]{
  width: 1.1rem;
  height: 1.1rem;
}

fieldset label{
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

button[type="submit"]{
  width: 100%;
  padding: 0.95rem 1.25rem;
  background: var(--blue-bulletin);
  color: var(--watchdog-white);
  border: 2px solid rgba(0,0,0,0.25);
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

button[type="submit"]:hover{
  filter: brightness(1.05);
}

button[type="submit"]:focus-visible{
  outline: 3px solid var(--watchdog-white);
  outline-offset: 3px;
}

/* Social buttons */
#social ul{
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
}

#social a{
  display: inline-block;
  padding: 0.65rem 1rem;
  background: var(--news-flash);
  color: var(--watchdog-white);
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

#social a:hover,
#social a:focus-visible{
  filter: brightness(1.05);
  outline: none;
}

/* Footer */
#social{
  background: var(--blue-bulletin);
  color: var(--watchdog-white);
  padding: 2rem 1.25rem 1.25rem 1.25rem;
  margin-top: 2.5rem;

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

#social ul{
  justify-content: flex-start;
  margin-top: 1rem;
  margin-bottom: 1.75rem;
}

footer{
  background: var(--blue-bulletin);
  color: var(--watchdog-white);
  text-align: center;

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  margin-top: 0;

  padding: 0 1.25rem 2rem 1.25rem;
}

footer p{
  margin: 0;
  opacity: 0.9;
}

/* medium styles 620px */
@media (min-width: 620px){
  main{
    padding: 2.25rem 1.25rem 3.5rem 1.25rem;
    padding-bottom: 0;
  }

     #breaking-news{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
  }

  #breaking-news h2{
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  #breaking-news article{
    grid-row: 2;
    height: 100%;
    display: grid;
    grid-template-rows: auto auto 1fr;
  }

  #breaking-news article + article{
    margin-top: 0;
  }

  #breaking-news article video{
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    margin-top: 0.85rem;
  }
  .articles-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  form{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  fieldset{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
  }

  fieldset div{
    margin-top: 0;
  }

  button[type="submit"]{
    grid-column: 1 / -1;
  }
}

/* large styles 920px */
@media (min-width: 920px){
  .menu-button{
    display: none;
  }

  .menu{
    display: flex;
    gap: 0.85rem;
    margin-top: 0;
  }

  .mobile-nav{
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .articles-list{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* x-large styles 1024px */
@media (min-width: 1024px){
  header{
    padding: 3.25rem 1.25rem 1.5rem 3.25rem;
  }

  .articles-list{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #social ul{
    gap: 1rem;
  }
}

/* Interaction Queries for color scheme light and dark and motion preference */
@media (prefers-reduced-motion: reduce){
  *{
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Feature Query for :has() that checks if the #menu-toggle is checked */
@supports (selector(:has(*))) {
  .mobile-nav:has(#menu-toggle:checked) .menu{
    display: grid;
  }
}

#social h2,
#social ul,
footer p{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

#social,
footer{
  padding-left: 3rem;
  padding-right: 1.25rem;
}
