/*==================================================
  ANNA CASTAGNOLI - MAIN STYLESHEET
  Clean, organized, and human-readable CSS
==================================================*/

/* NORMALIZE & BASE STYLES */
html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; }
body { margin: 0; line-height: 1.5; font-size: 100%; color: #222; background-color: #f5f5f5; font-family: 'Helvetica Neue', Helvetica, sans-serif; margin-top: 20px; }
img { max-width: 100%; border: 0; }
a { color: #b30a0a; text-decoration: none; transition: color 0.4s; }
a:hover { color: #999; }
input, select, textarea { font-family: inherit; font-size: 1rem; box-sizing: border-box; margin: 0; }
button { cursor: pointer; }

/* PAGE LAYOUT */
.content-area {
  background-color: #f5f4f2;
  padding: 20px;
  min-height: 100vh;
  margin-top: 45px;
}

@media (max-width: 63.99em) {
  .sidebar {
    display: none;
  }
  .sidebar.is-visible {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    overflow-y: auto;
    padding-top: 60px;
  }
}

@media (min-width: 64em) {
  .sidebar {
    position: fixed;
    width: 20rem;
    top: 0;
    bottom: 0;
    text-align: right;
  }
  .content-area {
    margin-left: 20rem;
  }
}

/* SIDEBAR STYLES */
.sidebar {
  text-align: right;
  background: white;
  padding-right: 5px;
  padding-top: 60px;
  box-shadow: 0 1px 3px hsla(0, 0%, 39%, .15);
}

.sidebar-header {
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
}

.site-title {
  font-size: 2rem;
  margin: 0 0 1rem 0;
  font-weight: 700;
}

.site-title img {
  max-height: 16rem;
}

/* SIDEBAR NAVIGATION */
.nav-wrap {
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
}

.main-navigation ul {
  list-style: none;
  padding-left: 0;
}

.main-navigation ul li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-navigation ul li:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.main-navigation a {
  display: block;
  color: #111;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.main-navigation a:hover {
  color: #999;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  font-weight: 700;
}

/* SIDEBAR SEARCH */
.sidebar-search {
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px;
  margin-bottom: 20px;
}

.sidebar-search .search-field {
  width: 100%;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 3px;
  box-sizing: border-box;
  font-size: 0.875rem;
}

.sidebar-search .search-submit {
  display: none;
}

/* SIDEBAR SOCIAL ICONS */
.sidebar-social {
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
  margin-top: 20px;
  margin-bottom: 20px;
}

.sidebar-social a {
  display: inline-block;
  margin: 0 7.5px;
}

.sidebar-social img {
  width: 24px;
  height: 24px;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  max-width: 16rem;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.875rem;
  color: #999;
}

.sidebar-footer p {
  font-size: 0.875rem;
  color: #999;
  margin: 0;
}

/* MOBILE NAVIGATION */
.toggle-nav {
  width: 28px;
  height: 28px;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  transition: 0.5s ease-in-out;
  cursor: pointer;
  display: block;
  border: none;
  background: transparent;
  padding: 0;
}

.toggle-nav span {
  position: absolute;
  height: 4px;
  border-radius: 2px;
  width: 100%;
  background: #333;
  opacity: 1;
  left: 0;
  transition: 0.25s ease-in-out;
  display: block;
}

.toggle-nav span:nth-child(1) { top: 1px; }
.toggle-nav span:nth-child(2), .toggle-nav span:nth-child(3) { top: 11px; }
.toggle-nav span:nth-child(4) { top: 21px; }

.toggle-nav.open span:nth-child(1) { top: 14px; width: 0; left: 50%; }
.toggle-nav.open span:nth-child(2) { transform: rotate(45deg); }
.toggle-nav.open span:nth-child(3) { transform: rotate(-45deg); }
.toggle-nav.open span:nth-child(4) { top: 14px; width: 0; left: 50%; }

@media (min-width: 64em) {
  .toggle-nav {
    display: none;
  }
}

@media (max-width: 1024px) {
  .sidebar-social {
    display: none;
  }
  .sidebar-footer {
    display: none;
  }
}

/* LISTING PAGE */
.content.js-grid {
  display: block;
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  width: 100%;
  padding-right: 30px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .content.js-grid {
    columns: 1;
  }
}

.post--grid {
  width: 100%;
  box-sizing: border-box;
  break-inside: avoid;
  margin: 20px;
  opacity: 0;
  animation: slideIn 0.6s ease-out forwards;
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post--grid .p3 {
  background: white;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* CARD ELEMENTS */
.post-image {
  margin: 0 0 20px 0;
  padding: 0;
  overflow: hidden;
}

.post-image a {
  display: block;
}

.post-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  transition: opacity 0.4s;
}

.post-image a:hover img {
  opacity: 0.75;
}

.entry-header {
  margin-top: 0;
  margin-bottom: 20px;
}

.entry-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  word-wrap: break-word;
}

.entry-title a {
  color: #111;
  text-decoration: none;
}

.entry-title a:hover {
  color: #999;
}

.entry-excerpt {
  margin-top: 0;
  font-size: 1.05rem;
  font-weight: 300;
}

.entry-excerpt p {
  margin: 0;
}

/* SINGLE POST PAGE */
.post-single {
  width: 75%;
  max-width: 900px;
  margin: 3rem auto;
  background: white;
  padding: 2rem;
  box-sizing: border-box;
}

.post-header {
  text-align: center;
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #111;
}

.post-meta {
  text-align: center;
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.post-meta .post-meta-sep {
  margin: 0 0.5rem;
}
.post-meta .post-category {
  color: #b30a0a;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-meta .post-category:hover {
  text-decoration: underline;
}

.post-content {
  color: #111;
  line-height: 1.6;
}

.post-content h2 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1rem; }
.post-content h3 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.post-content h4 { font-size: 1.25rem; margin-top: 1rem; margin-bottom: 0.5rem; }
.post-content p { margin-bottom: 1.5rem; line-height: 1.6; }
.post-content img { max-width: 100%; height: auto; display: block; margin: 2rem auto; border-radius: 4px; }
.post-content a { color: #b30a0a;; text-decoration: underline; }
.post-content a:hover { opacity: 0.8; }

@media (max-width: 768px) {
  .post-single {
    width: 100%;
    padding: 1.5rem;
    margin: 1.5rem 0;
  }
  .post-header h1 {
    font-size: 1.75rem;
  }
  .post-content img {
    margin: 1.5rem 0;
  }
}

/* SEARCH PAGE */
.search-container {
  max-width: 100%;
  padding: 2rem;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  border: 2px solid rgba(0, 0, 0, 0.125);
  border-radius: 4px;
  margin-bottom: 2rem;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: #b30a0a;
}

.search-results {
  width: 100%;
}

.loading {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.125rem;
  color: rgba(0, 0, 0, 0.6);
}

/* UTILITY CLASSES */
.clearfix::after {
  content: " ";
  display: table;
  clear: both;
}

.screen-reader-text {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.hidden {
  display: none !important;
}
