/* VDict Stylesheet - Bootstrap Edition */

/* Recent lookups animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* Recent lookups */
.small-title {
    font-size: 0.875rem !important;
}

.recent-lookup-word {
    animation: slideInRight 0.3s ease-out forwards;
}

.recent-lookup-word.removing {
    animation: slideOutLeft 0.3s ease-out forwards;
}

/* Site Structure */
body {
    background-color: #f8f9fa;
    min-height: 100vh;
}

#container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
.navbar {
    background-color: #0099cc !important;
}

.navbar .row {
    width: 100%;
    margin: 0;
}

.navbar .col-lg-10,
.search-section .col-lg-10 {
    padding: 0;
}

.col-lg-8.mx-auto {
    padding: 0;
}

.navbar-brand {
    margin-right: 2rem;
    padding: 0;
}

/* Hybrid logo: CSS-only badge ring + inlined V SVG + Fredoka HTML wordmark.
   Sized to match the original logo's footprint (~40h × ~150w). Color variant #170
   from logotest.html: dark red ring (#991b1b) + white V + white "dict" + dark red ".com". */
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    line-height: 1;
}
.logo-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #991b1b;   /* dark red ring */
    background: transparent;     /* navbar shows through */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.logo-v {
    width: 87%;
    height: 87%;
    display: block;
    transform: translateY(1px);  /* sit V slightly low for visual balance */
}
.logo-text {
    font-family: "Fredoka", system-ui, sans-serif;
    font-size: 30px;
    line-height: 1;
    white-space: nowrap;
    transform: translateY(-1px);
    letter-spacing: -0.015em;
}
.logo-name { color: #fff; font-weight: 600; }       /* "dict" — white */
.logo-tld  { color: #991b1b; font-weight: 400; }    /* ".com" — dark red */

.navbar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Language Switcher */
.nav-link.text-white.opacity-75 {
    background: none !important;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin: 0;
    opacity: 0.75;
    transition: all 0.2s ease;
}

.nav-link.text-white.opacity-75:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: none;
}

/* Content Spacing */
#contents {
    padding: 0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #0099cc;
        padding: 1rem;
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        background: rgba(255, 255, 255, 0.1);
        text-align: center;
    }

    .navbar-nav .nav-link:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.2);
    }

    .navbar-toggler {
        width: 48px;
        height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        line-height: 1;
        padding: 0.5rem;
        margin-left: auto;
        margin-right: 0;
    }
}

/* Search Section */
.search-section {
    background-color: #e9f1f3;
    border-bottom: 2px solid #d9e5e9;
}

@media (max-width: 768px) {
    .search-section.py-4 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* Search Form */
.search-form-group {
    display: flex;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #0099cc;
}

.search-input-group {
    flex: 1;
    padding: 0.25rem;
}

.search-controls-group {
    display: flex;
    padding: 0.25rem;
    gap: 0.25rem;
}

#text-lookup {
    border: none;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    background: #f8f9fa;
}

#selected-dictionary {
    border: none;
    background-color: #f8f9fa;
    min-width: 250px;
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

#lookupbutton {
    border-radius: 4px;
    white-space: nowrap;
    padding: 0.75rem 2rem;
}

/* Translation Input */
#translate-text,
#textToTranslate {
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #0099cc;
    border-radius: 4px;
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    line-height: 1.5;
    width: 100%;
    resize: vertical;
}

/* Search Options */
#searchoptions {
    margin-top: 1.5rem;
}

.searchoption label {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
}

.btn-outline-primary {
    border-color: #0099cc;
    color: #0099cc;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-check:checked+.btn-outline-primary {
    background-color: #0099cc;
    border-color: #0099cc;
    color: white;
}

/* Content Area */
.container {
    flex: 1;
}

.illustration-float {
    float: right;
    margin: 0 0 1.5rem 1.5rem;
    width: 280px;
    max-width: 100%;
    text-align: center;
    shape-outside: margin-box;
    position: relative;
    z-index: 10;
}

.word-type-section:has(.illustration-float) {
    min-height: 460px;
}

.illustration-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.illustration-caption {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
}

@media (max-width: 576px) {
    .illustration-float {
        float: none;
        margin: 0 auto 1rem auto;
        max-width: 100%;
    }
}

.illustration-gallery-card {
    overflow: hidden;
}

