/*
Theme Name: Phantoms of Legend
Theme URI:  https://example.com/phantoms-of-legend
Author:     Your Name
Author URI: https://example.com
Description: A WordPress theme for the Phantoms of Legend blog (art, philosophy, history, myth).
Version:    1.0.0
License:    GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: phantoms-of-legend
Tags: art, blog, history, philosophy, custom-menu, featured-images
*/

/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Joan&display=swap');

* {
    font-family: 'Joan', serif !important;
}

/* Body & Background */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-image: url('assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    color: #fff;
}

/* ===================================
   HEADER
=================================== */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 40px;
    background: transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-sizing: border-box;
    transition: top 0.3s ease-in-out;
}

.site-header .logo img {
    height: 120px;
    width: auto;
    transition: all 0.3s ease;
}

.site-header .logo img:hover {
    animation: logo-glow 0.6s ease-in-out;
    cursor: pointer;
}

@keyframes logo-glow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 0px #f0a500);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
        filter: drop-shadow(0 0 20px #f0a500);
    }
}

/* Navigation */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
}

.main-nav .menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.main-nav .menu li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    padding: 5px 8px;
    transition: 0.3s;
    white-space: nowrap;
}

.main-nav .menu li a:hover {
    color: #f0a500;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 21px;
        cursor: pointer;
        z-index: 1100;
    }

    .main-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.9);
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: 0.4s ease;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav .menu {
        flex-direction: column;
        gap: 25px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .main-nav .menu li a {
        font-size: 20px;
    }

    .site-header {
        padding: 10px 20px;
    }

    .site-header .logo img {
        height: 70px;
    }
}

/* ===================================
   HERO SECTION
=================================== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 20px;
  background: none;
  color: #f6d47a;
  position: relative;
}

.hero-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1.5s ease-out forwards;
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.full-hero-text {
  font-family: 'Cinzel', serif;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #f6d47a;
  margin: 0 0 20px;
  display: inline-block;
  text-align: center !important;
  -webkit-font-smoothing: antialiased;
}

.full-hero-text .char {
  display: inline-block;
  font-size: inherit;
  line-height: inherit;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.9,.3,1);
  color: inherit;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.full-hero-text .char.visible {
  opacity: 1;
  transform: translateY(0);
}

.full-hero-text .char.space {
  width: 0.6em;
  opacity: 1;
  transform: none;
}

.hero-cursor {
  display: inline-block;
  width: 3px;
  height: 1.02em;
  background: currentColor;
  margin-left: 8px;
  vertical-align: middle;
  animation: blinkCursor 1s steps(2,end) infinite;
}

@keyframes blinkCursor {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.hero-content::after {
  content: '';
  position: absolute;
  pointer-events: none;
  width: 60%;
  height: 40%;
  left: 20%;
  top: 40%;
  filter: blur(40px);
  background: radial-gradient(circle at center, rgba(246,212,122,0.06), rgba(0,0,0,0));
  z-index: 0;
}

.full-hero-text, .explore-btn-container {
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .full-hero-text {
    font-size: 1.4rem;
    letter-spacing: 0.9px;
  }
  .full-hero-text .char.space {
    width: 0.45em;
  }
}

/* ===================================
   EXPLORE BUTTON
=================================== */
.explore-btn {
  position: relative !important;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow: visible !important;
  transition: all 0.3s ease-in-out;
  animation: glowIn 1.5s ease forwards;
}

@keyframes glowIn {
  from {
    opacity: 0;
    transform: scale(0.9);
    filter: drop-shadow(0 0 0 rgba(240, 165, 0, 0));
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(240, 165, 0, 0.6));
  }
}

.explore-btn .btn-base {
  display: block;
  width: 180px;
}

.explore-btn img {
  width: 220px;
  filter: drop-shadow(0 0 8px rgba(240, 165, 0, 0.5));
  transition: all 0.3s ease-in-out;
}

.explore-btn:hover img {
  transform: scale(1.08);
  filter: drop-shadow(0 0 20px rgba(240, 165, 0, 0.9));
}

/* Sword Animation */
.hero, .hero-content, .explore-btn-container {
  overflow: visible !important;
  position: relative;
  z-index: 20;
}

