/*
Theme Name: Blocksy Child
Description: Child theme of Blocksy
Author: Your Name
Template: blocksy
Version: 1.0.0
*/

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-EL.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-L.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-R.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-M.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-SB.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-B.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "GenYoMin TW";
  src: url("./fonts/GenYoMin2TW-H.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

body,
body * {
  font-family: "GenYoMin TW" !important;
}
#wpadminbar .ab-icon,
#wpadminbar .ab-item:before,
#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon,
.wp-admin-bar-arrow {
  font-family: dashicons !important;
}

.archive-wrapper,
.archive-portfolio-wrapper,
.archive-portfolio-wrapper *,
.archive-wrapper * {
  font-family: "GenYoMin TW";
}

header#header {
  position: sticky;
  top: 0;
}

body.admin-bar header#header {
  top: 32px;
}

/* Portfolio Archive Grid Layout */
.page-header {
  min-height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: linear-gradient(
    to bottom,
    #e0e0e0 0%,
    #f3f3f3 50%,
    transparent 50%
  );
  overflow: hidden;
}

.page-header::before {
  content: "PORTFOLIO";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(80px, 15vw, 160px);
  font-weight: 900;
  color: #f3f3f3;
  z-index: 1;
  white-space: nowrap;
  pointer-events: none;
  line-height: 0.7;
}

.page-title {
  text-align: center;
  position: relative;
  z-index: 2;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 70px;
  margin-top: 40px;
}

.portfolio-item {
  margin-bottom: 0;
}

.portfolio-card {
  border-radius: 8px;
  overflow: visible;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-5px);
}

.portfolio-thumbnail {
  position: relative;
  overflow: visible;
  aspect-ratio: 4/3;
}

.portfolio-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.portfolio-thumbnail:hover img {
  transform: scale(1.02);
}

.portfolio-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(to right, #e6d6c4 0%, #af7525 100%);

  /* 利用 mask 保留邊框，內部透明 */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  border-radius: 10px;
  width: 100%;
  height: 100%;
  padding: 1px;
}
.portfolio-info {
  background: #f3f3f3;
  color: #af7525;
  font-weight: 700;
  position: absolute;
  bottom: -30px;
  right: 10px;
  z-index: 10;
  padding: 0 15px;
}

.portfolio-category {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  background: #060606;
  color: white;
  padding: 10px 20px;
  border-bottom-right-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 10%;
}

.portfolio-views {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.portfolio-content {
  padding-top: 45px;
}

.portfolio-title {
  margin: 0 0 24px 0;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 10%;
}

.portfolio-title a {
  color: #060606;
  text-decoration: none;
  transition: color 0.3s ease;
}

.portfolio-title a:hover {
  color: #007cba;
}

.portfolio-excerpt {
  color: #7e7e7e;
  font-size: 16px;
  line-height: 30px;
  letter-spacing: 10%;
  margin: 0;
}

/* Pagination Styles */
.archive-portfolio-wrapper .pagination {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
}

.archive-portfolio-wrapper .pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.archive-portfolio-wrapper .pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 500;
  line-height: 30px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #060606;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: auto;
}

.archive-portfolio-wrapper .pagination .page-numbers.current {
  background: #060606;
  color: white;
  font-weight: 700;
}

.archive-portfolio-wrapper .pagination .page-numbers:hover:not(.current):not(.dots) {
  background: #e0e0e0;
}

.archive-portfolio-wrapper .pagination .page-numbers.dots {
  background: transparent;
  cursor: default;
}

.archive-portfolio-wrapper .pagination .page-numbers.prev,
.archive-portfolio-wrapper .pagination .page-numbers.next {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 0;
  position: relative;
}

