/*
Theme Name: FML Theme
Theme URI: https://wordpress.org/themes/fml/
Author: MKW
Author URI: http://localhost
Description: Custom theme dedicated for making a magazine style blog that consist of Fashion, Music and Lifestyle
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: fmltheme
*/

@font-face {
  font-family: FreightDisp;
  src: url("fonts/freight-disp-medium.otf") format("opentype");
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  height: 100%;
}

body {
  /*font-family: "Archivo Black", sans-serif;*/
  font-family: "Nunito", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #43403b;
}

main {
  flex: 1;
}

/* front-page */
.landing {
  height: 86vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
}

.letters {
  display: flex;
  justify-content: center;
  align-items: center;
  /*font-family: "Archivo Black", sans-serif;*/
  font-family: "Playfair", serif;
  gap: 0;
  transition: all 0.4s ease;
}

.letter {
  display: flex;
  align-items: center;
  font-weight: bold;
  text-decoration: none;
  color: #43403b;
  /*overflow: hidden;*/
  transition: all 0.4s ease;
}

.letter .big {
  font-size: 14rem;
  transition: transform 0.4s ease;
}

.letter .rest {
  font-size: 4rem;
  opacity: 0;
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.4s ease;
  margin-top: 40px;
  margin-left: -5px;
}

.letter:hover .rest {
  opacity: 1;
  max-width: 400px;
}

.letter:hover .big {
  transform: translateX(-5px);
}

.letters .letter {
  transition: margin 0.4s ease;
}

.letters .letter:hover {
  margin: 0 1.5rem;
}

.letters:hover .letter:not(:hover) {
  opacity: 0.5;
}

.bottom-section {
  text-align: center;
  margin-top: 50px; /* space before this section */
  width: 100%;
  bottom: 0;
}

.line {
  width: 100%;
  border-top: 1px solid #cacaca;
  margin: 0 auto;
}

.copyright {
  color: #7c7c7c;
  font-size: 15px;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .letter .big {
    font-size: 8rem;
  }

  .letter .rest {
    font-size: 2rem;
  }
}
/* front page end */

/* Navbar */
.navbar {
  border-bottom: 1px solid #ccc;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  width: auto;
  max-width: 1280px;
}

.navbar-logo img {
  height: 70px;
}

.navbar-menu {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.navbar-menu li {
  position: relative;
}

.navbar-menu li a {
  text-decoration: none;
  /* font-family: "Playfair Display", serif; */
  font-family: "FreightDisp", sans-serif;
  font-weight: bold;
  font-size: 20px;
  color: #43403b;
  padding: 0 5px;
  display: inline-block;
}

.navbar-menu li.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -26px;
  width: 100%;
  height: 2px;
  background: #3a3a3a;
}

@media (max-width: 1024px) {
  .navbar-menu {
    gap: 20px;
  }
  .navbar-container {
    width: auto;
    max-width: 1024px;
    padding: 0 48px;
  }
}

@media (max-width: 768px) {
  .navbar-menu {
    gap: 15px;
    font-size: 16px;
  }
  .navbar-container {
    width: auto;
    max-width: 768px;
    padding: 0 16px;
  }
}

/* Category / Homepage */
.category-page {
  margin: 0 auto;
  width: auto;
  max-width: 1280px;
  height: auto;
}

.category-header {
  text-align: center;
  font-size: 60px;
  margin-top: 40px;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
}

.latest-post {
  margin-top: 78px;
}

.latest-post img {
  width: 100%;
  height: auto;
  display: block;
}

.latest-post h2 {
  font-size: 40px;
  margin-top: 24px;
  margin-bottom: 0px;
  text-align: center;
  color: #43403b;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
}

.latest-post .subtitle {
  font-size: 18px;
  margin-top: 6px;
  text-align: center;
  color: #43403b;
  font-family: "Nunito", sans-serif;
}

.latest-post .author {
  font-size: 18px;
  text-align: center;
  color: #818181;
  font-family: "Nunito", sans-serif;
}

.latest-post a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.latest-post a:hover {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 70px;
}

.post-card img {
  width: 296px;
  height: 370px;
  object-fit: cover;
}

.post-card h3 {
  margin-top: 8px;
  font-size: 20px;
  color: #43403b;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
}

