/*
Theme Name: Cronologia 40 anys
Theme URI: https://cronologia.periodistes.cat/
Description: 40 anys Col·legi de Periodistes de Catalunya
Version: 1.0
*/

/* Font Face Declarations */
@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-VariableFont_wght.woff') format('woff'),
       url('fonts/Lora-VariableFont_wght.ttf') format('truetype');
  font-weight: 300 400 700;
  font-style: normal;
  font-display: swap;
  font-preload: true;
}

@font-face {
  font-family: 'Lora';
  src: url('fonts/Lora-Italic-VariableFont_wght.woff2') format('woff2'),
       url('fonts/Lora-VariabºleFont_wght.ttf') format('truetype');
  font-weight: 300 400 700;
  font-style: italic;
  font-display: swap;
  font-preload: true;
}

@font-face {
  font-family: 'UntitledSans';
  src: url('fonts/UntitledSans-Regular.woff') format('woff'),
       url('fonts/UntitledSans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  font-preload: true;
}


/* Base Styles */
body {
  margin: 0;
  padding: 0;
  font-family: 'UntitledSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  font-size: 1.5rem; /* 18pt = 24px */
  line-height: 2rem; /* 24pt = 32px */
  background: #eae7db;
  color: #000;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

body.category-associacio {
  background: #FFD7D2;
}

a, a:hover {
  color: #000;
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-weight: 300;
  font-synthesis: none;
}

h1 {
  font-size: 3.83rem; /* 46pt = 61.33px */
  line-height: 4.17rem; /* 50pt = 66.67px */
}

h2 {
  font-size: 2rem; /* 24pt = 32px */
  line-height: 2.5rem; /* 30pt = 40px */
}

.hidden {
  display: none;
}

/* Layout */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.home main {
  padding-bottom: 3.5rem;
}

.wrapper {
  margin: 0 auto;
  /*padding: 0 1rem;*/
}

/* Header Styles */
header {
  border-bottom: 1px solid #000;
}

.site-header .wrapper, .site-footer .wrapper {
  width: 1500px;
  margin: 0 auto;
}

.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 3rem 0.5rem 3rem;
}

.site-header-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1002;
  /*flex: 1;*/
  width: 33%;
}

.site-header-logo {
  height: 40px;
}

.site-nav {
  /*flex: 1;*/
  width: 33%;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  align-items: center;
  font-size: 0.85rem; /* 14pt */
  justify-content: flex-end;
}

.site-nav ul a {
  text-decoration: none;
}

.site-nav ul .current-menu-item a {
  text-decoration: underline;
}

.site-header-title {
  text-align: center;
  font-family: 'Lora Italic', serif;
  font-style: italic;
  font-size: 1.85rem;
  line-height: 1.333rem; /* 32px */
  font-style: italic;
  margin: 0.5rem 0;
  font-weight: 500;
  /*flex: 1;*/
  width: 33%;
}

.site-header-title a, .site-nav-heading a {
  text-decoration: none;
}

.site-header-yearnav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding-bottom: 1rem;
  gap: 2rem;
  border-bottom: 1px solid #000;
}

.footer-yearnav {
  border-top: 1px solid #000;
  padding-top: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}

.site-header-yearnav a {
  font-size: 2rem;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.site-header-yearnav a:hover {
  color: #b89c5a;
}

.site-header-yearnav h1 {
  margin: 0;
  font-size: 2.9rem;
}

.site-header-yearnav .wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cronology-nav {
  padding: 0.3rem 0 0 0;
  border-bottom: 1px solid #000;
  font-size: 0.85rem;
}

.cronology-nav .wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  max-width: 1000px;
}

.cronology-nav > .wrapper > a {
  display: inline-block;
  text-decoration: none;
  margin: 5px 20px -2px 0;
}

.cronology-nav .year-slider {
  display: flex;
  align-items: center;
  gap: 2rem;
  overflow: hidden;
  margin: -4px 0 0 0;
}

