/**
 * Settings
 */

:root {
  --gap: 30px;
  --columns: repeat(auto-fit, minmax(300px, 1fr));
}

/**
 * Default grid setup
 */

.grid {
  display: grid;
  grid-gap: var(--gap);
}

@media (min-width: 690px) {
  .grid {
    grid-template-columns: var(--columns);
  }
}

/**
 * Flag
 */

.flag {
  position: relative;
  z-index: 2;
  box-shadow: 0px 2px 8px #999;
  background-color: white;
}

.flag > * {
  margin: 0;
}

.masthead {
  height: 60px;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
}

.logo img {
  height: 30px;
  max-width: 100%;
}

[page="home"] .logo img {
  height: 40px;
}

.hamburger {
  display: flex;
  align-items: center;
  margin-right: 10px;
  flex: 1;
}

.hamburger > * {
  padding: 10px;
}

.hamburger .toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.hamburger .toggle svg {
  margin-right: 8px;
}

.hamburger .toggle h5, .hamburger .toggle h4 {
  position: relative;
  margin: 0;
  top: 0.1em;
  font-family: "McClatchy Sans";
}

.sign-in {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: 10px;
  flex: 1;
}

.sign-in a {
  padding: 6px 12px 2px;
  font: 500 14px "McClatchy Sans";
}

.sign-in a.reverse {
  background-color: black;
  color: white;
}

.sign-in span {
  position: relative;
  top: 0.1em;
}

.subscribe-icon-button {
  display: none;
  padding: 10px;
}

@media (max-width: 1200px) {
  .hamburger .label {
    display: none;
  }
}

@media (max-width: 1024px) {
  .search-button {
    display: none;
  }

  .sign-in a, .weather-button {
    display: none;
  }

  .subscribe-icon-button {
    display: block;
  }
}

@media (max-width: 767px) {
  .ereader-button {
    display: none;
  }
}

nav {
  display: flex;
  justify-content: center;
}

nav a {
  padding: 10px 20px;
  font: 14px "McClatchy Sans";
  color: #757575;
  border-bottom: 3px solid transparent;
}

nav a.active {
  border-color: black;
}

@media (max-width: 690px) {
  nav a {
    font-size: 13px;
    padding: 10px 15px;
  }
}

/**
 * Special feature
 */

.special-feature {
  flex-direction: row;
  flex-wrap: wrap;
}

.special-feature figure {
  flex: 1 1 150px;
}

.special-feature .card-info {
  flex: 2 1 360px;
  justify-content: center;
}

.special-feature h1 {
  max-width: 607px;
}

.special-feature time {
  display: block;
  flex: none;
}

.special-feature .author {
  font-weight: 600;
  padding-right: 4px;
  margin-right: 4px;
  border-right: 1px solid white;
}

@media (min-width: 570px) {
  .special-feature .card-info {
    padding: 35px 30px 30px;
  }
}

/**
 * In depth
 */

.in-depth {
  flex-direction: row;
  flex-wrap: wrap;
}

.in-depth figure {
  flex: 2 1 590px;
}

.in-depth .card-info {
  flex: 1 1 250px;
}

@media (min-width: 930px) {
  .in-depth .card-info {
    padding: 30px;
  }
}

/**
 * Featured videos
 */

.videos {
  position: relative;
}

.videos .card:not(:first-of-type) {
  margin-top: 15px;
}

@media (min-width: 1020px) {
  :root {
    --active-video-width: 606px;
  }

  .videos {
    display: flex;
  }

  .videos .card {
    margin-top: 0 !important;
    flex: 0 1 calc((100% - var(--active-video-width)) / 2);
    transition: all .4s ease;
  }

  .videos figure {
    flex: 1;
    filter: brightness(40%);
    height: calc(var(--active-video-width) * .5625);
  }

  .videos .card-info {
    flex: none;
  }

  .videos .kicker {
    display: none;
  }

  .videos .card-info h3 {
    height: 3.6em;
    overflow: hidden;
  }

  .videos[selected="0"] .card:nth-child(2),
  .videos[selected="1"] .card:nth-child(3),
  .videos[selected="2"] .card:nth-child(4) 
  {
    flex: 0 1 var(--active-video-width);
  }

  .videos[selected="0"] .card:nth-child(2) figure,
  .videos[selected="1"] .card:nth-child(3) figure,
  .videos[selected="2"] .card:nth-child(4) figure 
  {
    filter: brightness(1);
  }
}

/**
 * Section nav
 */

@media (max-width: 1000px) {
  .section-nav {
    display: none;
  }
}

.section-nav .toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.section-nav .toggle svg {
  margin-left: 4px;
  transition: transform .3s ease;
}

.section-nav h1 {
  margin: 0;
  padding-top: 4px;
  border-top: 2px solid #222;
}

.section-nav ul {
  list-style-type: none;
  display: flex;
  margin: 0;
  padding: 0;
  font: 12px/1.2em "McClatchy Sans";
  height: auto;
  transition: transform .3s ease, opacity .2s ease-in .1s;
}

.section-nav a {
  display: block;
  padding: 10px 8px 0px 8px;
  color: #757575;
}

.section-nav li:first-child a {
  padding-left: 0;
  color: inherit;
}

.section-nav.closed svg {
  transform: rotate(180deg);
}

.section-nav.closed ul {
  transform: translateY(-30px);
  opacity: 0;
  height: 0;
  pointer-events: none;
  transition: transform .3s ease .1s, opacity .2s ease-in;
}

/**
 * Related Sections
 */

.related-sections ul {
  list-style-type: none;
}

.related-sections li {
  font: 500 14px/16px "McClatchy Sans";
  padding: 10px 0;
  color: #989898;
}

.related-sections li.arrow {
  color: black;
}

/**
 * Footer
 */

footer {
  background-color: #e0e0e0;
}

footer h3, footer h4 {
  font-family: "McClatchy Sans";
  font-weight: 500;
  margin: 0 0 10px;
}

footer .grid {
  max-width: 1140px;
  padding: var(--gap);
  margin: 0 auto;
}

@media (min-width: 1020px) {
  footer .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

footer a {
  display: block;
  padding: 10px 0px;
  font: 14px "McClatchy Sans";
  color: #757575;
}

footer .stay-connected a {
  color: #222;
  font-weight: 500;
}

@media (max-width: 690px) {
  footer {
    grid-template-columns: 1fr 1fr;
  }
}

/**
 * Hamburger panel
 */

.hamburger.panel {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 260px;
  background-color: #373737;
  color: white;
  fill: white;
  z-index: 4;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  transition: transform .4s ease;
  transform: translateX(-260px);
}

.hamburger.panel .toggle {
  padding: 20px 40px;
}

.hamburger.panel nav {
  padding: 0;
  flex-direction: column
}

.hamburger.panel nav a {
  padding: 15px 40px 15px 36px;
  border-bottom: none;
  border-left: 4px solid transparent;
  font-size: 14px;
  color: white;
}

.hamburger.panel nav a.active {
  border-left-color: #0066B3;
  background-color: #222;
}

/* Hamburger menu animation */

body.menu .hamburger.panel {
  transform: translateX(0);
}

body.menu:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 3;
}


/**
 * Card Animation
 */

.card, .digest {
  transition: opacity .2s ease-in, transform .3s ease-in;
  will-change: transform;
}

.card:nth-of-type(odd), .digest:nth-of-type(odd) {
  transition-delay: .2s;
}

.animate-in {
  opacity: 0;
  transform: translateY(50px);
}
