/* projects.css - responsive grid, featured card, tag chips, accessible cards */

:root{
  --gap: 16px;
  --card-radius: 10px;
  --max-width: 1200px;
  --bg: floralwhite;
  --muted: #666;
  --accent: #111;
}

* { box-sizing: border-box; }
html,body { height:100%; }
body {
  margin:0;
  font-family: 'Atkinson Hyperlegible Next', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--accent);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.preview-btn{
  position:absolute;
  bottom:8px;
  right:8px;
  width:28px;
  height:28px;
  border:none;
  border-radius:50%;
  background:rgba(0,0,0,0.7);
  color:white;
  font-size:14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:3;
}

.preview-btn:hover{
  background:black;
}

.card-thumb{
  position:relative;
}

.logo {
  width: 75px;
  height: 65px;
  display: block;
  margin: -8px;
}

.logo-item {
  margin-right: 12px;
}

.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 18px;
}

/* Top nav */
#main-nav {
  margin-top: -0.5%;
  display: flex;
  align-items: center;
  font-size:18px;
  padding:0;
  list-style:none;
}

#main-nav li {
    margin-left: 12px;
}

#main-nav li:nth-child(2) {
  margin-left: auto;
}

#main-nav li:first-child {
    margin-left: 0;
}

#main-nav a { 
    color: black;
    text-decoration:none;
    padding:8px 8px;
    position:relative;
    display:inline-block;
    transition: font-weight 0.2s ease;
}

#main-nav a::before {
  content: attr(data-text);
  font-weight: 700;
  visibility: hidden;
  display: block;
  height: 0;
  overflow: hidden;
}

#main-nav a:hover {
  font-weight: 525;
}

#main-nav a.active { 
    font-weight:550;
}

ul li a::after {
  content: "";
  position: absolute;
  left: 15px;
  bottom: 4px;
  width: calc(100% - 30px);
  height: 2px;
  background: black;
  transform: scaleX(0);
  transition: transform 1s ease;
}

ul li a.active::after { 
    transform: scaleX(1);
}

/* Controls (filters + search) */
#projects-controls {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  margin:12px 0 18px 0;
}
.filters {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.filter-btn {
  background:#eee;
  border-radius:999px;
  padding:8px 12px;
  font-size:14px;
  cursor:pointer;
  border:0;
}

#toggle-preview {
  min-width: 150px;
  max-width: 150px;
  font-weight:600;
  background:white;
  border: solid 1px #79B349;
}

#toggle-preview[aria-pressed="true"] {
    border: solid 1px #B34F49;
}


.filter-btn[aria-pressed="true"] {
  background:white;
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

/* search */
#projects-search {
  width:350px;
  max-width:40vw;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #d7d7d7;
  font-size:15px;
}

/* Grid */
.grid-container {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  grid-auto-rows: minmax(260px, auto);
}

/* Make featured larger on wide screens */
.featured-project {
  grid-column: span 2;
  grid-row: span 2;
}
@media (max-width: 900px) {
  .featured-project { grid-column: 1 / -1; grid-row: auto; }
}

/* Ensure the featured card's inner heights avoid empty gaps */
.featured-project .project-card { height:100%; display:flex; flex-direction:column; }
.featured-project .card-thumb { height:320px; }

@media (max-width:900px) {
  .featured-project .card-thumb { height:180px; }
}

/* Card (anchor) */
.project-card {
  display:block;
  background:white;
  border-radius: var(--card-radius);
  overflow:hidden;
  text-decoration:none;
  color:inherit;
  border:1px solid #e6e6e6;
  transition:transform .16s ease, box-shadow .16s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  height:100%;
  display:flex;
  flex-direction:column;
}
.project-card:focus,
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(10,10,10,0.06);
  outline: none;
}

/* Thumbnail area */
.card-thumb {
  width:100%;
  height:160px;
  background: linear-gradient(90deg,#f3f3f3,#ededed);
  display:block;
  overflow:hidden;
  flex-shrink:0;
  position:relative;
}
.card-thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition: opacity .18s ease, transform .25s ease;
}

/* when preview is available we will fade to the preview on hover; JS toggles src */

.card-thumb.preview-enabled img.preview-layer {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  pointer-events:none;
}

/* Card body */
.card-body {
  padding:12px;
  display:flex;
  gap:8px;
  flex-direction:column;
  flex:1 1 auto;
}
.card-title {
  font-size:16px;
  margin:0 0 6px 0;
  line-height:1.2;
  font-weight:600;
}
.card-desc {
  font-size:13px;
  margin:0 0 10px 0;
  color:var(--muted);
  flex:1 1 auto;
}

/* Tag chips and meta */
.tag-list { display:flex; gap:8px; flex-wrap:wrap; }
.tag {
  background:#f1f1f1;
  padding:6px 8px;
  border-radius:999px;
  font-size:12px;
  color:#333;
}

/* small footer row inside card */
.card-meta {
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:space-between;
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
}

/* pagination */
.pagination {
  display:flex;
  gap:6px;
  justify-content:center;
  align-items:center;
  margin:20px 0 40px 0;
  flex-wrap:wrap;
}
.page-btn {
  background:white;
  border:1px solid #ddd;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}
.page-btn[aria-current="true"] {
  background:#111;
  color:white;
  border-color:#111;
}

/* small utilities */
.external-indicator {
  font-size:12px;
  opacity:0.8;
}

.grid-error {
  grid-column:1/-1;
  padding:16px;
  background:#fff;
  border-radius:8px;
  border:1px solid #eee;
}

.previews-disabled .preview-btn{
  display:none;
}

@media (hover: hover) and (pointer: fine) {
  .preview-btn {
    display: none;
  }
}

/* footer */
#bottom-left {
	position: sticky;
    bottom: 0;
	margin-bottom:1%;
    margin-left:1.4%;
}