/* Define fonts first */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-regular.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.subset.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.subset.woff2') format('woff2');
}

/* Base and Global Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

input {
    font-family: 'Inter', sans-serif;
}

/* Typography */
strong {
    font-weight: 600;
}
b {
    font-weight: 500;
}

h1 {
    font-size: 28px;
    font-weight: 600;
}

h2 {
    font-size: 16px;
    font-weight: 500;
}

/* Tag Buttons */
.tag-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
}

.tag-button:hover {
    background: #eaecef;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 24px;
    background-color: #292e36;
    min-height: 43px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.logo-img {
    width: auto;
    margin-right: 8px;
}

.navbar .search-form {
    flex: 1;
    max-width: 250px;
    margin-left: 40px;
    position: relative;
}

.navbar .search-form input[type="text"] {
    width: 100%;
    padding: 10px 44px 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    box-sizing: border-box;
}

.navbar .search-form input:focus {
    outline: none !important;
}

.navbar .search-form button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.navbar .search-form button:hover {
    color: #000;
}

/* Main Background */
.main-bg {
    flex: 1;
    padding: 10px 40px;
    background: #f5f5f5;
}

/* Cards Layout */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, 260px);
    justify-content: center; /* ensures it's centered when columns don't fill full width */
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.card {
    position: relative; /* no longer absolute */
    width: 100%;         /* grid will handle width */
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
    box-sizing: border-box;
}


.card h2 {
    font-size: 14px;
    margin: 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card a {
    text-decoration: none;
    color: #222222;
}

.card .tags {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 260px;
    height: 30px;
    overflow: hidden;
}

.card .tag-button {
  padding: 6px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}


/* Thumbnail Container */
.thumb-container {
    width: 100%;
    background-color: #efefef; /* Invert base color */
    background-image: 
      linear-gradient(45deg, #fff 25%, transparent 25%), 
      linear-gradient(-45deg, #fff 25%, transparent 25%), 
      linear-gradient(45deg, transparent 75%, #fff 75%), 
      linear-gradient(-45deg, transparent 75%, #fff 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Footer */
.footer {
    padding: 15px 0;
    color: white;
    font-size: 14px;
    border-top: 1px solid #ddd;
    background-color: #292e36;
    margin-top: auto;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
}

.footer-left,
.footer-right {
    margin: 5px 0;
}

.footer a {
    color: white;
    text-decoration: none;
    margin: 0 8px;
}

.footer a:hover {
    text-decoration: underline;
}

/* Media Queries */
@media (max-width: 1225px) {
    .main {
        padding: 20px 0;
        margin: 0;
    }

    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-right {
        margin-top: 10px;
    }

    .footer a {
        display: inline-block;
        margin: 6px 8px;
    }
}

@media (max-width: 650px) {
    .navbar form {
        display: none;
    }
}
