/* ----------------------------------------------------------------------
 * Max-Width: 950px
 * ----------------------------------------------------------------------*/

@media (max-width: 950px) {

    /* ----------------------------------------------------------------------
     * Header / Footer
     * ----------------------------------------------------------------------*/

    header,
	section,
	footer {
		padding: 1.2rem 1.8rem;
	}

    /* ----------------------------------------------------------------------
     * Grid / Cards
     * ----------------------------------------------------------------------*/

    .grid {
		gap: 1.4rem;
	}

	.grid.split {
		grid-template-columns: 1fr;
	}

}

@media (max-width: 768px) {

	/* ----------------------------------------------------------------------
     * Header / Footer
     * ----------------------------------------------------------------------*/

	header {
		padding: 1rem 1.2rem;
		gap: 0.5rem;
	}

	header, .toolbar {
		flex-wrap: wrap;
	}

	footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
    }

	/* ----------------------------------------------------------------------
     * Menus / Navigation
     * ----------------------------------------------------------------------*/

    .menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		left: 0;
		top: 50%;
		transform: translateY(-50%);
		background: #151c24;
		color: #a3b8d0;
		border: 1px solid #23303e;
		width: 42px;
		height: 42px;
		border-radius: 10px;
		font-size: 1.1rem;
		cursor: pointer;
		z-index: 10;
	}

    nav {
		margin: 0;
		padding: 0;
	}

    .nav-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		background: rgba(0, 0, 0, 0.75);
		backdrop-filter: blur(5px);
		-webkit-backdrop-filter: blur(5px);
		opacity: 0;
		visibility: hidden;
		transition: all 0.3s ease;
		z-index: 9999;
	}

	.nav-overlay.active {
		opacity: 1;
		visibility: visible;
	}

    .menu {
		position: fixed;
		top: 0.2rem !important;
		left: 0.2rem !important;
		width: 260px;
		height: auto;
		max-height: 85vh;
		overflow-y: auto;
		background: #10161d;
		border: 1px solid #23303e;
		border-radius: 16px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		margin: 0 !important;
		padding: 1.25rem;
		gap: 0.5rem;
		list-style: none;
		transform: translateX(calc(-100% - 1rem));
		visibility: hidden;
		transition:
			transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
			visibility 0.3s;
		z-index: 10000;
	}

	.menu.active {
		transform: translateX(0);
		visibility: visible;
	}

	.drawer-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		padding-bottom: 1rem;
		margin-bottom: 0.5rem;
		border-bottom: 1px solid #202a33;
		color: #eef3f9;
		font-weight: 600;
	}

	.close-btn {
		background: transparent;
		border: none;
		color: #9aaec2;
		font-size: 1.2rem;
		cursor: pointer;
	}

	.menu li {
		width: 100%;
		flex: none;
		margin: 0;
	}

	.menu a {
		display: block;
		width: 100%;
		text-align: left;
		padding: 0.75rem 1rem;
		background: #151c24;
		color: #a3b8d0;
		text-decoration: none;
		font-weight: 500;
		border-radius: 12px;
		border: 1px solid #23303e;
		box-sizing: border-box;
	}

	/* ----------------------------------------------------------------------
     * Meta / Tags
     * ----------------------------------------------------------------------*/

	.meta-details {
		flex-wrap: wrap;
		justify-content: flex-start;
	}

	.meta-details time {
		width: 100%;
		margin-left: 0;
		margin-top: 0.2rem;
		padding-right: 0;
		justify-content: flex-start;
	}

    /* ----------------------------------------------------------------------
     * Lists
     * ----------------------------------------------------------------------*/

    .list-grid {
        flex-direction: column;
    }

	/* ----------------------------------------------------------------------
     * Tooltip
     * ----------------------------------------------------------------------*/

	[data-tooltip]::after {
		max-width: min(260px, 80vw);
		white-space: normal;
		word-wrap: break-word;
	}

}

/* ----------------------------------------------------------------------
 * Max-Width: 630px
 * ----------------------------------------------------------------------*/