.cronology-nav .swiper-wrapper {
  max-width: 500px;
}

.cronology-nav .swiper-slide-active a {
  font-weight: bold;
}

.cronology-nav .swiper-slide {
  flex-shrink: 0;
}

.cronology-nav .swiper-slide a {
  display: block;
  text-decoration: none;
  margin: -4px 0 0 0;
  padding: 0;
  white-space: nowrap;
  text-align: center;
  width: 100%;
}

.cronology-nav .swiper-button-prev,
.cronology-nav .swiper-button-next {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  color: inherit;
  display: flex !important;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 10;
  background-color: #eae7db;
  padding: 0 10px;
}

.cronology-nav .swiper-button-prev img,
.cronology-nav .swiper-button-next img {
  display: block;
}

.cronology-nav .swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}


/* Home Page Styles */
.home h2 {
  margin: 0 auto 2rem auto;
  font-size: 2.9rem;
}

.home-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  margin: 2rem auto;
  text-wrap: balance;
  text-align: center;
  max-width: 60ch;
}

.home-intro-text {
  font-size: 1.15rem;
  line-height: 1.5rem;
  font-family: 'Lora', serif;
  text-wrap: auto;
  max-width: 600px;
  margin: 0 auto;
}

.home-help-text {
  margin: 1rem auto 4rem auto;
  text-align: center;
  font-size: 1.14rem;
  font-family: 'Lora', serif;
}

/* News Block Styles */
.news-block:not(:last-child) {
  border-bottom: 1px solid #000;
}

.news-block .wrapper {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  position: relative;
  margin: 1.4rem auto;
}

.news-block-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.news-block-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 500;
  max-width: 430px;
  margin-top: 0;
}

.news-block-text {
  font-size: 1.15rem;
  margin: 0;
  max-width: 430px;
  line-height: 1.5rem;
}

.news-block-caption {
  font-size: 0.8rem;
  color: #555;
  margin: 0.5rem 0;
  max-width: 430px;
}

.news-block-count {
  font-size: 0.8rem;
  color: #555;
}

.news-block-right {
  width: 760px;
  flex-shrink: 0;
  min-width: 0;
}

.news-block-media {
  width: 100%;
  height: 100%;
}

/* YouTube Embed Responsive */
.youtube-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Gallery Styles */
.news-block-gallery {
  position: relative;
}

.gallery-slideshow {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-slide {
  display: none;
  width: 100%;
  height: 100%;
}

.gallery-slide.active {
  display: block;
}

.gallery-slideshow .gallery-slide:first-child { display: block; }

.gallery-nav-buttons {
  display: flex;
  flex-direction: row;
  justify-content: start;
  gap: 1.9rem;
  margin: 2rem 0 0 -1.1rem;
}


/* Page Styles */
.page-content {
  text-align: center;
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  line-height: 2.3rem;
}

.page-content h1, .page-content h2, .page-content h3, .page-content p, .page-content ul, .page-content ol {
  max-width: 60ch;
  margin: 0 auto;
}

.page-content h1 {
  padding: 3.3rem 0;
  border-bottom: 1px solid #000;
  margin-bottom: 5.5rem;
  width: 100%;
  font-size: 2.9rem;
}

.page-content p, .page-content ul, .page-content ol {
  margin-bottom: 2rem;
}


/* Footer Styles */
.site-footer {
  margin-top: auto;
  text-align: center;
  font-size: 1.17rem; /* 14pt = 18.67px */
  line-height: 1.67rem; /* 20pt = 26.67px */
  border-top: 1px solid #000;
  flex-shrink: 0;
}

.site-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 3.8rem;
}

.site-footer-bottom .wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
}

.site-footer-social,
.site-footer-search,
.site-footer-legal {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-height: 60px;
  background: none;
  gap: 10px;
}

.site-footer-social {
  padding-right: 1rem;
}