.post-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card a:hover {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.load-more {
  display: block;
  margin: 62px auto;
  padding: 12px 24px;
  font-size: 18px;
  border: 1px solid black;
  background: none;
  cursor: pointer;
  border: 1px solid black;
}

@media (max-width: 1024px) {
  .category-page {
    width: auto;
    padding: 0 48px;
    min-height: auto;
  }
  .latest-post {
    width: 100%;
  }
  .latest-post img {
    width: 100%;
    height: auto;
  }
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .post-card img {
    width: 100%;
    height: 565px;
  }
}

@media (max-width: 767px) {
  .category-page {
    padding: 0 16px;
  }

  .category-header {
    font-size: 40px;
    margin-top: 24px;
  }

  .latest-post h2 {
    font-size: 28px;
    margin-top: 16px;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 16px; /* Adjust gap for mobile */
  }

  .post-card img {
    height: auto;
  }

  .post-card h3 {
    font-size: 18px;
    margin-top: 4px;
  }

  .load-more {
    margin: 40px auto;
  }
}

/* POST */
.single-post-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1280px;
  width: auto;
  margin: 0 auto;
  padding: 3rem 1rem;
  box-sizing: border-box;
}

.single-post-container .post-title {
  font-size: 50px;
  text-align: center;
  margin-bottom: 8px;
}
.single-post-container .subtitle {
  font-size: 18px;
  text-align: center;
  margin-bottom: 2px;
  color: #43403b;
}
.single-post-container .post-author {
  font-size: 18px;
  text-align: center;
  margin-top: 0px;
  margin-bottom: 32px;
  color: #818181;
  font-family: "Nunito", sans-serif;
}

.post-content {
  width: 100%;
  display: grid;
  justify-content: center;
}

.single-post-container .post-content p {
  text-align: justify;
  max-width: 800px;
  width: 100%;
  margin: 0 auto 10px auto;
  font-family: "Nunito", sans-serif;
}

.single-post-container .post-content p:has(img:only-child) {
  text-align: center;
  max-width: 100%;
  width: 100%;
  margin: 0 auto 32px auto;
  padding: 0;
}

.single-post-container .post-content p img:only-child {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  max-width: 1280px;
  margin: 0 auto 32 auto;
}

@media (max-width: 1024px) {
  .single-post-container {
    width: 100%;
    max-width: 928px;
    padding: 2rem 1rem;
  }

  .single-post-container .post-title {
    font-size: 48px;
  }

  .single-post-container .subtitle,
  .single-post-container .post-author,
  .single-post-container .post-content p {
    font-size: 18px;
  }

  .single-post-container .post-content p {
    text-align: justify;
    max-width: 600px;
    width: 100%;
    margin: 0 auto 10px auto;
  }

  .single-post-container .post-content p:has(img:only-child) {
    max-width: 100%;
    width: 100%;
    margin: 0 auto 32px auto;
  }

  .single-post-container .post-content p img:only-child {
    max-width: 928px;
    width: 100%;
    height: auto;
    margin: 0 auto 32px auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
}

@media (max-width: 768px) {
  .single-post-container {
    width: 100%;
    padding: 2rem 1rem;
  }

  .single-post-container .post-title {
    font-size: 36px;
  }

  .single-post-container .post-content p {
    text-align: justify;
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px 0;
  }

  .single-post-container .post-content p:has(img:only-child) {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 32px auto;
  }

  .single-post-container .post-content p img:only-child {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0 auto 32px auto;
  }
}

/* SINGLE-LAYOUT2 */
.single-postb-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.single-postb-container .post-title {
  font-size: 50px;
  text-align: center;
  margin-bottom: 8px;
}
.single-postb-container .subtitle {
  font-size: 18px;
  text-align: center;
  margin-bottom: 2px;
  color: #43403b;
}
.single-postb-container .post-author {
  font-size: 18px;
  text-align: center;
  margin-top: 0px;
  margin-bottom: 32px;
  font-family: "Nunito", sans-serif;
  color: #818181;
}

.post-content > p:first-of-type > img {
  float: right;
  width: 630px;
  height: auto;
  margin-left: 20px;
  margin-bottom: 20px;
  display: inline;
  font-family: "Nunito", sans-serif;
}

.post-content > p:first-of-type + p {
}

.post-content > p:first-of-type + p + p {
  clear: both;
}

@media (max-width: 768px) {
  .single-postb-container p > img:first-child,
  .post-content p > img:first-child,
  .single-postb-container .wp-block-image,
  .post-content .wp-block-image {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
  }
}

/* SHARE BUTTON */
.share-buttons {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
  text-align: center;
}

.share-buttons h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #555;
}

.share-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.share-buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}

.share-button i {
  margin-right: 8px;
}

.share-button.facebook {
  background-color: #3b5998;
}

.share-button.facebook:hover {
  background-color: #2d4373;
}

.share-button.twitter {
  background-color: #1da1f2;
}

.share-button.twitter:hover {
  background-color: #0d8ddb;
}

.share-button.pinterest {
  background-color: #bd081c;
}

.share-button.pinterest:hover {
  background-color: #8c0615;
}

.share-button.linkedin {
  background-color: #0077b5;
}