@media (max-width: 630px) {

    /* ----------------------------------------------------------------------
     * HTML / Body
     * ----------------------------------------------------------------------*/

    body {
		padding: 1rem 0.8rem;
		gap: 1.2rem;
	}

    /* ----------------------------------------------------------------------
     * Header / Footer
     * ----------------------------------------------------------------------*/

	header,
	section,
	footer {
		padding: 1.2rem;
		border-radius: 1.5rem;
	}

	header {
        justify-content: center;
        gap: 0.2rem;
        min-height: auto;
		isolation: auto !important;
		z-index: auto !important;
		transform: none !important;
		filter: none !important;
	}

    footer {
		flex-direction: column;
		text-align: center;
	}

	.header-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 0;
        height: auto;
        min-height: 0;
        margin-bottom: 0.4rem;
    }

    .header-logo img {
		max-width: 220px;
		height: auto;
		display: block;
	}

    /* ----------------------------------------------------------------------
     * Headers / Titles
     * ----------------------------------------------------------------------*/

    .page-title {
        margin: 0;
		padding: 0;
    }

    /* ----------------------------------------------------------------------
     * Grid / Cards
     * ----------------------------------------------------------------------*/

    .grid {
		gap: 1.2rem;
	}

    /* ----------------------------------------------------------------------
     * Article
     * ----------------------------------------------------------------------*/

    section > article {
        flex-direction: column;
		align-items: stretch;
		gap: 1.2rem;
    }

    section > article:not(.card) .poster {
        width: 100%;
		min-width: 0;
		max-width: 360px;
		align-self: center;
    }

    article .content {
        width: 100%;
    }

    article .content .title-row,
    article .content .meta-details {
        align-items: center;
		justify-content: center;
		text-align: center;
    }

    article .content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

	/* ----------------------------------------------------------------------
     * Meta / Tags
     * ----------------------------------------------------------------------*/

	.meta-details time {
		justify-content: center;
	}

    /* ----------------------------------------------------------------------
     * Rating
     * ----------------------------------------------------------------------*/

    article .content .rating-container {
        max-width: 100%;
    }

    .external-badge {
        flex: 1 1 calc(50% - 0.5rem);
		justify-content: center;
    }

    /* ----------------------------------------------------------------------
     * Tables
     * ----------------------------------------------------------------------*/

    .table-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

    .toolbar-left {
		width: 100%;
		justify-content: flex-start;
	}

    .toolbar-left .btn {
		flex: 1;
		justify-content: center;
	}

	.toolbar-right,
	.search-box {
		max-width: 100%;
	}

	.toolbar-right {
		min-width: 0;
	}

    /* ----------------------------------------------------------------------
     * Forms
     * ----------------------------------------------------------------------*/

	form .group {
		min-width: 100%;
	}

    .form-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.toggle-group {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.8rem;
	}

	.form-actions .btn {
		width: 100%;
		padding: 0.55rem 1rem;
	}

    /* ----------------------------------------------------------------------
     * Code Block
     * ----------------------------------------------------------------------*/

    .code-header {
		flex-wrap: wrap;
		gap: 0.6rem;
		padding: 0.75rem 1rem;
	}

	.code-title {
		flex-wrap: wrap;
		gap: 0.4rem;
		max-width: 100%;
	}

	.code-filename {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		max-width: 180px;
	}

	.code-tags {
		display: flex;
		align-items: center;
		gap: 0.5rem;
		margin-left: auto;
	}

	.code-size-tag {
		font-size: 0.7rem;
		padding: 0.1rem 0.35rem;
	}

}

/* ----------------------------------------------------------------------
 * Min-Width: 769px
 * ----------------------------------------------------------------------*/

@keyframes sticky-header-shadow {
	0%, 100% {
		box-shadow: none;
	}
	2%, 92% {
		box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
	}
}

@media (min-width: 769px) {

    /* ----------------------------------------------------------------------
     * Menus / Navigation
     * ----------------------------------------------------------------------*/

    .menu-toggle,
	.drawer-header,
	.nav-overlay {
		display: none !important;
	}

    nav {
		width: 100%;
		margin-top: 0.5rem;
		margin-bottom: 0.8rem;
	}

    .menu {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.menu li {
		flex: 1;
	}

	/* ----------------------------------------------------------------------
     * Tables
     * ----------------------------------------------------------------------*/

	div.table {
		overflow: clip;
		view-timeline-name: --table-scroll;
		view-timeline-axis: block;
	}

	table thead th {
		position: sticky;
		top: 0;
		z-index: 20;
		background: #151c24;
		animation: sticky-header-shadow linear both;
		animation-timeline: --table-scroll;
		animation-range: exit-crossing 0px exit-crossing 100%;
	}

	table caption {
		border-top-left-radius: 11px;
		border-top-right-radius: 11px;
	}

	table:not(:has(caption)) thead th:first-child {
		border-top-left-radius: 11px;
	}

	table:not(:has(caption)) thead th:last-child {
		border-top-right-radius: 11px;
	}

	table tbody tr:last-child th.row-header:first-child,
	table tbody tr:last-child td:first-child {
		border-bottom-left-radius: 11px;
	}

	table tbody tr:last-child td:last-child {
		border-bottom-right-radius: 11px;
	}

	table tbody tr:last-child th,
	table tbody tr:last-child td {
		border-bottom: none;
	}

	table td {
		white-space: normal;
		word-break: break-word;
	}

}