@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Chomsky';
  src: url('./fonts/Chomsky.woff2') format('woff2'), /* Modern browsers */
       url('./fonts/Chomsky.woff') format('woff'),   /* Fallback for older browsers */
       url('./fonts/Chomsky.otf') format('opentype'); /* OTF as a last fallback */
  font-weight: normal;
  font-style: normal;
}

.logo text {
  font-family: 'Chomsky', serif; /* Fallback to a serif font */
}

html {
  font-size: 16px;
}

h3 {
  text-wrap: pretty;
  font-size: 1.2rem;
}

body {
  font-family: "Montserrat", sans-serif;
  display: grid;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-areas:
    "header header header"
    "main main aside";
  container-type: inline-size;
  container-name: body;
}

img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

svg {
  width: 16px;
  height: 16px;
}

/* Header */

header {
  grid-area: header;
  display: grid;
  justify-content: start;
  gap: 15px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 50px 70px 50px;
  grid-template-areas:
    "search search search"
    "logo logo logo"
    "nav nav nav";
  border-bottom: 4px double #333;
}

main {
  grid-area: main;
  border-right: 1px solid #979797;
  margin-top: 1rem;
  padding-right: 1rem;
}

article {
  display: grid;
  /* gap: 20px; */
  grid-template-columns: 35% 65%;
  border-bottom: 1px solid #333;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

main article:last-child {
  border-bottom: none;
}

article img {
  padding-left: 2rem;
}

.buttons {
  grid-area: search;
}

.lang-nav {
  display: flex; /* Enable flexbox */
  justify-content: center; /* Center the content horizontally */
  align-items: center; /* Optional: Align items vertically if needed */
  padding: 0; /* Remove the padding-right for proper centering */
}

.lang-nav > ul > *:hover {
  cursor: pointer;
  border: 1px solid #333;
  border-radius: 10px;
}

.login-buttons > * {
  transition: all 0.3s;
}

.login-buttons > *:hover {
  cursor: pointer;
  background-color: #333;
}

.mobile-header {
  display: none;
}

.main-header {
  grid-area: logo;
}

.main-nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.2rem;
}

.main-nav nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.main-nav nav ul li:hover {
  cursor: pointer;
  border-bottom: 1px solid #333;
}

.main-nav .vertical-line {
  border-left: 1px solid #dfdfdf;
  height: 16px;
  margin: 0px 10px 0px;
}

header .buttons {
  justify-content: space-between;
  align-items: center;
  min-height: 24px;
  margin-top: 3px;
  position: relative;
}

header nav ul {
  display: block;
  list-style: none;
  letter-spacing: 1.4px;
  text-align: center;
  padding-top: 4px;
}

.lang-nav ul li {
  font-size: 0.7rem;
}

