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

/* Skip link (visually hidden until focused) */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus,
.skip-link:active {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    background: #111;
    color: #fff;
    z-index: 9999;
    border-radius: 4px;
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* --- Header Updates --- */
header {
    background-color: hsl(0, 0%, 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;

    z-index: 100;
    border-bottom: 1px solid #ddd;
    /* Use flexbox for layout */
    display: flex;
    justify-content: space-between; /* Space between logo/social and nav */
    align-items: center; /* Vertically center items */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between logo and site name */
}

.logo-link {
    /* Style for the logo link container */
    display: block; /* Make the link area clickable */
    text-decoration: none; /* Remove underline if it's an anchor */
}

.logo-placeholder {
    width: 50px; /* Adjust size as needed */
    height: 50px; /* Adjust size as needed */
    /*background-color: #ccc; /* Placeholder color */
    border: 1px solid #999; /* Placeholder border */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #666;
    /* Ensure the placeholder fits nicely within the link */
    width: 100%;
    height: 100%;
}

.logo-placeholder img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

header h1 {
    margin: 0; /* Remove default margin */
    font-size: 1.8rem; /* Slightly smaller for header */
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem; /* Reduced gap for nav items */
    margin: 0; /* Remove default margin */
    padding: 0; /* Remove default padding */
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: color 0.2s;
    /* No decorative border by default; active gets a straight line */
    border-bottom: none;
}

/* Active menu item: a straight solid line beneath the item */
nav a.active {
    color: #333; /* keep color consistent */
    border-bottom: 2px solid #333;
    border-radius: 0; /* straight edge */
    padding-bottom: 0.15rem; /* keep spacing when line appears */
}

nav a:hover {
    color: #333; /* subtle hover color; no underline change */
}

/* Focus-visible styles for keyboard users */
a:focus-visible,
button:focus-visible,
select:focus-visible,
.filter-btn:focus-visible,
.btn:focus-visible {
    outline: 3px solid #ffb400;
    outline-offset: 3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem; /* Space between social media links */
}

.social-link {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    /* Style for image-based social links */
    display: block; /* Make the link area clickable */
}

.social-link img {
    width: 24px; /* Adjust size as needed */
    height: 24px; /* Adjust size as needed */
    vertical-align: middle; /* Align image with text baseline if needed */
    transition: opacity 0.3s; /* Smooth hover effect */
}

.social-link:hover img {
    opacity: 0.7; /* Example hover effect */
}
/* --- End Header Updates --- */

/* Breadcrumbs */
.breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 0 2rem;
    font-size: 0.9rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: #999;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #333;
    text-decoration: underline;
}

.breadcrumbs li:last-child {
    color: #333;
    font-weight: 500;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: #333; /* Improved contrast for main content */
}

section {
    margin-bottom: 1.5rem;
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
    grid-auto-rows: max-content; /* Allow rows to size based on content */
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0.5rem auto 2rem auto;
    align-items: start; /* Align cards to top */
}
@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 0.5rem;
}

.category-card img {
    width: 100%;
    /* Category cards now use a square (1:1) aspect ratio for all images.
       This ensures both portrait and landscape images fill the card area,
       cropping as needed for a consistent grid.
       Default desktop height: 420px (420x420)
    */
    height: 420px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid #eee;
    background: #f0f0f0;
}

/* Make home category cards smaller on narrow screens */
@media (max-width: 768px) {
    .category-card img {
        height: 260px;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 480px) {
    .category-card img {
        height: 180px;
        aspect-ratio: 1 / 1;
    }
}

.category-card span {
    font-weight: bold;
    color: #333;
}

.artwork-item {
    text-align: center;
    color: #333;
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
}

@media (max-width: 600px) {
    .logo {
        max-width: 80px;
    }
}


.artwork-item a {
    text-decoration: none;
    color: inherit;
}

.artwork-item img {
    /* Gallery images display at their full aspect ratio without cropping.
       Use `object-fit: contain` to fit the entire image within the card.
       Add data-orientation attribute to gallery items for appropriate sizing:
       - data-orientation="landscape": 4:3 aspect ratio
       - data-orientation="portrait": 9:16 aspect ratio
       
       Display guidance:
       - Landscape: ~300px tall on wide screens -> recommend 1200x900 source (1x) and 2400x1800 (2x).
       - Portrait: allow variable height based on aspect ratio (no fixed height limit).
    */
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* default landscape ratio */
    object-fit: contain; /* Display full image without cropping */
    border: 2px solid #eee;
    transition: transform 0.3s;
    background-color: #f0f0f0;
    max-height: none; /* Remove height cap to allow portrait images */
}

/* Portrait images use taller aspect ratio */
.artwork-item[data-orientation="portrait"] img {
    aspect-ratio: 3 / 4;
}

/* Landscape images use wider aspect ratio */
.artwork-item[data-orientation="landscape"] img {
    aspect-ratio: 4 / 3;
}

.artwork-item img:hover {
    transform: scale(1.02);
}

.artwork-item h3 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.artwork-item p {
    color: #666;
    font-size: 0.9rem;
}

/* About page photo placeholder and layout */
#about-artist .about-content {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.about-photo {
    display: block;
    margin: 0 auto 2rem auto;
    width: auto;
    height: 420px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid #e6e6e6;
    background: #f3f3f3;
    max-width: 100%;
}

