* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root { --hero-gap: 34px; } /* tweak to taste */


body {
    background-color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Font declarations */
@font-face {
    font-family: 'PublicaSansRound';
    src: url('PublicaSansRound-Bd.otf') format('opentype');
    font-weight: bold;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
  }
  
  @font-face {
    font-family: 'Rubik';
    src: url('Rubik-VariableFont_wght.ttf') format('truetype');
    font-display: swap;
    -webkit-font-smoothing: antialiased;
  }

/* Styles for the desktop header link */
.header h1 a {
    color: #050505;
    text-decoration: none;
}

/* Styles for the mobile header link */
.mobile-title a {
    color: #050505;
    text-decoration: none;
}

/* Mobile Header Styles */
.mobile-header {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: white;
    z-index: 1000;
    padding: 0 20px;
    border-bottom: 1px solid #f0f0f0;
    justify-content: space-between;
    align-items: center;
}

.mobile-title {
    font-family: 'PublicaSansRound', system-ui, -apple-system, sans-serif;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Menu Toggle Button Styles */
.mobile-menu-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 5px;
}

.hamburger-icon {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #050505;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.sidebar {
    width: 256px;
    height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically for ALL pages */
    position: relative; /* Consistent positioning */
}

.header {
    margin-bottom: 1rem;
}

.header h1 {
    font-family: 'PublicaSansRound', system-ui, -apple-system, sans-serif;
    font-weight: bold;
    line-height: 1.2;
    text-align: right;
}

.header span {
    display: block;
}

.nav-menu {
    list-style: none;
    text-align: right;
    position: relative; /* Added for dropdown positioning */
}

.nav-menu li {
    margin-bottom: 0.25rem;
}

.nav-menu a {
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    color: #050505;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.1;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Add underline on hover for navbar links */
.nav-menu a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.nav-menu li.has-dropdown {
    position: relative;
}

.nav-menu li.has-dropdown:hover > .dropdown-menu {
    display: block;
}

/* Submenu styling */
.nav-menu .dropdown-menu li.has-submenu {
    position: relative;
}

.nav-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: -10px; /* Slight offset to align better */
    left: 100%; /* Position to the right of the nav menu instead of right */
    min-width: 150px;
    background-color: #f8f8f8; /* Very light grey */
    padding: 10px 0;
    z-index: 100;
    text-align: right;
    list-style: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Update submenu positioning to match */
.nav-menu .submenu {
    display: none;
    position: absolute;
    top: -10px; /* Align with parent */
    left: 100%; /* Position to the right of the first dropdown instead of right */
    min-width: 150px;
    background-color: #f0f0f0; /* Slightly darker light grey */
    padding: 10px 0;
    z-index: 101;
    text-align: right;
    list-style: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-menu .dropdown-menu li.has-submenu:hover > .submenu {
    display: block;
}

.nav-menu .dropdown-menu a,
.nav-menu .submenu a {
    display: block;
    padding: 5px 15px;
    /* Inherits other properties from .nav-menu a */
}


.social-links {
    position: absolute;
    bottom: 2rem;
}

.social-links a {
    color: #050505;
    font-size: 12px;
    text-decoration: none;
    margin-right: 0.5rem;
    transition: opacity 0.2s ease;
}

.social-links a:hover {
    opacity: 0.7;
}

.main-content {
    flex-grow: 1;
    display: flex;
    align-items: center; /* Center content vertically to match index */
    justify-content: flex-start;
    padding: 2rem;
    margin-left: 0;
}

.about-content {
    flex-grow: 1;
    display: flex; /* Add this to match main-content */
    align-items: center; /* Center content vertically to match index */
    justify-content: flex-start;
    padding: 2rem;
    margin-left: 0;
    overflow-y: auto;
}

/* Hero and Quote Styles for Homepage */
.home .main-content {
    justify-content: center; /* Center the wrapper horizontally */
    align-items: center; /* Center vertically */
    padding: 2rem 0; /* Adjust padding */
}

/* Hero content wrapper to contain both image and quote */
.hero-content-wrapper {
    display: inline-block; /* Alternative approach: inline-block shrinks to content */
    text-align: left; /* Align quote text left */
}

.hero-content-wrapper > * { margin: 0; }
.hero-content-wrapper > * + * { margin-top: var(--hero-gap); }

/* Adjust hero image container */
.home .hero-image-container {
  display: block;
  text-align: left;   /* was center */
  padding: 0;         /* ensure no left padding */
  margin: 0;          /* no container margins affecting alignment */
}

/* Ensure image maintains aspect ratio and fits within container */
.home .hero-image {
  display: block;     /* was inline-block */
  margin: 0;          /* no sneaky default margins */
  max-height: 70vh;
  max-width: 80vw;
  height: auto;
  width: auto;
}


/* Quote container matches actual image width */
.quote-container {
    padding: 0; /* Remove extra padding */
    max-width: 45vw; /* Ensure it doesn't exceed viewport */
}

.hero-quote {
    margin: 0;
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    color: #050505;
    text-align: left; /* Or center if you prefer */
}

.hero-quote p {
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    font-style: italic;
    margin-bottom: 0.75rem;
    
}

.hero-quote cite {
    display: block;
    font-size: 10px;
    font-style: normal;
    color: #666;
    line-height: 1.4;
    letter-spacing: 0.5px;
}

.hero-quote cite a {
  color: #050505;
  text-decoration: underline;
}

.hero-quote cite a:hover {
  opacity: 0.7;
}


.hero-quote cite em {
    font-style: italic;
}

.home .layout-container {
    padding-top: 0; /* Remove the default top padding */
}

/* All pages will use a consistent layout-container padding */
.layout-container {
    display: flex;
    max-width: 1500px;    
    margin: 0;            
    padding: 0 2rem 0 150px; /* Universal padding, no top padding */
    align-self: flex-start;
    flex-grow: 1;
}

/* Homepage-specific styles */
.home .sidebar, .home .main-content {
    transform: none; /* Remove the transform */
}

/* CV page-specific styles */
.cv-page .sidebar {
    justify-content: center; /* Override the flex-start setting */
    position: relative; /* Override sticky positioning */
    top: auto; /* Remove top positioning */
}

.cv-page .main-content {
    overflow-y: auto;
    padding-left: 8rem; /* Keep this CV-specific setting */
}

.cv-page .cv-container {
    padding-top: 2rem;
}

.about-container {
    padding-top: 2rem;
}

/* CV SECTION */
.cv-container {
    display: flex;
    width: 100%;
    gap: 15rem;
}

.cv-title {
    width: 150px;
    font-family: 'Rubik', sans-serif;
    font-size: 20px;
    color: #050505;
    letter-spacing: 0.5px;
    font-weight: bold; 
}

.cv-content {
    flex-grow: 1;
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    color: #050505;
    letter-spacing: 0.5px;
    line-height: 1.6;
    max-width: 800px;
    min-width: 300px;
    width: 100%; /* Ensures it takes full available width */
}

.cv-section {
    margin-bottom: 2rem;
}

.cv-section-title {
    font-weight: bold;
    margin-bottom: 1rem;
}

.cv-entry {
    margin-bottom: 1rem;
}


/* Footer Styles */
/* Footer Styles */
#footer-container {
    width: 100%;
}

.site-footer {
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    font-size: 10px;
    color: #666;
    letter-spacing: 0.5px;
}

.copyright {
    opacity: 0.8;
}

/* Portfolio Page Styles */

/* Apply similar styling as CV page for consistency */
.portfolio-page .sidebar {
    justify-content: center; /* Match the CV page sidebar positioning */
    position: relative;
    top: auto;
}

.portfolio-content {
    flex-grow: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 2rem;
    margin-left: 0;
    overflow-y: auto;
    padding-left: 8rem; /* Match the CV page padding */
    min-width: 300px;
    padding-top: 10vh; /* Position content ~25% down the viewport height */
}

/* Portfolio section styles */
.portfolio-section {
    margin-bottom: 3rem;
}

.portfolio-details {
    margin-bottom: 2rem;
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    color: #050505;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.portfolio-details p {
    margin-bottom: 0.5rem;
}

.portfolio-text {
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    color: #050505;
    letter-spacing: 0.5px;
    line-height: 1.6;
    width: 100%;
    min-height: 50px;
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack children vertically */
    align-items: flex-start; /* Left-align all children */
}

.portfolio-text p {
    margin-bottom: 1.5rem;
}

.portfolio-text a,
.cv-content a,
.about-content a {
    color: #050505; /* Same color as navbar links */
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

/* Hover state for body links */
.portfolio-text a:hover,
.cv-content a:hover,
.about-content a:hover {
    opacity: 0.7;
}

/* Ensure dropdown menus maintain styling */
.nav-menu .dropdown-menu a:hover,
.nav-menu .submenu a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Video container for responsive videos */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 2rem;
    margin-top: 2rem;
    width: 100%; /* Full width of parent */
    max-width: 800px; /* Match the max-width of the portfolio-text content */
    min-width: 500px; /* Minimum width of 500px */
    margin-left: 0; /* Explicitly set left margin to 0 to ensure left alignment */
}

/* Smaller video container option */
.video-container.small {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Image containers */
.image-container {
    margin: 2rem 0;
    max-width: 800px;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Horizontal images (landscape orientation) */
.image-container.horizontal {
    width: 100%;
}

/* Vertical images (portrait orientation) */
.image-container.vertical {
    width: 60%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.image-caption {
    font-family: 'Rubik', sans-serif;
    font-size: 10px;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.4;
    letter-spacing: 0.5px;
}


/* Mobile Styles - Consolidated and Enhanced */
/* Mobile Styles - Corrected for all page types */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    /* Show the mobile header */
    .mobile-header {
        display: flex;
    }
    
    /* Layout adjustments */
    .layout-container {
        flex-direction: column;
        padding: 60px 1rem 0 1rem; /* Reduce top padding */
    }

    .cv-content {
        width: 100%;
        padding-left: 0; /* Remove any left padding */
    }

    .portfolio-page .cv-container {
        flex-direction: column;
    }
    
    /* Make sure padding is appropriate */
    .portfolio-content,
    .cv-page .main-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    
    /* Sidebar mobile styling - CONSISTENT for ALL page types */
    .sidebar {
        width: 100% !important; /* Override any page-specific width */
        height: auto !important;
        max-height: 100vh;
        position: fixed !important; /* Force fixed position on all pages */
        top: 0 !important;
        left: 0;
        background-color: white;
        z-index: 999;
        transform: translateY(-100%) !important; /* Force slide from top on all pages */
        transition: transform 0.3s ease;
        padding: 70px 2rem 2rem !important; /* Add padding top for menu button */
        overflow-y: auto;
        justify-content: flex-start !important; /* Force top alignment on mobile */
    }
    
    /* Hide the name in the menu on mobile */
    .sidebar .header {
        display: none;
    }
    
    /* Show sidebar when mobile-visible class is added - FOR ALL PAGES */
    .sidebar.mobile-visible {
        transform: translateY(0) !important; /* Force slide down for all pages */
    }
    
    /* Explicitly override any specific page transforms */
    .home .sidebar,
    .cv-page .sidebar,
    .about-page .sidebar {
        transform: translateY(-100%) !important; /* Force hide initially */
    }
    
    .home .sidebar.mobile-visible,
    .cv-page .sidebar.mobile-visible,
    .about-page .sidebar.mobile-visible {
        transform: translateY(0) !important; /* Force show when toggled */
    }
    
    /* Content adjustments */
    .main-content, .about-content {
        margin-left: 0;
        padding: 1rem;
        margin-top: 60px; /* Add space for the header */
    }
    
    .cv-page .main-content {
        padding-left: 1rem;
    }
    
    /* Social links adjustments */
    .social-links {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }
    
    /* Hero and quote adjustments for mobile */
    .hero-content-wrapper {
        gap: 1rem; /* Slightly smaller gap on mobile */
    }
    
    .home .hero-image-container {
        height: 60vh; /* Smaller on mobile */
    }
    
    .home .main-content {
        padding: 1rem;
        margin-top: 60px; /* Account for mobile header */
    }
    
    .hero-quote p {
        font-size: 13px;
    }
    
    .hero-quote cite {
        font-size: 10px;
    }
    
    /* CV container adjustments */
    .cv-container {
        flex-direction: column;
        gap: 1.5rem; /* Reduced gap for mobile */
    }
    
    .cv-title {
        width: 100%;
        text-align: left;
        margin-bottom: 1rem; /* Add space between title and content */
        font-size: 22px; /* Slightly larger for better mobile visibility */
    }

    .nav-menu {
        width: 100%;
    }
    
    .nav-menu .dropdown-menu,
    .nav-menu .submenu {
        position: static;
        width: 100%;
        display: none;
        padding: 0;
        margin-top: 5px;
        box-shadow: none;
        background-color: transparent;
        left: auto; /* Reset the left positioning */
        top: auto; /* Reset the top positioning */
    }
    
    .nav-menu .dropdown-menu {
        padding-right: 10px;
        background-color: rgba(248, 248, 248, 0.7);
    }
    
    .nav-menu .submenu {
        padding-right: 20px;
        background-color: rgba(240, 240, 240, 0.7);
    }
    
    .nav-menu .dropdown-menu li,
    .nav-menu .submenu li {
        margin-bottom: 5px;
    }
    
    .dropdown-menu a,
    .submenu a {
        padding: 5px 0;
    }
    
    /* Use active class for mobile toggles */
    .dropdown-menu.active,
    .submenu.active {
        display: block;
    }
    
    /* Style for the mobile dropdown backgrounds */
    .nav-menu .dropdown-menu {
        background-color: rgba(248, 248, 248, 0.7);
    }
    
    .nav-menu .submenu {
        background-color: rgba(240, 240, 240, 0.7);
    }

    .site-footer {
        padding: 1rem 0;
        margin-top: 1rem;
    }

    .portfolio-content {
        padding-top: 5vh; /* Less spacing on mobile for better usability */
        padding-left: 1rem;
        margin-top: 30px; /* Keep the space for mobile header */
    }
    
    .image-container.vertical {
        width: 80%; /* Slightly wider on mobile */
    }
    
    .video-container {
        min-width: 100%; /* On mobile, use full width instead of fixed minimum */
        max-width: 100%;
    }
}


/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* CSS specific to iOS devices */
    .sidebar {
      -webkit-transform: translateY(-100%) !important;
      transform: translateY(-100%) !important;
      -webkit-transition: -webkit-transform 0.3s ease, transform 0.3s ease !important;
        transition: transform 0.3s ease !important;
    }
    
    .sidebar.mobile-visible {
      -webkit-transform: translateY(0) !important;
      transform: translateY(0) !important;
    }
    
    /* Fix for position:fixed issues */
    .mobile-header {
      position: -webkit-sticky;
      position: sticky;
      -webkit-backface-visibility: hidden;
    }
    
    /* Fix for flexbox issues */
    .mobile-header, .hamburger-icon {
      display: -webkit-flex;
      -webkit-justify-content: space-between;
      -webkit-align-items: center;
    }
    
    /* Fix for transform rotation in hamburger */
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
      -webkit-transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
      -webkit-transform: rotate(-45deg) translate(8px, -8px);
    }
  

  /* Mobile-specific, Safari-friendly menu */
.safari .sidebar {
    display: none !important;
    transform: none !important;
  }
  
  .safari .sidebar.mobile-visible {
    display: block !important;
    -webkit-animation: fadeIn 0.3s ease-in-out;
    animation: fadeIn 0.3s ease-in-out;
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
}

@media (max-width: 768px) {
  .home .hero-image-container { text-align: left; } /* override mobile centering */
  .hero-content-wrapper > * + * { margin-top: var(--hero-gap); } /* same consistent gap */
}
