:root {
  --brown:        #8B5A2B;
  --beige:        #F2E8B8;
  --tan:          #D6C3A4;
  --dark-shadow:  #5C3C1A;
  --light-shadow: #F5E8D2;
  --text:         #2E1C0C;
  --link:         #F4D03F; /* Vibrant yellow */
}

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

/* Prevent horizontal overflow */
html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Ensure all elements respect container width */
* {
  max-width: 100%;
  box-sizing: border-box;
}

body {
  background-color: var(--beige);
  background-image: url('images/paper-texture.png');
  background-repeat: no-repeat;
  background-position: bottom right;
  background-size: cover;
  color: var(--text);
  font-family: Verdana, sans-serif;
  line-height: 1.6;
  padding: 0;
  overflow-x: hidden;
  margin: 0;
  width: 100%;
  max-width: 100vw;
}

/* center the page content */
.site-wrapper { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0; 
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

header {
  background: linear-gradient(to bottom, 
    var(--dark-shadow) 0%, 
    #4a2c17 50%, 
    var(--dark-shadow) 100%);
  padding: 10px 0;
  border-bottom: 3px solid var(--brown);
  border-radius: 0;
  box-shadow: 
    0 6px 12px rgba(0,0,0,0.4),
    0 2px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
  /* Make header truly full-width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
  position: relative;
}
       header h1 {
         color: var(--link);
         font-size: 2em;
         text-shadow: 
           2px 2px 0px rgba(0,0,0,0.8),
           4px 4px 4px rgba(0,0,0,0.6),
           0 0 8px rgba(244, 208, 63, 0.3);
         letter-spacing: 1px;
         text-align: center;
         max-width: 1200px;
         margin: 0 auto;
         position: relative;
         transform: perspective(500px) rotateX(5deg);
       }
header h1 a { color: inherit; text-decoration: none; }

       nav {
         background: linear-gradient(to bottom, 
           var(--dark-shadow) 0%, 
           #4a2c17 50%, 
           var(--dark-shadow) 100%);
         border-top: 2px solid var(--brown);
         border-radius: 0;
         overflow: hidden;
         margin-top: 0;
         box-shadow: 
           0 4px 8px rgba(0,0,0,0.3),
           inset 0 1px 0 rgba(255,255,255,0.1);
         /* Make nav truly full-width */
         width: 100vw;
         margin-left: calc(-50vw + 50%);
       }
nav ul {
  display: flex;
  list-style: none;
  justify-content: space-around;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}
nav li {
  flex: 1;
  border-left: 1px solid var(--brown);
  position: relative;
}
nav li:first-child {
  border-left: none;
}
nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  color: var(--link);
  text-shadow: 1px 1px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
  text-decoration: none;
  height: 100%;
  min-height: 44px;
  box-sizing: border-box;
  position: relative;
  /* Enhanced 3D effect */
  background: linear-gradient(to bottom, 
    rgba(255,255,255,0.1) 0%, 
    rgba(0,0,0,0.1) 100%);
  border: 1px solid transparent;
  border-top: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(0,0,0,0.3);
}
nav a:hover {
  background: linear-gradient(to bottom, 
    var(--tan) 0%, 
    var(--brown) 100%);
  color: var(--text);
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 2px 4px rgba(0,0,0,0.3);
  border-color: var(--brown);
  transform: translateY(-1px);
}
nav a.active {
  background: linear-gradient(to bottom, 
    var(--tan) 0%, 
    var(--brown) 100%);
  color: var(--text);
  box-shadow: 
    inset 0 2px 4px rgba(255,255,255,0.4),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    0 3px 6px rgba(0,0,0,0.4);
  border-color: var(--brown);
  transform: translateY(-2px);
  font-weight: bold;
}

