/*
Theme Name: UGA Today v2.0
Theme URI: https://news.uga.edu
Author: UGA MARCOMM (team lead - Zach Alig)
Author URI: https://mc.uga.edu
Description: The 2024 full site editor rebuild of UGA's news site.
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 5.7
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfour
Text Domain: uga-today-v2-0
Tags: 
*/

/****** TABLE of CONTENTS ***********

- Fonts
- Turn off break-word from starter theme
- Mobile Navigation
- Pagination 
- Header Navigation - Search Icon
- Header Navigation - Active Item
- Header Navigation - Hide search field until icon is clicked
- Placeholder Images for Query Loop Blocks 
- Placeholder Images in Archive Query Loop Blocks
- Hide Placeholder Images for Query Loop Blocks in Gutenberg editor views
- Button and Link Transitions
- Sticky Header
- Card style query loop row 
- Focused block

***** END TABLE of CONTENTS ********/

/* Fonts */
nav ul.wp-block-navigation{
    font-family: var(--wp--preset--font-family--merriweather-sans)
}

h2 a,
h3 a{
    font-family: var(--wp-preset--font-family--merriweather);
    text-decoration: none!important;
}

h2.has-background{
    padding: .5rem 1rem!important;
}

/* Turn off break-word from starter theme */
* {
    word-break: normal !important; 
}
/* Mobile Navigation */
nav .is-menu-open .wp-block-navigation__responsive-dialog{
    padding: 0 2rem;
}

.wp-block-navigation__responsive-container-close {
	right: 2rem !important;
}

.wp-block-navigation__responsive-container-close svg{
    width: 48px !important;
    height: 48px !important;
}

.wp-block-navigation__responsive-container-close:hover{
    opacity: 50% !important;
}


nav .wp-block-navigation__responsive-container ul li.wp-block-navigation-item {
    border-bottom: 1px solid #a0a3a380; 
    width:100%;
    padding: 0 0 1rem 0;
}

/*nav.uga-today-mobile-nav .wp-block-navigation__responsive-container .wp-block-site-logo img {
    width:400px;
    max-width:100%;
}
*/

/* Pagination */

a.page-numbers,
.page-numbers{
    text-decoration:none!important;
    text-align: center;
    padding: .5rem .75rem;
    border: 1px solid var(--wp--preset--color--primary-2);
}

.page-numbers.current{
    border-color: var(--wp--preset--color--primary-1);
    font-weight: 700;
}

a.page-numbers:hover{
    border-color: var(--wp--preset--color--vibrant-1);
}

.wp-block-query-pagination-numbers .page-numbers.dots{
    border: none;
}

/* Header Navigation - Search Icon */
header .icn-uga-today-nav-search:hover,
header .icn-uga-today-nav-search.active{
    cursor: pointer;
    opacity: 50%;
}

/* Header Navigation - Active Item */

header nav li.wp-block-navigation-item.current-menu-item{
    font-weight: 700;
    color:var(--wp--preset--color--secondary-neutral-1);
}

/* Header Navigation - Hide search field until icon is clicked */
header #uga-today-header-search{
    height:0;
    padding:0!important;
    overflow:hidden;
    transition: height .3s ease-in-out;
}


/*  - Styles for active search field */
header #uga-today-header-search.active{
    height: 4.2rem;
    padding: 1rem;
}

/* Placeholder Images for Query Loop Blocks */
div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before   {
    content: "";
    background: no-repeat center center url("/wp-content/themes/uga-today-v2-0/assets/img/RGB-GEORGIA-V-W.png") #f7f7f7;
    background-size: 50% auto;
    display: block;
    width: 100%;
    flex-basis: 30%;
    flex-shrink: 1;    
    aspect-ratio: 4/3;
    margin: 0 0 1em !important;
    -webkit-box-shadow: 1px 0px 85px 29px rgba(0,0,0,0.04) inset;
    -moz-box-shadow: 1px 0px 85px 29px rgba(0,0,0,0.04) inset;
    box-shadow: 1px 0px 85px 29px rgba(0,0,0,0.04) inset;
}

/* Placeholder Images in Archive Query Loop Blocks */
body.archive ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
body.archive div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before {
    flex-basis: 40%;
}

/* Placeholder Images in Homepage & Columns Landing Page Query Loop Blocks */
body.page-template-landing-page-columns ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
body.page-template-landing-page-columns ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before,
body.home ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
body.home div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before {
    aspect-ratio: 16/9;
}

/* Placeholder Images for Profiles loops (custom css class .uga-profiles must be added) */
body.home .wp-block-group.uga-profiles ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
body.home .wp-block-group.uga-profiles ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before
{
    aspect-ratio: 3/4;
}

/* Hide Placeholder Images for Query Loop Blocks in Gutenberg editor views */
div.block-editor-block-list__layout div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex::before,
div.block-editor-block-list__layout div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-constrained::before{
    display: none;
}

div.wp-block-query ul.wp-block-post-template:not(.uga-today-no-thumbs) li.wp-block-post.post:not(.has-post-thumbnail) > div.wp-block-group-is-layout-flex  {
    margin-top:0!important;
}

/* Button and Link Transitions */
a,
a.wp-element-button:hover{
    transition: all 0.2s ease-in-out;
}

/* Category Pill Button */
.is-style-pill a{
    background-color: var(--wp--preset--color--white)!important;
    color: var(--wp--preset--color--primary-2)!important;
    transition: 0.2s ease;
    margin-top: .375rem;
    border: 2px, solid, var(--wp--preset--color--primary-2);

}

.is-style-pill a:hover{
    text-decoration: none !important;
    color: var(--wp--preset--color--white)!important;
    background-color: var(--wp--preset--color--primary-2)!important;
}