.about-copy {
    flex: 1 1 auto;
}

.artwork-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.artwork-image img {
    width: 100%;
    height: auto;
    display: block;
    background-color: #f0f0f0; /* Placeholder color */
}

.artwork-info h2 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.artwork-details {
    margin: 1.5rem 0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.detail-item strong {
    color: #333;
}

.artwork-description {
    margin: 1.5rem 0;
}

.artwork-description h3 {
    margin-bottom: 1rem;
}

.artwork-actions {
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #333;
    color: white;
}

.btn-primary:hover {
    background-color: #555;
}

.filter-buttons {
    text-align: center;
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #333;
    color: white;
    border-color: #333;
}

/* Make filter buttons more prominent and match icon sizing */
.filter-buttons .filter-btn {
    font-weight: bold;
    padding: 0.5rem 1.25rem;
}

/* Filter controls layout */
.filter-controls {
    display: flex;
    flex-direction: column; /* Stack buttons above selects */
    align-items: center; /* Center both buttons and selects */
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Make nav links easier to tap on touch devices */
nav a {
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
}

.filter-selects {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-selects label {
    font-size: 0.95rem;
    color: #333;
}

.filter-selects select {
    margin-left: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Responsive adjustments for filter controls */
@media (max-width: 768px) {
    .filter-controls {
        flex-direction: column;
        align-items: center;
    }

    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .filter-selects {
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        max-width: 720px;
    }

    .filter-selects label {
        flex: 1 1 48%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .filter-selects select {
        margin-left: 0.25rem;
        width: 60%;
    }
}

/* Artwork availability badge */
.artwork-item {
    position: relative; /* for positioning badge */
}

.availability-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.availability-badge.sold { background: #b22222; }
.availability-badge.available { background: #228b22; }
.availability-badge.not-for-sale { background: #555; }

/* --- Footer Updates --- */
footer {
    background-color: #f8f8f8;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid #ddd;
    /* Use flexbox for layout */
    display: flex;
    flex-direction: column; /* Stack copyright and social links */
    align-items: center;
    gap: 1rem; /* Space between copyright and social links */
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* Space between social media links */
    margin-top: 1rem; /* Space above social links */
}

.footer-social a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    /* Style for image-based social links in footer */
    display: block; /* Make the link area clickable */
}

.footer-social a img {
    width: 20px; /* Adjust size as needed */
    height: 20px; /* Adjust size as needed */
    vertical-align: middle; /* Align image with text baseline if needed */
    transition: opacity 0.3s; /* Smooth hover effect */
}

.footer-social a:hover img {
    opacity: 0.7; /* Example hover effect */
}
/* --- End Footer Updates --- */

/* --- Social Icon Updates --- */
.social-icons a, .footer-social-icons a {
  color: #000;
  text-decoration: none;
  margin: 0 18px;
  font-size: 2.2rem;
  transition: filter 0.2s, color 0.2s;
  filter: grayscale(100%);
}

.social-icons a:hover, .footer-social-icons a:hover {
  color: #222;
  filter: grayscale(0%);
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: 1rem;
}

.footer-social-icons {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}
/* --- End Social Icon Updates --- */

/* --- Navigation Centering --- */
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin: 0;
  padding: 0;
}
nav ul li {
  margin: 0;
}
/* --- End Navigation Centering --- */

/* Responsive design */
@media (max-width: 768px) {
    header {
        flex-direction: column; /* Stack header elements */
        gap: 1rem;
        padding: 1rem;
    }

    .header-left,
    nav ul,
    .header-right {
        justify-content: center; /* Center items on mobile */
    }

    nav ul {
        gap: 1rem; /* Adjust gap for mobile */
        flex-wrap: wrap; /* Allow nav items to wrap if needed */
    }

    .artwork-grid {
        grid-template-columns: 1fr;
    }

    .artwork-detail {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem;
    }

    /* Stack about photo and copy on small screens */
    #about-artist .about-content {
        flex-direction: column;
        align-items: center;
    }

    .about-photo {
        height: 300px;
    }
}

/* Smaller adjustments for very small screens */
@media (max-width: 480px) {
    .artwork-item img {
        aspect-ratio: 4 / 3;
        max-height: 320px;
    }

    .availability-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    nav a {
        padding: 0.5rem 0.6rem;
    }

    .about-photo {
        height: 200px;
    }
}
/* About page paragraph spacing */
.about-copy p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-copy p:last-child {
    margin-bottom: 0;
}

/* Reduce space above footer */
footer {
    margin-top: 2rem;
}
