/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

 /* app/assets/stylesheets/application.css */

/* 1. Global Reset & Minimalist Variables */
:root {
  /* Minimalist Gallery Palette */
  --bg-color: #ffffff; /* Pure white gallery wall */
  --surface-color: #f9f9f9; /* Just a hint of gray for secondary sections */
  
  /* Text Colors - Charcoal instead of pure black is easier on the eyes */
  --text-main: #2c2c2c; 
  --text-muted: #888888;
  
  /* Accent Color - A soft, organic color used very sparingly (e.g., links) */
  --accent-color: #d4a373; 
  
  /* Soft UI Elements */
  --border-light: 1px solid #eaeaea;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
  --border-radius: 4px; /* Very subtle rounding */
}

/* Base Body Styles */
body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; /* Clean, classic sans-serif */
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased; /* Makes text look sharper and thinner on Mac */
}

/* 2. Gallery Button Base */
.btn-gallery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px; /* Tracking out the letters adds elegance */
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  
  color: var(--text-main);
  background-color: transparent;
  border: 1px solid var(--text-main);
  border-radius: 50px; /* Pill shape for an organic, smooth feel */
  
  transition: all 0.3s ease; /* Slower, smoother transition */
}

/* 3. The Refined Hover State */
.btn-gallery:hover, .btn-gallery:focus {
  background-color: var(--text-main);
  color: var(--bg-color); /* Swaps text to white */
  outline: none;
}

/* =========================================
   Minimalist Navigation Header
   ========================================= */

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px; /* More breathing room */
  background-color: rgba(255, 255, 255, 0.95); /* Slight transparency */
  backdrop-filter: blur(5px); /* Blurs the artwork as it scrolls behind the header */
  
  position: sticky;
  top: 0;
  z-index: 100;
  /* We removed the bottom border completely for a cleaner look */
}

/* Delicate Navigation Links */
.nav-links {
  display: flex;
  gap: 40px; /* Lots of space between links */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--text-main);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent-color); /* A subtle color shift, no background blocks */
}

/* =========================================
   Logo Cropping & Zooming
   ========================================= */

/* 1. The Cropping Container (The physical space in your header) */
.header-logo .logo-crop {
  display: block;
  height: 40px;  /* The exact height you want in the navbar */
  width: 140px;  /* Adjust this based on your logo's width */
  overflow: hidden; /* The scissors that cut off the excess */
}

/* 2. The Telescope Zoom */
.header-logo .logo-crop img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures the whole image fits inside the box first */
  
  /* THIS IS THE MAGIC NUMBER: */
  transform: scale(2.5); /* Increase this (e.g. 3, 4) to zoom in more, decrease to zoom out */
  transform-origin: center center; /* Zooms perfectly from the middle */
}

/* =========================================
   Minimalist Portfolio Grid (CSS Grid)
   ========================================= */

.gallery-container {
  max-width: 1400px; /* Keep it from stretching endlessly on massive monitors */
  margin: 60px auto; /* Centers the grid and adds breathing room below the header */
  padding: 0 40px;
}

.portfolio-grid {
  display: grid;
  /* 
    This is the magic line. It creates columns that are AT LEAST 300px wide, 
    but will automatically stretch (1fr) to fill remaining space. 
    It auto-wraps based on screen size!
  */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  
  /* We set a fixed height for our standard rows to anchor the masonry math */
  grid-auto-rows: 350px; 
  gap: 24px; /* The clean, consistent white space between paintings */
}

/* Base Item Styling */
.portfolio-item {
  position: relative; /* Needed so the overlay sits on top */
  overflow: hidden; /* Ensures the image doesn't break out when zoomed */
  border-radius: var(--border-radius); /* That subtle 4px rounding from our variables */
  background-color: var(--surface-color);
}

/* Image Handling */
.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Absolutely crucial: crops the image gracefully instead of squishing */
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth, premium zoom */
}

/* --- The Masonry Utility Classes --- */
.span-tall {
  grid-row: span 2; /* Takes up two 350px rows + the gap */
}

.span-wide {
  grid-column: span 2; /* Takes up two columns */
}

/* The Text Overlay */
.portfolio-item .overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.85); /* Milky white semi-transparent veil */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.4s ease;
}

.portfolio-item .overlay span {
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  transform: translateY(15px); /* Start slightly low */
  transition: transform 0.4s ease;
}

/* The Hover Triggers */
.portfolio-item:hover img {
  transform: scale(1.05); /* Gentle zoom on the artwork */
}

.portfolio-item:hover .overlay {
  opacity: 1; /* Fade in the veil */
}

.portfolio-item:hover .overlay span {
  transform: translateY(0); /* Slide the text up into place */
}