/* Base styles */
:root {
    --black: #000000;
    --dark-gray: #302626;
    --white: #ffffff;
    --pink: #811c4a;
    --max-width: 1200px;
    /* let the header shrink on smaller screens */
    --header-height: auto;
}

body {
    margin: 0;
    padding: 0;
    background: var(--black);
    color: var(--white);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Layout */
.layout {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

main,
.main-grid {                    /* both home & article use .main-grid */
    flex: 1 0 auto;
}

/* Header section */
.header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
    /* width: 100%; */
    align-items: center;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-left h1 {
    font-size: 2.5rem;
    margin: 0;
}

.header-left .subtitle {
    font-size: 1.2rem;
    color: #888;
    margin: 0;
}

.header-left img {
    width: clamp(140px, 35vw, 220px);
    height: auto;
}

/* Navigation */
.header-right ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-right a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
}

.header-right a:hover {
    color: var(--pink);
}

.header-right .btn {
    background: var(--pink);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
}

.header-right .btn:hover {
    background: transparent;
    color: var(--pink);
    outline: 2px solid var(--pink);
}

/* Main content */
.main-grid {
    background: var(--dark-gray);
    padding: 4rem 2rem;
}

/* Blog section */
.blogarticles {
    margin: 0 auto;
    padding-left: 10rem;
    padding-right: 10rem;
}

.title h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);  /* Always 3 columns on large screens */
    gap: 5rem;
    margin: 0 auto;
}

.card {
    /* background: rgba(255, 255, 255, 0.05); */
    background: #1a1a1a;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;

    /* Note: This was pushing them off center. */
    /* aspect-ratio: 1; */

    min-height: 400px;
    position: relative;  /* For absolute positioning of button */
}

.threejs-container {
	position: relative;
	width: 100%;
	/* height: 600px; */
	background: #000;
	/* z-index: 9999; */
}

#c {
	width: 100%;
	height: 100%;
	display: block;
}

.threejs h1 {
	color: white;
	text-align: center;
	padding: 20px 0;
	margin: 0;
}

#c canvas {
	background-color: rgba(255,0,0,0.2) !important;
	/* z-index: 9999 !important; */
	position: relative !important;
}

/* Three‑JS box: shrink gracefully */
.threejs-container {
    /* height: clamp(300px, 60vh, 600px); */
}

.centered-text {
	text-align: center;
}

/* .button {
	position: relative;
} */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.subtitle {
	/* font-size: var(--fs-h3); */
	font-size: 1.25rem;
	margin-bottom: 3rem;
	color: '#fcfc';
}

.date {
	font-size: var(--fs-h6) !important;
	color: var(--color-h6) !important;
}

.card-title {
	font-size: var(--fs-h5);
}

.button-wrapper {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
}

.button {
    display: inline-block;
    background: var(--pink);
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover {
    background: transparent;
    outline: 2px solid var(--pink);
    transform: translateY(-2px);
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;  /* Center tags horizontally */
    width: 100%;  /* Ensure full width */
}

.tag {
    background: var(--pink);
    color: var(--white);
    padding: 0.25rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    display: inline-block;  /* Ensure the span takes the full space */
}

.tags a {
    text-decoration: none;
    color: inherit;  /* This ensures the link color matches the tag color */
}

/* Card content */
.card-title {
    font-size: 1.25rem;
    margin: 0;
}

/* Ensure thumbnails don’t overflow */
.card .pra img {
    max-width: 100%;
    height: auto;
}

.date {
    color: #888;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    padding: 2rem;
    text-align: center;
    background: var(--black);
}

.social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.25rem;
}

.social a:hover {
    color: var(--pink);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);  /* 2 columns on medium screens */
    }
}

/*@media (max-width: 768px) {*/
@media (max-width: 900px) {
    .header {
        grid-template-columns: 1fr;
        text-align: center;
    }

   .header-left h1 {
      font-size: clamp(1.5rem, 6vw, 2.5rem);
      word-break: break-word;       /* handles very long words if needed */
      max-width: 90vw;              /* prevents horizontal overflow */
      margin: 0 auto;               /* center it if it wraps */

      font-weight: 600;          /* slightly lighter than default bold */
      letter-spacing: -0.5px;    /* tighten characters very subtly */
   }

    .header-right ul {
        flex-direction: column;
        /* so buttons stretch */
        align-items: stretch;
        gap: .75rem;
    }

    .header-right .btn {
        width: 100%;
        text-align: center;
    }

    .cards {
        grid-template-columns: 1fr;  /* Single column on mobile */
        padding: 0 5vw;
    }

    .card {
        min-height: 300px;  /* Smaller on mobile */
    }
}

/* Responsive card sizes */
@media (min-width: 1200px) {
    .card {
        min-height: 400px;  /* Larger on big screens */
    }
}

@media (max-width: 480px) {
    .card {
        aspect-ratio: auto;   /* let height follow content */
        min-height: 260px;    /* or just `min-height: auto;` */
    }

    /* Stack the UI controls under the canvas on phones */
    #ui-container {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        align-items: center;
    }
}

@media (min-width: 901px) {
    .header {
        justify-content: center;   /* centre the two columns as a group */
    }
}
