html {
    background-color: #141c32;
    min-height: 100vh;
}

body { 
    background-color: #141c32;
    background-repeat: repeat;
    color: #ffd014;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-style: normal;
    min-height: 100vh;
    margin: 0;
    padding: 0;

}

header {
        max-height: 4rem;
        padding: 1px 0;
        text-align: center;
        font-size: 16px;
        display: flex;
        align-items: center;
    }

header > div:first-child {
        width: 30%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

header > div:nth-child(2) {
        width: 40%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

header > div:last-child {
        width: 30%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-right: 20px;
    }

/* Index page specific header styles */
.header-container header > div:first-child {
        flex-direction: column;
        gap: 5px;
    }

.header-container header form {
        margin: 0;
        text-align: center;
    }

.header-container header label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
    }

.header-container header input[type="search"] {
        width: 80%;
        max-width: 200px;
    }

.header-container header p {
        margin: 5px 0;
        font-size: 12px;
        text-align: center;
    }

.header-container header h1,
.header_container header h1 {
        margin: 0;
    }

/* Instagram link styles */
.instagram-link {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.instagram-label {
    font-size: 14px;
    color: #ffd014;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

/* Location chip (flag + text) */
.location-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffd014;
}
.location-text {
    font-size: 14px;
    color: #ffd014;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
.location-icon {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}


    /* Smaller circular button for mobile */
    .instagram-link a {
        width: 34px;
        height: 34px;
        border-width: 2px;
    }
.instagram-link a {
    color: #ffd014; /* gold scheme */
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ffd014;
    border-radius: 50%;

    /* Mobile location chip sizes */
    .location-icon {
        width: 28px;
        height: 28px;
    }
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.instagram-link a:hover {
    color: #ffe470; /* lighter gold */
    border-color: #ffe470;
    background-color: rgba(255, 208, 20, 0.12);
    transform: scale(1.05);
}

/* Keep the Instagram glyph (SVG stroke using currentColor) white */
.instagram-link a[href*="instagram.com"] {
    color: #ffffff;
}
.instagram-link a[href*="instagram.com"]:hover {
    color: #ffffff;
}

.instagram-link svg {
    display: block;
}

/* PNG social icon defaults (TikTok) */
.instagram-link img.social-icon {
    display: block;
    width: 32px;
    height: 32px;
}

/* Search result page specific styles */
.header_container header h1 {
        font-size: 22px;
        line-height: 1.2;
    }

/* Search result page button styles */
.header_container header button {
        font-size: 12px;
        height: 40px;
        padding: 5px 15px;
        line-height: 1;
    }

.header_container header a {
        text-decoration: none;
    }

#card-count {
        font-size: 12px;
    }

.card-count-box {
        background-color: #0b233e;
        border: medium double #ffd014;
        border-radius: 8px;
        color: #ffd014;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        font-size: 12px;
        padding: 6px 12px;
        text-align: center;
        white-space: nowrap;
        margin-top: 10px;
    }

#pagination-container {
        position: relative;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 2px;
    }

#pagination-container .card-count-box {
        position: absolute;
        left: 0;
        top: 10px;
    }

#pagination-container .pagination {
        text-align: center;
    }

