/* ==========================================================================
   1. MODERN CSS RESET
   Ensures consistent sizing and behavior across all browser types.
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   2. FLUID ROOT SIZING
   Scales all webpage text together based on the screen width.
   ========================================================================== */
html {
  /* Minimum: 15px on small screens
     Fluid: 13.5px base + 0.5% of the screen width
     Maximum: 19px on giant monitors */
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  
  /* Enables smooth scrolling when linking to page anchors */
  scroll-behavior: smooth; 
}

/* ==========================================================================
   3. GLOBAL BODY STYLES
   Sets up global defaults for the page text layout.
   ========================================================================== */
body {
  /* Inherits the fluid size from html, but applies comfortable line spacing */
  font-size: 1rem; 
  line-height: 1.6;
  
  /* System font stack for optimal readability and performance */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #212529;
  background-color: #f8f9fa;
  
  /* Improves text rendering across browsers */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   4. RESPONSIVE HEADINGS & PARAGRAPHS
   All sizes use 'rem' units so they multiply cleanly against the root size.
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: #1a1a1a;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.5em; /* Dynamic spacing relative to the heading's own size */
}

/* Headings safely cascade in scale */
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p, ul, ol {
  margin-bottom: 1.25rem; /* Creates clean spacing between blocks of text */
}

/* ==========================================================================
   5. OTHER INTERACTIVE FLUID ELEMENTS
   ========================================================================== */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, .button {
  display: inline-block;
  font-size: 1rem; /* Dynamically resizes alongside body text */
  padding: 0.5em 1.2em;
  background-color: #0066cc;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #0052a3;
}

/* front page thumbnail elements */



.thumb {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    margin: 0 auto;

}

.related-thumb {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    margin: 0 auto;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.related-card {
    text-align: center;
}

.related-card h3 {
    font-size: 0.8rem;
    line-height: 1.4;
    font-weight: bold;
    margin-top: 6px;
    margin-bottom: 6px;
}



.download-card {
    padding: 8px;
    background: transparent;
}

.download-card h2,
.download-card h3 {
    font-size: 1rem;
    line-height: 1.3;
    margin-top: 10px;
    margin-bottom: 8px;
}

.download-card h4 {
    opacity: 0;
    width: 100%;
    max-width: 220px;
    margin: 4px auto 0;
    font-size: 0.65rem;
    line-height: 1.2;
    text-align: center;
}

.download-card:hover h4 {
    opacity: 1;
}

    font-size: 1rem;
    line-height: 1.3;
    margin-top: 10px;
    margin-bottom: 8px;
}

.download-card p {
    font-size: 0.75rem;
    line-height: 1.4;
    margin-top: 8px;
}

.thumb-link {
    position: relative;
    display: block;
    text-decoration: none;
}

.thumb-link .thumb {
    display: block;
}

.thumb-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.25;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.thumb-link:hover .thumb-title,
.thumb-link:focus .thumb-title {
    opacity: 1;
}



.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}#search-results {
    margin-top: 10px;
    text-align: left;
}

.search-result {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.search-result a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-decoration: none;
}

.search-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 4px;
}

.search-result-text {
    display: block;
}

.search-result-text strong {
    display: block;
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 4px;
}

.search-result-text small {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
}

.search-all {
    margin-top: 10px;
    text-align: center;
}

.search-all a {
    font-size: 0.85rem;
    font-weight: bold;
}

.search-all {
    margin-top: 10px;
    text-align: center;
}

.search-all a {
    font-size: 0.85rem;
    font-weight: bold;
}

.full-search-thumb {
    width: 90px;
    max-width: 90px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 6px;
}

.full-search-result {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.full-search-result a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
}

.full-search-text {
    display: block;
    padding-top: 2px;
}

.full-search-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.full-search-text small {
    display: block;
    font-size: 0.85rem;
    line-height: 1.35;
	
}




/* ==========================================================
   SIDEBAR
   ========================================================== */

.site-sidebar {
    padding: 10px;
    background-color: #d5e6f7;
}

.sidebar-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.sidebar-section h2 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 10px;
}


/* Search */

.sidebar-section input[type="search"] {
    width: 100%;
    max-width: 220px;
    padding: 6px;
    box-sizing: border-box;
}

