/* custom.css - Dampfboot Verlag Theme */

/* ===== Base Styles ===== */
body {
    background-color: #ffffff;
}

.ui.menu {
    margin-top: 1rem;
    border-radius: 4px;
}

footer {
    margin-top: 2rem;
}

/* ===== Colors ===== */
.ui.card .header a,
.ui.card .header a:hover,
.book-title,
.author-bio .author-link {
    color: #8B2C2C;
}

.ui.green.horizontal.label {
    background-color: #8B2C2C;
}

.ui.card .meta {
    color: #5a6b5d;
}

.book-title:hover,
.author-bio .author-link:hover {
    color: #a84545;
    text-decoration: underline;
}

/* Custom admin styling */
.form-tabs {
    margin-bottom: 2rem;
}

.tab-content {
    padding: 2rem 0;
}

.field .help {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.field .highlight {
    background: #fff3e0;
    padding: 0.5rem;
    border-radius: 4px;
}

/* Alphabet navigation */
.ui.compact.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
    background: none;
    border: none;
    box-shadow: none;
}

.ui.compact.menu .button {
    min-width: 2.5rem;
    text-align: center;
    font-weight: bold;
}

.ui.disabled.button {
    cursor: default;
    pointer-events: none;
}

/* Responsive adjustments for alphabet navigation */
@media (max-width: 768px) {
    .ui.compact.menu .button {
        min-width: 2rem;
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ui.compact.menu .button {
        min-width: 1.8rem;
        padding: 0.4rem 0.2rem;
        font-size: 0.7rem;
    }
}

/* ===== Author Bio Section ===== */
.author-bio {
    margin-bottom: 1.5rem;
    background: #faf7f0;
    border-left: 4px solid #8B2C2C;
}

.author-bio h3.ui.header {
    margin-bottom: 0.5rem;
}

.author-link-more {
    margin-top: 1rem;
}

.author-link-more .ui.tiny.basic.button {
    color: #8B2C2C;
    border-color: #8B2C2C;
    background: transparent;
}

.author-link-more .ui.tiny.basic.button:hover {
    background: #8B2C2C;
    color: white;
}

.author-description {
    margin-top: 1rem;
    line-height: 1.6;
}

.author-description p:last-child {
    margin-bottom: 0;
}

.author-bio .orcid.icon {
    color: #A6CE39;
}

/* ===== Search Field ===== */
.ui.category.search {
    width: auto;
}

.ui.transparent.icon.input {
    width: 200px;
    transition: width 0.2s ease;
}

.ui.transparent.icon.input input.prompt {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 500px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.ui.transparent.icon.input input.prompt:focus {
    width: 250px;
    background: white;
    box-shadow: 0 0 0 1px #8B2C2C;
}


/* ===== Book Cover Styling  ===== */


.book-cover-container {
    position: relative;
    width: 100%;
    padding-top: 0;              /* Auskommentieren/fixed Ratio entfernen */
    min-height: 300px;           /* Einheitliche Mindesthöhe */
     background: white; 
    overflow: hidden;            /* Für saubere Kanten */
    border-radius: 4px; 
}

.book-cover {
    position: relative;          /* Absolute Positionierung lösen */
    top: auto;
    left: auto;
    transform: none;
    margin: 0 auto;
    display: block;
    max-height: 280px;           /* Maximale Cover-Höhe */
    width: auto;
    object-fit: contain;         /* Ganzes Cover sichtbar halten */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);  /* Ganz subtiler Schatten */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.book-card:hover .book-cover {
    transform: scale(1.03);      /* Leicht verstärken, jetzt ohne Verzerrung */
}

/* Responsive Anpassung */
@media (max-width: 768px) {
    .book-cover-container {
        min-height: 250px;
    }
    
    .book-cover {
        max-height: 250px;
    }
    
    .book-cover-large {
        max-width: 200px;
    }
}


/* Fallback icons */
.fallback-icon,
.fallback-icon-small {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #ccc;
}

.fallback-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fallback-icon-small {
    width: 100%;
    height: 100%;
}

/* Large cover on individual book page */
.book-cover-large-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.book-cover-large {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-cover-large:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.fallback-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf7f0;
    border-radius: 4px;
    min-height: 300px;
    color: #ccc;
}

/* Book metadata styling */
.book-meta {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

.book-meta i {
    margin-right: 0.5rem;
    color: #8B2C2C;
}

.book-subtitle {
    color: #666;
    font-style: italic;
}

/* Book actions panel on individual page */
.book-actions {
    text-align: center;
}

.book-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8B2C2C;
}

.book-isbn {
    font-size: 0.85rem;
    color: #666;
}

/* ===== Grid/List View Components ===== */
.book-cover-link {
    display: block;
}

.book-cover-link:hover .book-cover {
    transform: scale(1.02);
}

/* Category filter bar */
.ui.horizontal.list .item {
    margin-right: 0.5rem;
}

.ui.basic.label {
    cursor: pointer;
}

.ui.basic.label.primary {
    background: #8B2C2C !important;
    color: white !important;
    border-color: #8B2C2C !important;
}

/* List view styling */

/* ===== Shadows for List View Covers ===== */

/* Der Container hat bereits overflow: hidden oder ist relativ positioniert.
   Wir setzen den Schatten direkt auf das Bild, damit es "schwebt". */
.ui.items .item .ui.small.image img {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); /* Leichter, räumlicher Schatten */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;              /* Vermeidet Unterseiten-Lücken */
}

/* Hover-Effekt: Das Cover hebt sich etwas */
.ui.items .item:hover .ui.small.image img {
    transform: translateY(-2px) scale(1.02); /* Leicht nach oben und größer */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); /* Schatten wird dunkler/größer */
}

