/*
Theme Name: Endocrin
Theme URI: https://andijonendo.loc
Author: Istam
Author URI: https://andijonendo.uz
Description: Andijon viloyati endokrinologiya dispanserining zamonaviy WordPress temasi. Professional tibbiyot sayti uchun mo'ljallangan.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: endocrin
Tags: medical, responsive, block-patterns, editor-style, wide-blocks
*/

@tailwind base;
@tailwind components;
@tailwind utilities;

a {
    text-decoration: none !important;
}

/* Pagination Styles for Archives */
.pagination-container .nav-links { display: flex; gap: 8px; justify-content: center; align-items: center; }
.pagination-container .page-numbers { padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 8px; color: #1e293b; font-weight: 600; background: white; transition: all 0.2s; }
.pagination-container .page-numbers:hover { background: #06b6d4; color: white; border-color: #06b6d4; }
.pagination-container .page-numbers.current { background: #0f172a; color: white; border-color: #0f172a; }

/* Hide scrollbar for Tailwind scrollbar-hide class */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Contact page custom shadow */
.clinical-shadow {
    box-shadow: 0px 4px 20px rgba(15, 23, 42, 0.05);
}

/* Lenis Smooth Scrolling */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* =============================================
   GLOBAL PREMIUM UX / UI IMPROVEMENTS
   ============================================= */

/* Smooth transitions on all interactive elements */
a, button, input, textarea, select {
    transition-property: color, background-color, border-color, box-shadow, opacity;
    transition-duration: 250ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image smoothness */
img {
    -webkit-font-smoothing: antialiased;
    image-rendering: auto;
}

/* Body typography enhancements */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    letter-spacing: -0.01em;
    @apply font-sans text-on-surface bg-surface text-body-md text-left;
}

/* Headings kerning */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    font-feature-settings: 'kern' 1;
    @apply font-heading text-on-background font-semibold;
}

/* Paragraph spacing and justification */
p {
    @apply text-left;
}
p + p {
    margin-top: 1em;
}

/* Only justify long-form content inside .prose (Gutenberg/Articles) */
.prose p {
    @apply text-justify hyphens-auto;
}

/* Ensure buttons, nav, short elements NEVER justify */
button, a, .nav-links, span {
    text-align: inherit;
}

/* Premium Table Styling (Xizmatlar / Narxlar) */
.prose table {
    @apply w-full text-sm border-collapse shadow-sm rounded-lg overflow-hidden;
}
.prose thead {
    @apply bg-brand-primary text-white;
}
.prose th {
    @apply px-3 py-2 text-left font-semibold border-none whitespace-nowrap;
}
.prose td {
    @apply px-3 py-2 border-b border-slate-100 align-middle;
}
.prose tbody tr:nth-child(even) {
    @apply bg-slate-50;
}
.prose tbody tr:last-child td {
    @apply border-b-0;
}
.prose tbody tr:hover {
    @apply bg-brand-cyan/10 transition-colors;
}

/* Gutenberg Alignment Support */
.prose > *:not(.alignwide):not(.alignfull):not(.wp-block-group.alignfull) {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}
.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
}
.alignwide {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

/* Scrollbar styles (webkit) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #c6c6cd;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #76777d;
}

/* Prose content improvements */
.prose {
    line-height: 1.8;
}
.prose h2 {
    margin-top: 2em;
    margin-bottom: 0.75em;
}
.prose h3 {
    margin-top: 1.75em;
    margin-bottom: 0.6em;
}
.prose figure {
    margin-top: 2em;
    margin-bottom: 2em;
}

/* Contact Form 7 Modern Styling */
.wpcf7 form {
    @apply flex flex-col gap-6;
}
.wpcf7 form p {
    @apply flex flex-col gap-2 m-0;
    font-weight: 500;
    color: var(--color-on-surface-variant);
}
.wpcf7-text, .wpcf7-textarea {
    @apply w-full px-5 py-4 bg-surface-container-lowest border border-outline-variant/60 rounded-xl focus:border-brand-cyan focus:ring-2 focus:ring-brand-cyan/20 outline-none transition-all duration-300 text-on-surface;
}
.wpcf7-submit {
    @apply w-full md:w-auto bg-brand-primary text-white px-10 py-4 rounded-xl hover:bg-brand-primary/90 hover:shadow-lg hover:shadow-brand-primary/20 transition-all duration-300 cursor-pointer font-bold mt-2;
}
.wpcf7-response-output {
    @apply rounded-xl text-sm mt-6 border-none bg-surface-container-low p-4 !important;
}

/* Premium Table Styling (Minimalist UI/UX) */
.premium-table {
    @apply w-full border-collapse text-left bg-white rounded-3xl shadow-[0_20px_50px_-12px_rgba(0,0,0,0.05)] overflow-hidden;
}
.premium-table thead th {
    @apply py-6 px-8 border-b border-outline-variant/20 bg-surface text-on-surface-variant uppercase text-sm font-semibold tracking-wider;
}
.premium-table thead th:nth-child(2),
.premium-table thead th:nth-child(3) {
    @apply text-right;
}
.premium-table tbody tr {
    @apply border-b border-outline-variant/10 transition-colors duration-300;
}
.premium-table tbody tr:nth-child(even) {
    @apply bg-surface-container-low/50;
}
.premium-table tbody tr:hover {
    @apply bg-brand-cyan/5;
}
.premium-table tbody td {
    @apply py-5 px-8 text-body-md text-on-surface font-medium;
}
.premium-table tbody td:nth-child(2),
.premium-table tbody td:nth-child(3) {
    @apply text-right font-semibold text-brand-primary/80 whitespace-nowrap;
}
.premium-table tbody tr:last-child {
    @apply border-b-0;
}

/* Gutenberg Core Alignment Styles */
.alignnone {
    margin: 5px 20px 20px 0;
}
.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
}
.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}
.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}
a img.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}
a img.alignnone {
    margin: 5px 20px 20px 0;
}
a img.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}
a img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 96%;
    padding: 5px 3px 10px;
    text-align: center;
}
.wp-caption.alignnone {
    margin: 5px 20px 20px 0;
}
.wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}
.wp-caption.alignright {
    margin: 5px 0 20px 20px;
}
.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
}
.wp-caption p.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    margin: 0;
    padding: 0 4px 5px;
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Gutenberg Layout Constraints */
.entry-content > * {
    @apply max-w-container-max mx-auto px-gutter;
}
.entry-content > .alignfull,
.entry-content > .wp-block-group.alignfull {
    @apply max-w-full px-0;
}
.entry-content > .alignwide,
.entry-content > .wp-block-group.alignwide {
    @apply max-w-container-max px-gutter mx-auto;
}
.alignfull > .alignwide {
    @apply max-w-container-max mx-auto px-gutter;
}
.alignwide {
    @apply max-w-container-max mx-auto;
}

