/*
Theme Name: ThatInfraDba
Theme URI: https://yourdomain.com/
Author: Your Name
Description: Futuristic, secure, tech-inspired theme.
Version: 0.2.6
*/

:root {
  --primary-blue: #23395d;
  --accent-orange: #ff7f2a;
  --accent-yellow: #ffd700;
  --circuit-blue: #b3e0ff;
}

body {
  background: linear-gradient(135deg, var(--primary-blue) 60%, var(--accent-orange) 100%);
  background-attachment: fixed;
  font-family: 'Montserrat', 'Roboto', sans-serif;
  color: #fff;
  margin: 0;
  min-height: 100vh;
  position: relative;
}

/* Circuit lines overlay on body background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./assets/circuit-lines-sparse.png');
  background-size: 800px 800px;
  background-repeat: repeat;
  opacity: 0.20;
  pointer-events: none;
  z-index: -1;
}

/* Ensure all main content is above the background pattern */
.site-header,
.card,
footer,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Global link styling - white with underline */
a {
  color: #fff;
  text-decoration: underline;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-yellow);
}

/* Exception for buttons - they should not look like links */
a.button,
a.button-small,
.menu-item a {
  text-decoration: none;
}

.site-header {
  background: var(--primary-blue);
  border-bottom: 4px solid var(--accent-orange);
  box-shadow: 0 2px 8px rgba(35,57,93,0.2);
  padding: 1rem 0;
  text-align: center;
  position: relative;
  z-index: 100;
}

/* Circuit pattern in header */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./assets/circuit-lines-sparse.png');
  background-size: 600px 600px;
  background-position: center;
  opacity: 0.20;
  pointer-events: none;
  z-index: 0;
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.header-content {
  margin-bottom: 1rem;
}

.site-logo {
  width: 80px;
  height: auto;
  margin-bottom: 0.5rem;
}

.site-title {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-yellow);
  margin: 0;
}

.site-description {
  margin: 0.5rem 0 0 0;
  color: #fff;
}

/* Navigation Menu */
.primary-navigation {
  margin: 0;
  padding: 0;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-menu li {
  display: inline-block;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s;
}

.nav-menu a:hover {
  background: rgba(255, 127, 42, 0.8);
  color: white !important;
}

.nav-menu .current-menu-item a,
.nav-menu .current_page_item a {
  background: rgba(255, 127, 42, 0.8);
  color: white !important;
}

.card {
  background: #1a2636;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(35,57,93,0.3);
  border: 2px solid var(--accent-orange);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 950px;
  position: relative;
  overflow: hidden;
}

/* Circuit pattern inside cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./assets/circuit-lines-sparse.png');
  background-size: 500px 500px;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

.button {
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow));
  color: var(--primary-blue);
  border-radius: 12px;
  padding: 0.75rem 2rem;
  font-weight: bold;
  border: none;
  box-shadow: 0 2px 6px rgba(255,127,42,0.2);
  transition: background 0.3s;
  cursor: pointer;
}

.button:hover {
  background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
}

footer,
.site-footer {
  background: transparent;
  color: #fff;
  padding: 3rem 20px 1.5rem 20px;
  border-top: 4px solid var(--accent-orange);
  margin-top: 2rem;
  font-size: 1rem;
  text-align: center;
  position: relative;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

footer p {
  margin: 0;
}

.footer-content {
  display: inline-block;
  vertical-align: middle;
}

.footer-content span {
  display: inline-block;
  margin: 0 10px;
  vertical-align: middle;
}

.footer-logo {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: auto;
  display: block;
  padding: 10px;
}

/* Social Icons Styling */
.social-icons {
  display: inline-flex;
  gap: 15px;
  align-items: center;
  margin-left: 20px;
  vertical-align: middle;
}

.social-icons a {
  display: inline-block;
  transition: opacity 0.3s ease;
}

.social-icons a:hover {
  opacity: 0.7;
}

.social-icons img {
  width: 28px;
  height: 28px;
  display: block;
}

/* Make LinkedIn icon orange to match theme */
.social-icons a[href*="linkedin"] img {
  filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(2067%) hue-rotate(348deg) brightness(101%) contrast(103%);
}

/* Make Sessionize icon orange to match theme */
.social-icons a[href*="sessionize"] img {
  filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(2067%) hue-rotate(348deg) brightness(101%) contrast(103%);
}

/* Profile Image on About Page */
.profile-image {
  float: right;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-orange);
  box-shadow: 0 4px 12px rgba(255, 127, 42, 0.3);
  margin: 0 0 1.5rem 2rem;
  position: relative;
  z-index: 2;
}

