* {
  box-sizing: border-box;
  font-family:"JetBrains Mono", monospace
}

body {
  margin: 0;
  background:black;
  font-family:"JetBrains Mono", monospace;
  color:white;
  align-items: center;
}


/* Page container for centered layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px; /* left/right gutters on small screens */
}
/* NAVBAR */
.navbar {
  background: black;
  /* navbar visual */
}

/* TOP ROW */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* let the container provide the horizontal gutter; remove extra left/right padding */
  padding: 14px 0;
  flex-wrap: nowrap; /* keep logo and nav links on one line */
}

/* LOGO */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  flex: 0 0 auto; /* do not allow logo to shrink or grow */
}

.logo-img {
  height: 140px; /* larger desktop default for visibility */
  width: auto;
  max-width: 45vw; /* prevent it from taking too much space */
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  white-space: nowrap; /* keep title on one line */
}

/* Centered logo row (top of header) */
.logo-centered {
  text-align: center;
  padding: 14px 0 8px;
  position: relative;
}

/* full-width thin line under the centered logo that spans the container */
.logo-centered::after { /* removed - line moved to .tabs-row */ }

/* full-width thin line under the centered logo that spans the container */
/* logo underline removed per request */

.logo-centered .logo-img {
  display: inline-block;
  height: 140px; /* match desktop logo size */
  width: auto;
  max-width: 45vw;
}

.logo-centered .logo-text {
  margin-top: 6px;
  font-size: 30px;
}

.logo-text span {
  color: white; /* accent for the second word */
  font-weight: 800;
}

/* RIGHT LINKS */
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  color: #aaa;
  text-decoration: underline;
}

.nav-links a:hover {
  text-decoration: underline;
  
}

/* TABS */
.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 8px;
  position: relative; /* for the line pseudo-element */
  z-index: 1;
}

/* Draw the thin line at the bottom of the tabs row so tabs sit on it */
.tabs-row::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0; /* line sits at bottom edge of tabs-row */
  height: 1px;
  background: rgba(255,255,255,0.12);
  z-index: 0;
}

.tabs {
  display: flex;
  gap: 24px;
}

.tab {
  display: inline-block;
  padding: 6px 0;
  text-decoration: none;
  font-size: 15px;
  color: #666;
  position: relative;
}

.tab:hover {
  color:white;
}

/* Underline placed directly under the tab text (hidden by default) */
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  bottom: 0; /* sits just under the tab content area */
  background: transparent;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease, background-color 160ms ease;
}

.tab:hover::after {
  background: rgba(255,255,255,0.12);
  transform: scaleX(1);
}

/* ACTIVE TAB (Moodle-style underline) */
.tab.active {
  color: greenyellow;
  font-weight: 500;
}

.tab.active::after {
  background: greenyellow;
  transform: scaleX(1);
  height: 3px;
}

/* Make the right-hand nav links align properly in the tabs row */
.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  color: #aaa;
  text-decoration: underline;
  padding-left: 12px;
}
/* gallery grid code */
/* Pinterest-like masonry using CSS columns for variable-height cards */
.gallery-grid {
  column-width: 320px;      /* preferred column width */
  column-gap: 16px;         /* gutter between columns */
  margin-top: 20px;
  /* ensure children are positioned naturally inside columns */
}

.painting-card {
  display: inline-block;    /* required for column layout */
  width: 100%;              /* fill column width */
  margin: 0 0 16px;         /* vertical gap between cards */
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  break-inside: avoid;      /* avoid awkward breaks */
  -webkit-column-break-inside: avoid;
  -moz-column-break-inside: avoid;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.painting-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}

.painting-card img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  background: #111;
}

/* ensure overlay sits above the image and does not push layout */
.painting-card {
  position: relative; /* anchor for absolute overlay */
  overflow: visible;  /* allow overlay to extend slightly outside if needed */
}

.painting-meta {
  z-index: 10; /* sit above the image */
  pointer-events: auto;
  /* subtle gradient so overlay doesn't fully obscure image */
  background: linear-gradient(180deg, rgba(0,0,0,0.40), rgba(0,0,0,0.56));
}

/* Overlay metadata on top of the image to remove the white strip underneath */
.painting-meta {
  position: absolute; 
  left: 12px;
  bottom: 12px;
  /* keep overlay compact rather than spanning full width */
  width: auto;
  max-width: 72%;
  padding: 8px 10px;
  color: #fff;
  background: rgba(0,0,0,0.48);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}
.painting-meta h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color:yellowgreen;
  line-height: 1.12;
  /* allow wrapping for long titles but limit height */
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
}
.painting-meta .meta-sub {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  opacity: 0.95;
}
/* row containing artist on left and year on right */
.painting-meta .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.painting-meta .meta-artist {
  font-size: 12px;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.painting-meta .meta-year {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  opacity: 0.9;
  flex: 0 0 auto;
  margin-left: 8px;
}
@media (max-width: 900px) {
  /* no-op for masonry container on narrower screens */
  .gallery-grid {
  }
  /* Make the logo more visible on tablet/mobile */
  .logo-img { height: 100px; max-width: 65vw; }
  .logo-centered .logo-img { height: 100px; max-width: 65vw; }
  .logo-text { font-size: 20px; }
  .nav-inner { padding: 12px 0; }
  .nav-links { flex: 0 0 auto; }
}

@media (max-width: 420px) {
  /* Keep logo large and readable on small phones */
  .logo-img { height: 80px; max-width: 75vw; }
  .logo-centered .logo-img { height: 80px; max-width: 75vw; }
  .logo-text { font-size: 16px; }
  .nav-links a { font-size: 13px; }
}

/* Responsive adjustments for Masonry: make cards full-width on small screens */
@media (max-width: 600px) {
  /* Two-column grid on narrow screens: each card takes ~50% minus horizontal gutters */
  .painting-card { width: calc(50% - 16px); margin-left: 8px; margin-right: 8px; }
  /* On small screens, let overlay expand to almost full width for readability */
  .painting-meta { max-width: calc(100% - 24px); left: 12px; right: 12px; }
}

/* PRELOADER STYLES */
.preloader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #ffffff;
}

.preloader p {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
  opacity: 0.8;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Hide preloader by default */
.preloader {
  display: none;
}

.preloader.show {
  display: flex;
}