.site-footer-legal {
  padding-left: 1rem;
  font-size: 0.75rem;
}

.site-footer-bottom .wrapper > *:not(:last-child) {
  border-right: 1px solid #000;
}

.site-footer-social a img {
  display: block;
  width: 32px;
  height: 32px;
}

.footer-page {
  text-align: center;
  border-bottom: 1px solid #000;
  padding: 6rem 0 3rem 0;
}

.page-template-default.page .site-footer {
  margin-top: 4.5rem;
}

.page-footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 3.5rem auto 2rem auto;
}


/* Search Styles */
.site-footer-search {
  display: flex;
  align-items: center;
}

.site-footer-search .search-input-wrapper {
  width: 100%;
  padding: 0 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: none;
  border: none;
  outline: none;
  padding: 8px 40px 8px 50px;
  font-family: 'UntitledSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9rem;
  color: #000;
  width: 100%;
  text-transform: uppercase;
}

.search-input::placeholder {
  text-transform: uppercase;
}

.search-input:focus {
  outline: none;
}

.search-button {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #000;
  transition: color 0.2s;
}

.search-button:hover {
  color: #b89c5a;
}


/* Hamburger menu styles */
.hamburger-menu {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

body.no-scroll {
  overflow: hidden !important;
}

/* Swiper library reset */
.swiper-button-next::after,
.swiper-button-prev::after {
  display: none !important;
  content: none !important;
}

.swiper-button-next, .swiper-button-prev {
  position: relative!important;
}

.swiper-slide {
  height: auto!important;
  max-height: none;
}

.swiper-slide img {
  max-width: 100%;
  max-height: 507px;
  height: auto;
  /* les verticals, a 425x638 i les horitzontals a 760x507 */
}

.swiper-slide .swiper-caption {
  text-align: right;
  margin-top: 0;
}

.swiper-caption, .pdf-caption {
  font-size: 0.8rem;
  line-height: 1.15rem;
  margin: 1rem 0 0.85rem 0;
}

.swiper-pagination {
  font-size: 0.8rem;
}

.news-block-media,
.swiper-slide {
  position: relative;
  overflow: visible;
}

.swiper-slide-meta {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 2.5rem;
  margin-top: 2rem;
}

.swiper-slide-meta .swiper-pagination {
  width: 50px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: end;
  align-items: end;
  line-height: 8px;
}

/* External Links */
.external-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.91rem;
}

.external-links-list li {
  margin-bottom: 0;
}

.external-links-list a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

/* PDF */
.pdf-caption {
  margin-top: 0.4rem;
}
.pdf-caption a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: start;
}


/* Media Queries */
@media (max-width: 1500px) {
  .site-header .wrapper, .site-footer .wrapper {
    width: 100%;
    padding: 0;
  }
}

@media (min-width: 1200px) {
  .wrapper {
    width: 1200px;
  }


  .home .site-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #eae7db;
    z-index: 777;
  }
}

@media (max-width: 1200px) {
  header .wrapper, footer .wrapper, .site-header-yearnav .wrapper, .site-footer-bottom .wrapper {
    width: 100%;
  }

  .wrapper {
    padding: 0 15px;
  }
}