.archive-portfolio-wrapper .pagination .page-numbers.prev::before,
.archive-portfolio-wrapper .pagination .page-numbers.next::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg width='5' height='10' viewBox='0 0 5 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.5 1L1 5L4.5 9' stroke='%23060606' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.archive-portfolio-wrapper .pagination .page-numbers.next::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .portfolio-overlay {
    top: 10px;
    left: 10px;
    right: 10px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* blog (archive.php) */
.archive-wrapper .page-header::before {
  content: "BLOG";
}

.blog-grid {
  max-width: 1010px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.blog-item-wrapper {
  display: flex;
  gap: 60px;
}
.blog-date-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.blog-month-year {
  color: #7e7e7e;
  font-size: 16px;
  line-height: 30px;
  letter-spacing: 0.1em;
}
.blog-date-seperator {
  width: 50px;
  height: 1px;
  background: linear-gradient(to right, #af7525, #e6d6c4);
}
.blog-day {
  color: #7e7e7e;
  font-size: 40px;
  font-weight: bold;
  line-height: 30px;
  letter-spacing: 0.1em;
}
.blog-card {
  display: flex;
  background: white;
  border: 0px transparent solid;
  border-radius: 0px;
  padding: 0px;
  position: relative;
  transition: all 0.3s ease;
}
.blog-card::after {
  content: "";
  position: absolute;
  bottom: 74px;
  right: 48px;
  width: 295px;
  height: 295px;
  background: radial-gradient(circle at center, #ffdbb2 0%, #f3f3f3 50%);
  transform: translate(50%, 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  overflow: hidden;
}
.blog-card:hover {
  border: 1px #af7525 solid;
  border-radius: 10px;
  padding: 14px;
}
.blog-card:hover::after {
  opacity: 0.5;
}

.blog-card:hover .blog-content {
  border: none;
}

.blog-thumbnail {
  flex-shrink: 0;
  position: relative;
}

.blog-card img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  aspect-ratio: 1;
}

.blog-content {
  padding: 26px 26px 26px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px #dedede solid;
  transition: all 0.3 ease;
}

.blog-title {
  color: #060606;
  font-size: 24px;
  font-weight: bold;
  line-height: 40px;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
}

.blog-title a {
  color: inherit;
  text-decoration: none;
}

.blog-excerpt {
  color: #7e7e7e;
  font-weight: 500;
  font-size: 16px;
  line-height: 30px;
  letter-spacing: 0.1em;
  margin: 0;
}

.blog-category {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #060606;
  color: white;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 2;
}

.blog-views {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  z-index: 2;
}

.blog-info {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: #f3f3f3;
  color: #af7525;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.blog-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Floating side menu */
.floating-side-menu {
  width: 50px;
  box-sizing: border-box;
  position: fixed;
  bottom: 140px;
  right: 0px;
  z-index: 100;
  text-align: center;
  background: rgb(153 153 153 / 80%);
  border-bottom-left-radius: 10px;
  border-top-left-radius: 10px;
  overflow: hidden;
}

.floating-side-menu a {
  display: inline-block;
  margin-bottom: 0px;
  padding: 7px 3px;
  transition: all 0.3s;
  border-bottom: 1px solid #aaa;
  font-size: 12px;
  color: #fff;
  letter-spacing: 3px;
  width: 100%;
}
.floating-side-menu img {
  opacity: 1;
  width: 100%;
  max-width: 35px;
}

/* Responsive Blog Layout */
@media (max-width: 768px) {
  .blog-grid {
    gap: 20px;
    padding: 0 15px;
  }

  .blog-card {
    flex-direction: column;
    max-height: none;
  }

  .blog-card img {
    width: 100%;
    height: 250px;
  }

  .blog-content {
    padding: 20px;
  }

  .blog-title {
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 12px;
  }

  .blog-excerpt {
    font-size: 14px;
    line-height: 24px;
  }

  .blog-category {
    top: 10px;
    left: 10px;
    font-size: 11px;
    padding: 4px 8px;
  }

  .blog-views {
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 4px 6px;
  }

  .blog-info {
    bottom: 10px;
    right: 10px;
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .blog-grid {
    padding: 0 10px;
  }

  .blog-card img {
    height: 200px;
  }

  .blog-content {
    padding: 15px;
  }

  .blog-title {
    font-size: 18px;
    line-height: 24px;
  }

  .blog-excerpt {
    font-size: 13px;
    line-height: 20px;
  }
  .blog-date-info {
    display: none;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .blog-card img {
    width: 280px;
    height: 280px;
  }

  .blog-content {
    padding: 20px 20px 20px 30px;
  }

  .blog-title {
    font-size: 22px;
    line-height: 32px;
  }

  .blog-excerpt {
    font-size: 15px;
    line-height: 26px;
  }
}