/* Center the search results heading like the pagination */
.header_container .search-results-title {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

/* Ensure the header's middle column centers its content across the full header
   (overrides the last-child rule that pushed it left). Keeps the left "Return Home"
   button in place while centering the H1 relative to the section. */
.header_container header > div:nth-child(2) {
    width: auto;
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav, section {
        float: left; 
        padding: 20px;
        min-height: 80%;
        box-sizing: border-box;
    }

section {
        width: 70%;
        text-align: center;
    }

nav {
        width: 30%;
        text-align: center; 
    }

footer {
        position:relative;
        height: 15%;
        bottom: 0px;
        clear: both;
        text-align: center;
    }

label{
    margin-right: 28px;
    font-size: clamp(11px, 0.57vw, 22px);
    padding: clamp(3px, 0.16vw, 6px) clamp(8px, 0.42vw, 16px);
}

fieldset {
    border: 2px solid #ffd014;
    border-radius: 16px;
    margin: 10px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box; /* Include border and padding in width calculation */
}

button {
  align-items: center;
  background-color: #0b233e;
  border: medium double #ffd014;
  border-radius: 8px;
  box-sizing: border-box;
  color: #ffd014;
  cursor: pointer;
  display: flex;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: clamp(22px, 1.15vw, 44px);
  height: clamp(44px, 2.3vw, 88px);
  justify-content: center;
  line-height: 1.4;
  max-width: 100%;
  padding: 0 clamp(25px, 1.3vw, 50px);
  position: relative;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  white-space: pre-wrap;
}

button:hover {
  background-color: #0e226f;
}

button:active {
  background-color: #05043e;
}

@media (min-width: 768px) {
  button {
    padding: 0 40px;
  }
}

.filter-control-btn {
  font-size: 16px;
  height: 36px;
  padding: 0 15px !important;
  max-width: 240px;
}

.btn-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    margin: 0.2rem;
    width: 100%;
}

/* Search Results Page */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    max-height: calc(3 * 260px + 2 * 8px + 80px); /* 3 card rows + gaps + pagination height ~80px = ~876px */
    font-size: clamp(13px, 0.68vw, 26px); /* Dynamic scaling from 1920px to 3840px */
}

table caption {
    padding: 10px;
    font-size: 1.1em;
    font-weight: bold;
}

table, th, td {
    border: 1px solid #ffd014;
}

th, td {
    padding: clamp(10px, 0.52vw, 20px);
    text-align: left;
}

th {
    background-color: #0b233e;
    font-weight: bold;
}