/* Contact Links on About Page */
.contact-links {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(26, 38, 54, 0.5);
  border: 2px solid var(--accent-orange);
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none !important;
}

.contact-link:hover {
  background: rgba(255, 127, 42, 0.1);
  border-color: var(--accent-yellow);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 127, 42, 0.3);
}

.contact-link img {
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

.contact-link:hover img {
  transform: scale(1.1);
}

.contact-link span {
  font-weight: bold;
  font-size: 1.1rem;
}

/* Make LinkedIn and Sessionize icons in contact links orange */
.contact-link[href*="linkedin"] img,
.contact-link[href*="sessionize"] img {
  filter: brightness(0) saturate(100%) invert(56%) sepia(89%) saturate(2067%) hue-rotate(348deg) brightness(101%) contrast(103%);
}

.circuit-bg {
  background-image: url('assets/circuit-bg.svg');
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.2;
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
}

/* Contact Form Styles */
.contact-form {
  margin-top: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #fff;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--accent-orange);
  border-radius: 8px;
  background: #0d1620;
  color: #fff;
  font-family: 'Montserrat', 'Roboto', sans-serif;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-yellow);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.form-group textarea {
  resize: vertical;
}

.captcha-group {
  background: rgba(255, 127, 42, 0.1);
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid var(--accent-orange);
  box-sizing: border-box;
}

.captcha-group input {
  max-width: 150px;
}

/* Blog Posts Styling */
.blog-posts {
  margin-top: 2rem;
}

.blog-post {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(26, 38, 54, 0.5);
  border-left: 4px solid var(--accent-orange);
  border-radius: 8px;
  transition: all 0.3s;
}

.blog-post:hover {
  background: rgba(26, 38, 54, 0.8);
  border-left-color: var(--accent-yellow);
}

.blog-post h4 {
  margin-top: 0;
  color: var(--accent-yellow);
}

.blog-post h4 a {
  color: var(--accent-yellow);
  text-decoration: underline;
  transition: color 0.3s;
}

.blog-post h4 a:hover {
  color: var(--accent-orange);
}

.post-meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Individual Blog Post Styling */
.blog-post-full {
  max-width: 900px;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 127, 42, 0.3);
}

