/* =================================================================== */
/*    PARTIAL: LAYOUT                                                  */
/*    Contains: Styles for the main page structure, including the      */
/*    main content area, sidebar, article containers, and footer.      */
/* =================================================================== */

main {
    margin: 15px auto; /* Centered top/bottom */
    padding: 0 15px;   /* Symmetrical side gutters */
    margin-bottom: 100px;
    min-width: 259px;
}

.sidebar, article {
    background: var(--eerie-black2);
    border: 1px solid var(--jet);
    border-radius: 20px;
    box-shadow: var(--shadow1);
    z-index: 1;
    padding: 15px;
}

article {
  display: none;
}

article.active {
    display: block;
    animation: fade .5s ease backwards;
}

.separator {
    width: 100%;
    height: 1px;
    background: var(--jet);
    margin: 16px 0;
}

/* --- Sidebar Base --- */

.sidebar {
    margin-bottom: 15px;
    max-height: 145px;
    overflow: hidden;
    padding: 15px;
    transition: var(--transition2);
}

.sidebar.active {
  /* --- SURGICAL FIX: Increased height to prevent clipping social icons --- */
  max-height: 800px; 
}

/* --- Sidebar Header Logic (Shared) --- */
.sidebar-info {
    position: relative;
    display: flex;
    gap: 15px;
}

.info-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
}

.sidebar-logo {
    padding: 0;
}

.sidebar-logo img {
    width: 100%;
    max-width: 140px; /* Locked size to prevent jumping */
    height: auto;
    transition: none; 
}

.avatar-box {
    background: var(--bg-gradient-onyx);
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* =================================================================== */
/*    MOBILE HEADER STABILIZATION (Under 1250px)                       */
/* =================================================================== */
@media (max-width: 1249px) {
    .sidebar-info {
        flex-direction: row;
        justify-content: flex-start;
        /* Anchors logo to top and locks height to prevent dropping */
        align-items: flex-start; 
        padding-top: 15px;
        height: 110px; 
    }

    .info-content {
        align-items: center;
        margin-top: -5px; /* Optically aligns text with the avatar circle */
    }
    
    .avatar-box {
        margin-top: 5px;
        flex-shrink: 0;
    }
}

/* --- Sidebar Content Elements --- */

.info-content .name {
    color: var(--white2);
    font-size: var(--fs3);
    font-weight: var(--fw500);
    letter-spacing: -0.25px;
    margin-bottom: 10px;
}

.info-content .title {
    color: var(--white1);
    background: var(--onyx);
    font-size: var(--fs8);
    font-weight: var(--fw300);
    width: max-content;
    padding: 3px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.info-more-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    border-radius: 0 15px;
    font-size: 13px;
    color: var(--orange-yellow-crayola);
    background: var(--border-gradient-onyx);
    padding: 10px;
    box-shadow: var(--shadow2);
    transition: var(--transition1);
    z-index: 1;
}

.info-more-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: var(--bg-gradient-jet);
    transition: var(--transition1);
    z-index: -1;
}

.info-more-btn ion-icon {
  transition: var(--transition1);
}

.sidebar.active .info-more-btn ion-icon {
  transform: rotate(180deg);
}

.info-more-btn span {
  display: none;
}

.sidebar-info-more {
    opacity: 0;
    visibility: hidden;
    transition: var(--transition2);
}

.sidebar.active .sidebar-info-more {
    opacity: 1;
    visibility: visible;
}

.contacts-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.contact-item {
    min-width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.contact-info {
    max-width: calc(100% - 46px);
    width: calc(100% - 46px);
}

.contact-info :is(.contact-link, time, address) {
    color: var(--white2);
    font-size: var(--fs7);
}

.contact-info address {
  font-style: normal;
}

.contact-title {
    color: var(--light-gray70);
    font-size: var(--fs8);
    text-transform: uppercase;
    margin-bottom: 2px;
}

/* --- SOCIAL LIST ALIGNMENT (Unified Center) --- */
.social-list {
    display: flex;
    /* --- SURGICAL FIX: Centers icons on Mobile and Desktop --- */
    justify-content: center; 
    align-items: center;
    gap: 15px;
    padding-bottom: 4px;
    padding-left: 0; /* Removed offset to ensure true centering */
}

.social-item .social-link {
    color: var(--light-gray70);
    font-size: 18px;
}

.social-item .social-link:hover {
  color: var(--light-gray);
}

/* --- "Now" Sidebar Section --- */
.sidebar-now-section {
    padding: 10px 15px;
    background: var(--bg-gradient-jet);
    border-radius: 12px;
    border: 1px solid var(--jet);
    margin-top: 15px;
}

.sidebar-now-section h4 {
  margin-bottom: 15px;
  color: var(--light-gray);
  font-weight: var(--fw500);
}

.sidebar-now-section .now-content p {
  font-size: var(--fs7);
  color: var(--light-gray70);
  line-height: 1.6;
}

/* --- Site Footer --- */
.site-footer {
  padding: 30px 15px;
  margin-top: 30px;
  text-align: center;
  font-size: var(--fs8);
  color: var(--light-gray70);
  border-top: 1px solid var(--jet);
  width: 100%;
}

.site-footer p {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--light-gray70);
    margin-top: 15px;
}

.footer-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  padding-left: 0;
  list-style: none;
}

.footer-link {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    border-bottom: 1px solid var(--orange-yellow-crayola);
    color: var(--white2);
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-left: 0;
}

/* =================================================================== */
/*    DESKTOP RESPONSIVE BREAKPOINT (Over 1250px)                      */
/* =================================================================== */
@media (min-width: 1250px) {

    main {
        max-width: 1200px;
        margin-inline: auto;
        display: flex;
        justify-content: center;
        align-items: stretch;
        gap: 25px;
    }

    .main-content {
        flex: 1;
        min-width: 0;
        margin: 0;
    }

    .sidebar {
        flex-shrink: 0;
        width: 300px;      
        position: sticky;
        top: 60px;
        /* --- SURGICAL FIX: Remove height limits for Desktop to prevent clipping --- */
        max-height: none !important; 
        height: auto;
        margin-bottom: 0;
        padding-top: 60px;
        z-index: 1;
    }

    /* --- CENTERED DESKTOP HEADER --- */
    .sidebar-info {
        flex-direction: column;
        align-items: center !important; /* Force center for Desktop */
        justify-content: center;
        height: auto !important; /* Reset fixed height from mobile */
        padding-top: 0;
        gap: 15px;
    }

    .info-content {
        align-items: center;
        gap: 20px;
    }

    .avatar-box img {
        width: 150px;
        height: auto;
    }

    .info-content .name {
        white-space: nowrap;
        text-align: center;
    }

    .info-content .title {
      margin: auto;
    }

    .info-more-btn {
      display: none;
    }

    .sidebar-info-more {
        opacity: 1;
        visibility: visible;
    }

    .contacts-list {
      grid-template-columns: 1fr;
    }

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

    .main-content.full-width {
        width: 100%;
        min-width: 100%;
        margin: 0;
    }
}