.main-layout {
  display: flex;
  gap: 16px;
  margin: 16px 8px;
  width: calc(100% - 16px);
  box-sizing: border-box;
}
.main-layout main {
  flex: 3;
  min-width: 0; /* Prevents flex item from overflowing */
}
       .main-layout aside#sketch-sidebar {
         flex: 1;
         min-width: 0; /* Prevents flex item from overflowing */
         background: var(--beige);
         border: 4px inset var(--brown);
         padding: 12px;
         border-radius: 4px;
         box-shadow:
           inset 2px 2px rgba(0,0,0,0.2),
           -2px -2px rgba(255,255,255,0.7);
       }
       aside#sketch-sidebar h3 {
         margin-bottom: 12px;
         font-size: 1.1em;
         color: var(--dark-shadow);
         text-align: center;
       }
       
       /* Sketch Grid Styles */
       .sketch-grid {
         display: grid;
         grid-template-columns: 1fr 1fr;
         gap: 4px;
         margin-bottom: 8px;
       }
       
       .sketch-photo {
         position: relative;
         aspect-ratio: 1;
         overflow: hidden;
         border: 1px solid var(--brown);
         border-radius: 3px;
         cursor: pointer;
         transition: transform 0.2s ease, box-shadow 0.2s ease;
       }
       
       .sketch-photo:hover {
         transform: scale(1.02);
         box-shadow: 0 4px 8px rgba(0,0,0,0.3);
       }
       
       .sketch-photo img {
         width: 100%;
         height: 100%;
         object-fit: cover;
         display: block;
       }
       
       .sketch-overlay {
         position: absolute;
         bottom: 0;
         left: 0;
         right: 0;
         background: linear-gradient(transparent, rgba(0,0,0,0.7));
         color: white;
         padding: 8px 4px 4px 4px;
         opacity: 0;
         transition: opacity 0.2s ease;
       }
       
       .sketch-photo:hover .sketch-overlay {
         opacity: 1;
       }
       
       .sketch-title {
         font-size: 0.7em;
         font-weight: bold;
         text-align: center;
         text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
       }

       /* Gallery box styling for sketch sidebar */
       .gallery-box {
         border: 3px inset var(--brown);
         border-radius: 4px;
         padding: 10px;
         background: var(--beige);
         box-shadow:
           inset 1px 1px rgba(0,0,0,0.15),
           -1px -1px rgba(255,255,255,0.6);
         flex: 1;
         display: flex;
         flex-direction: column;
       }

       .sidebar-grid {
         display: flex;
         flex-direction: column;
         gap: 8px;
         margin-bottom: 8px;
         flex: 1;
       }

       .sidebar-photo {
         position: relative;
         aspect-ratio: 1;
         overflow: hidden;
         border: 1px solid var(--brown);
         border-radius: 3px;
         cursor: pointer;
         transition: transform 0.2s ease, box-shadow 0.2s ease;
       }

       .sidebar-photo:hover {
         transform: scale(1.02);
         box-shadow: 0 4px 8px rgba(0,0,0,0.3);
       }

       .sidebar-photo img {
         width: 100%;
         height: 100%;
         object-fit: cover;
         display: block;
       }

       .sidebar-actions {
         display: flex;
         justify-content: center;
       }

main section {
  background: var(--beige);
  border: 4px inset var(--brown);
  padding: 16px;
  border-radius: 4px;
  box-shadow:
    inset 2px 2px rgba(0,0,0,0.2),
    -2px -2px rgba(255,255,255,0.7);
}

.blog-posts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.blog-post {
  white-space: pre-wrap;
  font-size: 1em;
  line-height: 1.6;
  color: var(--text);
}
.blog-post h2 {
  font-size: 1.4em;
  margin-bottom: 8px;
  color: var(--dark-shadow);
}
.blog-post time {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9em;
  color: var(--dark-shadow);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.video-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--beige);
  border: 4px inset var(--brown);
  border-radius: 4px;
  box-shadow:
    inset 2px 2px rgba(0,0,0,0.2),
    -2px -2px rgba(255,255,255,0.7);
  overflow: hidden;
}
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.btn {
  display: inline-block;
  background: var(--dark-shadow);
  color: var(--beige);
  padding: 6px 12px;
  border: 3px groove var(--brown);
  border-radius: 4px;
  text-shadow: 1px 1px rgba(0,0,0,0.4);
  box-shadow:
    inset 1px 1px rgba(0,0,0,0.2),
    -1px -1px rgba(255,255,255,0.7);
  transition: background .2s, box-shadow .2s;
  text-decoration: none;
}
.btn:hover {
  background: var(--brown);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
}

footer {
  background: var(--dark-shadow);
  color: var(--link);
  text-align: center;
  padding: 12px 0;
  border-top: 3px solid var(--brown);
  margin-top: 24px;
  /* Make footer truly full-width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-sizing: border-box;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.social-links img {
  width: 32px;
  height: auto;
}
.social-links img[alt="Musicaly"] {
  width: 48px;
}
.social-links img[alt="Twitter"] {
  width: 24px;
}

/* Subscribe form input (inline + modal) */
.subscribe input[type="email"],
.buttondown-form input[type="email"]{
  padding: 8px 10px;
  border: 3px inset var(--brown);
  border-radius: 4px;
  background: var(--beige);
  color: var(--text);
  width: min(420px, 100%);
}

/* Modal overlay and popup */
.modal-overlay{
  position: fixed; 
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal{
  position: relative;
  background: var(--beige);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.modal[hidden],
.modal-overlay[hidden]{
  display: none !important;
}
.modal-inner{
  width: min(560px, 92%);
  max-height: 90vh;
  background: var(--beige);
  border: 4px inset var(--brown);
  border-radius: 6px;
  box-shadow: 
    inset 2px 2px rgba(0,0,0,0.2), 
    -2px -2px rgba(255,255,255,0.7),
    0 10px 30px rgba(0,0,0,0.3);
  padding: 16px;
  position: relative;
  overflow-y: auto;
}
.modal-close{
  position: absolute; top: 6px; right: 8px;
  background: transparent; border: none; color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer;
}

/* Prevent background scroll while modal open */
body.modal-open { overflow: hidden; }

/* Override Safari's default orange focus highlights */
*:focus {
  outline: 2px solid var(--brown) !important;
  outline-offset: 2px;
}

input:focus,
button:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--brown) !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--brown) !important;
}

