Template:Content/styles.css: Difference between revisions

From Delanor Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
}
}


/* Tile container */
/* Outer tile container */
.tile-row > div {
.tile {
     width: 180px;
     width: 180px;
     height: 240px; /* Slightly taller to fit image + label */
     height: 240px;
     padding: 0.5em;
     padding: 0.5em;
     background: #fdfaf3;
     background: #fdfaf3;
Line 19: Line 19:
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
    justify-content: space-between;
     align-items: center;
     align-items: center;
    justify-content: space-between; /* Ensure spacing between image & text */
     text-align: center;
     text-align: center;
     transition: transform 0.2s;
     transition: transform 0.2s, box-shadow 0.2s;
     box-sizing: border-box;
     box-sizing: border-box;
    overflow: hidden; /* Prevent hover bleed */
}
}


.tile-row > div:hover {
/* Hover effect on tile */
.tile:hover {
     transform: scale(1.03);
     transform: scale(1.03);
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
}


/* Image wrapper */
/* Image container inside tile */
.tile-top {
.tile-top {
     width: 100%;
     width: 100%;
Line 40: Line 42:
}
}


/* Image scaling */
/* Image scaling behavior */
.tile-top img {
.tile-top img {
     max-height: 100%;
     max-height: 100%;
Line 48: Line 50:
}
}


/* Text label */
/* Label under the image */
.tile-bottom {
.tile-bottom {
     font-size: 1em;
     font-size: 1em;
Line 58: Line 60:
}
}


/* Remove MediaWiki link styling */
/* Kill default link styles */
.tile-bottom a {
.tile-bottom a,
.tile-top a {
     all: unset;
     all: unset;
     font-size: inherit;
     font-size: inherit;
Line 66: Line 69:
     cursor: pointer;
     cursor: pointer;
     display: inline-block;
     display: inline-block;
    text-align: center;
     line-height: 1.4;
     line-height: 1.4;
}
}


.tile-bottom a:hover {
/* Optional underline on hover */
.tile-bottom a:hover,
.tile-top a:hover {
     text-decoration: underline;
     text-decoration: underline;
    color: #000;
}
}


/* Responsive layout */
/* Responsive layout */
@media (max-width: 800px) {
@media (max-width: 800px) {
     .tile-row > div {
     .tile {
         flex: 1 1 45%;
         width: 45%;
        width: auto;
         height: auto;
         height: auto;
     }
     }
}
}

Revision as of 06:07, 26 July 2025

.tile-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2em;
    margin: 2em auto;
    max-width: 1200px;
}

/* Outer tile container */
.tile {
    width: 180px;
    height: 240px;
    padding: 0.5em;
    background: #fdfaf3;
    border: 1px solid #c8b68e;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    overflow: hidden; /* Prevent hover bleed */
}

/* Hover effect on tile */
.tile:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image container inside tile */
.tile-top {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Image scaling behavior */
.tile-top img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

/* Label under the image */
.tile-bottom {
    font-size: 1em;
    font-weight: 500;
    color: #222;
    text-align: center;
    width: 100%;
    padding-bottom: 0.2em;
}

/* Kill default link styles */
.tile-bottom a,
.tile-top a {
    all: unset;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    line-height: 1.4;
}

/* Optional underline on hover */
.tile-bottom a:hover,
.tile-top a:hover {
    text-decoration: underline;
    color: #000;
}

/* Responsive layout */
@media (max-width: 800px) {
    .tile {
        width: 45%;
        height: auto;
    }
}