/* =========================================
   Richard Flint — Portfolio styles.css
   - Desktop: table layout for projects
   - Mobile: card layout for projects
   - Includes: portrait/landscape thumbnail crops, header mobile stacking
   ========================================= */

/* -----------------------------
   Theme variables
----------------------------- */
:root {
    --bg: #0b0d10;
    --card: #11151b;
    --text: #e9eef6;
    --muted: #aab7c6;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #7aa7ff;
  }
  
  /* -----------------------------
     Base / reset
  ----------------------------- */
  * { box-sizing: border-box; }
  
  html, body {
    margin: 0;
    padding: 0;
  }
  
  body {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
      "Apple Color Emoji", "Segoe UI Emoji";
    background:
      radial-gradient(1000px 600px at 20% 0%, rgba(122,167,255,0.18), transparent 60%),
      radial-gradient(900px 600px at 80% 10%, rgba(255,255,255,0.06), transparent 60%),
      var(--bg);
    color: var(--text);
    line-height: 1.6;
  }
  
  /* -----------------------------
     Layout wrapper
  ----------------------------- */
  .wrap {
    max-width: 1050px;
    margin: 0 auto;
    padding: 28px 18px;
  }
  
  /* =========================================
     Header / nav
     ========================================= */
  .header {
    padding: 18px 0 10px;
    border-bottom: 1px solid var(--line); /* subtle separator from main content */
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 13, 16, 0.78);
    backdrop-filter: blur(10px);
    transition: padding 0.25s ease, border-bottom-color 0.25s ease, background 0.25s ease, transform 0.3s ease;
  }

  .header-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
  }

  .header-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }
  
  .header-title:hover {
    opacity: 0.85;
  }

  /* Smoothly animate the title when the header shrinks */
  .header h1 {
    transition: font-size 0.25s ease;
  }

  /* State applied when the user scrolls down a bit */
  .header--scrolled {
    padding: 10px 0 6px;
    border-bottom-color: rgba(255, 255, 255, 0.16);
  }

  .header--scrolled h1 {
    font-size: 1.7rem;
  }

  /* State for hiding header on mobile when scrolling */
  .header--hidden {
    transform: translateY(-100%);
  }
  
  h1 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: -0.02em;
  }
  
  .subtitle {
    margin: 6px 0 0;
    color: var(--muted);
  }
  
  .nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
  }
  
  .nav a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
  }
  
  .nav a:hover {
    color: var(--text);
    border-bottom-color: var(--line);
  }
  
  /* =========================================
     Sections / typography
     ========================================= */
  section { margin-top: 28px; }
  
  h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
  }
  
  /* Intro + Contact: muted body copy */
  .intro p,
  .contact p {
    margin: 0;
    color: var(--muted);
  }
  
  /* If you switched your intro to multiple <p> blocks, this spacing helps readability */
  .intro p {
    margin: 0 0 12px;
  }
  .intro p:last-child {
    margin-bottom: 0;
  }

  /* ---------------------------------
   Intro portrait
   --------------------------------- */
  .intro-portrait {
      margin-bottom: 18px;
  }

  /* Mobile-first: portrait fills the available width */
  .intro-portrait img {
      width: 100%;
      height: auto;
      max-width: 480px; /* prevent it from feeling oversized on small phones */
      object-fit: cover;
      border-radius: 18px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,0.04);
      display: block;
  }

  @media (min-width: 761px) {
      /* Desktop: circle-cropped portrait on the right */
      .intro-portrait img {
        width: 250px;
        height: 250px;
        border-radius: 50%;
      }

      .intro {
        display: grid;
        grid-template-columns: 1fr auto; /* text first, portrait second */
        column-gap: 24px;
        align-items: start;
      }
    
      /* Keep all text aligned to the left column */
      .intro h2,
      .intro p {
        grid-column: 1;
      }
    
      /* Move portrait to the right */
      .intro-portrait {
        grid-column: 2;
        grid-row: 1 / span 10;
        justify-self: end;
      }
    }      
      
  
  /* =========================================
     Projects: search + filter controls
     ========================================= */
  .projects-head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  
  .controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  input[type="search"],
  select {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    outline: none;
  }
  
  input[type="search"]::placeholder {
    color: rgba(233,238,246,0.45);
  }
  
  input[type="search"]:focus,
  select:focus {
    border-color: rgba(122,167,255,0.55);
  }

  select:focus {
    outline: none;
    border-color: rgba(122,167,255,0.55);
    background-color: rgba(255,255,255,0.06);
  }  

  select option {
    background: #11151b;
    color: #e9eef6;
  }  
  
  /* =========================================
     Desktop projects table (hidden - replaced by tiles)
     ========================================= */
  .table-card {
    display: none; /* Hide table on all screen sizes */
  }
  
  /* “Notes” under the projects section */
  .projects-note {
    margin: 14px 2px 0;
    color: var(--muted);
    font-size: 0.95rem;
  }
  
  /* =========================================
     Badges + links
     ========================================= */
  .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    color: rgba(233,238,246,0.8);
    font-size: 0.85rem;
  }
  
  .project-link {
    color: var(--text);
    text-decoration: none;
  }
  
  .project-link:hover {
    color: var(--accent);
  }
  
  /* =========================================
     Thumbnails (shared by table + cards)
     - Keep a consistent “frame” style
     - Two crop modes: landscape + portrait
     ========================================= */
  .thumb {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    display: block;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  
  /* Landscape crop (film stills) */
  .thumb-landscape {
    width: 120px;
    height: 70px;
    object-fit: cover;
  }
  
  /* Portrait crop (posters / title cards) */
  .thumb-portrait {
    width: 70px;
    height: 105px;
    object-fit: cover;
  }
  
  /* Center thumbnails in the table cell */
  .thumb-cell {
    text-align: center;
    vertical-align: middle;
  }
  .thumb-cell .thumb {
    margin: 0 auto;
  }
  
  /* If thumbnails are links, make them feel clickable */
  .thumb-cell a,
  .thumb-link {
    display: inline-block;
  }
  
  /* Hover feedback (desktop) */
  .thumb-cell a:hover .thumb {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  
  /* Hover feedback for card thumbnails */
  .card-media a:hover .thumb {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  
  /* Keyboard focus ring for accessibility */
  .thumb-link:focus-visible {
    outline: 2px solid rgba(122,167,255,0.7);
    outline-offset: 3px;
    border-radius: 14px;
  }
  
  /* =========================================
     Equipment section (grid of cards)
     ========================================= */
  .equipment-intro {
    margin: 0 0 14px;
    color: var(--muted);
  }
  
  .equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
  }
  
  .equipment-group {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
  }
  
  .equipment-group h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  
  .equipment-group ul {
    margin: 0;
    padding-left: 16px;
    color: var(--muted);
  }
  
  .equipment-group li {
    margin: 4px 0;
  }
  
  /* =========================================
     Footer
     ========================================= */
  .footer {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: rgba(233,238,246,0.45);
    font-size: 0.9rem;
  }
  
  /* =========================================
     Projects cards/tiles layout
     - Grid layout on desktop
     - Stacked on mobile
     ========================================= */
  .cards {
    display: grid;
    margin-top: 12px;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  
  .card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  }
  
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: rgba(122,167,255,0.3);
  }
  
  /* Desktop: tile layout with image on the left and content on the right */
  @media (min-width: 761px) {
    .card-top {
      display: flex;
      flex-direction: row;
      gap: 14px;
      align-items: flex-start;
    }
    
    .card-media {
      flex: 0 0 auto;
      width: 130px;
      height: 190px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      overflow: hidden;
    }
    
    .card-media .thumb {
      width: 100%;
      height: 100%;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain; /* Always fit image inside a portrait frame */
      display: block;
      margin: 0;
    }
    
    .card-media .thumb-landscape {
      width: 100%;
      height: 100%;
    }
    
    .card-media .thumb-portrait {
      width: 100%;
      height: 100%;
    }
    
    .card-body {
      min-width: 0;
      flex: 1 1 auto;
    }
    
    .card-title {
      margin: 0 0 8px;
      font-size: 1.1rem;
      letter-spacing: -0.01em;
    }
    
    .card-meta {
      margin-top: 8px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      color: var(--muted);
      font-size: 0.9rem;
    }
    
    .card-description {
      margin-top: 10px;
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.5;
    }
    
    .card-festivals {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.5;
    }
  }
  
  /* Mobile: horizontal layout */
  @media (max-width: 760px) {
    .cards {
      grid-template-columns: 1fr;
    }
    
    .card-top {
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }
    
    .card-media {
      flex: 0 0 auto;
      width: 100px;
      height: 150px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
      overflow: hidden;
    }
    
    .card-media .thumb,
    .card-media .thumb-landscape,
    .card-media .thumb-portrait {
      width: 100%;
      height: 100%;
      max-width: 100%;
      max-height: 100%;
      object-fit: contain; /* Fit any aspect ratio into a portrait frame */
      display: block;
    }
    
    .card-body {
      min-width: 0;
      flex: 1 1 auto;
    }
    
    .card-title {
      margin: 0;
      font-size: 1.02rem;
      letter-spacing: -0.01em;
    }
    
    .card-meta {
      margin-top: 6px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      color: var(--muted);
      font-size: 0.92rem;
    }
    
    .card-description {
      margin-top: 8px;
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.45;
    }
    
    .card-festivals {
      margin-top: 10px;
      color: var(--muted);
      font-size: 0.92rem;
      line-height: 1.45;
    }
  }
  
  .card-title a {
    color: var(--text);
    text-decoration: none;
  }
  
  .card-title a:hover {
    color: var(--accent);
  }
  
  /* Slight spacing tweak when badges appear in meta row. */
  .card-meta .badge {
    margin-right: 6px;
  }
  
  /* Role styling - appears in meta row */
  .card-role {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: inherit;
  }
  
  .card-role-label {
    color: rgba(233, 238, 246, 0.6);
    margin-right: 4px;
    font-weight: 500;
  }
  
  /* Year styling - appears in meta row */
  .card-year {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: inherit;
  }
  
  .card-year-label {
    color: rgba(233, 238, 246, 0.6);
    margin-right: 4px;
    font-weight: 500;
  }
  
  /* Duration styling - appears in meta row */
  .card-duration {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: inherit;
  }
  
  .card-duration-label {
    color: rgba(233, 238, 246, 0.6);
    margin-right: 4px;
    font-weight: 500;
  }
  
  /* Description styling */
  .card-description {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
  }
  
  .card-festivals strong {
    color: var(--text);
    font-weight: 600;
  }
  
  /* =========================================
     Responsive rules (mobile)
     - Stack header/nav
     - Slightly adjust thumbnail sizes
     ========================================= */
  @media (max-width: 760px) {
    /* Header: center the title and subtitle, hide nav */
    .header-inner {
      justify-content: center;
      align-items: center;
    }

    .header-title {
      flex-direction: column;
      align-items: center;
      white-space: normal;
      text-align: center;
    }

    .header-title .subtitle {
      margin: 4px 0 0;
    }

    .nav {
      display: none;
    }

    /* Thumbs: slightly smaller on mobile (keeps aspect-specific sizing intact) */
    .thumb-landscape { width: 110px; height: 64px; }
    .thumb-portrait  { width: 64px;  height: 96px; }
  }