@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@500;800&display=swap");

/* Custom Properties */
:root {
    /* Colors using HSL for better control */
    --color-yellow: hsl(47, 88%, 63%);
    --color-white: hsl(0, 0%, 100%);
    --color-gray-600: hsl(0, 0%, 42%);
    --color-gray-950: hsl(0, 0%, 7%);

    /* Spacing */
    --spacing-50: 4px;
    --spacing-100: 8px;
    --spacing-150: 12px;
    --spacing-200: 24px;

    /* Card dimensions */
    --card-width: 384px;
    --card-image-width: 336px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Figtree", sans-serif;
}

body {
    background: var(--color-yellow);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-200);
    transition: all 0.3s ease;
    font-size: 16px;
}

/* Card Component */
.card {
    border-radius: 20px;
    border: 1px solid var(--color-gray-950);
    background: var(--color-white);
    box-shadow: 8px 8px 0px 0px #000;
    padding: var(--spacing-200);
    width: var(--card-width);
    max-width: 100%;
    transition: all 0.3s ease;
}

.card-image {
    border-radius: 20px;
    overflow: hidden;
    width: var(--card-image-width);
    height: 200px;
    margin-bottom: var(--spacing-200);
}

.card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Styles */
.text-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-150);
    margin-bottom: var(--spacing-200);
}

.tag {
    display: inline-flex;
    padding: var(--spacing-50) var(--spacing-150);
    justify-content: center;
    align-items: center;
    background: var(--color-yellow);
    border-radius: 4px;
    font-weight: 800;
    font-size: 14px;
    width: 82px;
    height: 32px;
}

.date {
    color: var(--color-gray-950);
    font-size: 14px;
}

h1 {
    color: var(--color-gray-950);
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1.5;
}

h1:hover {
    color: var(--color-yellow);
}

.description {
    color: var(--color-gray-600);
    font-size: 16px;
    line-height: 150%;
}

/* Author Section */
.author {
    display: flex;
    align-items: center;
    gap: var(--spacing-150);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0;
    padding: 0;
}

.author-name {
    color: var(--color-gray-950);
    font-size: 14px;
    font-weight: 800;
}

/* Attribution */
.attribution { 
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 11px; 
    text-align: center; 
}

.attribution a { 
    color: hsl(228, 45%, 44%); 
}

/* Responsive Styles */
@media (max-width: 425px) {
    :root {
        --card-width: 100%;
        --card-image-width: 100%;
        --spacing-200: 16px;
    }

    body {
        padding: var(--spacing-100);
    }

    .card {
        box-shadow: 6px 6px 0px 0px #000;
        width: 75%;
    }

    h1 {
        font-size: 20px;
    }

    .description {
        font-size: 14px;
    }
}

.view-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: var(--color-white);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.view-switcher button {
    padding: 8px 16px;
    border: 1px solid var(--color-gray-950);
    background: var(--color-white);
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Figtree', sans-serif;
}

.view-switcher button.active {
    background: var(--color-yellow);
}

/* Force Desktop View */
.force-desktop {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.force-desktop .card {
    width: var(--card-width);
    max-width: var(--card-width);
}

.force-desktop .card-image {
    width: var(--card-image-width);
}

/* Force Mobile View */
.force-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: var(--spacing-100, 8px);
}

.force-mobile .card {
    width: 375px;
}

.force-mobile .card-image {
    width: 100%;
}