.explore-btn .sword {
  position: absolute !important;
  top: 50% !important;
  left: 120% !important;
  transform: translateY(-50%) rotate(40deg) !important;
  width: 72px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 99999 !important;
  transition: left 0.78s cubic-bezier(.2,.9,.3,1) !important,
              transform 0.78s cubic-bezier(.2,.9,.3,1) !important,
              opacity .28s !important;
}

.explore-btn.sword-active .sword {
  left: 50% !important;
  transform: translate(-50%, -50%) rotate(-12deg) !important;
  opacity: 1 !important;
}

.explore-btn .sword-spark {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, #fff, #f0a500, transparent) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(0.2) !important;
  z-index: 100000 !important;
}

@keyframes swordSparkAnim {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
}

.explore-btn.sword-active .sword-spark {
  animation: swordSparkAnim 0.48s ease-out 0.55s forwards !important;
}

@media (max-width: 768px) {
  .explore-btn img {
    width: 160px;
  }
}

@media (max-width: 480px) {
  .explore-btn .sword {
    width: 52px !important;
    left: 140% !important;
  }
  .explore-btn .btn-base {
    width: 140px;
  }
}

/* ===================================
   TIMELINE SECTION
=================================== */
.timeline-section {
  padding: 140px 20px;
  position: relative;
  overflow: hidden;
  color: #fff;
  font-family: 'Cinzel', serif;
}

.timeline-container {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 768px) {
  .timeline-line-horizontal {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #b8860b, #f0a500, #b8860b);
    box-shadow: 0 0 12px rgba(240, 165, 0, 0.5);
    transform: translateY(-50%);
    z-index: 0;
  }
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  position: relative;
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #f0a500 40%, #b8860b 90%);
  border: 2px solid #fff;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 50%;
  z-index: 2;
  box-shadow: 0 0 10px rgba(240, 165, 0, 0.6);
}

.timeline-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #fff;
  transition: transform 0.3s ease, filter 0.3s ease;
  z-index: 3;
  background: transparent;
}

.timeline-card:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

@media (min-width: 768px) {
  .timeline-card.top {
    transform: translateY(-110px);
  }

  .timeline-card.bottom {
    transform: translateY(153px);
  }
}

.timeline-category {
  font-size: 12px;
  letter-spacing: 2px;
  color: #f0a500;
  text-transform: uppercase;
  font-weight: bold;
  margin-bottom: 6px;
}

.timeline-year {
  font-size: 20px;
  font-weight: bold;
  color: #ff4c4c;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.timeline-image-frame {
  position: relative;
  width: 160px;
  height: 160px;
  border: 2px solid #b8860b;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(240, 165, 0, 0.25);
  transition: all 0.3s ease;
}

.timeline-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-card:hover .timeline-image-frame {
  box-shadow: 0 0 40px rgba(240, 165, 0, 0.6);
  border-color: #f0a500;
}

.timeline-hover-text {
  margin-top: 8px;
  font-size: 13px;
  color: transparent;
  transition: color 0.3s ease;
}

.timeline-card:hover .timeline-hover-text {
  color: #f0a500;
}

@media (max-width: 768px) {
  .timeline-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 100px;
    position: relative;
    padding: 80px 0;
  }

  .timeline-line-horizontal {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #b8860b, #f0a500, #b8860b);
    box-shadow: 0 0 10px rgba(240, 165, 0, 0.4);
    z-index: 0;
  }

  .timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 300px;
    z-index: 2;
  }

  .timeline-dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #f0a500;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(240, 165, 0, 0.7);
    z-index: 3;
  }

  .timeline-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(4px);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    margin-top: 30px;
    position: relative;
    box-shadow: 0 4px 12px rgba(240, 165, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(240, 165, 0, 0.25);
  }

  .timeline-image-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #f0a500;
    box-shadow: 0 0 10px rgba(240, 165, 0, 0.3);
  }

  .timeline-year {
    font-size: 18px;
    font-weight: bold;
    color: #f0a500;
    margin-bottom: 6px;
  }

  .timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
  }

  .timeline-category {
    font-size: 13px;
    color: #ddd;
    opacity: 0.9;
  }

  .timeline-hover-text {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .timeline-grid {
    gap: 80px;
  }

  .timeline-card {
    padding: 16px;
  }

  .timeline-image-frame {
    width: 100px;
    height: 100px;
  }

  .timeline-year {
    font-size: 16px;
  }

  .timeline-title {
    font-size: 14px;
  }

  .timeline-category {
    font-size: 12px;
  }
}