/* Sticky Header */
.uga-today-university-brand{
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.uga-today-sticky {
    position:fixed;
    min-width:100%;
    z-index:9999!important;
}

/* Card style query loop row (used on homepage and in block pattern) */

/* .ugatoday-query-loop-card{
    box-shadow: 1px 2px 3px rgba(0,0,0,0.07);
} */

/* Focused block if user tabs through page */

:where(.wp-site-blocks *:focus-visible){
    outline-width:2px;
    outline-style:solid
}


/* Archive View */

/* -- Vertical Column Divider */
@media screen and (min-width: 1013px) {
    
    ul.columns-2.alignfull.wp-block-post-template.is-layout-grid.wp-block-post-template-is-layout-grid::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 1px;
        height: calc(100% - 10rem);
        background-color: var(--wp--preset--color--primary-1);    

    }
    
    ul.columns-2.alignfull.wp-block-post-template.is-layout-grid.wp-block-post-template-is-layout-grid li:nth-child(even){
        margin-left: 1.5rem;
    }
}

/* SINGLE VIEW STYLES */
/* Category Tags */

.is-columns-single-view div.taxonomy-category a,
.is-ugatoday-single-view div.taxonomy-category a {
	border: 2px #ba0c2f solid;
	border-radius: 4px;
	padding: 0.25rem 0.5rem;
	margin: 0.25rem;
}

.is-columns-single-view div.taxonomy-category a:hover,
.is-ugatoday-single-view div.taxonomy-category a:hover {
	background-color: #ba0c2f;
	color: #fff;
	text-decoration: none;
}

/* Dropcap */
.has-drop-cap:not(:focus)::first-letter {
    font-size: 6.4em !important;
    margin: 0.08em .1em 0 0 !important;
}

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

/* Featured Image Captions */
main.is-columns-single-view figure.wp-block-post-featured-image figcaption {
	color: grey;
  	font-size: var(--wp--preset--font-size--small);
}

/* Magazine - no space between header nav and image */
main.is-magazine-single-view {
	margin-block-start: 0 !important;
}
main.is-magazine-single-view > figure {
	z-index: -1;
}

blockquote {
  position: relative;
  max-width: 800px !important;
  margin: auto;
  padding: 2rem 2.5rem 2rem 3.5rem; /* extra left padding for the quote */
  font-family: Merriweather, serif;
}

blockquote p span.quote-first-letter {
	position: relative;
}

blockquote p span.quote-first-letter::before {
  content: "“";
  position: absolute;
  top: -0.75rem;       /* Adjust this value to align vertically with text */
  left: -2.5rem;
  font-size: 4rem;
  font-weight: normal;
  line-height: 1;
}

blockquote p {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
	margin-bottom: 0;
}

:root :where(blockquote.wp-block-quote cite) {
	display: block !important;
  font-weight: normal;
  font-style: italic !important;
  text-align: right;
  font-size: 1.25rem !important;
}

/* Magazine - Limit height of featured image (small viewport fix) */

@media (max-width: 768px) {
    
    body.georgia-mag-posts-template-default .wp-block-post-featured-image{
        height:auto !important;
        max-height: 50vh;
    }
}

/*==============================================================
=                  Plugin/Block Style Adjustments              =
==============================================================*/

/* ========== Meow Galleries ========== */

/* Allows for long captions to use ellipses instead of being cutoff */
.mgl-caption p {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== Carousel V2 ========== */
/* Common styles for both buttons */
.wp-block-cb-carousel-v2 .cb-button-next, .wp-block-cb-carousel-v2 .cb-button-prev {
    color: #ba0c2f !important;
}

/* Shared triangle base styles */
.swiper-button-next:after,
.swiper-button-prev:after,
.swiper-rtl .swiper-button-next:after,
.swiper-rtl .swiper-button-prev:after {
  content: "" !important; /* Overrides the deafult value of 'prev' that the plugin uses */
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Right-pointing arrow */
.swiper-button-next:after,
.swiper-rtl .swiper-button-prev:after {
  margin-left: 18px;
  border-left: 12px solid #ba0c2f;
}

/* Left-pointing arrow */
.swiper-button-prev:after,
.swiper-rtl .swiper-button-next:after {
  margin-right: 18px;
  border-right: 12px solid #ba0c2f;
}



/*==============================================================
=                 Legacy Style Adjustment                  =
==============================================================*/

/* Adds these core classic theme WP classes for images */
.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
  display: inline;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1em;
  display: inline;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media screen and (max-width: 670px) {

    figure.wp-block-image.alignleft,
    figure.wp-block-image.alignright {
        float: none;
        margin-left:0;
        margin-right:0;
        width:100%;
    }

    figure.wp-block-image.alignleft img,
    figure.wp-block-image.alignright img {
        width:100%;
    }

}

/*==============================================================
=                Gallery Customizations                        =
==============================================================*/

.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
	backdrop-filter:none!important;
	height: auto!important;
	-webkit-mask-image:  none!important;
	mask-image: none!important;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption, .wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before {
	position: initial!important;
    display: block;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	background: #000!important;
	color: #fff;
}

body.wp-child-theme-uga-today-v2-0 .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
    width:calc(60% - var(--wp--style--unstable-gallery-gap, 16px)/2);
}

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img{
    height: auto !important;
}

@media (min-width: 600px) {
body.wp-child-theme-uga-today-v2-0   .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image) {
    width: calc(33.33% - var(--wp--style--unstable-gallery-gap, 16px)*.66667);
  }
}

/*==============================================================
=                 Utility Classes                              =
==============================================================*/
/* Classes you can apply direcly to blocks  */

.nowrap {
    white-space: nowrap !important;
}