@media (max-width: 600px) {
  body {
    padding: 0 8px;
  }
  nav ul {
    flex-direction: column;
    justify-content: flex-start;
  }
  nav li {
    border-left: none;
    border-bottom: 1px solid var(--brown);
  }
  nav li:last-child {
    border-bottom: none;
  }
  nav a {
    padding: 12px 16px;
    flex: none;
    min-height: 48px;
    transform: none;
  }
  nav a:hover,
  nav a.active {
    transform: none;
  }
  main section {
    padding: 12px;
  }
  .main-layout {
    flex-direction: column;
  }
  .blog-post h2 {
    font-size: 1.2em;
  }
  
  /* Mobile styles for sketches/lyrics sidebar */
  .main-layout aside#sketch-sidebar {
    padding: 10px;
    margin-top: 16px;
  }
  
  aside#sketch-sidebar h3 {
    margin-bottom: 10px;
    font-size: 1em;
  }
  
  .sidebar-grid {
    gap: 6px;
    margin-bottom: 10px;
  }
  
  .sidebar-photo {
    border-radius: 2px;
    min-height: 60px; /* Better touch targets for mobile */
  }
  
  .sidebar-photo:hover {
    transform: none; /* Disable hover effects on mobile */
  }
  
  /* Adjust button size for mobile */
  aside#sketch-sidebar .btn {
    font-size: 0.7em;
    padding: 6px 10px;
  }
}

/* Studio Carousel Styles */
.studio-carousel {
  background: var(--beige);
  border: 4px inset var(--brown);
  border-radius: 4px;
  box-shadow:
    inset 2px 2px rgba(0,0,0,0.2),
    -2px -2px rgba(255,255,255,0.7);
  padding: 12px;
  margin: 16px 0;
}

/* Studio Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 100%;
}

.studio-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--tan);
  border: 3px inset var(--brown);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.studio-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.studio-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.studio-photo-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.studio-photo:hover .studio-photo-info {
  opacity: 1;
}

.studio-photo-title {
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  margin: 0;
}

.studio-loading {
  color: var(--dark-shadow);
  font-style: italic;
  text-align: center;
  padding: 20px;
  grid-column: 1 / -1;
}

.carousel-container {
  position: relative;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

       .carousel-image-container {
         position: relative;
         width: 100%;
         height: 600px; /* Further increased height to show more of each photo */
         background: var(--tan);
         border: 3px inset var(--brown);
         border-radius: 4px;
         overflow: hidden;
         margin-bottom: 12px;
         display: flex;
         align-items: center;
         justify-content: center;
       }

       .carousel-image-container img {
         width: 100%;
         height: 100%;
         object-fit: cover;
         display: block;
       }

.carousel-loading {
  color: var(--dark-shadow);
  font-style: italic;
}

.carousel-info {
  text-align: center;
  margin-bottom: 12px;
}

.carousel-info h4 {
  font-size: 1.1em;
  color: var(--dark-shadow);
  margin: 0 0 6px 0;
}

.carousel-info p {
  color: var(--text);
  margin: 0;
  line-height: 1.3;
  font-size: 0.9em;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.carousel-btn {
  background: var(--dark-shadow);
  color: var(--beige);
  border: 3px groove var(--brown);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 16px;
  cursor: pointer;
  text-shadow: 1px 1px rgba(0,0,0,0.4);
  box-shadow:
    inset 1px 1px rgba(0,0,0,0.2),
    -1px -1px rgba(255,255,255,0.7);
  transition: background .2s, box-shadow .2s;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: var(--brown);
  box-shadow: inset 0 0 4px rgba(0,0,0,0.2);
}

.carousel-btn:active {
  transform: translateY(1px);
  box-shadow: inset 2px 2px rgba(0,0,0,0.3);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tan);
  border: 2px solid var(--brown);
  cursor: pointer;
  transition: all 0.2s ease;
}

.carousel-dot.active {
  background: var(--dark-shadow);
  border-color: var(--dark-shadow);
}

.carousel-dot:hover {
  background: var(--brown);
  border-color: var(--brown);
}

/* Visitor Counter Styles */
.visitor-counter {
  background: var(--tan);
  border: 3px inset var(--brown);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 12px 0;
  text-align: center;
  box-shadow:
    inset 1px 1px rgba(0,0,0,0.2),
    -1px -1px rgba(255,255,255,0.7);
}

.visitor-counter span {
  color: var(--dark-shadow);
  font-size: 0.9em;
  font-weight: bold;
  text-shadow: 1px 1px rgba(255,255,255,0.5);
}

/* Responsive carousel */
@media (max-width: 600px) {
  .carousel-image-container {
    height: 250px; /* Increased mobile height proportionally */
  }
  
  .carousel-controls {
    gap: 8px;
  }
  
  .carousel-btn {
    padding: 4px 8px;
    font-size: 14px;
    min-width: 28px;
    height: 28px;
  }
  
  .carousel-dot {
    width: 8px;
    height: 8px;
  }
  
  /* Mobile visitor counter */
  .visitor-counter {
    padding: 6px 8px;
    margin: 10px 0;
  }
  
  .visitor-counter span {
    font-size: 0.8em;
  }
}