.illustration-gallery-image {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.illustration-gallery-caption {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* Definition Switch */
.definition-switch {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.form-check.form-switch {
    margin: 0;
    min-width: 3rem;
}

.form-check-input {
    cursor: pointer;
    width: 3rem !important;
    height: 1.5rem !important;
    margin: 0;
    background-color: #0099cc !important;
    border-color: #0099cc !important;
}

.form-check-input:checked {
    background-color: #0099cc !important;
    border-color: #0099cc !important;
}

.switch-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
    user-select: none;
    min-width: 4.5rem;
    text-align: center;
    transition: color 0.2s ease;
}

.switch-label.active {
    color: #0099cc;
}

@media (max-width: 768px) {
    .word-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .definition-switch {
        margin-left: 0 !important;
        align-self: center;
    }
}

/* Word Results */
.word-results {
    padding: 2rem 0;
}

.content-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.2;
}

.content-breadcrumb__home {
    display: inline-flex;
    align-items: center;
    color: #0099cc;
    text-decoration: none;
}

.content-breadcrumb__home-icon {
    display: block;
    transform: translateY(-1px);
}

.content-breadcrumb__separator,
.content-breadcrumb__meta {
    color: #6c757d;
}

.content-breadcrumb__dict-link,
.content-breadcrumb__current {
    color: #0099cc;
    text-decoration: none;
    font-weight: 400;
}

.content-breadcrumb__dict-link:hover {
    color: #0077a3;
    text-decoration: underline;
}

/* Word Highlighting */
.d_1,
.d_2,
.d_3,
.d_4,
.d_5,
.d_7 {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background-image: linear-gradient(transparent 0%, transparent 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transition: background-image 0.2s;
}

.d_1:hover,
.d_2:hover,
.d_3:hover,
.d_4:hover,
.d_5:hover,
.d_7:hover {
    background-image: linear-gradient(var(--bs-primary-bg-subtle) 0%, var(--bs-primary-bg-subtle) 100%);
}

.found-in-dicts {
    color: #666;
    font-size: 0.9rem;
    text-align: right;
}

.found-in-dicts .badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
    background-color: transparent;
    border: none;
}

.found-in-dicts .badge:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.word-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.pronunciation {
    font-size: 1.1rem;
    color: #666;
    margin-left: 1rem;
    font-style: italic;
    white-space: nowrap;
}

.word-type-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: rgba(0, 153, 204, 0.1);
    color: #0099cc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.copy-btn:hover,
.copy-btn:focus {
    background: rgba(0, 153, 204, 0.15);
    transform: translateY(-1px);
    outline: none;
}

.copy-btn:focus {
    box-shadow: 0 0 0 2px rgba(0, 153, 204, 0.2);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.copy-btn.copied {
    background: #0099cc;
    color: white;
}

@media (max-width: 768px) {
    .copy-btn {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.4rem;
    }

    .copy-btn span {
        display: none;
    }

    .copy-btn svg {
        width: 18px;
        height: 18px;
    }
}

.word-type {
    color: #0099cc;
    font-weight: 500;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Override uppercase for friendly definition */
#friendlyDefinition .word-type {
    text-transform: none;
    letter-spacing: normal;
}

.meanings-list {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.meaning {
    margin-bottom: 1.5rem;
}

.meaning-value {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.5;
}

/* Definition styles */
.word-type-section>.meaning-value {
    margin-bottom: 1.5rem;
}

.word-type-section>.meaning-value:only-child {
    margin-bottom: 0;
}

.word-type-section>.meaning-value>p:first-of-type {
    margin-bottom: 1rem;
}

.word-type-section>.meaning-value>p:last-of-type {
    margin-bottom: 0;
}

.word-type-section .meaning-value ul {
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
}

.word-type-section .meaning-value ul li {
    margin-bottom: 0.5rem;
}

.word-type-section .meaning-value ul li strong {
    font-weight: 500;
    color: #333;
}

.word-type-section .meaning-value ul li ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.25rem;
    color: #666;
}

.word-type-section .meaning-value ul li ul li {
    font-style: italic;
    margin-bottom: 0.25rem;
}

.word-type-section .meaning-value ol {
    padding-left: 1.5rem;
    margin: 0;
}

.word-type-section .meaning-value ol>li {
    margin-bottom: 1rem;
}

.word-type-section .meaning-value ol>li:last-child {
    margin-bottom: 0;
}

.word-type-section .meaning-value ol>li>ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.word-type-section .meaning-value ol>li>ul>li {
    color: #666;
    font-style: italic;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
    margin-bottom: 0.5rem;
}

.examples-list {
    margin-top: 0.75rem;
    margin-left: 1rem;
}

.example {
    color: #666;
    font-style: italic;
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}

.translation {
    color: #0099cc;
    margin-top: 0.25rem;
}

.idioms .idioms-title {
    color: #0099cc;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Word Lists */
.word-relations {
    border-top: 1px solid #dee2e6;
    padding-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.word-relation-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    clear: both;
}

.word-relation-card h2 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.2;
}

.word-relation-card ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.word-relation-card li {
    display: inline;
}

.word-relation-card li:not(:last-child):after {
    content: "•";
    color: #dee2e6;
    margin-left: 1rem;
}

/* Proverb card: 2-column list on desktop, 1-column on narrow screens */
.proverb-card-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    margin: 0;
    padding: 0;
}

.proverb-card-list li {
    display: block;
}

.proverb-card-list li:not(:last-child):after {
    content: "•";
    color: #dee2e6;
    margin-left: 1rem;
}

/* Footer */
.footer {
    background-color: #0099cc !important;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer a {
    color: white;
    text-decoration: none;
}

.footer a:hover {
    color: #ff9900;
}

/* Links */
a {
    color: #0099cc;
    text-decoration: none;
}

a:hover {
    color: #ff9900;
    text-decoration: none;
}

/* Utility Classes */
.bg-primary {
    background-color: #0099cc !important;
}

.btn-primary {
    background-color: #0099cc;
    border-color: #0088bb;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

.btn-primary:hover {
    background-color: #0088bb;
    border-color: #0077aa;
}

.text-primary {
    color: #0099cc !important;
}

/* Pagination */
.pagination-nav {
    margin-top: 2rem;
}

.word-results>.pagination-nav:first-of-type {
    margin-top: 0;
    margin-bottom: 2rem;
}

.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 50% !important;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    color: #0099cc;
    transition: all 0.2s ease-in-out;
}

.page-item.active .page-link {
    background-color: #0099cc;
    color: white;
    transform: scale(1.2);
    box-shadow: 0 2px 4px rgba(0, 153, 204, 0.2);
}

.page-item:not(.active) .page-link:hover {
    background-color: #e9f1f3;
    color: #0088bb;
    transform: scale(1.1);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    opacity: 0.5;
}

/* First/Last Page Links */
.page-item:first-child .page-link,
.page-item:last-child .page-link {
    width: 3rem;
}

/* Mobile Styles */
@media (max-width: 768px) {

    /* Word header spacing */
    .word-header,
    .pronunciation {
        margin-left: 5px !important;
        margin-right: 5px !important;
    }

    /* Search form mobile styles */
    .search-form-group {
        flex-direction: column;
        background: none;
        box-shadow: none;
        width: 95%;
        margin: 0.25rem auto;
    }

    /* Reduce search section padding */
    .search-section {
        padding: 0.25rem 0;
    }

    .search-input-group {
        background: white;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        margin-bottom: 0.25rem;
    }

    .search-controls-group {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 0.25rem;
        background: none;
        box-shadow: none;
        padding: 0;
    }

    #selected-dictionary {
        background: white;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 0.5rem;
        min-width: unset;
        height: 40px;
    }

    #lookupbutton {
        height: 40px;
        padding: 0 1rem !important;
        font-size: 0.9rem;
    }

    #text-lookup {
        padding: 0.5rem;
        height: 40px;
    }

    /* Search options */
    #searchoptions {
        flex-direction: column;
        gap: 1rem !important;
    }

    .searchoption {
        width: 100%;
    }

    /* Typography */
    #text-lookup {
        font-size: 1em;
    }

    .word-header h1 {
        font-size: 2rem;
    }

    .word-type-section {
        padding: 1rem;
    }

    /* Word relations */
    .word-relations {
        grid-template-columns: 1fr;
    }

    .word-relation-card {
        padding: 1rem;
    }

    .word-relation-card ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .word-relation-card li:not(:last-child):after {
        display: none;
    }

    .proverb-card-list {
        grid-template-columns: 1fr;
    }
}