/* Search form */

#sidebar-search-form {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

#sidebar-search-form input[type="search"] {
    flex: 1 1 150px;
    width: auto;
    max-width: 220px;
    padding: 6px;
    box-sizing: border-box;
}

#sidebar-search-form button {
    padding: 6px 10px;
    cursor: pointer;
}


/* Sidebar image grid */

.sidebar-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.sidebar-featured {
    width: 100%;
}

.sidebar-thumb-link {
    position: relative;
    display: block;
    width: 140px;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.sidebar-featured-thumb {
    width: 100%;
    max-width: 140px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 5px;
    margin: 0 auto;
}

/* Homepage introduction */

.home-intro {
    text-align: center;
    padding: 10px 20px 20px;
}

.home-intro h1 {
    font-size: 1.6rem;
    margin: 0 0 8px;
}

.home-intro p {
    margin: 6px 0;
}

.home-intro a {
    font-weight: bold;
}


/* Hover title */

.sidebar-thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    padding: 5px 4px;

    background: rgba(0, 0, 0, 0.75);
    color: white;

    text-align: center;
    font-size: 0.65rem;
    line-height: 1.2;

    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-thumb-link:hover .sidebar-thumb-title {
    opacity: 1;
}

/* ==========================================================
   ADVERTISING
   ========================================================== */
.content-ad {
    margin: 25px auto;
    padding: 10px 0;
    text-align: center;
}

.sidebar-ad {
    margin: 25px auto;
    padding: 10px 0;
    text-align: center;
}

/* ==========================================================
   SITE HEADER
   ========================================================== */

.site-header {
    width: 98%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 70px;

    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    flex: 0 1 300px;
}

.header-logo img {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

.header-spacer {
    flex: 1;
}

.header-right {
    flex: 0 1 300px;
}


/* ==========================================================
   MOBILE HEADER
   ========================================================== */

@media (max-width: 600px) {

    .site-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-logo {
        flex: 0 1 100%;
    }

    .header-logo img {
        margin: 0 auto;
    }

    .header-right {
        flex: 0 1 100%;
        text-align: center;
    }

}

/* ==========================================================
   MAIN PAGE LAYOUT
   ========================================================== */

.page-layout {
    display: grid;
    grid-template-columns: 25% 75%;
    align-items: start;
}

.sidebar-column {
    min-width: 0;
}

.main-column {
    min-width: 0;
    padding: 0 10px;
}


/* ==========================================================
   MOBILE PAGE LAYOUT
   ========================================================== */

@media (max-width: 600px) {

    .page-layout {
        grid-template-columns: 1fr;
    }

    .main-column {
        padding: 0 10px;
    }

    .sidebar-column {
        order: 2;
    }

    .main-column {
        order: 1;
    }

}

/* ==========================================================
   DOWNLOAD PAGE - RESPONSIVE IMAGE AND INFORMATION
   ========================================================== */

/* Desktop */

.download-image {
    width: 73%;
    vertical-align: top;
}

.download-spacer {
    width: 2%;
}

.download-info {
    width: 25%;
    vertical-align: top;
}


/* Mobile */

@media (max-width: 600px) {

    .download-image,
    .download-info {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    .download-spacer {
        display: none;
    }

}

/* ==========================================================
   SITE FOOTER
   ========================================================== */

.site-footer {
    width: 98%;
    max-width: 1400px;
    margin: 30px auto 0;
    padding: 20px 10px;
    text-align: center;
    font-size: 0.75rem;
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    margin: 0 6px;
}

.site-footer p {
    margin: 0;
    font-size: 0.7rem;
}

.content-ad {
    margin: 25px auto;
    padding: 10px 0;
    text-align: center;
}

/* ==========================================================
   HOMEPAGE CATEGORY PREVIEWS
   ========================================================== */

.category-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.category-preview-item {
    width: 100%;
}

.category-preview-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.category-preview-thumb {
    width: 70px !important;
    height: 70px !important;
    max-width: 70px !important;
    object-fit: cover;
    flex: 0 0 70px;
    border-radius: 5px;
}

.category-preview-title {
    font-size: 1rem;
}

.category-view-all {
    margin-top: 5px;
    margin-bottom: 20px;
}