.share-button.linkedin:hover {
  background-color: #005f90;
}

@media (max-width: 600px) {
  .share-button {
    flex: 1 1 120px;
    max-width: 45%;
    padding: 0.75rem 0;
    font-size: small;
  }

  .share-buttons-container {
    gap: 4px;
  }
}

/* RELATED POST */
.related-posts-wrapper {
  max-width: 1248px;
  margin: 3rem auto 0;
  padding: 3rem 1rem 0;
  border-top: 1px solid #ddd;
}

.related-posts-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
}

/* Grid Layout */
.related-posts-grid {
  display: grid !important;
  justify-content: center;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Each card */
.related-post-card {
  text-align: center;
}

.related-post-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-post-thumbnail-container {
  width: 100%;
  padding-bottom: 125%; /* keeps 4:5 aspect ratio */
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.related-post-thumbnail-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

.related-post-card:hover img {
  transform: scale(1.05);
}

.related-post-title {
  font-size: 1rem;
  margin-top: 0.75rem;
  line-height: 1.3;
}

@media (max-width: 1024px) {
  .related-posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
}

/* FOOTER */
.footer {
  background-color: #000;
  width: 100%;
  margin-top: auto;
}

.footer-container {
  background-color: #000;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  width: auto;
  padding-top: 10px;
  padding-bottom: 10px;
  max-width: 1280px;
}

.footer-logo img {
  height: 150px;
}

.footer-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu li a {
  text-decoration: none;
  font-size: 18px;
  /*font-family: "Archivo Black", sans-serif;*/
  font-family: "Nunito", sans-serif;
  color: #fff;
  padding: 5px 0;
  display: inline-block;
}

.footer-social {
  display: flex;
  flex-direction: row;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-social li a {
  color: #fff;
  font-size: 18px;
  padding: 0 5px;
  display: inline-block;
  text-decoration: none;
}

@media (max-width: 1024px) {
  .footer {
    gap: 20px;
  }
  .footer-container {
    padding: 0 48px;
  }
}

@media (max-width: 768px) {
  .footer {
    gap: 15px;
    font-size: 16px;
  }

  .footer-container {
    padding: 0 16px;
  }
}

/* === Layout container === */
.single-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
  box-sizing: border-box;
}

/* === Typography === */
.single-container .post-title {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 0.5rem;
}

.single-container .subtitle {
  font-size: 1.125rem;
  text-align: center;
  margin-bottom: 0.25rem;
  color: #43403b;
}

.single-container .post-author {
  font-size: 1rem;
  text-align: center;
  margin-top: 0;
  margin-bottom: 2rem;
  color: #818181;
  font-family: "Nunito", sans-serif;
}

/* === Post content === */
.post-test-content {
  width: 100%;
  max-width: 760px;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #2c2c2c;
  overflow-wrap: break-word;
}

.post-test-content p {
  margin-bottom: 1.5em;
}

/* === General image behavior === */
.post-test-content img {
  display: block;
  height: auto;
  max-width: 100%;
  margin: 0 auto; /* center wide images */
  border-radius: 8px;
}

/* If an image is inside the editor and larger than the container,
   it will shrink to fit and remain centered. */
.post-test-content img.size-full,
.post-test-content img.size-large {
  width: auto;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

/* === WordPress alignment classes === */
.post-test-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.post-test-content .alignleft {
  float: left;
  margin: 0.5em 1.5em 1em 0;
  max-width: 50%;
}

.post-test-content .alignright {
  float: right;
  margin: 0.5em 0 1em 1.5em;
  max-width: 50%;
}

/* === WordPress image caption block === */
.post-test-content .wp-caption {
  display: inline-block;
  max-width: 100%;
  text-align: center;
  margin: 1.5em auto;
}

.post-test-content .wp-caption img {
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

.post-test-content .wp-caption p.wp-caption-text {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.5em;
  line-height: 1.4;
  font-style: italic;
}

/* === Responsive adjustments === */

/* Tablet view */
@media (max-width: 1024px) {
  .post-test-content {
    max-width: 680px;
    font-size: 1.05rem;
  }

  .post-test-content .alignleft,
  .post-test-content .alignright {
    max-width: 45%;
  }
}

/* Mobile view */
@media (max-width: 768px) {
  .single-container {
    padding: 2rem 1rem;
  }

  .post-test-content {
    max-width: 100%;
    font-size: 1rem;
  }

  /* Stack floated images on small screens */
  .post-test-content .alignleft,
  .post-test-content .alignright {
    float: none;
    display: block;
    margin: 1.5em auto;
    max-width: 100%;
  }

  /* Captions stay centered */
  .post-test-content .wp-caption {
    width: 100% !important;
    text-align: center;
  }
}