header nav ul li {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

header nav ul li a {
  text-decoration: none;
  color: #333;
  padding: 7px 8px 6px;
}

.search-section {
  position: absolute;
  top: 4px;
  left: 0;
}

.search-section a {
  padding: 8px 9px 9px;
  margin-left: -8px;
}

.login-buttons {
  position: absolute;
  top: 4px;
  right: 0;
  display: flex;
  gap: 16px;
}

.login-buttons button {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05rem;
  padding: 8px 12px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  background-color: rgb(86, 123, 149);
  color: #fff;
  cursor: pointer;
}

.main-header {
  display: grid;
  grid-template-areas: "today logo stock";
  grid-template-columns: 20% 60% 20%;
  justify-items: stretch;
  justify-content: space-between;
  align-items: center;
  /* padding-block: 26px; */
  /* width: clamp(6rem, 80vw, 1200px); */
  /* margin: 0 auto; */
}

.main-p-section {
  grid-area: today;
}

.main-header p {
  font-size: 0.875rem;
  color: #333;
}

.stock {
  width: 100%;
  text-align: end;
  grid-area: stock;
}

.logo {
  /* display: block;
  margin: 0 auto;
  padding-right: 5rem;
  grid-area: logo; */
  display: flex; /* Use flexbox for centering */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically if needed */
  margin: 0 auto; /* Center the block element in its container */
  padding: 0; /* Remove padding-right */
  grid-area: logo;
}

.logo svg {
  width: auto;
  height: 65px;
}

.stock span {
  font-size: 0.875rem;
  color: rgb(82, 135, 69);
}

.fa-chevron-down {
  font-size: 0.7rem;
  color: #979797;
}

.dropdown-menu {
  display: none; /* Hidden by default */
  position: absolute;
  background-color: #fff;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 1;
}

.dropdown-menu li {
  padding: 8px 16px;
}

.dropdown-menu li a {
  text-decoration: none;
  color: #333;
  display: block;
}

.dropdown-menu li a:hover {
  background-color: #f0f0f0;
}

.dropdown i {
  cursor: pointer;
}


/* Main */

.news-text section + section {
  border-top: 1px solid #dfdfdf;
  margin-top: 1rem;
  padding-top: 1rem;
}

.news-text h3 {
  font-size: 1rem;
  color: #333;
}

.news-text p {
  padding-top: 0.5rem;
  font-size: 0.9rem;
}

.news-text address {
  font-size: 0.8rem;
  color: #333;
  margin-top: 0.3rem;
}

.news-image {
  display: flex; /* Optional: to layout image and figcaption properly */
  flex-direction: column; /* Stack image and caption vertically */
  align-items: center; /* Center-align the image and caption */
  text-align: center; /* Center-align the caption */
  margin: 0 auto; /* Center the entire section */
  width: 100%; /* Allow the section to span the full width */
  max-width: 800px; /* Optional: Limit the section's maximum width */
}

.news-image img {
  width: 100%; /* Make the image responsive to the container width */
  height: auto; /* Maintain the aspect ratio */
}

.news-image figcaption {
  font-size: 0.75rem;
  color: #333;
  margin-top: 0.25rem;
  text-align: end;
  width: 100%; /* Ensure the figcaption spans the full width of its container */
}

.links-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-block: 0.5rem;
  width: 92%;
}

