
/*
Theme Name: The Angel's Den
Theme URI: https://example.com/
Author: Gabe Ketter
Author URI: https://example.com/
Description: Custom portfolio and commissions theme for a freelance illustrator.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: angelsden
*/

/* === Global Reset === */
html, body {
  overflow-x: hidden;
}

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

:root {
  --main-bg-color: #050E27;
  --header-bg-color: #142147;
  --text-color: #FFFFFF;
  --accent-color: #CB991E;
  --header-title-color: #E2CF63;
  --footer-text-color: #e2cf63;
  --commission-bg: #142147;
  --commission-border: #93B7C7;
  --commission-text: #F7F0D6;
  --commission-hover-bg: #142147;
  --tos-bg: #142147;
  --tos-border: #93B7C7;
  --tos-text: #F7F0D6;
  --tos-hover-bg: #142147;
}

/* === BASE STYLES === */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--main-bg-color);
  color: var(--text-color);
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

body.fade-in {
  opacity: 1;
}


body.fade-out {
  opacity: 0;
}

a {
  text-decoration: none;
  color: var(--accent-color);
}

/* === HEADER STYLES (FINAL MERGED) === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2000; /* raised for safety */
  background-color: var(--header-bg-color);
  padding: 20px 40px;
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: visible;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* will be tightened on phones */
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-icon {
  width: 60px;
  height: auto;
  max-height: 60px;
}

.site-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-title {
  margin: 0;
  font-size: 1.8em;
  color: var(--header-title-color);
  text-align: left;
}

.site-subtitle {
  margin: 5px 0 0;
  font-size: 1em;
  color: var(--header-title-color);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: left;
}

.main-nav {
  display: flex;
  gap: 20px;
}

.main-nav a {
  color: #CB991E;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.main-nav a:hover { color: #F7F0D6; }

/* ===== Tablet + Mobile (<=1024px): use hamburger ===== */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hamburger { display: flex !important; margin-left: auto; }
}

/* ===== Phone-only tweaks (<=768px) ===== */
@media (max-width: 768px) {
  .header-inner {
    position: relative;        /* anchor absolute mobile menu */
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
  }
  .site-branding { flex: 1; flex-shrink: 1; }
  .site-icon { width: 40px; max-height: 40px; }
  .site-title { font-size: 1.3em; }
  .site-subtitle { font-size: 0.85em; }
}

/* ===== Hamburger Button ===== */
.hamburger {
  display: none;               /* overridden by media query */
  flex-direction: column;
  justify-content: space-around;
  width: 25px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 2002;               /* above menu */
  touch-action: manipulation;  /* fixes delayed taps on iOS */
  pointer-events: auto;
  color: #CB991E;              /* ensure visible contrast */
  -webkit-tap-highlight-color: transparent;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: currentColor !important; /* force visible bars */
  border-radius: 2px;
}

/* ===== Mobile Navigation (base: hidden) ===== */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;                   /* just below header-inner */
  right: 0;
  left: 0;
  background-color: var(--header-bg-color);
  padding: 12px 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
  border-radius: 8px;
  z-index: 2001;               /* under hamburger, over header */
  flex-direction: column;
  opacity: 0;                  /* smooth reveal */
  pointer-events: none;
  transition: opacity .2s ease;
}

.mobile-nav a {
  display: block;
  color: #CB991E;          /* visible against dark header */
  font-size: 1rem;
  padding: 12px 10px;
  text-decoration: none;
}
.mobile-nav a:hover {
  background-color: #CB991E;
  color: #fff;
}

/* Visible when toggled via JS */
.mobile-nav.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* Never show the mobile menu on desktop */
@media (min-width: 1025px) {
  .mobile-nav { display: none !important; }
}

/* --- Ensure correct stacking and overflow (Step 3) --- */
.header-inner { position: relative; overflow: visible; }
.site-header  { z-index: 2000; }
.mobile-nav   { z-index: 2001; }
.hamburger    { z-index: 2002; }

.mobile-nav:empty::before {
  content: "Menu is empty (no items rendered)";
  display: block;
  padding: 12px;
  color: #fff;
  background: #c00;
}

/* Ensure WP menus render visibly in the mobile panel */
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav li { margin: 0; padding: 0; }

/* === SEARCH STYLES === */
.site-search { margin-left: 20px; z-index: 1; }