/* ===================================
   CATEGORY CARDS - FIXED (Click Only, No Hover Flip)
=================================== */
.categories-section {
  text-align: center;
  margin: 100px 0;
  padding: 0 20px;
}

.section-title {
  font-family: 'Cinzel', serif;
  color: #ffffff;
  font-size: 2rem;
  margin-bottom: 40px;
  letter-spacing: 2px;
}

.categories-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

/* Card wrapper - NO flip on hover */
.category-card {
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  width: 200px;
  transition: transform 0.3s ease;
}

/* Only lift on hover, NO flip */
.category-card:hover {
  transform: translateY(-5px);
}

/* Card inner container */
.card-inner {
  width: 200px;
  height: 280px;
  position: relative;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Flip only when .flip class is added by JavaScript */
.category-card.flip .card-inner {
  transform: rotateY(180deg);
}

/* Glow effect on hover */
.category-card:hover .card-inner {
  box-shadow: 0 0 30px rgba(240, 165, 0, 0.7);
  animation: softGlow 2s infinite ease-in-out;
}

@keyframes softGlow {
  0% { box-shadow: 0 0 20px rgba(240, 165, 0, 0.4); }
  50% { box-shadow: 0 0 40px rgba(240, 165, 0, 0.8); }
  100% { box-shadow: 0 0 20px rgba(240, 165, 0, 0.4); }
}

/* Card front & back */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  border: none;
}

.card-front {
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-back {
  transform: rotateY(180deg);
  background: rgba(0, 0, 0, 0.7);
}

.card-back img.random-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card title below card */
.category-card h3 {
  margin-top: 15px;
  color: #ffffff;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  font-size: 1.1rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .categories-container {
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin: 50px 0;
  }

  .category-card {
    width: 160px;
  }

  .card-inner {
    width: 160px;
    height: 220px;
    box-shadow: 0 6px 15px rgba(240, 165, 0, 0.5);
  }

  .category-card:hover .card-inner {
    box-shadow: 0 10px 25px rgba(240, 165, 0, 0.7);
    animation: softGlow 2s infinite ease-in-out;
  }

  .category-card h3 {
    font-size: 1rem;
    margin-top: 10px;
  }
}

/* ===================================
   FOOTER
=================================== */
.phantoms-footer {
  background-color: #000;
  color: #d4b76a;
  padding: 40px 5%;
  font-family: 'Cinzel', serif;
  border-top: 1px solid rgba(240, 165, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.phantoms-footer::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(240,165,0,0.05) 0%, transparent 70%);
  animation: glowMove 8s infinite alternate;
  z-index: 0;
}

@keyframes glowMove {
  from { opacity: 0.15; transform: scale(1); }
  to { opacity: 0.4; transform: scale(1.2); }
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.footer-column {
  flex: 1;
  min-width: 220px;
}

.footer-logo img {
  width: 120px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(240, 165, 0, 0.7));
  transition: transform 0.4s ease;
}

.footer-logo img:hover {
  transform: scale(1.08);
}

.footer-quote {
  font-style: italic;
  font-size: 0.9rem;
  color: #c6a750;
  opacity: 0.9;
  margin-top: 10px;
  line-height: 1.4;
}

.footer-column h3 {
  color: #f0a500;
  font-size: 1.1rem;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(240, 165, 0, 0.3);
  display: inline-block;
  padding-bottom: 5px;
  letter-spacing: 1px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 8px;
}

.footer-column a {
  color: #bfa24e;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-column a:hover {
  color: #f0a500;
  text-shadow: 0 0 6px #f0a500;
  transform: translateX(4px);
}

.social-icons {
  margin-top: 10px;
  display: flex;
  gap: 15px;
}

.social-icons a {
  color: #d4b76a;
  font-size: 1.2rem;
  border: 1px solid rgba(240,165,0,0.4);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.03);
}

.social-icons a:hover {
  background-color: #f0a500;
  color: #000;
  box-shadow: 0 0 12px #f0a500;
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  margin-top: 50px;
  border-top: 1px solid rgba(240, 165, 0, 0.2);
  padding-top: 15px;
  font-size: 0.85rem;
  color: #a88a42;
  opacity: 0.8;
  position: relative;
  z-index: 2;
}