/* Word List Columns */
.word-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.word-item {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

.word-item:hover {
    background-color: #f8f9fa;
}

@media (max-width: 1200px) {
    .word-columns {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .word-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .word-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .word-columns {
        grid-template-columns: 1fr;
    }
}

/* Audio Player */
.audio-player {
    color: #0099cc;
    transition: all 0.15s;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    padding: 0 4px;
    border-radius: 50%;
    background: #f8f9fa;
    cursor: pointer;
    transform: translateY(0);
    box-shadow: 0 2px 0 #007399;
}

.audio-player:hover {
    color: #007399;
    background: #e9ecef;
}

.audio-player:active,
.audio-player.playing {
    transform: translateY(2px);
    box-shadow: none;
    color: #007399;
    background: #e9ecef;
}

/* Browse Page Styles */
.dictionary-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dictionary-item h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.alphabet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.alphabet-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    background-color: #f8f9fa;
    color: #0099cc;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.alphabet-list a:hover {
    background-color: #0099cc;
    color: white;
    transform: scale(1.1);
}

.dictionary-landing {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dictionary-landing__hero {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dictionary-landing__subtitle {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

.dictionary-section {
    background: #fff;
    border: 1px solid #e7edf3;
    border-radius: 18px;
    padding: 1.35rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.dictionary-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dictionary-section__eyebrow {
    margin: 0 0 0.2rem;
    color: #0099cc;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dictionary-section__title {
    margin: 0;
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 700;
}

.dictionary-section__note {
    margin: 0;
    color: #6c757d;
    font-size: 0.92rem;
    white-space: nowrap;
}

.dictionary-alphabet-grid {
    gap: 0.75rem;
}

.dictionary-alphabet-grid .dictionary-alphabet-card {
    width: auto;
    height: auto;
    min-width: 4.6rem;
    min-height: 4.6rem;
    padding: 0.65rem 0.6rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f9fcff 0%, #edf7fc 100%);
    border: 1px solid #d7ebf5;
    box-shadow: 0 8px 18px rgba(0, 153, 204, 0.08);
    flex-direction: column;
    gap: 0.25rem;
}

.dictionary-alphabet-grid .dictionary-alphabet-card:hover {
    transform: translateY(-2px);
}

.dictionary-alphabet-card__letter {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.dictionary-alphabet-card__count {
    color: #5f6c7b;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}

.dictionary-random-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dictionary-random-word {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.7rem 1rem;
    border: 1px solid #dbe7f0;
    border-radius: 999px;
    background: #f8fbfd;
    color: #1f2937;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s ease-in-out;
}

.dictionary-random-word:hover {
    background: #0099cc;
    border-color: #0099cc;
    color: #fff;
    transform: translateY(-1px);
}

.dictionary-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
}

.dictionary-image-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem;
    border-radius: 16px;
    border: 1px solid #e8eef5;
    background: #fbfdff;
    color: #1f2937;
    text-decoration: none;
    transition: transform 0.18s ease-in-out, box-shadow 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

.dictionary-image-card:hover {
    transform: translateY(-2px);
    border-color: #cfe3ef;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dictionary-image-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: #eef4f8;
}

.dictionary-image-card__word {
    color: #5f6c7b;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.dictionary-empty-state {
    margin: 0;
    color: #6c757d;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .dictionary-item {
        padding: 1rem;
    }

    .alphabet-list {
        gap: 0.25rem;
    }

    .alphabet-list a {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.9rem;
    }

    .dictionary-section {
        padding: 1rem;
    }

    .dictionary-section__header {
        flex-direction: column;
        margin-bottom: 0.85rem;
    }

    .dictionary-section__note {
        white-space: normal;
    }

    .dictionary-alphabet-grid {
        gap: 0.5rem;
    }

    .dictionary-alphabet-grid .dictionary-alphabet-card {
        min-width: 4rem;
        min-height: 4rem;
        padding: 0.55rem 0.45rem;
    }

    .dictionary-random-words {
        gap: 0.55rem;
    }

    .dictionary-random-word {
        min-height: 2.5rem;
        padding: 0.6rem 0.85rem;
    }

    .dictionary-image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.7rem;
    }
}

/* Reserve space for AdSense to prevent Cumulative Layout Shift (CLS).
   Avoid flex on the wrapper — it collapses the <ins> width to 0 and
   AdSense's responsive auto-format skips rendering, killing impressions. */
.ad-placeholder-top,
.ad-placeholder-bottom,
.ad-placeholder-inline {
    min-height: 280px;
}

.ad-placeholder-top .adsbygoogle,
.ad-placeholder-bottom .adsbygoogle,
.ad-placeholder-inline .adsbygoogle {
    min-height: 280px;
}

@media (max-width: 768px) {
    .ad-placeholder-top,
    .ad-placeholder-bottom,
    .ad-placeholder-inline {
        min-height: 296px;
    }

    .ad-placeholder-top .adsbygoogle,
    .ad-placeholder-bottom .adsbygoogle,
    .ad-placeholder-inline .adsbygoogle {
        min-height: 296px;
    }
}

/* ── Proverb entry layout ── */

.proverb-translation-card {
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #ff9900;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.proverb-translation-label {
    display: block;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.proverb-translation-value {
    color: #0099cc;
    font-size: 1.08rem;
    line-height: 1.55;
    margin: 0;
}

.proverb-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.proverb-section-title {
    color: #0099cc;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.proverb-variants-section {
    margin-top: 1.5rem;
}

.proverb-variant-list {
    column-count: 2;
    column-gap: 2rem;
    margin: 0;
    padding-left: 1.1rem;
}

.proverb-variant-list li {
    break-inside: avoid;
    margin-bottom: 0.55rem;
    color: #666;
}

.proverb-variant-list a {
    color: #0099cc;
    text-decoration: none;
}

.proverb-variant-list a:hover {
    color: #ff9900;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .proverb-panel-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .proverb-variant-list {
        column-count: 1;
    }

    .proverb-translation-value {
        font-size: 1rem;
    }
}
