/**
 * @package     Joomla.Plugin
 * @subpackage  Content.Pullquote
 *
 * Pull Quote Plugin Styles
 */

/* ============================================
   CSS Custom Properties (configurable)
   ============================================ */
.pullquote {
    --pullquote-accent: #0066cc;
    --pullquote-bg: #f8f9fa;
    --pullquote-text-color: #333;
    --pullquote-mark-color: var(--pullquote-accent);
    --pullquote-font-size: 1.25rem;
    --pullquote-line-height: 1.5;
    --pullquote-padding: 1.5rem;
    --pullquote-margin: 1rem;
    --pullquote-border-radius: 4px;
}

/* ============================================
   Base Pull Quote Styles
   ============================================ */
.pullquote {
    position: relative;
    box-sizing: border-box;
    margin: var(--pullquote-margin) 0;
    padding: var(--pullquote-padding);
    background-color: var(--pullquote-bg);
    border-radius: var(--pullquote-border-radius);
    font-style: italic;
    clear: both;
}

.pullquote-content {
    margin: 0;
    padding: 0;
    border: none;
}

.pullquote-text {
    margin: 0;
    padding: 0;
    font-size: var(--pullquote-font-size);
    line-height: var(--pullquote-line-height);
    color: var(--pullquote-text-color);
}

/* ============================================
   Position Variants
   ============================================ */

/* Left positioned */
.pullquote-left {
    float: left;
    margin-right: 2rem;
    margin-left: 0;
    margin-bottom: 1rem;
}

/* Right positioned */
.pullquote-right {
    float: right;
    margin-left: 2rem;
    margin-right: 0;
    margin-bottom: 1rem;
}

/* Center positioned */
.pullquote-center {
    float: none;
    width: 80% !important;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* ============================================
   Quotation Marks
   ============================================ */
.pullquote-mark {
    display: inline-block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3rem;
    font-style: normal;
    font-weight: bold;
    line-height: 0;
    color: var(--pullquote-mark-color);
    opacity: 0.6;
}

.pullquote-mark-open {
    margin-right: 0.25rem;
    vertical-align: -0.4em;
}

.pullquote-mark-close {
    margin-left: 0.25rem;
    vertical-align: -0.6em;
}

/* Hide marks when disabled */
.pullquote:not(.pullquote-has-marks) .pullquote-mark {
    display: none;
}

/* ============================================
   Attribution Styles
   ============================================ */
.pullquote-attribution {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    font-style: normal;
}

.pullquote-author {
    display: block;
    font-weight: 600;
    color: var(--pullquote-accent);
}

.pullquote-source {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.pullquote-source::before {
    content: "— ";
}

/* ============================================
   Style: Classic
   ============================================ */
.pullquote-style-classic {
    background-color: var(--pullquote-bg);
    border-left: 4px solid var(--pullquote-accent);
}

.pullquote-style-classic.pullquote-right {
    border-left: none;
    border-right: 4px solid var(--pullquote-accent);
}

.pullquote-style-classic.pullquote-center {
    border-left: none;
    border-right: none;
    border-top: 4px solid var(--pullquote-accent);
    border-bottom: 4px solid var(--pullquote-accent);
}

/* ============================================
   Style: Modern
   ============================================ */
.pullquote-style-modern {
    background: linear-gradient(135deg, var(--pullquote-bg) 0%, #fff 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 2rem;
}

.pullquote-style-modern .pullquote-mark {
    position: absolute;
    font-size: 5rem;
    opacity: 0.15;
    color: var(--pullquote-accent);
}

.pullquote-style-modern .pullquote-mark-open {
    top: 0.5rem;
    left: 0.5rem;
}

.pullquote-style-modern .pullquote-mark-close {
    bottom: 0.5rem;
    right: 0.5rem;
}

.pullquote-style-modern .pullquote-text {
    position: relative;
    z-index: 1;
}

/* ============================================
   Style: Minimal
   ============================================ */
.pullquote-style-minimal {
    background: transparent;
    border: none;
    padding: 1rem 0;
}

.pullquote-style-minimal .pullquote-text {
    font-size: 1.35rem;
    font-weight: 300;
    color: var(--pullquote-accent);
}

.pullquote-style-minimal .pullquote-mark {
    color: var(--pullquote-accent);
    opacity: 0.4;
}

.pullquote-style-minimal .pullquote-attribution {
    border-top: none;
    padding-top: 0.5rem;
}

/* ============================================
   Style: Bordered
   ============================================ */
.pullquote-style-bordered {
    background: transparent;
    border: 2px solid var(--pullquote-accent);
    border-radius: 0;
    position: relative;
}

.pullquote-style-bordered::before,
.pullquote-style-bordered::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
}

.pullquote-style-bordered::before {
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom: 2px solid var(--pullquote-accent);
}

.pullquote-style-bordered::after {
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 2px solid var(--pullquote-accent);
}

.pullquote-style-bordered .pullquote-mark {
    font-size: 2.5rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .pullquote-left,
    .pullquote-right {
        float: none;
        width: 100% !important;
        margin-left: 0;
        margin-right: 0;
    }

    .pullquote-center {
        width: 100% !important;
    }

    .pullquote {
        --pullquote-font-size: 1.1rem;
        --pullquote-padding: 1rem;
    }

    .pullquote-mark {
        font-size: 2rem;
    }

    .pullquote-style-modern .pullquote-mark {
        font-size: 3rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .pullquote {
        float: none !important;
        width: 100% !important;
        margin: 1rem 0;
        padding: 1rem;
        background: #f5f5f5 !important;
        border: 1px solid #ccc;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .pullquote-mark {
        color: #333 !important;
    }

    .pullquote-style-modern {
        background: #f5f5f5 !important;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */
@media (prefers-color-scheme: dark) {
    .pullquote {
        --pullquote-bg: #2a2a2a;
        --pullquote-text-color: #e0e0e0;
    }

    .pullquote-attribution {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .pullquote-source {
        color: #aaa;
    }

    .pullquote-style-modern {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .pullquote-style-bordered::before,
    .pullquote-style-bordered::after {
        background: #1a1a1a;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.pullquote:focus-within {
    outline: 2px solid var(--pullquote-accent);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .pullquote {
        transition: none;
    }
}

/* ============================================
    Clear fix for content after floated quotes
   ============================================ */
.pullquote + p,
.pullquote + div {
    overflow: hidden;
}