@media (max-width: 1092px) {  
  header {
    position: relative;
  }
  .hamburger-menu {
    display: flex !important;
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 1002;
  }
  .site-header-title {
    display: none !important;
  }
  .site-nav {
    display: none;
  }
  body.menu-open .site-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #eae7db;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    z-index: 1001;
    transform: translateX(0);
    pointer-events: auto;
    opacity: 1;
  }
  body.menu-open .site-nav ul {
    flex-direction: column;
    font-size: 1.3rem;
  }
  body.menu-open .site-nav ul a {
    text-decoration: none;
  }
  body.menu-open .site-nav .site-footer-bottom {
    display: block !important;
    width: 100%;
  }
  .site-footer-bottom .wrapper {
    flex-direction: column;
    padding: 0;
  }
  .site-footer-social, .site-footer-search, .site-footer-legal {
    border-bottom: 1px solid #000;
  }
  .site-footer-search {
    order: 1;
  }
  body.menu-open .site-footer-search {
    border-top: 1px solid #000;
  }
  body.menu-open .site-footer-search .search-input-wrapper {
    width: 85%;
  }
  .site-footer-bottom {
    padding-inline: 0;
  }
  .site-footer-social {
    padding-left: 1rem;
    order: 2;
  }
  .site-footer-legal {
    order: 3;
  }
  .site-footer-bottom .wrapper > *:not(:last-child) {
    border-right: none;
  }
  .site-nav-heading {
    display: block;
    text-align: center;
    font-style: italic;
    font-size: 1.38rem;
    margin-top: 71px;
    padding: 1rem 0;
    font-family: 'Lora', serif;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    width: 100%;
  }
}

@media (min-width: 1093px) {
  .hamburger-menu {
    display: none !important;
  }
  .site-nav-heading {
    display: none !important;
  }
  .site-nav .site-footer-bottom {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  /* Mobile Typography */
  body {
    font-size: 1.33rem; /* 16pt = 21.33px */
    line-height: 1.83rem; /* 22pt = 29.33px */
  }
  
  h1 {
    font-size: 2.33rem; /* 28pt = 37.33px */
    line-height: 2.67rem; /* 32pt = 42.67px */
  }
  
  h2 {
    font-size: 1.17rem; /* 14pt = 18.67px */
    line-height: 2.33rem; /* 28pt = 37.33px */
  }

  .site-header-bar {
    padding-inline: 0.94rem;
  }
  
  .site-nav ul {
    font-size: 1.17rem; /* 14pt = 18.67px */
    line-height: 1.5rem; /* 18pt = 24px */
  }

  .mobile-header-title {
    text-align: center;
    font-size: 1.38rem;
    border-top: 1px solid #000;
    font-family: 'Lora', serif;
    font-style: italic;
    padding: 1rem 0;
  }

  .home-intro-text {
    font-size: 1rem;
    line-height: 1.25rem;
    margin-bottom: 0;
  }

  .home-help-text {
    font-size: .90rem;
    margin: 0 auto;
  }

  .site-header-yearnav h1 {
    font-size: 2.75rem;
  }
  
  .site-footer {
    font-size: 1rem; /* 12pt = 16px */
    line-height: 1.5rem; /* 18pt = 24px */
  }

  .news-block-title {
    font-size: 1.25rem;
  }

  .news-block-text {
    font-size: 1rem;
    line-height: 1.38rem;
  }
  
  .swiper-slide img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
  }

  .swiper-caption {
    font-size: 0.75rem;
    line-height: 0.88rem;
  }

  .news-block-left, .news-block-right {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
  
  .news-block .wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .swiper-slide {
    text-align: left;
  }

  .swiper-slide .swiper-caption {
    text-align: left;
  }

  .swiper-pagination {
    display: block !important;
  }

  .swiper-slide-meta {
    gap: 0;
  }  

  .swiper-horizontal>.swiper-pagination-bullets, .swiper-pagination-bullets.swiper-pagination-horizontal, .swiper-pagination-custom, .swiper-pagination-fraction {
    top: auto!important;
    bottom: auto!important;
  }

  /*.gallery-nav-buttons {
    margin-top: 0;
  }*/
}

@media (max-width: 768px) {
  .cronology-nav .swiper-wrapper {
    max-width: 250px;
  }

  .news-block-title {
    font-size: 1.25rem;
  line-height: 1.5rem;
  }

  .site-footer {
    position: relative;
  }
}

@media (max-width: 576px) {
  .cronology-nav .swiper-wrapper {
    max-width: 190px;
  }

  .footer-page img {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 320px) {
  .cronology-nav .swiper-wrapper {
    max-width: 110px;
  }
}