.post-header h1 {
  color: var(--accent-orange);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.post-meta-full {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.post-date, .post-author, .post-tags {
  display: inline-flex;
  align-items: center;
}

.post-content {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.post-content h1 {
  color: var(--accent-orange);
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h2 {
  color: var(--accent-orange);
  font-size: 1.5rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.post-content h3 {
  color: var(--accent-yellow);
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

/* Links inherit global styling - white with underline */

.post-content code {
  background: rgba(179, 224, 255, 0.1);
  color: var(--circuit-blue);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.post-content pre {
  background: rgba(26, 38, 54, 0.8);
  border-left: 4px solid var(--accent-orange);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: #fff;
  display: block;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-yellow);
  padding-left: 1rem;
  margin-left: 0;
  margin-bottom: 1rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.post-content table th,
.post-content table td {
  border: 1px solid rgba(255, 127, 42, 0.3);
  padding: 0.75rem;
  text-align: left;
}

.post-content table th {
  background: rgba(255, 127, 42, 0.2);
  color: var(--accent-orange);
  font-weight: bold;
}

.post-content table tr:hover {
  background: rgba(26, 38, 54, 0.5);
}

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(255, 127, 42, 0.3);
}

/* Schedule Styling */
.schedule-list {
  max-width: 100%;
  margin: 0 auto;
}

.schedule-list h3 {
  color: var(--accent-orange);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Event session items within event card */
.event-session-item {
  padding: 0.65rem 0;
  background: transparent;
  border-left: none;
  margin-top: 0.5rem;
  border-radius: 0;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.event-session-item:first-of-type {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
}

.event-session-item:last-of-type {
  margin-bottom: 0.5rem;
  padding-bottom: 0.65rem;
}

.session-label {
  color: var(--circuit-blue);
  font-weight: bold;
  margin-right: 0.5rem;
}

.session-date {
  color: var(--accent-orange);
  font-size: 0.9rem;
  font-weight: bold;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Compact event item styling */
.event-item-compact {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(26, 38, 54, 0.6);
  border-left: 5px solid var(--accent-orange);
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.event-item-compact:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: -0.75rem;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
  opacity: 0.6;
}

.year-events .event-item-compact:last-child::after {
  display: none;
}

.event-item-compact:hover {
  background: rgba(26, 38, 54, 0.8);
  border-left-color: var(--accent-yellow);
  box-shadow: 0 4px 12px rgba(255, 127, 42, 0.3);
  transform: translateX(5px);
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.event-item-compact h4 {
  margin: 0;
  color: var(--accent-orange);
  font-size: 1.15rem;
  flex: 1;
  min-width: 200px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.event-item-compact h4::before {
  content: '[ ';
  color: var(--accent-yellow);
  font-weight: bold;
}

.event-item-compact h4::after {
  content: ' ]';
  color: var(--accent-yellow);
  font-weight: bold;
}

.event-date {
  color: var(--accent-orange);
  font-weight: bold;
  font-size: 0.9rem;
  white-space: nowrap;
  background: rgba(255, 127, 42, 0.15);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.session-title {
  color: #fff;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.event-session {
  color: #fff;
  font-size: 0.95rem;
  margin: 0.5rem 0;
  font-style: italic;
  padding-left: 1rem;
  border-left: 3px solid rgba(255, 215, 0, 0.3);
}

.event-session strong {
  color: var(--circuit-blue);
}

.event-location {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.event-location strong {
  color: var(--accent-orange);
  font-weight: 600;
}

/* Link styling for schedule page */
.schedule-list a,
.event-item-compact a,
.year-section a {
  color: #fff;
  text-decoration: underline;
}

.schedule-list a:hover,
.event-item-compact a:hover,
.year-section a:hover {
  color: var(--accent-yellow);
}

.button-small {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  margin-top: 0.75rem;
  background: var(--accent-yellow);
  color: #000 !important;
  text-decoration: none !important;
  font-weight: bold;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.button-small:hover {
  background: var(--accent-orange);
  color: #000 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 127, 42, 0.5);
}

/* Collapsible year sections */
.year-section {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border: 3px solid rgba(255, 127, 42, 0.4);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.year-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 127, 42, 0.25), rgba(255, 215, 0, 0.15));
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: var(--accent-orange);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  user-select: none;
  border-bottom: 2px solid rgba(255, 127, 42, 0.3);
}

.year-header:hover {
  background: linear-gradient(135deg, rgba(255, 127, 42, 0.35), rgba(255, 215, 0, 0.25));
  color: var(--accent-yellow);
  box-shadow: inset 0 0 15px rgba(255, 127, 42, 0.2);
}

.year-header::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.75rem;
  transition: transform 0.3s ease;
  font-size: 1rem;
  color: var(--accent-orange);
  text-shadow: 0 0 8px rgba(255, 127, 42, 0.5);
}

details[open] .year-header::before {
  transform: rotate(90deg);
  color: var(--accent-yellow);
}

.year-title {
  font-size: 1.4rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.year-count {
  font-size: 0.95rem;
  color: var(--circuit-blue);
  font-weight: normal;
  background: rgba(35, 57, 93, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.year-events {
  padding: 1rem;
  background: rgba(26, 38, 54, 0.4);
  border-top: 1px solid rgba(255, 127, 42, 0.2);
}

.year-events .event-group:last-child {
  margin-bottom: 0;
}

/* Legacy event item styling (for backwards compatibility) */
.event-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(26, 38, 54, 0.5);
  border-left: 4px solid var(--accent-orange);
  border-radius: 8px;
}

.event-item h4 {
  margin-top: 0;
  color: var(--accent-yellow);
}

.event-meta {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.event-description {
  margin-bottom: 0;
}

/* Presentations Styling */
.presentations-list {
  margin-top: 2rem;
}

.presentation-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(26, 38, 54, 0.5);
  border-left: 4px solid var(--accent-orange);
  border-radius: 8px;
}

/* Folder Structure Styling - Presentations Page */
#presentations-list .folder-structure {
  margin-top: 1.5rem;
}

.folder-item {
  margin-bottom: 0.75rem;
}

.folder-details {
  background: rgba(26, 38, 54, 0.5);
  border-left: 4px solid var(--accent-orange);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.folder-details:hover {
  background: rgba(26, 38, 54, 0.7);
  border-left-color: var(--accent-yellow);
}

.folder-details[open] {
  background: rgba(26, 38, 54, 0.6);
  border-left-color: var(--accent-yellow);
}

.folder-name {
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: var(--accent-orange);
  font-weight: bold;
  font-size: 1.05rem;
  user-select: none;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.folder-name:hover {
  color: var(--accent-yellow);
  background: rgba(255, 127, 42, 0.1);
}

.folder-icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.folder-count {
  color: var(--circuit-blue);
  font-size: 0.9rem;
  font-weight: normal;
  margin-left: 0.5rem;
  background: rgba(35, 57, 93, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
}

#presentations-list .folder-contents {
  padding: 0.5rem 0 0.5rem 2rem !important;
  border-top: 1px solid rgba(255, 127, 42, 0.2);
}

#presentations-list .file-item {
  display: flex !important;
  align-items: center !important;
  padding: 0.65rem 1rem !important;
  background: rgba(26, 38, 54, 0.4) !important;
  border-left: 3px solid var(--circuit-blue) !important;
  border-radius: 6px !important;
  margin-bottom: 0.5rem !important;
  transition: all 0.3s ease !important;
}

#presentations-list .file-item:hover {
  background: rgba(26, 38, 54, 0.6) !important;
  border-left-color: var(--accent-yellow) !important;
  transform: translateX(3px) !important;
}

#presentations-list .file-item .file-icon {
  font-size: 1rem !important;
  flex-shrink: 0 !important;
  margin-right: 1.5rem !important;
}

#presentations-list .file-item .file-name {
  color: #fff !important;
  font-weight: 500 !important;
  flex: 1 !important;
  min-width: 200px !important;
  margin-right: 1.5rem !important;
}

#presentations-list .file-item .file-size {
  color: var(--accent-orange) !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  white-space: nowrap !important;
  min-width: 100px !important;
  text-align: right !important;
  flex-shrink: 0 !important;
  margin-right: 2rem !important;
}

#presentations-list .file-item .button-small {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
}

/* Nested folder styling - each level gets progressively thinner border */
.folder-contents .folder-details {
  border-left-width: 3px;
}

.folder-contents .folder-contents .folder-details {
  border-left-width: 2px;
}

.folder-contents .folder-contents .folder-contents .folder-details {
  border-left-width: 2px;
}

.presentation-count {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(255, 127, 42, 0.3);
  text-align: center;
  color: var(--accent-orange);
  font-weight: bold;
  font-size: 1.05rem;
}

.error-message, .no-files {
  text-align: center;
  padding: 2rem;
  background: rgba(26, 38, 54, 0.4);
  border-radius: 8px;
  border: 2px solid rgba(255, 127, 42, 0.3);
}

.error-message p, .no-files p {
  margin: 1rem 0;
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none !important;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10001;
  flex-direction: column;
  gap: 0.35rem;
  width: auto;
  height: auto;
  font-size: 0;
  line-height: 0;
  outline: none;
}

.mobile-menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--accent-orange);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Tablets and smaller */
@media screen and (max-width: 768px) {
  :root { --mobile-nav-width: 280px; }
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex !important;
  }
  
  /* Header adjustments */
  .site-header {
    padding: 1rem;
    position: relative;
    z-index: 100 !important;
  }
  
  .site-title {
    font-size: 1.5rem;
  }
  
  .site-description {
    font-size: 0.9rem;
  }
  
  /* Ensure content is below menu */
  main, .card {
    position: relative;
    z-index: 1;
  }
  
  /* Navigation - sidebar style */
  .primary-navigation {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    transform: translateX(100%);
  width: var(--mobile-nav-width) !important;
    height: 100vh !important;
  background: linear-gradient(180deg, #284865 0%, #20374f 55%, #162838 100%) !important; /* Darker refined gradient */
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.8) !important;
    transition: transform 0.35s cubic-bezier(.4,.0,.2,1) !important;
  z-index: 11000 !important; /* Above overlay (raised) */
    overflow-y: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
    will-change: transform;
  }
  
  .primary-navigation.active {
    transform: translateX(0);
  }
  
  .nav-menu {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 4rem 0 2rem 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }
  
  .nav-menu li {
    display: block !important;
    width: 100% !important;
  }
  
  .nav-menu a {
    display: block !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 127, 42, 0.18) !important;
    color: #fff !important;
    text-decoration: none !important;
    position: relative !important;
  }
  
  .nav-menu a:hover {
    background: rgba(255, 127, 42, 0.55) !important;
  }
  
  .nav-menu li.current-menu-item a {
    background: rgba(255, 127, 42, 0.42) !important;
    border-left: 4px solid var(--accent-orange) !important;
    box-shadow: inset 0 0 12px rgba(255,127,42,0.35) !important;
  }
  
  /* Overlay when menu is open */
  /* Dedicated overlay element */
  .menu-overlay {
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(0,0,0,0.55);
    z-index: 10900; /* Below nav */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  /* Exclude nav area from overlay hit region by shrinking overlay width when active */
  body.menu-open .menu-overlay {
    width: calc(100% - var(--mobile-nav-width));
    right: var(--mobile-nav-width);
  }

  .menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Force everything else below the menu (except header which contains the button) */
  body.menu-open main,
  body.menu-open .card,
  body.menu-open footer {
    z-index: 1 !important;
    position: relative;
  }
  
  /* Prevent scrolling when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  /* Improve tap target and focus styles */
  .nav-menu a:focus-visible {
    outline: 2px solid var(--accent-yellow) !important;
    outline-offset: -2px;
    background: rgba(255, 215, 0, 0.18) !important;
  }
  
  /* Card adjustments */
  .card {
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 12px;
  }
  
  /* Profile image on about page */
  .profile-image {
    float: none;
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 180px;
    height: 180px;
  }
  
  /* Footer adjustments */
  footer .container {
    padding: 2rem 1rem;
  }
  
  .footer-logo {
    width: 100px;
    position: static;
    transform: none;
    display: block;
    margin: 1rem auto 0 auto;
  }
  
  /* Blog posts */
  .blog-posts {
    gap: 1.5rem;
  }
  
  .blog-post {
    padding: 1.25rem;
  }
  
  /* Contact form */
  .contact-form {
    padding: 0;
  }
  
  /* Schedule page */
  .event-item-compact {
    padding: 1.25rem;
  }
  
  /* Presentations page */
  .folder-item, .file-item {
    padding: 0.75rem;
  }
  
  .file-name {
    max-width: 150px;
  }
}

/* Mobile phones in portrait */
@media screen and (max-width: 480px) {
  .site-title {
    font-size: 1.3rem;
  }
  
  .site-description {
    font-size: 0.85rem;
  }
  
  .card {
    padding: 1rem;
    margin: 0.5rem;
    border-radius: 8px;
  }
  
  .profile-image {
    width: 150px;
    height: 150px;
  }
  
  /* Make buttons full width on very small screens */
  .button, .button-small {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.5rem 0;
  }
  
  /* Adjust blog post meta */
  .post-meta-full {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  /* Contact links */
  .contact-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .contact-link {
    width: 100%;
    justify-content: center;
  }
  
  /* Social icons */
  .social-icons {
    margin: 1rem auto 0 auto;
    display: flex;
  }
  
  /* File list adjustments */
  .file-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .file-name {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .file-size {
    flex: 1;
  }
  
  .button-small {
    flex: 1;
    width: auto;
  }
}

/* Landscape phones and small tablets override removed: previous rule caused hidden nav overlap */