/* =============================================
   ONLINE QABUL MODAL
   ============================================= */

/* Modal entrance animation */
#online-qabul-modal:not(.hidden) {
    animation: modalFadeIn 0.25s ease;
}
#online-qabul-modal:not(.hidden) > div:last-child {
    animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* CF7 form overrides inside modal */
#online-qabul-modal .wpcf7 form {
    @apply flex flex-col gap-4;
}
#online-qabul-modal .wpcf7 form p {
    @apply m-0 flex flex-col gap-1.5;
}
#online-qabul-modal .wpcf7-text,
#online-qabul-modal .wpcf7-tel,
#online-qabul-modal .wpcf7-date,
#online-qabul-modal .wpcf7-textarea {
    @apply w-full px-4 py-3.5 bg-surface border border-outline-variant/60 rounded-xl
           focus:border-brand-cyan focus:ring-2 focus:ring-brand-cyan/20
           outline-none transition-all duration-300 text-on-surface text-body-md;
    font-family: inherit;
}
#online-qabul-modal .wpcf7-select {
    @apply w-full px-4 py-3.5 bg-surface border border-outline-variant/60 rounded-xl
           focus:border-brand-cyan focus:ring-2 focus:ring-brand-cyan/20
           outline-none transition-all duration-300 text-on-surface text-body-md appearance-none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2376777d' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    font-family: inherit;
}
#online-qabul-modal .wpcf7-textarea {
    resize: vertical;
    min-height: 90px;
}
#online-qabul-modal .wpcf7-submit {
    @apply w-full bg-brand-primary text-white px-6 py-4 rounded-xl
           hover:bg-brand-primary/90 transition-all duration-300
           cursor-pointer font-bold text-body-md mt-2;
    letter-spacing: -0.01em;
    font-family: inherit;
}
#online-qabul-modal .wpcf7-response-output {
    @apply rounded-xl text-sm mt-3 border-none p-3 !important;
    font-family: inherit;
}
#online-qabul-modal .wpcf7-not-valid-tip {
    @apply text-red-500 text-xs mt-1;
}

/* ==========================================================================
   News Carousel Responsive Layout Rules
   ========================================================================== */
@media (min-width: 1024px) {
    .news-carousel-container {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        overflow-x: visible !important;
    }
    .news-card-item {
        min-width: 0 !important;
        width: 100% !important;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .news-card-item {
        min-width: calc(50% - 16px) !important;
    }
}
@media (max-width: 767px) {
    .news-card-item {
        min-width: 100% !important;
    }
}