/*
Theme Name: Kolling Institute Theme
Author: University of Sydney WordPress Team
Description: Kolling Institute Theme V1.1 (Refactored 7 April 2026)
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 8
Text Domain: kolling-institute-theme
*/

/* ----------------------------------------
   1. VARIABLES & RESET
---------------------------------------- */
:root { 
  --admin-bar-h: 0px; 
}

body.admin-bar { 
  --admin-bar-h: 32px; 
}

@media (max-width: 782px) {
  body.admin-bar { --admin-bar-h: 46px; }
}

/* Neutralise common layout containers that break sticky positioning */
.wp-site-blocks,
.wp-block-template-part,
header,
.wp-block-group {
  overflow: visible !important;
  transform: none !important;
}

/* ----------------------------------------
   2. GLOBAL STYLES
---------------------------------------- */
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* Desktop hover precision */
@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration: underline; }
}

.wp-block-quote {
  border-left: 1px solid #686868 !important;
  margin: 2em 0 !important;
}

.post-categories { font-weight: 300; }

.no-gap { margin-block-start: 0; }

/* ----------------------------------------
   3. HEADER & NAVIGATION
---------------------------------------- */

/* Sticky Logic (Desktop Only) */
@media screen and (min-width: 1021px) {
    .wp-block-template-part:has(> header.sticky-header) {
        position: sticky !important;
        top: var(--admin-bar-h);
        z-index: 9999;
    }
    
    header.sticky-header {
        position: relative !important;
    }
}

.desktop-header, .tablet-header, .mobile-header {
  padding: 25px;
}

.desktop-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-inline: var(--wp--preset--spacing--30);
  gap: 0;
}

.desktop-nav {
  --wp--style--block-gap: var(--wp--preset--spacing--40);
  font-size: 17px;
}

.desktop-nav.desktop-nav--center {
  font-size: 18px;
}

.desktop-header a {
  color: var(--wp--preset--color--base);
}

.desktop-header .wp-block-navigation a,
.desktop-header .wp-block-navigation__container a,
.desktop-header .wp-block-navigation-item a {
  font-weight: 400 !important;
}

/* Mobile Dropdown Icon */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
    display: block;
}

/* ----------------------------------------
   4. SEARCH COMPONENT
---------------------------------------- */
.wp-block-search {
    width: auto;
    min-width: 160px;
}

.wp-block-search__button-inside .wp-block-search__inside-wrapper {
    display: flex !important;
    align-items: center !important;
    border: 2px solid #ffffff !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    background: transparent !important;
    height: 34px !important;
}

.wp-block-search.aligncenter .wp-block-search__inside-wrapper {
  margin: auto;
}

.wp-block-search .wp-block-search__input {
  border-radius: 3.125rem;
}

.wp-block-search__button.has-icon {
    line-height: 0;
}

.wp-block-search__button {
    padding: 0 4px !important;
    margin: 0;
    width: 50px;
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 16px !important;
    cursor: pointer;
}

.wp-block-search__input {
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    font-size: 14px !important;
    width: 100% !important; /* Fixed: allows parent to control width */
    padding: 0 6px !important;
}

input.wp-block-search__input::placeholder,
.wp-block-search__input::placeholder {
    color: #fff !important;
    opacity: 1;
}

/* ----------------------------------------
   5. TEAM & CONTENT BLOCKS
---------------------------------------- */
.team-member {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  width: 100%;
  margin-bottom: 1rem;
  box-sizing: border-box;
  padding-right: 40px;
}

.team-member-content {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.team-member img {
  width: 180px;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  display: block;
}

.team-member-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
  color: #007ed5;
}

.break-terms a {
  display: block !important;
  margin-bottom: 1px;
  text-decoration: none !important;
  color: #007ed5;
}

/* Research Area / News Links */
.research-area-links, 
.research-group-links {
    list-style: none; 
    padding: 0;       
    margin: 0;        
}

.research-area-links li, 
.research-group-links li {
    margin-bottom: 8px;
    padding: 0;
}

.research-area-links li a,
.research-group-links li a {
    font-weight: 400; 
    font-size: 0.9rem;   
    text-decoration: none; 
}

.research-area-links li a:hover,
.research-group-links li a:hover {
    color: #000;
}

/* ----------------------------------------
   6. PAGINATION
---------------------------------------- */
.wp-block-query-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding: 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  font-family: inherit;
}

.wp-block-query-pagination-numbers .current {
  background-color: #00558c;
  color: #fff;
  border: 1px solid #00558c;
  padding: 4px 8px;
}

/* ----------------------------------------
   7. RESPONSIVE BREAKPOINTS
---------------------------------------- */

/* Tablet (950px to 1020px) */
@media screen and (min-width: 950px) and (max-width: 1020px) {
  .desktop-header, .mobile-header { display: none !important; }
  .tablet-header { display: block !important; }
}

/* Desktop Visibility (1021px+) */
@media screen and (min-width: 1021px) {
  .mobile-header, .tablet-header { display: none !important; }
  .desktop-header { display: block !important; }
}

/* Team Grid (Desktop Only) */
@media (min-width: 901px) {
  body.page .team-block-page,
  body.page .team-block-post {
    display: flex;
    flex-wrap: wrap;
    gap: 4%;
  }
  
  body.page .team-member {
    flex: 0 0 48%;
    max-width: 48%;
  }

  body.single .team-member {
    width: 100%;
  }
}

/* Mobile & Tablet General (<= 949px) */
@media screen and (max-width: 949px) {
  .desktop-header, .tablet-header { display: none !important; }
  .mobile-header { display: block !important; }
}

/* Mobile Specific (<= 768px) */
@media (max-width: 768px) {
  html, body { -webkit-text-size-adjust: 100%; }

  body {
    font-size: 1rem;
    line-height: 1.5;
  }

  a, .wp-block-button__link, .wp-block-button a {
    padding: 10px 6px;
    display: inline-block;
  }

  :focus {
    outline: 3px solid rgba(8,127,225,0.25);
    outline-offset: 2px;
  }

  .team-member {
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }

  .team-member img {
    width: 100%;
    max-width: 220px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
  }

  .wp-block-query-pagination a,
  .wp-block-query-pagination button,
  .wp-block-query-pagination .current {
    min-width: 44px;
    padding: 10px 12px;
  }

  p a, li a { text-decoration: underline; }

  /* Mobile Navigation Styles */
  .wp-block-navigation,
  .wp-block-navigation__container,
  .wp-block-navigation__responsive-container {
    text-align: left;
    background: #007ed5 !important;
  }

  .wp-block-navigation a,
  .wp-block-navigation__link,
  .wp-block-navigation-item a {
    display: block;
    width: 80%;
    padding: 16px;
    box-sizing: border-box;
    font-size: 1.125rem;
    line-height: 1.5;
    color: white !important;
    background: #007ed5 !important;
    transition: background-color 180ms ease, color 180ms ease;
  }

  .wp-block-navigation a:hover,
  .wp-block-navigation a:focus {
    color: #fff !important;
    text-decoration: none;
  }

  .wp-block-navigation__overlay,
  .wp-block-navigation__responsive-container {
    background: #007ed5 !important;
    color: #fff !important;
  }

  .wp-block-navigation__container ul,
  .wp-block-navigation__container li {
    list-style: none;
    padding: 10px;
    width: 100% !important;
    max-width: 400px;
  }

  .wp-block-navigation__container li li a {
    padding-left: 40px;
    font-size: 1rem;
  }

  .swiper-button-next,
  .swiper-button-prev {
      display: none;
  }
}