/* Sicherstellen, dass der Schatten nicht durch den Container abgeschnitten wird.
   Falls .ui.items .item overflow: hidden hat, muss man den Shadow entweder 
   hier entfernen oder den Container overflow: visible machen. 
   Fomantic UI Container haben meist keinen Overflow-Hack, aber zur Sicherheit: */
.ui.items .item .content .image {
    overflow: visible; /* Damit der Schatten außerhalb des Bildrahmens sichtbar ist */
}

/* Responsive Anpassung für Mobile (kleinere Thumbnails) */
@media (max-width: 768px) {
    .ui.items .item .ui.tiny.image img {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .ui.items .item:hover .ui.tiny.image img {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}


/* ===== Logo Styling ===== */
.logo-item {
    padding: 0.5rem 1rem !important;
}

.logo-image {
    height: 40px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.logo-image:hover {
    opacity: 0.8;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .ui.transparent.icon.input {
        width: 140px;
    }
    
    .ui.transparent.icon.input input.prompt:focus {
        width: 180px;
    }
    
    .ui.menu .item {
        padding: 0.8rem 0.6rem;
    }
    
    .ui.menu .header.item {
        font-size: 0.9rem;
    }
    
    .logo-image {
        height: 32px;
    }
    
    .book-cover-large {
        max-width: 250px;
        margin: 0 auto;
        display: block;
    }
    
    .book-cover-large-container {
        text-align: center;
    }
    
    .fallback-icon-large {
        min-height: 250px;
    }
    
    .ui.items .item {
        flex-direction: column;
    }
    
    .ui.items .item .ui.tiny.image {
        width: 120px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .ui.transparent.icon.input {
        width: 160px;
    }
}

@media (max-width: 550px) {
    .ui.transparent.icon.input {
        width: auto;
    }
    
    .ui.transparent.icon.input input.prompt {
        width: 0;
        padding: 0.6rem 0;
        opacity: 0;
        transition: all 0.2s ease;
    }
    
    .ui.transparent.icon.input input.prompt:focus {
        width: 160px;
        padding: 0.6rem 1rem;
        opacity: 1;
    }
    
    .ui.transparent.icon.input i.icon {
        pointer-events: none;
    }
    
    .ui.transparent.icon.input:focus-within i.icon {
        pointer-events: auto;
    }
}
