/* ===== RESET & BASE STYLES ===== */
/* Reset margins, padding, and use border-box for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base body styles */
body {
    font-family: "Manrope", sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: hsl(210, 46%, 95%); /* Light gray-blue */
}

/* ===== MAIN LAYOUT ===== */
/* Grid layout for desktop (2 columns) */
main {
    width: 50%; /* Half of viewport width */
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Image takes 1 part, content 1.5 parts */
    border-radius: 0.5rem; /* 8px */
    background-color: white;
    overflow: visible; /* Allows tooltips to overflow */
}

/* Article image */
.image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-top-left-radius: 0.5rem; /* 8px */
    border-bottom-left-radius: 0.5rem; /* 8px */
}

/* ===== RIGHT SECTION (CONTENT) ===== */
.right-section {
    padding: 2rem; /* 32px */
    display: flex;
    flex-direction: column;
    gap: 1rem; /* 16px */
}

/* Article title */
h2 {
    font-weight: 700;
    font-size: 1.375rem; /* 22px */
    color: hsl(217, 19%, 35%); /* Dark gray-blue */
}

/* Article excerpt */
.exp-text {
    font-size: 0.9375rem; /* 15px */
    color: hsl(214, 17%, 51%); /* Medium gray-blue */
}

/* ===== AUTHOR & SHARE SECTION ===== */
.avatar-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Author info container */
.image-name-section {
    display: flex;
    align-items: center;
    gap: 1.25rem; /* 20px */
}

/* Author name and date */
.name-date-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* 4px */
}

/* Author avatar */
.avatar-image {
    width: 3.125rem; /* 50px */
    border-radius: 1.5625rem; /* 25px */
    object-fit: cover;
}

/* Author name */
.name {
    color: hsl(217, 19%, 35%); /* Dark gray-blue */
    font-weight: 700;
    font-size: 0.875rem; /* 14px */
}

/* Publish date */
.date {
    font-size: 0.875rem; /* 14px */
    color: hsl(214, 17%, 51%); /* Medium gray-blue */
}

/* ===== SHARE BUTTON & TOOLTIP ===== */
.share-button {
    background-color: hsl(210, 46%, 95%); /* Light gray-blue */
    padding: 0.5rem; /* 8px */
    border-radius: 1rem; /* 16px */
    cursor: pointer;
    border: none;
    position: relative; /* For absolute positioning of tooltip */
}

/* Share icon color */
.svg-img path {
    fill: #6E8098; /* Default icon color (gray-blue) */
}

/* Active state for share button */
.share-button-background-color {
    background-color: #6E8098; /* Darker gray-blue */
}

/* Active state for share icon */
.svg-img-background-color path {
    fill: hsl(210, 46%, 95%); /* Light gray-blue */
}

/* Share tooltip (hidden by default) */
.hidden-con {
    background-color: hsl(217, 19%, 35%); /* Dark gray-blue */
    align-items: center;
    padding: 1rem 2rem; /* 16px 32px */
    gap: 1rem; /* 16px */
    border-radius: 0.5rem; /* 8px */
    color: hsl(212, 23%, 69%); /* Light gray-blue */
    font-size: 0.75rem; /* 12px */
    bottom: 3.125rem; /* 50px */
    right: -5.875rem; /* -94px */
    display: none;
    position: absolute;
}

/* Tooltip text (prevents wrapping) */
.nowrap-para {
    white-space: nowrap;
}

/* Tooltip arrow (triangle) */
.hidden-con::after {
    content: "";
    position: absolute;
    bottom: -0.625rem; /* -10px */
    left: 50%;
    transform: translateX(-50%);
    border-left: 0.625rem solid transparent; /* 10px */
    border-right: 0.625rem solid transparent; /* 10px */
    border-top: 0.625rem solid hsl(217, 19%, 35%); /* 10px */
}

/* Class to show tooltip (via JS) */
.show-con {
    display: flex;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 50rem) { /* 800px */
    main {
        width: 90%; /* More width for small screens */
        grid-template-columns: 1fr; /* Single column layout */
        overflow: hidden;
        position: relative;
    }
    
    /* Adjust image border radius */
    .image {
        border-top-right-radius: 0.5rem; /* 8px */
        border-bottom-left-radius: 0;
    }
    
    /* Reduce padding */
    .right-section {
        padding: 1.5rem; /* 24px */
    }
    
    /* Smaller title */
    h2 {
        font-size: 1.125rem; /* 18px */
    }

    /* Reposition share button */
    .share-button {
        position: static; /* Reset for mobile layout */
        z-index: 10;
        margin-top: 1.5rem; /* 24px */
    }

    /* Override active state for mobile */
    .share-button-background-color {
        background-color: hsl(210, 46%, 95%); /* Light gray-blue */
    }

    /* Mobile tooltip styles */
    .hidden-con {
        bottom: 0;
        right: 0;
        left: 0;
        height: 4.625rem; /* 74px */
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        z-index: -1; /* Push behind content */
        margin-top: -1.25rem; /* -20px */
    }

    /* Active icon color for mobile */
    .svg-img-background-color path {
        fill: white;
    }
    
    /* Hide tooltip arrow on mobile */
    .hidden-con::after {
        display: none;
    }
}