/*
Theme Name: Jessica Denzer Personal Theme
Description: A custom WordPress theme for Jessica Denzer's personal website. Features easy content management for academic profile, publications, teaching experience, and creative work.
Author: GitHub Copilot
Version: 1.0
Text Domain: jessica-denzer-theme
*/

body {
    background-color: #f2e9e4;
    color: #5a2d24;
    font-family: 'Spectral', serif;
    font-size: 14px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

h1, .display-1 {
    font-size: calc(2rem + 2.0vw);
    font-weight: 700;
    margin: 0;
    padding: 0;
}

h4 {
    font-size: calc(1rem + 1vw);
}

p {
    font-size: calc(1.1rem + 0.7vw);
    font-weight: 400;
}

.text-xs {
    font-size: calc(0.8rem + 0.4vw);
    font-weight: 400;
}

a {
    color: #4a4e69;
}

a:hover {
    color: #9a8c98;
}

ul > li {
    font-size: calc(1rem + 0.5vw);
    font-weight: 400;
    margin: 1rem 0;
}

.position-description {
    font-size: calc(0.7rem + 0.4vw);
    font-weight: 400;
    color: #7a6b5c;
}

/* Change selection highlight color */
::selection {
    background: #ecd4a2;
}

::-moz-selection {
    background: #ecd4a2;
}

hr {
    height: 4px !important;
}

.foots {
    background: #4a4e69;
    color: #f2e9e4;
    padding: 4rem 1rem;
}

.profile {
    width: 200px;
}

.btn {
    background-color: #4a4e69;
    color: #f2e9e4;
}

.btn-block {
    width: 100%;
}

.btn:hover {
    background-color: #9a8c98;
}

.bg-dark {
    background-color: #4a4e69 !important;
}

.nb-bg {
    background-image: url('assets/pgbg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: top left;
    min-height: 120px;
}

/* Responsive breakpoints */
@media (max-width: 1280px) {
    .container {
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* WordPress specific styles */
.wp-post-image {
    height: auto;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* Admin bar adjustments */
.admin-bar .fixed-top {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .fixed-top {
        top: 46px;
    }
}

/* Enhanced Accessibility Improvements */
/* Focus styles for keyboard navigation */
a:focus,
.btn:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #4a4e69;
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 78, 105, 0.25);
}

/* Enhanced focus for social links */
.social-link:focus {
    outline: 3px solid #f2e9e4;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(74, 78, 105, 0.5);
}

/* Keyboard navigation styles */
.keyboard-navigation a:focus,
.keyboard-navigation button:focus,
.keyboard-navigation .btn:focus {
    outline: 3px solid #4a4e69;
    outline-offset: 3px;
    box-shadow: 0 0 0 1px #f2e9e4, 0 0 0 4px #4a4e69;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    body {
        background-color: #ffffff;
        color: #000000;
    }
    
    .btn {
        background-color: #000000;
        color: #ffffff;
        border: 2px solid #000000;
    }
    
    a {
        color: #0000ff;
        text-decoration: underline;
    }
}

/* Screen reader improvements */
.sr-only,
.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Enhanced Skip Links and Accessibility */
.skip-links {
    position: relative;
    z-index: 999999;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    text-decoration: none;
    color: #f2e9e4;
    background: #4a4e69;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    border: 2px solid #4a4e69;
    transition: all 0.3s ease;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    z-index: 999999;
    text-decoration: none;
    color: #f2e9e4;
    background: #4a4e69;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.skip-link:hover:focus {
    background: #5a5e79;
    border-color: #5a5e79;
}

/* Print styles */
@media print {
    .btn, .social-links {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Enhanced mobile styles */
@media (max-width: 576px) {
    h1, .display-1 {
        font-size: calc(1.5rem + 1.5vw);
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .profile {
        width: 150px;
        margin-bottom: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
}

/* Content type specific styles */
.publication-item {
    border-bottom: 1px solid #ecd4a2;
    padding-bottom: 1rem;
}

.publication-meta {
    font-size: 0.9em;
    color: #7a6b5c;
    margin: 0.5rem 0;
}

.publication-type.badge {
    font-size: 0.75em;
}

/* Enhanced Image Loading and Performance - NO CROPPING */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain; /* Default: preserve full image, no cropping */
}

.img-fluid {
    max-width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
    object-fit: contain; /* Ensure responsive images show fully */
}

/* Image loading states */
.img-fluid.loading {
    opacity: 0.6;
    background: linear-gradient(90deg, #f2e9e4 25%, #ecd4a2 50%, #f2e9e4 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.img-fluid.loaded {
    opacity: 1;
}

.img-fluid.error {
    opacity: 0.3;
    filter: grayscale(100%);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Lazy loading images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Prevent layout shift while preserving full images - NO CROPPING */
.decorative-image,
.artwork-image {
    width: 100%;
    height: auto;
    object-fit: contain; /* Shows full image without cropping */
    display: block;
    margin: 0 auto;
    max-height: none; /* Remove any height restrictions */
}

.profile {
    width: 200px;
    height: 200px;
    object-fit: cover; /* Only profile image keeps square crop for header layout */
    border-radius: 50%;
}

/* Divider images should maintain aspect ratio */
.divider-image {
    width: 50%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Ensure all content images preserve their full appearance */
.decorative-image-container img,
.artwork-container img,
.section-image {
    object-fit: contain !important; /* Force no cropping */
    width: 100%;
    height: auto;
}

/* Font loading optimization */
.no-js body {
    font-family: Georgia, serif;
}

.fonts-loaded body {
    font-family: 'Spectral', serif;
}

/* Critical resource loading indicators */
.loading-indicator {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f2e9e4;
    border-radius: 50%;
    border-top-color: #4a4e69;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Additional image container rules to prevent cropping */
.decorative-image-container,
.artwork-container {
    overflow: visible; /* Allow images to display fully */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override any Bootstrap or framework constraints */
.col-md-5 img,
.col-md-7 img,
.row img {
    object-fit: contain !important;
    max-width: 100%;
    height: auto !important;
}

/* Ensure no height restrictions on any images except profile */
img:not(.profile) {
    height: auto !important;
    max-height: none !important;
}

/* Enhanced hover states */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Text wrapping around images */
.teaching-publications-section {
    position: relative;
}

.section-image {
    width: 40%;
    max-width: 500px;
    height: auto; /* Maintain aspect ratio */
    margin-right: 2rem;
    margin-bottom: 1rem;
    float: left;
    shape-outside: margin-box;
    object-fit: contain; /* Ensure no cropping */
}

/* Responsive adjustments for text wrapping */
@media (max-width: 768px) {
    .section-image {
        width: 100%;
        float: none;
        margin-right: 0;
        margin-bottom: 2rem;
        display: block;
        shape-outside: none;
    }
}

/* Clear floats */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}