.links-between a {
  font-size: 0.74rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

.links-between a + a {
  font-weight: unset;
}

.links-between.sections {
  display: grid;
  align-items: start;
  width: 100%;
  margin-top: 1.2rem;
  grid-template-columns: 1fr 1fr;
  /* grid-template-rows: 0.7fr 1fr; */
  gap: 0.8rem;
  grid-template-areas:
    "one two"
    "three three";
}

.links-between.sections > section:nth-child(2) {
  border-left: 1.2px solid #dfdfdf;
  padding-inline: 1.2rem;
}

.links-between.sections > section:last-child {
  grid-area: three;
  display: flex;
  align-items: start;
  border-block: 1.2px solid #979797;
  padding-block: 1.2rem;
}

.links-between.sections > section:last-child img {
  height: 91px;
  margin-right: 0.5rem;
}

.links-between.sections > section h3 {
  font-size: 0.8rem;
  padding-block: 0.2rem;
  color: #333;
}

.links-between.sections > section address {
  all: unset;
  font-size: 0.75rem;
  color: #333;
}

.links-between.sections > section:last-child h3 {
  font-size: 0.9rem;
  padding-block: 0.2rem;
  color: #333;
}

.links-between.sections > section:last-child p {
  font-size: 0.8rem;
  color: #333;
}

.links-between.sections > section:last-child address {
  font-size: 0.7rem;
  color: #333;
}

/* Aside */

aside {
  grid-area: aside;
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  height: fit-content;
  container-type: inline-size;
  container-name: aside;
}

aside article:last-child {
  border-bottom: none;
}

.small-two-news {
  display: grid;
  gap: 0rem;
  grid-template-columns: 50% 50%;
  padding-bottom: 4rem;
  position: relative;
}

.small-two-news :is(img, h3) {
  width: calc(100% - 0.3rem);
  font-size: 0.8rem;
}

.small-two-news address {
  font-size: 0.7rem;
  color: #333;
  margin-top: 0.3rem;
}

.next-buttons {
  position: absolute;
  bottom: 15px;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
}

.next-buttons button {
  all: unset;
  display: block;
  height: 26px;
  width: 26px;
  cursor: pointer;
}

.next-buttons svg {
  transition: fill 0.2s;
}

.next-buttons button:disabled {
  cursor: auto;
}

.next-buttons button:hover:not(:disabled) svg {
  fill: #dfdfdf;
}

.next-buttons svg {
  width: 26px;
  height: 26px;
  fill: var(--color-background-primary, #ffffff);
}

.next-buttons button:nth-of-type(1) {
  transform: rotate(180deg);
}

.next-buttons svg path {
  stroke: var(--color-stroke-primary, #121212);
}

.next-buttons button:disabled path {
  stroke: #dfdfdf;
}

.opinions {
  all: unset;
  padding-top: 0;
}

.opinions h3 {
  font-size: 1rem;
  color: #333;
}

.opinion {
  display: grid;
  gap: 0rem;
  justify-items: stretch;
  align-items: center;
  grid-template-columns: 80% 20%;
  padding-block: 1rem;
  border-bottom: 1px solid #dfdfdf;
}

.opinion .opinion-text > *:not(h4) {
  text-transform: uppercase;
}

.opinion-image {
  width: fit-content;
  height: fit-content;
  margin-left: auto;
}

.opinion img[big] {
  width: 152px;
  height: 152px;
}

.opinion img[mid] {
  width: 91px;
  height: 91px;
}

.opinion:has(img[big]) {
  grid-template-columns: 50% 50%;
  align-items: start;
}
.opinion:has(img[mid]) {
  grid-template-columns: 70% 30%;
  align-items: start;
}

.opinion:has(section:only-child) {
  grid-template-columns: 1fr;
}

.opinion img {
  height: 40px;
  margin-left: auto;
}

/* .opinions h3 {
  font-size: 0.9rem;
  color: #333;
} */

.opinion figcaption {
  font-size: 0.8rem;
  color: #333;
}

.opinion address {
  font-size: 0.8rem;
  color: #333;
  margin-top: 0.3rem;
}

.opinion-text h4 {
  padding-block: 0.2rem;
}

.play-button {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.play-button svg {
  width: 26px;
  height: 26px;
  fill: var(--color-background-primary, #ffffff);
}

.play-button svg path {
  fill: var(--color-stroke-primary, #121212);
}

.opinion + .small-two-news figcaption {
  font-size: 0.8rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  text-align: start;
  margin-bottom: 0.2rem;
}

@media (max-width: 1350px) {
  body {
    width: 90%;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "header header"
      "main main"
      "aside aside";
  }

  header {
    grid-template-rows: 50px 130px 80px;
  }

  .mobile-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
    justify-items: stretch;
    margin-bottom: 2rem;
  }

  .mobile-header a {
    padding: 1rem;
  }

  .mobile-header i {
    color: black;
  }

  .mobile-header a:last-child {
    text-align: end;
  }

  main article img {
    width: 100%;
  }

  header {
    width: 100%;
  }

  main {
    border-right: none;
  }

  .buttons {
    display: none;
  }

  aside article:not(article[class]) .news-image {
    padding-right: 1rem;
  }
}

@media (max-width: 1200px) {
  header {
    grid-template-rows: 80px 130px 80px;
  }
  .main-header {
    padding-bottom: 2rem;
    grid-template-columns: 100%;
    grid-template-areas:
      "logo logo logo"
      "today today today";
  }

  .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-right: 0;
    width: 80%;
    margin-top: 1.1rem;
  }

  .logo a {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo svg {
    width: 100%;

    height: 50px;
  }

  .main-p-section {
    width: 100%;
    text-align: center;
    padding-block: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
  }

  .stock {
    display: none;
  }

  aside article img {
    padding-left: 0;
  }
}

@media (max-width: 840px) {
  header {
    grid-template-rows: 30px 100px;
  }

  main article {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  main article img {
    padding-left: 0;
    width: 100%;
  }

  .main-nav {
    display: none;
  }

  .main-nav ul {
    padding-bottom: 2rem;
  }
}

@media (max-width: 400px) {
  header {
    grid-template-rows: 30px 100px 150px;
  }

  .main-nav ul {
    padding-bottom: 3.5rem;
    row-gap: 1rem;
  }
}

@container aside (max-width: 400px) {
  aside article {
    display: grid;
    gap: 1rem;
    padding-bottom: 0.3rem;
    grid-template-columns: 1fr;
  }

  aside article img {
    padding-left: 0;
    height: fit-content;
  }

  aside article .news-text {
    height: fit-content;
  }
}
