/*!
Theme Name: GeneratePress Child
Theme URI: https://yoursite.com
Description: GeneratePress 子主題，用於自訂樣式和功能
Author: Your Name
Author URI: https://yoursite.com
Template: generatepress
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: generatepress-child
Domain Path: /languages
*/

/* 
cutom
*/


/* font */
.gb-headline,
.gb-text a {
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.gb-block-image,
[class*="gb-media"] {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.gb-block-image img,
[class*="gb-media"] img {
    width: 100%;
    height: 187px;
    display: block;
    vertical-align: middle;
    transition: opacity 0.3s ease;
}


.dynamic-featured-image,
.dynamic-author-image,
.gb-block-image img,
[class*="gb-media"] img {
    width: 100%;
    max-width: 333px;
    height: 187px;
    aspect-ratio: 333 / 187; 
    vertical-align: middle;
    display: block;
    transition: opacity 0.3s ease;
}

@media (max-width: 767px) {
    .dynamic-featured-image,
    .dynamic-author-image,
    .gb-block-image img,
    [class*="gb-media"] img {
        max-width: 100%;
        width: 100%;
        aspect-ratio: 16 / 9;
    }
}

.gb-headline[title]:hover::before,
.gb-text a[title]:hover::before {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 450px;
    z-index: 1000;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.gb-headline[title]:hover::after,
.gb-text a[title]:hover::after {
    content: '';
    position: absolute;
    left: 15px;
    top: calc(100% - 0px);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2c3e50;
    z-index: 1001;
}


.gb-block-image img[title]:hover::before,
[class*="gb-media"] img[title]:hover::before,
.dynamic-featured-image[title]:hover::before,
.dynamic-author-image[title]:hover::before {
    content: attr(title);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 100%;
    background-color: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


.gb-block-image img[title]:hover::after,
[class*="gb-media"] img[title]:hover::after,
.dynamic-featured-image[title]:hover::after,
.dynamic-author-image[title]:hover::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 8px);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #2c3e50;
    z-index: 1001;
}

.gb-headline:hover,
.gb-text a:hover {
    color: #ff0000;
}

.gb-block-image img:hover,
[class*="gb-media"] img:hover,
.dynamic-featured-image:hover,
.dynamic-author-image:hover {
    opacity: 0.8;
}