td[colspan="4"] {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

table.secondary caption {
    caption-side: bottom;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.page-btn {
    font-size: 16px;
    height: 36px;
    padding: 0 15px;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #141c32;
}

.page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-number {
    font-size: 16px;
    height: 36px;
    width: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.page-number.active {
    background-color: #ffd014;
    color: #141c32;
    border-color: #ffd014;
}

.page-ellipsis {
    color: #ffd014;
    padding: 0 5px;
}

.page-info {
    text-align: center;
    font-size: 16px;
    margin: 10px 0;
}

/* Gallery grid - card binder layout (two 3x3 grids side by side) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) clamp(40px, 2vw, 80px) repeat(3, 1fr); /* 3 cols + gap + 3 cols */
    grid-auto-rows: auto;
    gap: clamp(8px, 0.5vw, 16px);
    align-items: start;
    max-width: clamp(1400px, 72vw, 2800px);
    margin: 0; /* Align left with table */
}

/* Position items in binder order: left page slots 1-9, right page slots 10-18 */
.gallery-anchor:nth-child(1) { grid-column: 1; grid-row: 1; }
.gallery-anchor:nth-child(2) { grid-column: 2; grid-row: 1; }
.gallery-anchor:nth-child(3) { grid-column: 3; grid-row: 1; }
.gallery-anchor:nth-child(4) { grid-column: 1; grid-row: 2; }
.gallery-anchor:nth-child(5) { grid-column: 2; grid-row: 2; }
.gallery-anchor:nth-child(6) { grid-column: 3; grid-row: 2; }
.gallery-anchor:nth-child(7) { grid-column: 1; grid-row: 3; }
.gallery-anchor:nth-child(8) { grid-column: 2; grid-row: 3; }
.gallery-anchor:nth-child(9) { grid-column: 3; grid-row: 3; }
.gallery-anchor:nth-child(10) { grid-column: 5; grid-row: 1; }
.gallery-anchor:nth-child(11) { grid-column: 6; grid-row: 1; }
.gallery-anchor:nth-child(12) { grid-column: 7; grid-row: 1; }
.gallery-anchor:nth-child(13) { grid-column: 5; grid-row: 2; }
.gallery-anchor:nth-child(14) { grid-column: 6; grid-row: 2; }
.gallery-anchor:nth-child(15) { grid-column: 7; grid-row: 2; }
.gallery-anchor:nth-child(16) { grid-column: 5; grid-row: 3; }
.gallery-anchor:nth-child(17) { grid-column: 6; grid-row: 3; }
.gallery-anchor:nth-child(18) { grid-column: 7; grid-row: 3; }

/* Apply same to div children for imagegallery.html */
.gallery-grid > div:nth-child(1) { grid-column: 1; grid-row: 1; }
.gallery-grid > div:nth-child(2) { grid-column: 2; grid-row: 1; }
.gallery-grid > div:nth-child(3) { grid-column: 3; grid-row: 1; }
.gallery-grid > div:nth-child(4) { grid-column: 1; grid-row: 2; }
.gallery-grid > div:nth-child(5) { grid-column: 2; grid-row: 2; }
.gallery-grid > div:nth-child(6) { grid-column: 3; grid-row: 2; }
.gallery-grid > div:nth-child(7) { grid-column: 1; grid-row: 3; }
.gallery-grid > div:nth-child(8) { grid-column: 2; grid-row: 3; }
.gallery-grid > div:nth-child(9) { grid-column: 3; grid-row: 3; }
.gallery-grid > div:nth-child(10) { grid-column: 5; grid-row: 1; }
.gallery-grid > div:nth-child(11) { grid-column: 6; grid-row: 1; }
.gallery-grid > div:nth-child(12) { grid-column: 7; grid-row: 1; }
.gallery-grid > div:nth-child(13) { grid-column: 5; grid-row: 2; }
.gallery-grid > div:nth-child(14) { grid-column: 6; grid-row: 2; }
.gallery-grid > div:nth-child(15) { grid-column: 7; grid-row: 2; }
.gallery-grid > div:nth-child(16) { grid-column: 5; grid-row: 3; }
.gallery-grid > div:nth-child(17) { grid-column: 6; grid-row: 3; }
.gallery-grid > div:nth-child(18) { grid-column: 7; grid-row: 3; }

.gallery-anchor,
.gallery-grid > div {
    display: block;
    background: #081228;
    border: 1px solid #ffd014;
    padding: clamp(6px, 0.4vw, 12px);
    border-radius: clamp(6px, 0.4vw, 12px);
    height: clamp(260px, 13.5vw, 520px); /* taller than wide to emphasize portrait cards */
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.no-results {
    color: #ffd014;
    text-align: center;
    padding: clamp(40px, 2.1vw, 80px);
    font-style: italic;
    font-size: clamp(16px, 0.83vw, 32px);
}

/* Floating Lightbox Gallery */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.lightbox-content {
    position: relative;
    z-index: 2;
    width: 95%;
    height: 90%;
    display: grid;
    grid-template-columns: 1fr clamp(350px, 18vw, 700px);
    gap: clamp(15px, 0.78vw, 30px);
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: clamp(-40px, -2.1vw, -80px);
    right: 0;
    background: none;
    border: none;
    color: #ffd014;
    font-size: clamp(40px, 2.1vw, 80px);
    cursor: pointer;
    padding: 0;
    width: clamp(40px, 2.1vw, 80px);
    height: clamp(40px, 2.1vw, 80px);
    line-height: clamp(40px, 2.1vw, 80px);
    z-index: 3;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-main {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.lightbox-zoom-view {
    width: 100%;
    height: calc(100% - 70px);
    background-color: rgba(20, 28, 50, 0.8);
    border-radius: 8px;
    border: 2px solid #ffd014;
    overflow: hidden;
}

.lightbox-zoom-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.lightbox-sidebar {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 15px;
}

.lightbox-thumbnails-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.lightbox-thumbnails-label {
    color: #ffd014;
    font-size: clamp(11px, 0.57vw, 22px);
    font-weight: bold;
    text-align: left;
    display: inline-block;
    border: 1px solid #ffd014;
    background-color: rgba(20, 28, 50, 0.8);
    padding: clamp(3px, 0.16vw, 6px) clamp(8px, 0.42vw, 16px);
    border-radius: 3px;
    width: fit-content;
}

.lightbox-preview-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.lightbox-preview {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(20, 28, 50, 0.8);
    border-radius: clamp(4px, 0.21vw, 8px);
    border: clamp(2px, 0.1vw, 4px) solid #ffd014;
    padding: clamp(8px, 0.42vw, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

.lightbox-preview-label {
    color: #ffd014;
    font-size: clamp(11px, 0.57vw, 22px);
    font-weight: bold;
    text-align: right;
    display: inline-block;
    border: 1px solid #ffd014;
    background-color: rgba(20, 28, 50, 0.8);
    padding: clamp(3px, 0.16vw, 6px) clamp(8px, 0.42vw, 16px);
    border-radius: 3px;
    width: fit-content;
    margin-left: auto;
}

.lightbox-preview-hint {
    color: #ffd014;
    font-size: clamp(11px, 0.57vw, 22px);
    text-align: center;
    font-style: italic;
    display: inline-block;
    border: 1px solid #ffd014;
    background-color: rgba(20, 28, 50, 0.8);
    padding: clamp(3px, 0.16vw, 6px) clamp(8px, 0.42vw, 16px);
    border-radius: 3px;
    width: fit-content;
    margin: 0 auto;
}

.lightbox-nav-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.lightbox-prev,
.lightbox-next {
    background-color: rgba(11, 35, 62, 0.8);
    border: 2px solid #ffd014;
    border-radius: 8px;
    color: #ffd014;
    font-size: 24px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-down {
    background-color: rgba(11, 35, 62, 0.8);
    border: 2px solid #ffd014;
    border-radius: 8px;
    color: #ffd014;
    font-size: 24px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.lightbox-prev:hover:not(:disabled),
.lightbox-next:hover:not(:disabled) {
    background-color: rgba(14, 34, 111, 0.9);
}

.lightbox-down:hover:not(:disabled) {
    background-color: rgba(14, 34, 111, 0.9);
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.lightbox-down:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(8px, 0.42vw, 16px);
    padding: clamp(8px, 0.42vw, 16px);
    background-color: rgba(20, 28, 50, 0.8);
    border-radius: clamp(4px, 0.21vw, 8px);
    border: clamp(2px, 0.1vw, 4px) solid #ffd014;
    width: 100%;
    box-sizing: border-box;
}

.lightbox-thumb {
    width: 100%;
    aspect-ratio: 1;
    cursor: pointer;
    border: clamp(2px, 0.1vw, 4px) solid transparent;
    border-radius: clamp(4px, 0.21vw, 8px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(11, 35, 62, 0.5);
    position: relative;
}

.lightbox-thumb:hover {
    border-color: #ffd014;
}

.lightbox-thumb.active {
    border-color: #ffd014;
    background-color: rgba(14, 34, 111, 0.8);
}

.lightbox-thumb.active::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(24px, 1.25vw, 48px);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.lightbox-preview {
    position: relative;
    width: 100%;
    background-color: rgba(20, 28, 50, 0.8);
    border-radius: 8px;
    border: 2px solid #ffd014;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

.lightbox-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.lightbox-zoom-indicator {
    position: absolute;
    width: clamp(40px, 2.1vw, 80px);
    height: clamp(40px, 2.1vw, 80px);
    border: clamp(2px, 0.1vw, 4px) solid #ffd014;
    border-radius: 50%;
    pointer-events: none;
    background-color: rgba(255, 208, 20, 0.2);
    display: none;
}

.lightbox-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Mobile Responsive Styles */

/* Hide mobile-only elements on desktop */
.mobile-card-view,
.mobile-lightbox {
    display: none !important;
}

/* Hint shown only in tablet / landscape layouts (default hidden) */
.mobile-landscape-hint {
    display: none;
}

/* Tablet breakpoint (768px and below) */
@media (max-width: 768px), (max-height: 768px) and (orientation: landscape) {
    /* Header layout: Page name left, search right */
    .header-container header {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 10px;
        max-height: none;
    }

    /* Search results page title: two lines on mobile */
    .search-results-title .title-dash {
        display: none;
    }

    .search-results-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .search-results-title .title-line-two {
        display: block;
    }

    .header-container header > div:first-child {
        width: auto;
        order: 2; /* Search on right */
    }

    .header-container header > div:nth-child(2) {
        width: auto;
        order: 1; /* Title on left */
    }

    .header-container header > div:last-child {
        width: 100%;
        order: 3; /* Instagram below on its own line */
        justify-content: flex-start;
        padding-right: 0;
        padding-left: 10px;
        margin-top: 10px;
    }

    .instagram-link svg {
        width: 28px;
        height: 28px;
    }

    .instagram-link img.social-icon {
        width: 28px;
        height: 28px;
    }

    .instagram-label {
        font-size: 11px;
    }

    .header-container header h1 {
        font-size: 18px;
        margin: 0;
    }

    .header-container header form {
        flex-direction: column;
        gap: 5px !important;
    }

    .header-container header label {
        font-size: 10px;
    }

    .header-container header input[type="search"] {
        width: 100%;
        max-width: 150px;
        font-size: 12px;
        padding: 5px;
    }

    /* Stack navigation sections vertically */
    .nav-container {
        display: flex;
        flex-direction: column;
    }

    nav, section {
        width: 100%;
        float: none;
        padding: 10px;
    }

    /* Multiple set search */
    nav fieldset {
        margin: 5px;
        padding: 8px;
    }

    nav legend {
        font-size: 14px;
    }

    /* Single set search buttons */
    section fieldset {
        margin: 5px;
        padding: 8px;
    }

    section legend {
        font-size: 14px;
    }

    /* Adjust button sizes for touch */
    button {
        font-size: 12px;
        height: 36px;
        padding: 0 15px;
    }

    /* Checkbox labels */
    label {
        font-size: 11px;
        padding: 4px 8px;
        margin-right: 10px;
    }

    /* Increase checkbox size for touch */
    input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
}

/* Phone breakpoint (480px and below) */
@media (max-width: 480px), (max-height: 480px) and (orientation: landscape) {
    /* Even smaller header */
    .header-container header h1 {
        font-size: 14px;
    }
    
    /* Search results page header */
    .header_container header h1 {
        font-size: 12px;
        line-height: 1.2;
    }
    
    /* Search results page button */
    .header_container header button {
        font-size: 10px;
        height: 36px;
        padding: 0 10px;
    }

    .header-container header input[type="search"] {
        max-width: 120px;
        font-size: 11px;
    }

    .header-container header label {
        font-size: 9px;
    }

    /* Smaller buttons */
    button {
        font-size: 10px;
        height: 32px;
        padding: 0 10px;
    }

    /* Smaller labels */
    label {
        font-size: 10px;
        padding: 3px 6px;
        margin-right: 8px;
    }

    /* Fieldsets */
    nav fieldset, section fieldset {
        margin: 3px;
        padding: 6px;
    }

    nav legend, section legend {
        font-size: 12px;
    }

    /* Checkboxes */
    input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
}

/* Mobile Search Results - Swipeable Card View */
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-portrait-hint {
        order: 3;
        display: block;
        color: #ffd014;
        font-size: clamp(10px, 0.4vw, 12px);
        text-align: center;
        margin-top: 8px;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        background-color: rgba(20, 28, 50, 0.8);
        border: 1px solid #ffd014;
        padding: clamp(4px, 0.3vw, 6px) clamp(8px, 0.6vw, 12px);
        border-radius: 6px;
        box-sizing: border-box;
        max-width: 260px;
        width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
    }
}
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-portrait-hint {
        display: block;
        color: #ffd014;
        font-size: clamp(10px, 0.4vw, 12px);
        text-align: center;
        margin-top: 8px;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        background-color: rgba(20, 28, 50, 0.8);
        border: 1px solid #ffd014;
        padding: clamp(4px, 0.3vw, 6px) clamp(8px, 0.6vw, 12px);
        border-radius: 6px;
        box-sizing: border-box;
        max-width: 260px;
        width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
    }
}
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-card-position .mobile-nav-btn,
    .mobile-card-down-row .mobile-nav-btn {
        width: auto;
        max-height: 28px;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 8px;
    }
}
@media (max-width: 768px) and (orientation: portrait) {
    .mobile-card-view {
        display: flex;
        flex-direction: column;
    }
    .mobile-card-down-row {
        order: 4;
        width: 100%;
        max-width: 500px;
    }
}
@media (max-width: 768px), (max-height: 768px) and (orientation: landscape) {
    /* Hide desktop table and gallery on search results page */
    .header_container .nav-container nav,
    .header_container .nav-container section {
        display: none;
    }

    /* Show mobile view */
    .mobile-card-view {
        display: flex !important;
    }

    /* Mobile card swipe container */
    .mobile-card-view {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px;
        height: calc(100vh - 80px);
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-card-info {
        width: 100%;
        max-width: 500px;
        background-color: rgba(11, 35, 62, 0.9);
        border: 2px solid #ffd014;
        border-radius: 8px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 10px;
        margin-bottom: 5px;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 2px;
        min-height: 80px;
        order: 1;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .mobile-card-container {
        position: relative;
        width: 100%;
        max-width: 500px;
        height: 60vh;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
        order: 2;
    }

    .mobile-card-position {
        text-align: center;
        color: #ffd014;
        font-size: 16px;
        margin-top: 10px;
        font-weight: bold;
        order: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        width: 100%;
        max-width: 500px;
    }

    .mobile-card-position-text {
        color: #ffd014;
        font-size: 16px;
        font-weight: bold;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .mobile-card-image-wrapper {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(20, 28, 50, 0.8);
        border: 2px solid #ffd014;
        border-radius: 8px;
        padding: 10px;
        box-sizing: border-box;
    }

    .mobile-card-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
    }

    .mobile-card-info-row {
        display: flex;
        align-items: center;
        font-size: 14px;
    }

    .mobile-card-info-row:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
    }

    .mobile-card-info-row:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
    }

    .mobile-card-info-row:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .mobile-card-info-row:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-end;
    }

    .mobile-card-info-label {
        font-weight: bold;
        color: #ffd014;
        margin-right: 5px;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .mobile-card-info-value {
        color: #ffd014;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .mobile-nav-btn {
        background-color: rgba(11, 35, 62, 0.8);
        border: 2px solid #ffd014;
        border-radius: 50%;
        color: #ffd014;
        font-size: 24px;
        width: 50px;
        height: 50px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mobile-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .mobile-nav-btn:hover:not(:disabled) {
        background-color: rgba(14, 34, 111, 0.9);
    }

    .mobile-loading {
        text-align: center;
        color: #ffd014;
        font-size: 16px;
        padding: 20px;
    }

    /* Hide landscape-only elements in portrait */
    .mobile-sidebar-landscape {
        display: none;
    }

    .mobile-landscape-title,
    .mobile-landscape-nav,
    .mobile-landscape-home,
    .mobile-card-info-landscape {
        display: none;
    }

    /* Show portrait info box */
    .mobile-card-info-portrait {
        display: grid;
    }

    /* Mobile Lightbox Gallery */
    .mobile-lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.95);
        z-index: 10000;
        display: none;
        flex-direction: column;
    }

    .mobile-lightbox.active {
        display: flex !important;
    }

    .mobile-lightbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        background-color: rgba(11, 35, 62, 0.9);
        border-bottom: 2px solid #ffd014;
        flex-shrink: 0;
    }

    .mobile-lightbox-title {
        color: #ffd014;
        font-size: 14px;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    }

    .mobile-lightbox-close {
        background: none;
        border: none;
        color: #ffd014;
        font-size: 32px;
        cursor: pointer;
        padding: 0;
        width: 40px;
        height: 40px;
        line-height: 32px;
    }

    .mobile-lightbox-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mobile-lightbox-main {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        overflow: hidden;
        position: relative;
    }

    .mobile-lightbox-image {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .mobile-lightbox-nav {
        position: absolute;
        top: 50%;
        width: 100%;
        display: flex;
        justify-content: space-between;
        transform: translateY(-50%);
        pointer-events: none;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .mobile-lightbox-nav button {
        pointer-events: all;
        background-color: rgba(11, 35, 62, 0.8);
        border: 2px solid #ffd014;
        border-radius: 50%;
        color: #ffd014;
        font-size: 24px;
        width: 50px;
        height: 50px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-lightbox-nav button:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .mobile-lightbox-thumbnails {
        background-color: rgba(11, 35, 62, 0.9);
        border-top: 2px solid #ffd014;
        padding: 10px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: minmax(80px, auto);
        gap: 8px;
        overflow-y: auto;
        max-height: 200px;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-lightbox-thumb {
        width: 100%;
        height: 100%;
        min-height: 80px;
        border: 2px solid transparent;
        border-radius: 4px;
        cursor: pointer;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(20, 28, 50, 0.8);
    }

    .mobile-lightbox-thumb.active {
        border-color: #ffd014;
    }

    .mobile-lightbox-thumb img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}

/* Mobile Landscape Orientation and Tablet */
@media (max-height: 768px) and (orientation: landscape), (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .mobile-portrait-hint {
        display: none !important;
    }
    /* Lightbox thumbnails to the right */
    .mobile-lightbox-content {
        flex-direction: row;
    }

    .mobile-lightbox-main {
        flex: 1;
    }

    .mobile-lightbox-thumbnails {
        border-top: none;
        border-left: 2px solid #ffd014;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: minmax(80px, auto);
        max-height: 100%;
        max-width: 200px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Search results card view - side-by-side layout */
    .mobile-card-view {
        flex-direction: row;
        height: 100vh;
        padding: 0;
    }

    /* Sidebar on left with all elements */
    .mobile-sidebar-landscape {
        width: 280px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 15px 15px;
        background-color: rgba(8, 18, 40, 0.95);
        border-right: 2px solid #ffd014;
        order: 1;
        overflow-y: auto;
    }

    .mobile-landscape-title {
        display: block;
        order: 1;
    }

    .mobile-landscape-title h2 {
        font-size: 14px;
        line-height: 1.3;
        color: #ffd014;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        font-weight: bold;
        text-align: center;
        margin: 0;
    }

    .mobile-card-info {
        width: 100%;
        margin-bottom: 0;
        order: 2;
    }

    /* Small instructional hint shown under the landscape info box - styled as a compact tip box */
    .mobile-landscape-hint {
        display: block;
        color: #ffd014;
        /* much smaller text */
        font-size: clamp(10px, 0.4vw, 12px);
        text-align: center;
        margin-top: 8px;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        order: 3;
        /* Boxed tip styling similar to .lightbox-preview-hint but compact */
        background-color: rgba(20, 28, 50, 0.8);
        border: 1px solid #ffd014;
        padding: clamp(4px, 0.3vw, 6px) clamp(8px, 0.6vw, 12px);
        border-radius: 6px;
        display: inline-block;
        box-sizing: border-box;
        max-width: 260px;
        width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
    }

    /* Show landscape info, hide portrait info */
    .mobile-card-info-landscape {
        background-color: rgba(11, 35, 62, 0.9);
        border: 2px solid #ffd014;
        border-radius: 8px;
        padding-top: 5px;
        padding-left: 10px;
        padding-right: 10px;
        padding-bottom: 10px;
        margin-bottom: 5px;
        box-sizing: border-box;
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 2px;
        min-height: 80px;
    }

    .mobile-card-info-portrait {
        display: none;
    }

    .mobile-landscape-nav {
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        order: 4;
        flex-wrap: wrap;
    }

    .mobile-landscape-position {
        width: 100%;
        text-align: center;
        color: #ffd014;
        font-size: 11px;
        font-weight: bold;
        font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
        margin-top: 5px;
    }

    .mobile-landscape-nav .mobile-nav-btn {
        width: auto;
        max-height: 28px;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 8px;
    }

    .mobile-landscape-home {
        display: block;
        margin-top: auto;
        text-align: center;
        order: 5;
    }

    .mobile-landscape-home a {
        text-decoration: none;
        display: inline-block;
    }

    .mobile-landscape-home button {
        width: auto;
        font-size: 12px;
        padding: 8px 12px;
    }

    .mobile-card-container {
        flex: 1;
        order: 2;
        height: 100vh;
        max-width: none;
        touch-action: none;
        position: relative;
        z-index: 1;
    }

    .mobile-card-image-wrapper {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide portrait navigation */
    .mobile-card-position {
        display: none;
    }

    /* Hide desktop header in landscape */
    .header_container header {
        display: none;
    }
}