.site-search form,
.mobile-search form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.site-search input.search-field,
.mobile-search input.search-field {
  padding: 6px 8px;
  border: 1px solid var(--accent-color, #ccc);
  border-radius: 4px;
  font-size: 0.9rem;
}

.site-search button.search-submit,
.mobile-search button.search-submit {
  background-color: var(--accent-color, #444);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease-in-out;
}

.site-search button.search-submit:hover,
.mobile-search button.search-submit:hover {
  background-color: var(--accent-hover-color, #222);
}

/* Desktop: icon toggle */
.site-search input.search-field {
  width: 0;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transition: width 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}
.site-search button.search-submit {
  background-color: transparent;
  color: var(--accent-color, #444);
  padding: 6px;
  border-radius: 50%;
  font-size: 1.1rem;
}
.site-search:hover input.search-field,
.site-search:focus-within input.search-field {
  width: 140px;
  opacity: 1;
  visibility: visible;
  margin-left: 5px;
  padding: 6px 8px;
  background-color: #fff;
}

/* Mobile: always visible and full-width */
@media (max-width: 768px) {
  .mobile-search { margin-top: 10px; width: 100%; }
  .mobile-search form { flex-direction: column; align-items: stretch; }
  .mobile-search input.search-field { width: 100%; opacity: 1; visibility: visible; }
  .mobile-search button.search-submit { width: 100%; background-color: var(--accent-color, #444); color: #fff; }
  .site-search { max-width: 60%; }
}

/* Anchor mobile menu under header on tablets too */
@media (max-width: 1024px) {
  .header-inner { position: relative; }
}

/* === CAROUSEL STYLES === */
.carousel {
  max-width: 700px;
  max-height: 500px;
  margin: 40px auto;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-track img {
  width: auto;
  max-width: 100%;
  height: 500px;
  object-fit: contain;
  border-radius: 10px;
  min-width: 100%;
}

.carousel button.prev,
.carousel button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 2em;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 50%;
  user-select: none;
  transition: background-color 0.3s ease;
  z-index: 10;
}

.carousel button.prev:hover,
.carousel button.next:hover {
  background-color: rgba(0,0,0,0.7);
}

.carousel button.prev {
  left: 10px;
}

.carousel button.next {
  right: 10px;
}

.carousel-dots {
  text-align: center;
  margin-top: 15px;
}

.carousel-dots button {
  cursor: pointer;
  height: 12px;
  width: 12px;
  margin: 0 6px;
  background-color: #bbb;
  border: none;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.carousel-dots button.active,
.carousel-dots button:hover {
  background-color: var(--accent-color);
}

@media (max-width: 600px) {
  .carousel-track img {
    height: auto;
  }

  .carousel button.prev,
  .carousel button.next {
    font-size: 1.5em;
    padding: 4px 10px;
  }
}

/* ===== Intro Section ===== */
.intro {
  max-width: 900px;
  margin: 60px auto 40px;
  padding: 0 20px;
  text-align: center;
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.intro h2 {
  font-size: 2.4em;
  color: var(--header-title-color);
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.intro p {
  font-size: 1.2em;
  line-height: 1.7;
  color: var(--text-color);
  max-width: 750px;
  margin: 0 auto;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
}

@media screen and (max-width: 768px) {
  .intro h2 {
    font-size: 2em;
  }

  .intro p {
    font-size: 1.05em;
  }
}

/* === FP CARD STYLES === */
.feature-grid.image-only {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 20px;
  justify-items: center;
}

.feature-image-link {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.feature-image-link:hover {
  transform: translateY(-6px);
}

.feature-image-link img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* === GALLERY STYLES === */
.gallery {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  justify-items: center;
  padding: 0 20px;
}

.gallery-title {
  text-align: center;
  font-size: 2em;
  margin: 40px 0 20px;
  color: var(--text-color);
}

.gallery img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery figure {
  margin: 0;
  text-align: center;
}

.gallery img.expandable {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.25s ease;
}

.gallery img.expandable:hover {
  transform: scale(1.05);
}

figcaption {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: #ccc;
}

.gallery figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  color: var(--accent-color);
  font-weight: 600;
}

/* === FOOTER === */
footer {
  background-color: var(--header-bg-color);
  text-align: center;
  padding: 15px 20px;
  font-size: 0.9em;
  color: var(--footer-text-color);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
  position: relative;
  width: 100%;
  max-width: 100vw;
}

footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

footer nav a {
  text-decoration: none;
  color: #CB991E;
  font-weight: 500;
  transition: color 0.3s ease;
}

footer nav a:hover {
  color: #F7F0D6;
}

@media (max-width: 600px) {
  footer nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    gap: 16px;
  }

footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}
  

  footer nav a {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 0.9em;
  }
}