        :root {
            --raja-kalar: #D3364D;
        }

        body {
            background-color: #f9fafb;
            color: #1f2937;
            font-family: "Inter", sans-serif;
        }

        .page-wrap {
            max-width: 72rem;
            /* matches reference's max-w-6xl */
            margin: 0 auto;
            padding: 1rem 1.5rem 2rem;
        }

        #card-count {
            display: block;
            margin-top: 0.125rem;
            font-size: 0.75rem;
            font-weight: 500;
            color: #6b7280;
        }

        /* ---- Gallery & cards ---- */
        .gallery {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 16px;
            padding: 1rem 0 0;
        }

        figure {
            margin: 0;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            text-align: center;
            position: relative;
            background: #ffffff;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        figure:hover {
            border-color: color-mix(in srgb, var(--raja-kalar) 50%, transparent);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        }

        /* Same height for every card; width fixed per orientation so cards of the
           same orientation always line up with identical widths. */
        figure.landscape {
            width: 300px;
        }

        figure.portrait {
            width: 150px;
        }

        .img-container {
            width: 100%;
            height: 210px;
            overflow: hidden;
            position: relative;
            background: #f3f4f6;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
        }

        .img-container img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            cursor: pointer;
            display: block;
        }

        .card-tag-list {
            position: absolute;
            top: 6px;
            left: 6px;
            right: 6px;
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin: 0;
        }

        .tag {
            background-color: rgba(17, 24, 39, 0.82);
            color: #fff;
            font-size: 10px;
            font-weight: normal;
            letter-spacing: 0.02em;
            padding: 2px 6px;
            border-radius: 4px;
            line-height: 1.2;
        }

        figcaption {
            margin-top: 0;
            padding: 8px 10px;
            font-size: 12px;
            font-weight: normal;
            color: #374151;
            text-align: left;
            border-top: 1px solid #f3f4f6;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ---- Modal ---- */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            inset: 0;
            background-color: rgba(17, 24, 39, 0.92);
            align-items: center;
            justify-content: center;
            flex-direction: column;
            color: #fff;
            padding: 20px;
            box-sizing: border-box;
        }

        .modal img {
            max-width: 88vw;
            max-height: 75vh;
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        .modal-caption {
            margin-top: 14px;
            font-size: 15px;
            font-weight: normal;
            text-align: center;
        }

        .modal-tag-box {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 5px;
            max-width: min(88vw, 640px);
        }

        .close {
            position: absolute;
            top: 18px;
            right: 22px;
            font-size: 26px;
            line-height: 1;
            color: #fff;
            cursor: pointer;
            opacity: 0.8;
            transition: opacity 0.15s ease;
        }

        .close:hover {
            opacity: 1;
        }

        .nav-button {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 44px;
            height: 44px;
            background-color: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.25);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #fff;
            cursor: pointer;
            user-select: none;
            transition: background-color 0.15s ease;
        }

        .nav-button:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }

        .nav-prev {
            left: 20px;
        }

        .nav-next {
            right: 20px;
        }

        @media (max-width: 640px) {
            .page-wrap {
                padding: 0.875rem 1rem 1.5rem;
            }
        }
